◉ TOKNADO

Integrations / OpenCode

OpenCode + TOKNADO

How to use OpenCode with TOKNADO (custom provider in opencode.json)

OpenCode is a terminal coding agent with a long list of built-in providers, plus a documented path for any OpenAI-compatible endpoint: declare the provider in opencode.json, give it a base URL, list the model IDs, and they appear in the model picker.

That makes TOKNADO a few lines of config. Here is the complete setup, including where to keep the key and the base URL mistake that causes most failures.

Start free trial Jump to setup

What you need

Setup: OpenCode with TOKNADO

  1. Set your API key

    Keep the key in the environment instead of the config file.

    export TOKNADO_API_KEY=YOUR_TOKNADO_API_KEY
  2. Create opencode.json

    Use opencode.json in your project root for a per-project setup, or ~/.config/opencode/opencode.json for a global one. The provider ID (toknado) is your choice and becomes the first half of the model reference.

    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "toknado": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "TOKNADO",
          "options": {
            "baseURL": "https://toknado.up.railway.app/v1",
            "apiKey": "{env:TOKNADO_API_KEY}"
          },
          "models": {
            "toknado/auto": { "name": "TOKNADO model" }
          }
        }
      },
      "model": "toknado/toknado/auto"
    }
  3. Alternative: store the key with /connect

    Instead of the env var, run /connect inside OpenCode, scroll to Other, enter the provider ID (toknado), and paste the key.

  4. Pick the model and run

    Start OpenCode and choose toknado/toknado/auto from the model list if it isn't already your default.

    opencode

Notes for real-world use

Troubleshooting OpenCode + TOKNADO

SymptomWhat to check
404 on every requestbaseURL is missing its API path. https://host will fail where https://host/v1 works; the adapter appends /chat/completions.
Model not in the pickerIt must be listed under models with the exact ID. Restart OpenCode after editing the config.
Authentication errorConfirm TOKNADO_API_KEY is exported in the shell that launches OpenCode, or re-run /connect.
Config seems ignoredProject opencode.json takes precedence over the global one; check you edited the file OpenCode is reading.

FAQ

Can OpenCode use any OpenAI-compatible provider?

Yes. Declare it under provider in opencode.json with npm set to @ai-sdk/openai-compatible and a baseURL.

Where does opencode.json go?

In your project root for project settings, or ~/.config/opencode/opencode.json for global settings.

How do I reference the model?

As provider-id/model-id, for example toknado/toknado/auto.

Is there a free way to test it?

TOKNADO's setup guide offers a three-day trial at up to 250 requests per rolling hour.

Point OpenCode at TOKNADO

One OpenAI-compatible endpoint, a managed model pool behind it, and usage you can see in the Storm Console. 3-day trial, up to 250 requests per rolling hour.

Start free trial See pricing Setup guide

Hourly limits apply over the previous 60 minutes. Service is best effort; upstream availability can reduce throughput.

More tools that work with TOKNADO