When to Use
OpenCode supports connecting to OpenAI-compatible models through a custom provider. Tokener CA exposes /v1/chat/completions, so you can configure it as an OpenAI-compatible provider.
Recommended configuration approach:
- Use
https://a.skypool.xyz/v1forbaseURL - Use your Consumer API Key as the API Key
- Use a platform model name for the model ID, for example
gemma4:26b - Store the key in an environment variable so you don't commit it to your project repository
Prerequisites
First confirm that your machine can already call Tokener CA directly:
curl -X POST "https://a.skypool.xyz/v1/chat/completions" \ -H "Authorization: Bearer <consumer_api_key>" \ -H "Content-Type: application/json" \ --data-raw '{ "model": "gemma4:26b", "messages": [ { "role": "user", "content": "Return a short message confirming the integration works." } ], "max_tokens": 64, "stream": false }'Then set the environment variable.
Current PowerShell window:
$env:SKYPOOL_API_KEY="stc-..."Persist on Windows:
setx SKYPOOL_API_KEY "stc-..."macOS / Linux:
export SKYPOOL_API_KEY="stc-..."Option 1: Save Credentials with /connect
If you'd like OpenCode to manage your authentication details, start OpenCode and then run:
/connectIn the provider picker, choose Other or a custom provider, and fill in:
| Field | Value |
|---|---|
| Provider ID | skypool |
| Provider name | Tokener CA |
| API Key | Consumer API Key |
Once the authentication details are saved, use the opencode.json below to configure the provider and model list.
Option 2: Use opencode.json
Create or update opencode.json in your project root:
{ "$schema": "https://opencode.ai/config.json", "provider": { "skypool": { "npm": "@ai-sdk/openai-compatible", "name": "Tokener CA", "options": { "baseURL": "https://a.skypool.xyz/v1", "apiKey": "{env:SKYPOOL_API_KEY}" }, "models": { "gemma4:26b": { "name": "gemma4 26B", "limit": { "context": 128000, "output": 8192 } } } } }}Notes:
@ai-sdk/openai-compatibleworks with OpenAI-compatible/v1/chat/completionsservices- Set
baseURLto/v1, not the full/v1/chat/completions - We recommend referencing an environment variable for
apiKeyrather than committing a plaintext key - The keys under
modelsmust match the Tokener CA platform model IDs exactly limittells OpenCode the model's context and output limits; adjust it to the model's actual capabilities
Select a Model and Test
After starting OpenCode, open the model picker in a session:
/modelsChoose a model under Tokener CA, for example gemma4:26b. Then send a small task to test:
Read the current project structure and summarize its main modules in three sentences.If OpenCode responds normally and you can see the corresponding request in the console activity log, the integration is complete.
Troubleshooting Checklist
| Symptom | How to Fix |
|---|---|
| Provider doesn't appear | Check that opencode.json is in the project root and that the JSON is valid |
| Model doesn't appear | Check that the model ID under models matches what the platform returns |
| Authentication fails | Confirm SKYPOOL_API_KEY is set in the same terminal where you started OpenCode |
404 | Check that baseURL is https://a.skypool.xyz/v1, not /chat/completions |
| Output cuts off | Verify with a non-streaming curl first, then lower max_tokens or switch to a more stable model |