Quick Start
Make your first TokOne API call in 5 minutes. TokOne is an AI API gateway that exposes OpenAI-, Anthropic-, and Gemini-compatible endpoints, without signing up for each provider separately.
About API keys and groups
Different models belong to different groups (OpenAI / Anthropic / Gemini, etc.). You need to create a separate API Key per group in the console. In other words, use the key that belongs to the group of the model you're calling — a single key does not unlock all three protocols at once.
1. Prerequisites
Before you start you'll need:
- A TokOne account, with an API Key created for the group you want to use (looks like
sk-xxxxxxxx). - Available balance on your account.
- Your API Base URL. Examples here use
https://api.tokone.ai— replace it with the domain you were assigned or deployed.
About the Base URL
TokOne's public domain is set by whoever deploys it. If you're unsure, check the console or ask your administrator. All examples below write it as https://api.tokone.ai.
2. Your first call
TokOne exposes OpenAI-, Anthropic-, and Gemini-compatible endpoints. Use whichever you prefer.
OpenAI-compatible (Chat Completions)
curl https://api.tokone.ai/v1/chat/completions \
-H "Authorization: Bearer $TOKONE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [
{ "role": "user", "content": "Reply with OK" }
]
}'Python (official openai SDK — only base_url changes):
from openai import OpenAI
client = OpenAI(
api_key="sk-...", # your TokOne API Key
base_url="https://api.tokone.ai/v1", # point at TokOne
)
resp = client.chat.completions.create(
model="gpt-5.5",
messages=[{"role": "user", "content": "Reply with OK"}],
)
print(resp.choices[0].message.content)Node.js:
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.TOKONE_API_KEY,
baseURL: "https://api.tokone.ai/v1",
});
const resp = await client.chat.completions.create({
model: "gpt-5.5",
messages: [{ role: "user", content: "Reply with OK" }],
});
console.log(resp.choices[0].message.content);Anthropic-compatible (Messages)
curl https://api.tokone.ai/v1/messages \
-H "x-api-key: $TOKONE_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-6",
"max_tokens": 256,
"messages": [
{ "role": "user", "content": "Reply with OK" }
]
}'Gemini-compatible (generateContent)
curl https://api.tokone.ai/v1beta/models/gemini-3.5-flash:generateContent \
-H "x-goog-api-key: $TOKONE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{ "role": "user", "parts": [{ "text": "Reply with OK" }] }
]
}'3. Streaming
Every inference endpoint supports SSE streaming — just add "stream": true:
curl https://api.tokone.ai/v1/chat/completions \
-H "Authorization: Bearer $TOKONE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"stream": true,
"messages": [{ "role": "user", "content": "Write a short poem about routing." }]
}'The response streams as text/event-stream chunks and ends with data: [DONE].
4. Authentication
TokOne accepts any of these request headers (in priority order):
| Header | When to use |
|---|---|
Authorization: Bearer <key> | Recommended, OpenAI style |
x-api-key: <key> | Anthropic-style clients |
x-goog-api-key: <key> | Gemini CLI compatibility |
WARNING
For security, passing the key via URL query parameters (?key= / ?api_key=) is not supported and will be rejected. Always send the key in a header.
5. Next steps
- CLI Tools — wire TokOne into Codex / Claude Code / Gemini CLI and other command-line tools.
- Editors / IDEs — wire TokOne into Cursor / Trae / Cline / Continue and other editors.
- Client Setup — general setup and desktop chat clients.
- API Endpoints — the full endpoint list and protocol notes.
- Models — supported models and how to choose.
- Pricing — how billing and multipliers work.