Connect your tool in a minute.
Every tool needs the same two things: the base URL below and your key. Pick your tool and follow the steps.
https://api.tokenlowcost.com/v1Quick start
-
Create a key
In the dashboard, pick a model and click Create key. Copy the key right away: it's shown only once.
-
Set up your tool
Find your tool below. Right after you create a key, the dashboard shows the same steps with your key already filled in.
-
Start working
Use your tool as usual. Each request is paid from your balance, and the dashboard shows it with its cost.
Models
Each key works with one model: the one you pick when you create it. That model answers every request made with the key, whatever model name your tool sends. Want two models? Create two keys.
For the same reason, GET /v1/models lists only your key's model. Tools that show a model list, like Cline and Roo Code, offer just that one.
All models and their prices are on the pricing page.
Billing & limits
You add money to your balance first. New accounts start with $50 of welcome credit, one per person. Each request costs its tokens at your model's price, and that amount comes off the balance. The dashboard lists every request with its tokens and cost.
When requests stop
| What happened | Result |
|---|---|
| Key limit reached | 402 for that key. Your other keys keep working. |
| Key expired | 403 for that key. |
| Key revoked | 401 right away. This can't be undone. |
| Balance at $0 | 402 for all keys until you top up. The balance never goes below zero. |
| Account banned | 403 for all keys, and you can't log in. Bans are for breaking the rules. |
Context & effort
When you create a key, you can also choose these two settings. The dialog shows what the input of a prompt that fills the chosen window costs.
| Setting | What it does |
|---|---|
| Context window | How much text one request can hold, from 128K tokens up to the model's maximum. It's a limit on the key: the model itself doesn't change. Requests over the limit are refused and cost nothing. The size is estimated, so it can be off by a few percent. |
| Effort | How hard the model thinks before it answers. Set in the app lets your tool decide. A fixed level applies to every request made with the key. More thinking means more output tokens, so it costs more. |
The setup steps in the dashboard pass both settings on to your tool.
Cursor
Open the settings
In Cursor, open Settings → Models and scroll down to API Keys.
-
Paste your key and the base URL
Paste your key into OpenAI API Key. Turn on Override OpenAI Base URL and paste the base URL.
OpenAI API Key sk-tlc-your-key Override OpenAI Base URL on Base URL https://api.tokenlowcost.com/v1
Add a model name
Click + Add model, type a name like
tlc-opusand turn it on. The name is just a label: your key decides the model. Use a name Cursor doesn't already have, so the request goes out with your key.Check and chat
Click Verify next to the key. Then pick your model in the chat.
VS Code
The chat built into VS Code can use your key. You need VS Code 1.122 or newer. If VS Code asks you to sign in when it first starts, click Continue without Signing In.
Add a custom endpoint
Press Ctrl + Shift + P (Cmd on a Mac) and run Chat: Manage Language Models. Click Add Models, then Custom Endpoint.
Enter a name and your key
Name it TokenLowCost and paste your key. At API Type, just press Enter.
-
Paste your model
VS Code opens a file with an empty model in it. Replace its
"models": [ … ]part with the block below and save. The dashboard gives you this block ready-made for your key, right after you create it. Copying from here? Take the Claude block for Claude models, the other one for the rest, and changeidandnameto your model. Pick the model
Open the chat, click the model name in the message box and pick your model.
Not signed in to GitHub? VS Code then shows Set BYOK utility models. Click Configure and choose Main Agent Model, so chat titles and commit messages use your model too. These are small requests, billed like any other.
Claude Code or Codex in VS Code
The Claude Code and Codex extensions use the same settings as their terminal versions. Paste the Claude Code or Codex line first, then install the extension and restart VS Code. For Claude Code, also open Settings, search for Claude Code login and tick Disable Login Prompt.
Claude Code
One line saves the base URL, your key and your key's model, and every new terminal picks them up. The line below is for a Claude Opus 5.5 key and has a placeholder key. The dashboard shows it made for your key: its model, context window and effort.
Paste the line
Paste it into PowerShell (Windows) or Terminal (macOS, Linux) and press Enter.
Run Claude Code
Run
claudein the same window. The first time, press Enter on the text style and security screens. When it asks whether you trust the folder, press ↓ to choose Yes, I trust this folder, then Enter: the preselected No, exit closes Claude Code. You don't need an Anthropic account.
irm https://claude.ai/install.ps1 | iex. On macOS or Linux, run curl -fsSL https://claude.ai/install.sh | bash. If the installer says its folder is not in your PATH, do what it shows. If you use the terminal inside VS Code or Cursor, restart the editor after pasting the line.Why the model name? Without it, Claude Code thinks it's talking to Claude Opus 5.5, whatever your key's model is. It tells the model so and signs commits with that name. With the name, it knows the real model. For a model that isn't Claude, Claude Code may say it doesn't recognize the model. That's fine: it only knows Claude models by name, and the requests still work.
Rather use a file? Put this in ~/.claude/settings.json (on Windows, %USERPROFILE%\.claude\settings.json):
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.tokenlowcost.com/v1",
"ANTHROPIC_AUTH_TOKEN": "sk-tlc-your-key",
"ANTHROPIC_MODEL": "claude-opus-5-5[1m]"
}
}Set ANTHROPIC_MODEL to your key's model: claude-opus-5-5, claude-sonnet-5, claude-haiku-4-5, or for other models the id from the price list, such as gpt-6-sol. Add [1m] at the end if the key's window is over 200K.
Claude Code also sends small background requests, such as chat titles. They use your key's model and are billed like any other request.
Codex
One line writes the Codex settings file and saves your key. If you already have a Codex config, it's kept as config.toml.bak. This line has a placeholder key; the dashboard shows it with yours.
Paste it into PowerShell (Windows) or Terminal (macOS, Linux) and press Enter. Then run codex in the same window and choose Trust and continue. You don't need a ChatGPT account.
npm install -g @openai/codex. Codex works best with OpenAI models, such as GPT-6 Sol.Rather edit the file yourself? This is what the line writes to ~/.codex/config.toml. If you add it to an existing file, keep the first lines above any [section].
Codex reads your key from the TOKENLOWCOST_API_KEY environment variable, which the line also sets. Set it yourself too: add export TOKENLOWCOST_API_KEY=sk-tlc-your-key to ~/.zshrc or ~/.bashrc, or on Windows run setx TOKENLOWCOST_API_KEY sk-tlc-your-key and open a new window.
Cline, Roo Code & Continue
In Cline or Roo Code, open the provider settings and fill in the fields below. The first time you open Cline, choose Bring my own API key to get there. Once the key is in, the model list shows just your key's model: pick it.
API Provider OpenAI Compatible Base URL https://api.tokenlowcost.com/v1 API Key sk-tlc-your-key Model ID anthropic/claude-opus-5.5
Cline shows the cost as $0, since it doesn't know our prices. The real cost is under Usage in your dashboard.
For Continue, put this in ~/.continue/config.yaml in place of what's there. Already have models in it? Add just the TokenLowCost entry under models:. The tool_use line lets Agent mode edit files; without it, Continue can't tell the model has tools.
name: My Config
version: 0.0.1
schema: v1
models:
- name: TokenLowCost
provider: openai
model: tlc-opus
apiBase: https://api.tokenlowcost.com/v1
apiKey: sk-tlc-your-key
capabilities:
- tool_useAny other tool with an OpenAI Compatible option works the same way.
OpenAI SDK
Set the base URL and your key. The rest is the usual SDK code.
from openai import OpenAI
client = OpenAI(
base_url="https://api.tokenlowcost.com/v1",
api_key="sk-tlc-your-key",
)
r = client.chat.completions.create(
model="claude-opus-5.5",
messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.tokenlowcost.com/v1",
apiKey: "sk-tlc-your-key",
});
const r = await client.chat.completions.create({
model: "claude-opus-5.5",
messages: [{ role: "user", content: "Hello" }],
});
console.log(r.choices[0].message.content);
The TypeScript examples on this page are ES modules: save one as main.mts and run npx tsx main.mts.
Streaming
Add stream=True. The token counts come in the last chunk, which can arrive without choices, so check chunk.choices first.
stream = client.chat.completions.create(
model="claude-opus-5.5",
messages=[{"role": "user", "content": "Write a haiku about caching"}],
stream=True,
)
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="")The Responses API works too: client.responses.create(...).
Anthropic SDK
Use the same base URL as everywhere else. The SDK adds /v1/messages to it, and that's fine. Some models send a thinking block before the text, so the example prints only the text blocks.
from anthropic import Anthropic
client = Anthropic(
base_url="https://api.tokenlowcost.com/v1",
api_key="sk-tlc-your-key",
)
msg = client.messages.create(
model="claude-opus-5.5",
max_tokens=512,
messages=[{"role": "user", "content": "Hello"}],
)
for block in msg.content:
if block.type == "text":
print(block.text)
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://api.tokenlowcost.com/v1",
apiKey: "sk-tlc-your-key",
});
const msg = await client.messages.create({
model: "claude-opus-5.5",
max_tokens: 512,
messages: [{ role: "user", content: "Hello" }],
});
for (const block of msg.content) {
if (block.type === "text") console.log(block.text);
}
cURL
The same key works in all three request formats.
curl https://api.tokenlowcost.com/v1/chat/completions \
-H "Authorization: Bearer sk-tlc-your-key" \
-H "Content-Type: application/json" \
-d '{"model": "claude-opus-5.5", "messages": [{"role": "user", "content": "Hello"}]}'
curl https://api.tokenlowcost.com/v1/messages \
-H "x-api-key: sk-tlc-your-key" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model": "claude-opus-5.5", "max_tokens": 256, "messages": [{"role": "user", "content": "Hello"}]}'
curl https://api.tokenlowcost.com/v1/responses \
-H "Authorization: Bearer sk-tlc-your-key" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-6-sol", "input": "Hello"}'
Check your balance and your last 20 requests:
curl https://api.tokenlowcost.com/v1/me -H "Authorization: Bearer sk-tlc-your-key"
Errors
When something goes wrong, you get a status code and a short message.
| Code | What it means | What to do |
|---|---|---|
| 401 | The key is missing, wrong or revoked. | Check that you pasted the whole key. |
| 402 | The key reached its spending limit, or your balance is $0. | Top up, or create a key with a higher limit. |
| 403 | The key has expired, or the account is banned. The message says which. | If it expired, create a new key. Bans are explained in the rules. |
| 400 | If the message says the prompt is too long: the request is bigger than the key's context window. It isn't billed. | Start a new chat, or use a key with a bigger window. |
| 404 | Wrong address. | Check the part after /v1. |
| Other | Passed on from the model provider as is, for example when it's overloaded. | Try again in a minute. |
Spending limits and expiry dates are set per key in the dashboard. Your balance is under Billing.
Ready to connect?
Create an account, get $50 of credit and make your first key. It takes about a minute.