Tokener CA
Service online
Sign up
DocsOpenCode Integration

OpenCode Integration

Integrate Tokener CA using OpenCode's custom OpenAI-compatible provider.

Updated:

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/v1 for baseURL
  • 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:

Bash
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:

PowerShell
$env:SKYPOOL_API_KEY="stc-..."

Persist on Windows:

PowerShell
setx SKYPOOL_API_KEY "stc-..."

macOS / Linux:

Bash
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:

Text
/connect

In the provider picker, choose Other or a custom provider, and fill in:

FieldValue
Provider IDskypool
Provider nameTokener CA
API KeyConsumer 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:

JSON
{  "$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-compatible works with OpenAI-compatible /v1/chat/completions services
  • Set baseURL to /v1, not the full /v1/chat/completions
  • We recommend referencing an environment variable for apiKey rather than committing a plaintext key
  • The keys under models must match the Tokener CA platform model IDs exactly
  • limit tells 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:

Text
/models

Choose a model under Tokener CA, for example gemma4:26b. Then send a small task to test:

Text
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

SymptomHow to Fix
Provider doesn't appearCheck that opencode.json is in the project root and that the JSON is valid
Model doesn't appearCheck that the model ID under models matches what the platform returns
Authentication failsConfirm SKYPOOL_API_KEY is set in the same terminal where you started OpenCode
404Check that baseURL is https://a.skypool.xyz/v1, not /chat/completions
Output cuts offVerify with a non-streaming curl first, then lower max_tokens or switch to a more stable model

References