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.
Zedinstalled.- 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:
"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:
Read https://tokun.sh/llms.txt and integrate Tokun into this project.Zed specifically.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
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.| Symptom | Likely cause | Fix |
|---|---|---|
401 / auth error | Wrong or missing key | Paste your Tokun sk- key in the Agent Panel. |
402 / payment required | Empty Tokun balance | Top up in the console. |
Model not found | Wrong model name | Use a lab/model id, e.g. anthropic/claude-opus-4-8. |