Quick Start
RouteAPI gives your application one authenticated entry point for OpenAI-compatible, Claude Messages, and Google Gemini APIs. This guide takes you from an account to a verified request, then points you to the right integration path for production.
Get access in three steps
Section titled “Get access in three steps”- Register an account. Visit the RouteAPI Console and register with email or Google. The dashboard shows your balance, usage, and account status.
- Create a token. Open Token Management → Create Key. Give the token a recognizable name, set an expiration date, and optionally add quota and model limits.
- Send a test request. Set
ROUTEAPI_KEYto the new token, choose an available model, and run the cURL example below.
Send a request
Section titled “Send a request”The OpenAI-compatible endpoint is the shortest path for a first test. It accepts the same basic chat format used by many existing clients.
export ROUTEAPI_KEY="sk-your-routeapi-token"
curl https://api.routeapi.ai/v1/chat/completions \ -H "Authorization: Bearer $ROUTEAPI_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.5", "messages": [ {"role": "user", "content": "Hello RouteAPI"} ] }'The response contains the assistant message and usage information. Keep the request ID returned by the API or client when available; it is useful for troubleshooting. If the model name is not available for your token, replace it with an ID returned by GET /v1/models.
Choose an integration path
Section titled “Choose an integration path”Node.js and Python
Section titled “Node.js and Python”RouteAPI is compatible with the official OpenAI SDKs. Choose your runtime, install its SDK, then set the RouteAPI Base URL:
# Node.jsbun add openai
# Pythonpip install openaiimport OpenAI from 'openai';
const client = new OpenAI({ apiKey: process.env.ROUTEAPI_KEY, baseURL: 'https://api.routeapi.ai/v1',});
const response = await client.chat.completions.create({ model: 'gpt-5.5', messages: [{ role: 'user', content: 'Introduce RouteAPI in one sentence' }],});
console.log(response.choices[0].message.content);See the complete Node.js, Python, and OpenAI SDK examples.
Stream incremental output
Section titled “Stream incremental output”Set stream to true to receive Server-Sent Events (SSE) as the model produces output. Read each data: event and stop when you receive data: [DONE].
curl https://api.routeapi.ai/v1/chat/completions \ -H "Authorization: Bearer $ROUTEAPI_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.5", "stream": true, "messages": [ {"role": "user", "content": "Explain RouteAPI in three points"} ] }'Streaming support and final usage events depend on the selected model. See Streaming Responses for SSE handling and mid-stream errors.
Verify and troubleshoot
Section titled “Verify and troubleshoot”Before integrating a larger application, use the same token to verify the model list and a real request:
curl https://api.routeapi.ai/v1/models \ -H "Authorization: Bearer $ROUTEAPI_KEY"- 401 — verify the token and the
Authorizationheader. - 402 — check the account balance or token quota.
- 429 — reduce request frequency and review rate limits.
- 502/503 — check model service availability, try a supported model, or retry with a limit.
- Model unavailable — confirm the exact model ID and its capabilities.
Use Request Debugging and Common Errors for a deeper diagnosis. The console usage log includes status, latency, tokens, cost, and error details.
Continue with RouteAPI
Section titled “Continue with RouteAPI”For production, keep tokens server-side, pin model IDs, record request IDs, and test optional features such as streaming, tool calling, structured outputs, and multimodal input with the exact model you plan to use.