Tokun

Use Tokun with Zed

Use Tokun as the model backend for Zed's Agent Panel via its OpenAI-compatible provider — the same Zed workflow, billed at Tokun pricing with Tokun's model routing.

What this connects

Use Tokun as the model backend for Zed's Agent Panel via its OpenAI-compatible provider — the same Zed workflow, billed at Tokun pricing with Tokun's model routing.

Before you start

  • A Tokun API key (starts with sk-) from the console.
  • A funded Tokun balance.
  • Zed installed.
  • A chosen model id, e.g. anthropic/claude-opus-4-8.

Recommended quickstart

In Zed's settings.json, add Tokun as an OpenAI-compatible provider:

json
"language_models": {
  "openai_compatible": {
    "Tokun": {
      "api_url": "https://api.tokun.sh/v1",
      "available_models": [
        { "name": "anthropic/claude-opus-4-8", "display_name": "Tokun Opus", "max_tokens": 200000 }
      ]
    }
  }
}

Then open the Agent Panel settings, select the Tokun provider, and paste your sk-… key.

Copy for AI agent

Working inside an AI coding agent? The shortest path is one line — paste this and your agent reads the full machine-readable guide at /llms.txt and does the Zed setup itself. You only supply your key:

text
Read https://tokun.sh/llms.txt and integrate Tokun into this project.
Want a fully-specified, deterministic block instead (exact steps, idempotent, fail-closed)? Paste the one below — it configures Zed specifically.
text
You are helping the user configure Zed to use Tokun. Edit Zed's settings.json and add an OpenAI-compatible provider:

"language_models": {
  "openai_compatible": {
    "Tokun": {
      "api_url": "https://api.tokun.sh/v1",
      "available_models": [
        { "name": "anthropic/claude-opus-4-8", "display_name": "Tokun Opus", "max_tokens": 200000 }
      ]
    }
  }
}

Then tell the user to open the Agent Panel settings, select the Tokun provider, and paste the Tokun key (starts with sk-).

Notes:
- api_url keeps the /v1 suffix (https://api.tokun.sh/v1).
- The key is a Tokun sk- key, NOT an OpenAI key.

Manual configuration

The provider lives under language_models.openai_compatible in settings.json (api_url: https://api.tokun.sh/v1 + your models); the key is entered in the Agent Panel. To roll back, remove the provider block.

Model naming

Each entry's name is a Tokun lab/model id, e.g. anthropic/claude-opus-4-8 or openai/gpt-5.5. Tokun does not silently substitute models — an unknown id returns an error.

Verify & troubleshoot

Use openai_compatible (not the Anthropic provider) and keep the /v1 suffix on api_url (https://api.tokun.sh/v1). The key is your Tokun sk- key.
SymptomLikely causeFix
401 / auth errorWrong or missing keyPaste your Tokun sk- key in the Agent Panel.
402 / payment requiredEmpty Tokun balanceTop up in the console.
Model not foundWrong model nameUse a lab/model id, e.g. anthropic/claude-opus-4-8.