Axiomancer
API reference — Overview

API overview

Use RouteShift's OpenAI-compatible client API at api.routeshift.io for chat completions, embeddings, and model discovery.

RouteShift exposes an OpenAI-compatible client surface at:

https://api.routeshift.io/v1

Use a RouteShift virtual key in the standard bearer-token header:

Authorization: Bearer sk-proxy-…

Supported client endpoints

MethodPathUse for
POST/v1/chat/completionsSend non-streaming or streaming chat-completion requests through your routing rules.
POST/v1/embeddingsCreate embeddings through a configured upstream provider.
GET/v1/modelsList the models currently exposed by RouteShift.
GET/v1/models/{model}Read one model's public metadata.

Anthropic can be configured as an upstream provider, but RouteShift does not currently expose a public Anthropic Messages-compatible endpoint. Send client traffic through the OpenAI-compatible routes above.

Virtual keys

Virtual keys use the sk-proxy-… prefix and authenticate client traffic. Each key can carry its own model allowlist, requests-per-minute and tokens-per-minute limits, budget, expiry, and metadata.

RouteShift returns a key's plaintext value only when the key is created. Store it in an approved secret manager and rotate it if it is exposed.

First request

curl https://api.routeshift.io/v1/chat/completions \
  -H "Authorization: Bearer sk-proxy-…" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      { "role": "user", "content": "Summarize this request in one sentence." }
    ]
  }'

Continue with Chat completions for request and streaming examples.

Rate limits

Each virtual key carries its own RPM and TPM caps. See Virtual API keys. When a cap is hit, RouteShift returns 429 and identifies the proxy-side reason.

HTTP/1.1 429 Too Many Requests
X-RouteShift-Reason: rpm_exceeded
Retry-After: 7

Retry-After is in seconds.

Errors

RouteShift preserves the upstream provider's error format when possible. Proxy-side errors use X-RouteShift-Reason so you can distinguish a RouteShift policy decision from an upstream failure.

ReasonStatusMeaning
key_revoked401Virtual key was revoked.
key_expired401Virtual key passed its expiry.
model_not_allowed403Model is not in this key's allowlist.
rpm_exceeded429Per-key requests-per-minute cap was reached.
tpm_exceeded429Per-key tokens-per-minute cap was reached.
budget_exceeded429Monthly budget was reached.
cost_ceiling_exceeded429Per-request cost ceiling was reached during a fallback chain.
no_provider_key503No configured provider key can serve the resolved upstream.
upstream_cooldown503All eligible credentials for the provider are cooling down.

Operator admin surface

RouteShift also has an operator-facing /admin surface for key lifecycle, usage, routing configuration, and cache invalidation. It does not accept virtual keys and is not a second client compatibility API.

Admin credentials and endpoint scope are deployment-managed. Scoped admin tokens are limited to specific read endpoints and explicit team IDs; mutation endpoints require the unrestricted operator credential. See the Admin API before building an internal integration.

Was this page helpful?

On this page