Every tool uses the same base URL and the same key. The gateway detects the request format — Anthropic Messages, OpenAI Chat Completions or Responses — from the path, so there is nothing else to configure.
/v1In the dashboard, choose the model, an optional budget and an expiry. The full key is shown once — store it in your password manager or the tool's settings immediately.
Pick your tool below. In most cases it's two settings: the base URL and the key.
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"}]}'
Each key is pinned to the model you selected when you created it. That is the model that answers and the model you're billed for, regardless of the model string your client sends. To use several models, create several keys.
Billing is prepaid and per token, deducted from your balance after each request at the key model's rate. Cached input tokens are billed at the cached rate. When a key's budget is reached or its expiry passes, the gateway rejects requests with that key; when your balance reaches zero, all requests stop. There is no overdraft.
Live rates for every model are on the pricing page. The catalog is also available as GET /v1/models.
curl https://api.tokenlowcost.com/v1/models -H "Authorization: Bearer sk-tlc-your-key"
Cursor talks to OpenAI-compatible endpoints through its OpenAI API Key setting.
https://api.tokenlowcost.com/v1.tlc-opus) and enable it. The name is only a label — the key decides the model.OpenAI API Key sk-tlc-your-key Override OpenAI Base URL on Base URL https://api.tokenlowcost.com/v1
Cursor requires a public HTTPS endpoint; this one already is.
Set the base URL and auth token as environment variables, then run Claude Code as usual. Leave ANTHROPIC_API_KEY empty so the auth token is used.
export ANTHROPIC_BASE_URL=https://api.tokenlowcost.com export ANTHROPIC_AUTH_TOKEN=sk-tlc-your-key export ANTHROPIC_API_KEY= claude
Or per project, in .claude/settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.tokenlowcost.com",
"ANTHROPIC_AUTH_TOKEN": "sk-tlc-your-key"
}
}
Add a provider that uses the Responses API, then select it.
[model_providers.tokenlowcost] name = "TokenLowCost" base_url = "https://api.tokenlowcost.com" wire_api = "responses" env_key = "TOKENLOWCOST_API_KEY" model_provider = "tokenlowcost" model = "gpt-5.5"
export TOKENLOWCOST_API_KEY=sk-tlc-your-key codex
Any extension with an OpenAI Compatible provider works. In the extension's provider settings:
Provider OpenAI Compatible Base URL https://api.tokenlowcost.com/v1 API Key sk-tlc-your-key Model any name, e.g. tlc-opus
For Continue, add the same values under models in ~/.continue/config.yaml with provider: openai and apiBase set to the base URL.
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);
Streaming (stream: true) and the Responses API (client.responses.create) work the same way.
from anthropic import Anthropic
client = Anthropic(
base_url="https://api.tokenlowcost.com",
api_key="sk-tlc-your-key",
)
msg = client.messages.create(
model="claude-opus-5.5",
max_tokens=512,
messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text)
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"}]}'
Check balance and the last 20 requests for a key:
curl https://api.tokenlowcost.com/me -H "Authorization: Bearer sk-tlc-your-key"
The gateway returns standard HTTP status codes with a JSON body describing the problem.
4014024034044xx / 5xxBudget and expiry are set per key in the dashboard; balance is under Billing.