modelrouting

API reference

modelrouting is a thin, fast pass-through to the airelay gateway. Everything is served over HTTPS from a single base URL; the catalog, models and limits are managed by airelay, not by this edge.

Base URL and auth

GET https://api.modelrouting.io/v1
Base URL:  https://api.modelrouting.io/v1
Auth:      Authorization: Bearer arl_…your-key

Your key is an arl_… token issued by the Telegram bot. It works anywhere a Responses-API key is accepted. The key carries your purchased concurrency limits; there is no separate quota to track.

POST /v1/responses

Native OpenAI Responses API. One in-flight execution consumes one LLM stream from your key for its entire lifetime.

POST /v1/responses
curl -N https://api.modelrouting.io/v1/responses \
  -H "Authorization: Bearer arl_…your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6.1-sol",
    "input": "Summarize the last commit",
    "stream": true
  }'

Set "stream": true to receive server-sent events as they happen; omit it for a single JSON response. Request bodies up to 256 MB are accepted.

Hosted tools

Tool calls run on our side; each in-flight tool execution consumes one tool stream. Included tools:

POST /v1/responses · with tools
{
  "model": "gpt-6.1-sol",
  "input": "Is the new airelay release out yet?",
  "tools": [{"type": "google_search", "google_search": {}}]
}

GET /v1/models

Live model catalog (requires a valid key). GET /v1/public/models serves the same catalog without auth, for display purposes.

Concurrency errors

When every one of your streams is busy, airelay answers 429 with a machine-readable code and a one-second retry hint:

429 response body
{ "error": { "code": "llm_concurrency_limit_exceeded", "retry_after": 1 } }
{ "error": { "code": "tool_concurrency_limit_exceeded", "retry_after": 1 } }

Harnesses that respect Retry-After will queue automatically. To raise your ceiling, buy an addon from the bot (+1 LLM stream, +2 tool streams).

Key lifecycle

Payments

Zero data retention

The edge logs metadata only — key id, model, HTTP status, duration, byte counts. Prompts, completions and tool payloads stream straight through to the gateway and are never persisted by modelrouting.

Health

GET /healthz · /readyz
GET /healthz   # database + upstream airelay status
GET /readyz    # same probe, readiness semantics