Docs › Quickstart
Quickstart
Key, credit, first call: about five minutes from start to finish.
-
Get an API key
Open Get API key and create a key. No email or card needed. Your key starts with
ck_and is shown only once, so save it in a password manager straight away. We only keep a fingerprint of it and can’t show it again.Store it in an environment variable so it stays out of your code:
Shellexport TOKENCENTER_API_KEY="ck_your_key_here" -
Add credit
New keys start with a $0 balance, and model calls need credit. On Pricing, pick a pack while you’re signed in with your key: Mini ($5), Maker ($19) or Studio ($59). Checkout runs on Stripe’s hosted page, and the credit is added to your balance once Stripe confirms the payment.
-
Make your first call
Use any OpenAI-compatible client. The example uses Ministral 3B, one of the cheapest models in the catalog at $0.10 per million input and output tokens, so this call costs a tiny fraction of a cent.
curlcurl 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 }'Python# 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)JavaScript// 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);Streaming isn’t available yetSend requests without
stream, or with"stream": false. With"stream": truethe API answers with an error event instead of a reply. If your tool streams by default, switch streaming off in its settings. -
Check your balance
Every successful call returns your remaining balance in the
x-cosmos-credit-balanceresponse header. You can also ask for it directly:curlcurl https://api.tokenctr.com/v1/usage/today \ -H "Authorization: Bearer $TOKENCENTER_API_KEY"credits_face_usdis your balance in US dollars, androlluplists today’s calls, tokens and cost by model. The Account page shows the same numbers.
Next steps
- Browse the model catalog and copy any model ID, such as
anthropic/claude-haiku-4.5ormistralai/ministral-3b-2512. - Read the API reference for request fields, response headers and account endpoints.
- Set
max_tokenson every request. It keeps the temporary hold on your balance small; see how holds work. - Coming from OpenRouter? See Migrate from OpenRouter.