Hyperouter API

Version v1 · Updated September 24, 2026

Hyperouter exposes one OpenAI-compatible HTTP API in front of many model providers. You send a request naming a model; Hyperouter picks the provider (the venue) that serves it best, forwards the request, and bills your balance at that venue’s list price.

BASEhttps://hyperouter.app/api/v1

The API is in private beta. Request a key to get access.

Quickstart

  1. Request an API key. Keys start with hr-.
  2. Store it in an environment variable, e.g. HYPEROUTER_API_KEY.
  3. Point any OpenAI SDK at the base URL above and pick a model.
curl https://hyperouter.app/api/v1/chat/completions \
  -H "Authorization: Bearer $HYPEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Authentication

Send your key as a bearer token on every request:

Authorization: Bearer hr-...

Keys carry full access to your balance. Keep them server-side, never in browser or mobile code. To rotate or revoke a key, email account@hyperouter.app; a revoked key stops working immediately.

Chat completions

POST/chat/completions

Accepts the OpenAI Chat Completions request body. Hyperouter adds the models and provider fields for routing.

Request body

FieldTypeDescription
modelstringModel slug, e.g. openai/gpt-5. Required unless models is set.
modelsstring[]Ordered fallback list. The next model is tried if every venue for the previous one fails.
messagesobject[]Conversation so far. Roles: system, user, assistant, tool. Content may include images where the model supports them.
streambooleanReturn server-sent events. See Streaming.
max_tokensintegerUpper bound on generated tokens.
temperature, top_pnumberSampling controls, passed through to the venue.
stopstring | string[]Sequences that end generation.
tools, tool_choiceobject[], string | objectFunction calling, in OpenAI format. Translated for venues that use a different schema.
response_formatobject{"type":"json_object"} or a JSON schema for structured output.
providerobjectRouting preferences. See Routing.
userstringYour end-user ID, used for abuse monitoring and your usage export.

Response

Identical to OpenAI’s, plus provider (the venue that filled the request) and usage.cost in USD.

{
  "id": "gen-01J8Z6Q4X2",
  "object": "chat.completion",
  "model": "anthropic/claude-sonnet-5",
  "provider": "anthropic",
  "choices": [{
    "index": 0,
    "message": { "role": "assistant", "content": "Hello! How can I help?" },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 8,
    "total_tokens": 17,
    "cost": 0.000147
  }
}

Streaming

With "stream": true the response is a stream of server-sent events in the OpenAI chunk format, ending with data: [DONE]. The last chunk before [DONE] carries usage and provider.

Fallback happens only before the first token is sent. If a venue fails mid-stream, the stream ends with an error event and you are billed only for tokens already delivered.

Routing

By default Hyperouter sends each request to the healthy venue with the lowest price for that model, breaking ties by latency. A venue is considered unhealthy after elevated error rates or timeouts in the last few minutes and is skipped until it recovers.

Override the default with the provider object:

FieldTypeDescription
sortstring"price" (default), "latency" or "throughput".
orderstring[]Venues to try first, in order, e.g. ["anthropic","bedrock"].
onlystring[]Only route to these venues.
ignorestring[]Never route to these venues.
allow_fallbacksbooleanDefault true. Set false to fail instead of trying another venue.
data_collectionstring"deny" limits routing to venues that do not retain or train on prompts.
max_priceobjectCeiling in USD per 1M tokens, e.g. {"prompt":1,"completion":4}. Venues above it are skipped.
{
  "model": "deepseek/deepseek-v3.2",
  "provider": {
    "sort": "throughput",
    "data_collection": "deny",
    "max_price": { "prompt": 0.5, "completion": 1 }
  },
  "messages": [{ "role": "user", "content": "Hello" }]
}

Models

GET/models

Lists every model you can call, with live prices per token in USD and the venues serving it. No authentication required.

{
  "data": [{
    "id": "anthropic/claude-sonnet-5",
    "name": "Claude Sonnet 5",
    "context_length": 200000,
    "pricing": { "prompt": "0.000003", "completion": "0.000015" },
    "venues": ["anthropic", "bedrock", "vertex"],
    "modalities": ["text", "image"]
  }]
}

Errors

Errors use standard HTTP status codes and an OpenAI-style body: {"error": {"code": 402, "message": "..."}}.

StatusMeaning
400Invalid request body or parameters.
401Missing, invalid or revoked API key.
402Balance too low for this request. Top up and retry.
403Input was rejected by a venue’s content policy.
404Unknown model, or no venue matches your provider constraints.
408The request timed out on every venue tried.
429Rate limited. Retry after the number of seconds in Retry-After.
502Every eligible venue returned an error. Not billed.
503Hyperouter is temporarily unavailable. Not billed.

Billing & limits

Support

Keys, billing and API questions: account@hyperouter.app. Chat product: chat@hyperouter.app. Please include the id from the response when reporting a specific request.