Use Tokun with Cline

Connect Cline to Tokun using your API key and a supported model.

Overview

Cline, the VS Code agent, connects to Tokun through its OpenAI Compatible provider. Your Cline workflow stays the same, and requests use Tokun's pricing and model routing.

Before you start

  • A Tokun API key (starts with sk-) from the API keys page.
  • A funded Tokun balance.
  • Cline, installed in VS Code.
  • A model ID, such as anthropic/claude-opus-4-8.

Quickstart

In Cline, open the API provider settings and choose OpenAI Compatible, then set:

  • Base URL: https://api.tokun.sh/v1.
  • API Key: your Tokun sk-… key.
  • Model ID: a Tokun model ID, such as anthropic/claude-opus-4-8.

Save, then start a task.

Set up with an AI assistant

Paste this prompt into your AI coding agent. It reads the setup guide at /llms.txt and sets up Cline for you. You only need to provide your API key.

text
Read https://tokun.sh/llms.txt and integrate Tokun into this project.
Prefer exact, step-by-step instructions? Paste this detailed prompt instead. It sets up Cline specifically.
text
You are helping the user configure Cline to use Tokun. Cline's provider config lives in its VS Code settings UI, so OUTPUT these steps for the user rather than editing anything:

1. Open Cline's settings -> API Provider -> "OpenAI Compatible".
2. Base URL: https://api.tokun.sh/v1
3. API Key: the Tokun key (starts with sk-).
4. Model ID: a Tokun lab/model id, e.g. anthropic/claude-opus-4-8.
5. Save, then start a task.

The key is a Tokun sk- key (NOT an OpenAI/Anthropic key). The base URL keeps the /v1 suffix.

Set up manually

All three fields (base URL https://api.tokun.sh/v1, API key, and model ID) are in Cline's OpenAI Compatible provider settings. To roll back, switch back to your previous provider or clear the base URL.

Model IDs

Use any Tokun model ID in lab/model format as the Model ID, such as anthropic/claude-opus-4-8 or openai/gpt-5.5. Tokun never substitutes a different model: an unknown ID returns an error.

Official model pools

Official model pools appear in the model catalog and use a pool ID such as flash-pool. Choose an available pool from the live catalog; pool names and members are configured by Tokun administrators.

When the pool enables member selection, use pool-id/member-name, replacing the model's lab prefix with the pool ID. The selected member is the only model that can execute; the pool's pricing mode still applies. When selection is disabled, this form returns 400.

  • Fixed token pricing uses the pool's input, output, cache and context-tier rates for every member, including a member you select yourself.
  • Actual model pricing uses the serving member's price, frozen before the request. A retry to another member uses that member's frozen price.
  • Fixed per-request pricing charges once after an upstream success response begins. Missing usage, a partial response or a client disconnect after that point still counts once. Failures before success and unsuccessful retries do not add charges.

Use a pool that lists the API format this client sends. Model pool settings in the live catalog control which members are shown and whether member selection is available.

Troubleshooting

Use the OpenAI Compatible provider (not the Anthropic one) and keep the /v1 suffix on the base URL (https://api.tokun.sh/v1). The key is your Tokun sk- key.
SymptomLikely causeFix
401 / auth errorWrong or missing keyUse your Tokun sk- key.
402 / payment requiredEmpty Tokun balanceTop up on the Billing page.
Model not foundWrong or blank Model IDSet a lab/model ID, such as anthropic/claude-opus-4-8.