Quickstart
Create an API key, copy your base URL, and point any OpenAI-compatible tool at RelayOS. You will be sending requests in under a minute.
BASE_URL=https://api.relayos.internal/v1
API_KEY=sk-prod-••••••••7A9FAuthentication
Authenticate every request with a Bearer token in the Authorization header. Keys are scoped per tool — create separate keys for Cursor, scripts, agents, and server apps.
-H "Authorization: Bearer sk-prod-••••••••7A9F"Base URL
All OpenAI-compatible requests go to the RelayOS base URL. Claude Code uses the host without the /v1 suffix.
https://api.relayos.internal/v1API keys
Manage keys from the API Keys page. Keys can be scoped to specific models, given monthly quotas, and set to expire. Full key values are shown only once at creation time.
Model names
Pass the model name exactly as listed on the Models page, for example claude-sonnet-4, gpt-4.1-mini, or gemini-2.5-pro.
{ "model": "claude-sonnet-4" }Cursor setup
Open Cursor settings, set the OpenAI base URL to your RelayOS base URL, paste your key, and select a model.
{
"openAIBaseUrl": "https://api.relayos.internal/v1",
"openAIKey": "sk-prod-••••••••7A9F",
"model": "claude-sonnet-4"
}Claude Code setup
Export the base URL and auth token as environment variables before launching Claude Code.
export ANTHROPIC_BASE_URL="https://api.relayos.internal"
export ANTHROPIC_AUTH_TOKEN="sk-prod-••••••••7A9F"OpenAI SDK setup
Point the official OpenAI SDK at RelayOS by overriding baseURL. Everything else stays the same.
const client = new OpenAI({
apiKey: process.env.RELAYOS_API_KEY,
baseURL: "https://api.relayos.internal/v1"
});How routing works
RelayOS automatically selects a healthy route for your selected model based on availability, success rate, latency, and policy. Internal route details are hidden by design.
Error codes
RelayOS surfaces friendly, high-level error categories so you can debug your own calls without infrastructure noise.
Upstream 502
The upstream provider returned a temporary gateway error. No quota is charged when the request fails before usage is produced. Retry after a short delay or share the request_id with the platform team.
Request debugging
Use the Requests page to inspect a high-level trace of any call: gateway acceptance, key and quota checks, route selection, first token, completion, and billing settlement. Internal route details are hidden by design.