Tool integration · OpenAI Chat Completions
Use TokenRa in Cline
Cline is an open-source coding agent for VS Code, JetBrains and the terminal. Its OpenAI Compatible provider connects to TokenRa with a base URL, your key and a model ID. We tested the setup with the Cline CLI 3.0.74, which shares its agent core and provider settings with the VS Code extension.
- Base URL
https://tokenra.io/v1- Provider
- OpenAI Compatible
- API format
- OpenAI Chat Completions
- Tested with
- Cline CLI 3.0.74
Before you start
Before you start
- A TokenRa API key: create an account, then add a key on the API Keys page of the console. Keys start with
sk-. - VS Code with the Cline extension: open Extensions (
Ctrl+Shift+X,Cmd+Shift+Xon macOS), search for Cline and install it. For the terminal, see the Cline CLI below.
Configure
Connect Cline to TokenRa
- Click the Cline icon in the activity bar to open its panel. On the welcome screen choose to use your own API key; if Cline is already set up, open its settings with the gear icon.
- Set API Provider to OpenAI Compatible.
- Fill in the three fields from the table below.
- Click Done. The model appears under the input box; type a task to start.
| Field | What to put in |
|---|---|
| Base URL | https://tokenra.io/v1, with /v1 |
| API Key | Your TokenRa key (sk-...) |
| Model ID | A TokenRa model ID, for example deepseek-v4.1-flash |
OpenAI Compatible also has optional model settings, such as the context window and image support. They only change how Cline budgets context and shows cost; the defaults worked with every model below.
Cline CLI
The terminal version uses the same provider settings; openai is its ID for OpenAI Compatible:
npm install -g cline
cline auth --provider openai --apikey sk-... --modelid deepseek-v4.1-flash --baseurl https://tokenra.io/v1
cline "Explain what this repository does"cline auth answers Provider configured: openai-compatible (deepseek-v4.1-flash). Add --yolo to run a task without approval prompts.
Models
Tested models
On 2026-10-29 every model below finished the same task in the Cline CLI 3.0.74: read a file, write a new file and check it. Times are for one run.
| Model | Model ID | Task time (one run) |
|---|---|---|
| DeepSeek V4.1 Flash | deepseek-v4.1-flash | 12 s |
| GLM-5.3 | glm-5.3 | 12 s |
| Qwen3.8 Max | qwen3.8-max | 27 s |
| MiniMax M3.1 Flash | minimax-m3.1-flash | 29 s |
| Kimi K3.1 Pro | kimi-k3.1-pro | 57 s |
glm-5.3-flash, kimi-k3, minimax-m3, qwen3.8-flash, mimo-v2.5, omen-alpha also completed a streamed tool-call round trip on /v1/chat/completions, the endpoint Cline uses.
gemini-3.8-flash cannot be used here: its upstream rejects every request that carries tool definitions (HTTP 400), and coding agents send tools with every request.FAQ
FAQ
HTTP 401: invalid key
Check the key and that the base URL is exactly https://tokenra.io/v1. Copy the key again from API Keys if needed.
HTTP 503: model_not_found
The Model ID is not a TokenRa model ID. Copy it from the model list.
Tasks are slow
Cline makes a request for every step, and reasoning models think before each one: Kimi K3.1 Pro needed about a minute for the test task, DeepSeek V4.1 Flash and GLM-5.3 about 12 seconds.
Where can I see usage and cost?
Every request is listed under Usage Logs in the console, with its model, tokens and cost. Live rates are on the Model Square.