Everything you need to integrate SeekRouter into your application.
SeekRouter provides an OpenAI-compatible API that routes requests to 100+ AI models from 20+ providers.
All API requests require a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer sr-your-api-key-hereCreates a chat completion. Compatible with the OpenAI Chat Completions API.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model ID (e.g. "deepseek/deepseek-chat") |
| messages | array | Yes | Array of message objects with role and content |
| temperature | number | No | Sampling temperature (0-2). Default: 1 |
| max_tokens | integer | No | Maximum tokens in the response |
| stream | boolean | No | Enable streaming. Default: false |
| top_p | number | No | Nucleus sampling parameter. Default: 1 |
curl https://seekrouter.com/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SEEKROUTER_API_KEY" \
-d '{
"model": "deepseek/deepseek-chat",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}'from openai import OpenAI
client = OpenAI(
base_url="https://seekrouter.com/api/v1",
api_key="sr-your-api-key",
)
response = client.chat.completions.create(
model="deepseek/deepseek-chat",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://seekrouter.com/api/v1',
apiKey: 'sr-your-api-key',
});
const response = await client.chat.completions.create({
model: 'deepseek/deepseek-chat',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Hello!' }
]
});
console.log(response.choices[0].message.content);{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1709000000,
"model": "deepseek/deepseek-chat",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 9,
"total_tokens": 29
}
}| Code | Description |
|---|---|
| 401 | Invalid or missing API key |
| 402 | Insufficient credits |
| 403 | App not approved or permission denied |
| 404 | Model not found |
| 429 | Rate limit exceeded |
| 503 | Provider unavailable |
Use the model ID in the format provider/model-name. See the full list with pricing on the Models page.