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/v1Use a RouteShift virtual key in the standard bearer-token header:
Authorization: Bearer sk-proxy-…Supported client endpoints
| Method | Path | Use for |
|---|---|---|
POST | /v1/chat/completions | Send non-streaming or streaming chat-completion requests through your routing rules. |
POST | /v1/embeddings | Create embeddings through a configured upstream provider. |
GET | /v1/models | List 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: 7Retry-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.
| Reason | Status | Meaning |
|---|---|---|
key_revoked | 401 | Virtual key was revoked. |
key_expired | 401 | Virtual key passed its expiry. |
model_not_allowed | 403 | Model is not in this key's allowlist. |
rpm_exceeded | 429 | Per-key requests-per-minute cap was reached. |
tpm_exceeded | 429 | Per-key tokens-per-minute cap was reached. |
budget_exceeded | 429 | Monthly budget was reached. |
cost_ceiling_exceeded | 429 | Per-request cost ceiling was reached during a fallback chain. |
no_provider_key | 503 | No configured provider key can serve the resolved upstream. |
upstream_cooldown | 503 | All 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.
Team & access
Invite teammates, assign roles, and manage workspace-level settings in RouteShift — the access control surface for shared keys, budgets, and billing artifacts.
Chat completions
OpenAI-compatible chat completions, streamed or buffered, with RouteShift's routing applied transparently — fail over, balance load, and bill back savings.