Getting started
Routix API
Routix is an OpenAI-compatible API. You send the same request body you already send to api.openai.com, to a different base URL, and you get the same response shape back. No new SDK, no new concepts.
https://routix.tech/v1
Authentication
Every request carries your key in the Authorization
header, as a bearer token. Keep it server-side; a key in a browser bundle is a key you have published.
Authorization: Bearer $ROUTIX_API_KEY
Quickstart
Your first request, end to end. Works with curl and with any OpenAI client library.
curl https://routix.tech/v1/chat/completions \ -H "Authorization: Bearer $ROUTIX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "glm-5.3-flash", "messages": [ {"role": "user", "content": "Explain routing in one sentence."} ] }'
{
"id": "chatcmpl-rx9f2a...",
"object": "chat.completion",
"created": 1792523626,
"model": "glm-5.3-flash",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "Routing sends each request to the model..." },
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 11, "completion_tokens": 24, "total_tokens": 35 }
}
API reference
List models
/v1/models
Returns every model your key can call.
{
"object": "list",
"data": [
{
"id": "glm-5.3-flash",
"object": "model",
"owned_by": "Zhipu AI"
}
]
}
Fields
| Field | Type | Description |
|---|---|---|
| id | string | Model identifier to pass in model. |
| object | string | Always "model". |
| owned_by | string | The model family that owns it. |
Chat completions
/v1/chat/completions
The same request body as the OpenAI chat completions endpoint. Supported parameters are passed through unchanged.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | yes | One of the ids from /v1/models. |
| messages | array | yes | Conversation history as {role, content} objects. |
| stream | boolean | no | Return server-sent events instead of a single JSON body. |
| temperature | number | no | Passed through to the model. |
| max_tokens | integer | no | Upper bound on generated tokens. |
| top_p | number | no | Nucleus sampling threshold. |
| stop | string | array | no | Sequences that end generation. |
Streaming
Set "stream": true and the response arrives as server-sent events.
Each event is a chat.completion.chunk, terminated by data: [DONE].
curl -N https://routix.tech/v1/chat/completions \ -H "Authorization: Bearer $ROUTIX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "glm-5.3-flash", "stream": true, "messages": [{"role": "user", "content": "Count to three."}] }'
data: {"id":"chatcmpl-rx...","object":"chat.completion.chunk","model":"glm-5.3-flash","choices":[{"delta":{"role":"assistant","content":""}}]}
data: {"id":"chatcmpl-rx...","object":"chat.completion.chunk","model":"glm-5.3-flash","choices":[{"delta":{"content":"One"}}]}
data: {"id":"chatcmpl-rx...","object":"chat.completion.chunk","model":"glm-5.3-flash","choices":[{"delta":{"content":", two"}}]}
data: [DONE]
Events are forwarded as they arrive from the model. If you proxy Routix through another layer, disable that layer's response buffering or tokens will arrive in bursts instead of as they are generated.
Errors
Errors use the standard OpenAI envelope, so existing error handling keeps working.
{
"error": {
"message": "Model not found: gpt-9",
"type": "invalid_request_error",
"code": "model_not_found"
}
}
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request_error | The body was not valid JSON. |
| 401 | authentication_error | Missing or invalid API key. |
| 404 | model_not_found | The model id is not available to your key. |
| 429 | rate_limit_exceeded | Too many requests for this key. Wait Retry-After seconds. See Limits. |
| 503 | api_error | The upstream model is temporarily unavailable. |
Guides
Using the OpenAI SDK
Point the client at Routix and everything else stays the same.
from openai import OpenAI client = OpenAI( base_url="https://routix.tech/v1", api_key=os.environ["ROUTIX_API_KEY"], ) r = client.chat.completions.create( model="glm-5.3-flash", messages=[{"role": "user", "content": "Hi"}], )
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://routix.tech/v1", apiKey: process.env.ROUTIX_API_KEY, }); const r = await client.chat.completions.create({ model: "glm-5.3-flash", messages: [{ role: "user", content: "Hi" }], });
Limits
| Limit | Value |
|---|---|
| Request body | 32 MB |
| Request timeout | 300 s |
| Rate limit | 60 requests / 60 s, per key |
Rate limiting
Limits apply per API key over a sliding 60-second window. Every successful response includes the current state of your quota:
X-RateLimit-Limit: 60 X-RateLimit-Remaining: 59 X-RateLimit-Reset: 60
| Header | Meaning |
|---|---|
| X-RateLimit-Limit | Requests allowed in the window. |
| X-RateLimit-Remaining | Requests left in the current window. |
| X-RateLimit-Reset | Seconds until the window frees up again. |
Exceeding the limit returns 429 with a Retry-After header in seconds. Back off by that amount rather than retrying immediately.
HTTP/1.1 429 Too Many Requests
Retry-After: 43
{
"error": {
"message": "Rate limit exceeded: 60 requests per 60s per key",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}
Limits are per key, not per account — create additional keys from your dashboard if you run several workloads. For substantially higher volume, get in touch.