Quickstart
Get your first API call working in under 5 minutes.
Prerequisites
- A Routic account with an active API Key. If you don't have one yet, sign up and create a key.
- Your Base URL:
https://api.routic.ai/v1 - Any HTTP client (curl, Python, Node.js, etc.)
Step 1 — Pick a model
Browse the Model catalog and choose a canonical model name. For your first call, try a general-purpose model:
| Use case | Model name |
|---|---|
| General chat | deepseek-v3 |
| Reasoning | deepseek-r1 |
| Cost-effective | deepseek-r1-distill-qwen-14b |
If your account has routing aliases enabled, you can also use public aliases like auto/chat or auto/reasoning — Routic picks an available model that matches the capability.
Step 2 — Send a request
curl
curl -sS "https://api.routic.ai/v1/chat/completions" \
-H "Authorization: Bearer $ROUTIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v3",
"messages": [{"role": "user", "content": "ping"}]
}'
Set ROUTIC_API_KEY in your environment before running the command.
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="https://api.routic.ai/v1",
api_key="sk-xxxxxxxx", # your Routic API Key
)
response = client.chat.completions.create(
model="deepseek-v3",
messages=[{"role": "user", "content": "ping"}],
)
print(response.choices[0].message.content)
Node.js (OpenAI SDK)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.routic.ai/v1",
apiKey: "sk-xxxxxxxx", // your Routic API Key
});
const response = await client.chat.completions.create({
model: "deepseek-v3",
messages: [{ role: "user", content: "ping" }],
});
console.log(response.choices[0].message.content);
Step 3 — Verify the response
A successful response looks like this:
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "deepseek-v3",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "pong"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 2,
"total_tokens": 10
}
}
If you get an error instead, check these common issues:
| Symptom | Likely cause | Fix |
|---|---|---|
401 invalid_api_key | Wrong or missing API Key | Verify the key starts with sk- and matches your dashboard |
401 missing_api_key | No Authorization header | Add Authorization: Bearer sk-xxx to your request |
400 invalid_model | Model name not recognized | Check the Model catalog for valid names |
402 insufficient_balance | Account balance depleted | Top up in your dashboard |
For all error codes, see HTTP semantics & error payloads.
Next steps
Now that you're up and running:
- Understand billing — Models, SKUs & usage
- Handle errors properly — Errors & retries
- Explore features — Streaming, Tool calls, Thinking mode
- Connect your tools — Cursor, Claude Code, Aider