Build once. Route to every model.
A focused guide to connect your application to Xyrus Router, authenticate requests, stream completions, and discover available models.
Base URL
https://ai-gateway-production-df56.up.railway.app/v101 / Quick start
Make your first request
Create an API key, choose a model, and send an OpenAI-compatible request to the Railway gateway.
Create a key
Generate a credential from the dashboard.
Choose a model
Use any ID returned by /models.
Send a request
Keep your existing OpenAI client.
curl https://ai-gateway-production-df56.up.railway.app/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer API_KEY_ANDA" -d '{"model":"xyrz/gpt-5.6-luna","messages":[{"role":"user","content":"Halo"}]}'02 / Authentication
Use a bearer token
Every chat request needs your API key in the Authorization header.
Generate your key from the dashboard. Keep it server-side and never commit it to source control.
03 / Chat completions
One endpoint, familiar shape
Xyrus Router accepts the same core request format used by OpenAI-compatible clients.
| Field | Type | Description |
|---|---|---|
| model | string | Model ID from the model catalog. |
| messages | array | Messages with role and content. |
| stream | boolean | Enable SSE streaming responses. |
| max_tokens | integer | Maximum tokens in the response. |
| temperature | float | Sampling temperature from 0 to 2. |
04 / Streaming
Stream tokens over SSE
Set stream to true to receive incremental completion chunks.
Standard Server-Sent Events
Read each data: line as JSON and stop when the server sends data: [DONE].
05 / Models
Discover available models
Use the model catalog before routing traffic to confirm IDs and provider availability.
This endpoint does not require authentication. It returns model IDs, providers, context windows, and billing multiples (billed tokens = (input + output) × multiple).
06 / Errors
Predictable error responses
Errors use standard HTTP status codes with a machine-readable error code.
| Status | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | Missing or invalid API key. |
| 404 | model_not_found | Model is not supported by the gateway. |
| 429 | rate_limit_exceeded | The API key rate limit was reached. |
| 502 | provider_error | The upstream provider returned an error. |
| 503 | provider_not_configured | The provider is not configured on this server. |