Documentation
One OpenAI-compatible API for 284 models, billed from prepaid credit at the provider’s own price, with zero markup.
https://api.tokenctr.com/v1Authorization: Bearer ck_…Start here
TokenCenter is an OpenAI-compatible API. If your code or tool already talks to OpenAI or OpenRouter, point it at https://api.tokenctr.com/v1, use your TokenCenter key, and pick a model ID from the catalog.
curl https://api.tokenctr.com/v1/chat/completions \
-H "Authorization: Bearer $TOKENCENTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistralai/ministral-3b-2512",
"messages": [{"role": "user", "content": "Say hello in five words."}],
"max_tokens": 100
}'# pip install openai
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.tokenctr.com/v1",
api_key=os.environ["TOKENCENTER_API_KEY"],
)
resp = client.chat.completions.create(
model="mistralai/ministral-3b-2512",
messages=[{"role": "user", "content": "Say hello in five words."}],
max_tokens=100,
)
print(resp.choices[0].message.content)
print(resp.usage)// npm install openai (Node 18+, ES modules)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.tokenctr.com/v1",
apiKey: process.env.TOKENCENTER_API_KEY,
});
const resp = await client.chat.completions.create({
model: "mistralai/ministral-3b-2512",
messages: [{ role: "user", content: "Say hello in five words." }],
max_tokens: 100,
});
console.log(resp.choices[0].message.content);
console.log(resp.usage);New here? Follow the Quickstart. Keys cost nothing to create but start at $0, so add credit from a pack before your first call.
All documentation
Quickstart
Get a key, add credit, and make your first call in about five minutes.
Read →API reference
Every public endpoint: chat completions, models, usage, logs, keys, and checkout.
Read →Authentication & keys
How keys work, the Bearer header, extra keys, daily spending caps, and rotation.
Read →Errors
Every status and error code the API returns, and what to do about each one.
Read →Billing & pricing
How a call is priced, credit packs, holds and refunds, and tracking your spend.
Read →Migrate from OpenRouter
Change the base URL and key. Model IDs stay the same.
Read →Changelog
What shipped and when.
Read →Good to know
- Prepaid, no subscription. Buy credit once; each call is deducted from your balance at the provider’s price, split into input and output tokens. See Billing.
- Every response shows your balance. Successful calls return an
x-cosmos-credit-balanceheader with what’s left, in US dollars. - Streaming isn’t available yet. Send non-streaming requests for now.
- Limits. 60 requests per minute per key and 120 per minute per IP address. See Errors.
- Prompts stay out of the logs. Usage records keep the model, tokens, and cost, never your prompt or the reply.