Configure OpenCode

OpenCode can use GetToken through an OpenAI-compatible provider configuration.

OpenCode can connect to GetToken through an OpenAI-compatible provider.

Config file

macOS / Linux:

~/.config/opencode/opencode.json

Windows:

%APPDATA%\opencode\opencode.json

Example

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "openai": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "OpenAI",
      "options": {
        "baseURL": "https://api.clawto.link",
        "apiKey": "<your GetToken API Key>"
      },
      "models": {
        "gpt-5.6-sol": {
          "name": "GPT-5.6 Sol",
          "limit": {
            "context": 1000000,
            "output": 128000
          },
          "options": {
            "store": false
          }
        }
      }
    }
  }
}

Common mistakes

  • The field is baseURL, not base_url.
  • Do not add extra spaces to the API Key.
  • JSON files cannot contain comments.

Screenshot placeholder: OpenCode configuration file.

On this page