Quick start
Follow the four steps below to send your first request in a few minutes.
1. Sign up and log in
Open CodingRouter to create an account, then log in to the console.
2. Top up
Top up on the console Wallet page, or redeem a code. The balance is in US dollars and each call is charged by actual usage. See Billing.
3. Create a token
Go to Token management and click "Add token":
- Group: decides which models this token can use and the discount it is billed at. For example, choose
claudeto call Claude andgptto call GPT. If you are not sure which to choose, first check in the model square which groups contain the target model. See Tokens and groups. - Quota, expiry time, IP allowlist: set as needed; leave empty for no limit.
After creating it, copy the token (like sk-...). A token is equivalent to a password. Do not commit it to a code repository or post it publicly.
4. Send your first request
All APIs share one address:
| Item | Value |
|---|---|
| Base URL | https://api.codingrouter.ai |
| OpenAI-compatible Base URL | https://api.codingrouter.ai/v1 |
| Authentication | Authorization: Bearer <your token> |
Put the token in an environment variable:
bash
export CODINGROUTER_KEY="sk-your-token"bash
curl https://api.codingrouter.ai/v1/chat/completions \
-H "Authorization: Bearer $CODINGROUTER_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [{"role": "user", "content": "Hello, introduce yourself"}]
}'python
from openai import OpenAI
client = OpenAI(
base_url="https://api.codingrouter.ai/v1",
api_key="sk-your-token",
)
resp = client.chat.completions.create(
model="gpt-5.5",
messages=[{"role": "user", "content": "Hello, introduce yourself"}],
)
print(resp.choices[0].message.content)js
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.codingrouter.ai/v1",
apiKey: process.env.CODINGROUTER_KEY,
});
const resp = await client.chat.completions.create({
model: "gpt-5.5",
messages: [{ role: "user", content: "Hello, introduce yourself" }],
});
console.log(resp.choices[0].message.content);The gpt-5.5 in the examples requires a token group of gpt, codex_gpt or az_gpt. When you switch to another model, remember to use a matching token group.
Next steps
- Native Claude and Gemini calls: API overview
- Using Claude Code, Codex and other tools: Tools
- Call errors: Errors and retries
