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.

Base URL
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
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."}
    ]
  }'
response · 200
{
  "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

GET /v1/models

Returns every model your key can call.

{
  "object": "list",
  "data": [
    {
      "id": "glm-5.3-flash",
      "object": "model",
      "owned_by": "Zhipu AI"
    }
  ]
}

Fields

FieldTypeDescription
idstringModel identifier to pass in model.
objectstringAlways "model".
owned_bystringThe model family that owns it.

Chat completions

POST /v1/chat/completions

The same request body as the OpenAI chat completions endpoint. Supported parameters are passed through unchanged.

Request body

ParameterTypeRequiredDescription
modelstringyesOne of the ids from /v1/models.
messagesarrayyesConversation history as {role, content} objects.
streambooleannoReturn server-sent events instead of a single JSON body.
temperaturenumbernoPassed through to the model.
max_tokensintegernoUpper bound on generated tokens.
top_pnumbernoNucleus sampling threshold.
stopstring | arraynoSequences 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 · stream
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."}]
  }'
events
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]
Note

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"
  }
}
StatusCodeMeaning
400invalid_request_errorThe body was not valid JSON.
401authentication_errorMissing or invalid API key.
404model_not_foundThe model id is not available to your key.
429rate_limit_exceededToo many requests for this key. Wait Retry-After seconds. See Limits.
503api_errorThe upstream model is temporarily unavailable.

Guides

Using the OpenAI SDK

Point the client at Routix and everything else stays the same.

python
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"}],
)
node
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

LimitValue
Request body32 MB
Request timeout300 s
Rate limit60 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:

response headers
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 60
HeaderMeaning
X-RateLimit-LimitRequests allowed in the window.
X-RateLimit-RemainingRequests left in the current window.
X-RateLimit-ResetSeconds 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.

429 response
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"
  }
}
Need more

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.