API Overview
RouteAPI provides enterprise-oriented unified AI API access, aggregating model capabilities from OpenAI, Claude, Gemini, Azure, AWS Bedrock, and more into a single stable, observable, and measurable interface system. Business systems only need to integrate with RouteAPI to call different model services under unified authentication, unified model IDs, and unified logging.
Get started in three steps
Section titled “Get started in three steps”If you’re already using any OpenAI-compatible SDK, you can get it running by changing just two settings:
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": "你好" }] }'- Change the Base URL to
https://api.routeapi.ai/v1. - Change the API Key to your RouteAPI Token (create one on the API Keys page in the console).
- Change
modelto a model ID available on your account. Look it up withGET /v1/models.
For the complete migration steps for an existing OpenAI application, see Migrating from OpenAI.
Supported protocol entry points
Section titled “Supported protocol entry points”RouteAPI supports three mainstream protocols at once: OpenAI-compatible, Claude Messages, and Google Gemini. You can keep using your existing SDK or client and just switch the Base URL and API Key to RouteAPI.
| Protocol | Typical endpoints | Suitable scenarios |
|---|---|---|
| OpenAI compatible | /v1/chat/completions, /v1/responses, /v1/embeddings | OpenAI SDK, Cursor, OpenCode, LangChain, LiteLLM, and other compatible clients |
| Claude Messages | /v1/messages | Claude Code, Anthropic SDK, and clients using Claude’s native message format |
| Google Gemini | /v1beta/models/{model}:generateContent | Google GenAI SDK, Gemini REST clients |
Requests entering through different protocols are adapted internally by RouteAPI as needed. On the business side, it’s best to pick whichever protocol your current client natively supports — a native protocol skips conversion entirely and behaves the most predictably. For the mapping rules and known limitations of cross-protocol calls (for example, calling a Claude model using the OpenAI format), see Protocol conversion.
Base URLs
Section titled “Base URLs”The OpenAI-compatible and Claude Messages protocols use this by default:
https://api.routeapi.ai/v1The Google Gemini protocol uses this by default:
https://api.routeapi.ai/v1betaCommon request headers
Section titled “Common request headers”Authorization: Bearer sk-your-routeapi-tokenContent-Type: application/jsonAll protocols use the same type of RouteAPI Token. Keep your Token on the server side — never expose it in a browser, mobile app, or public repository. For details on key permissions, quotas, and authentication errors, see Authentication.
The Claude Messages protocol also accepts the x-api-key header that the Anthropic SDK typically uses, so if you’re using the Anthropic SDK you usually only need to change the Base URL.
API and capability index
Section titled “API and capability index”Pick the entry point based on what you’re trying to do:
| What I want to do | Which endpoint | Docs |
|---|---|---|
| Standard multi-turn chat | /v1/chat/completions | Chat Completions |
| Coding agents, new-protocol clients | /v1/responses | Responses |
| Vector search, semantic search, RAG | /v1/embeddings | Embeddings |
| Look up available models and capabilities | /v1/models | Models |
| Let the model call external functions | tools parameter | Tool calling |
| Have the model output in a fixed JSON structure | response_format parameter | Structured outputs |
| Pass images to the model for understanding | multimodal content | Multimodal input |
| Stream responses token by token, lower time-to-first-token | stream: true | Streaming |
| AI music generation | Suno REST API | Suno API |
Protocol compatibility scope
Section titled “Protocol compatibility scope”RouteAPI tries to preserve the native calling experience of each protocol while forwarding requests to the appropriate model service. Actual supported capabilities depend on the model, the service’s capabilities, and the request parameters:
| Capability | Description |
|---|---|
| Chat Completions | The recommended basic chat endpoint, suitable for most OpenAI SDK compatible clients |
| Responses | Suitable for clients and coding agents that support the OpenAI Responses protocol |
| Embeddings | Used for vector search, semantic search, and RAG |
| Streaming | Returns incremental content using SSE |
| Claude Messages | Supports Claude’s native message structure, suitable for Claude Code and the Anthropic SDK |
| Google Gemini | Supports Gemini generateContent-style requests |
| Tool Calling | Depends on whether the model supports tool calling |
| Structured Outputs | Depends on whether the model supports JSON mode or JSON Schema |
| Vision / Multimodal | Depends on whether the model supports image or multimodal input |
Capabilities are provided per model, not per platform: the same endpoint may lose tool calling or image input support if you switch model. Test with your target model before going live, or check the capability fields returned by Models.
API stability conventions
Section titled “API stability conventions”- Request parameters are preserved and forwarded according to the protocol whenever possible.
- If an optional scalar parameter is explicitly passed as
0orfalse, RouteAPI treats it as an explicit value rather than dropping it as a default. - Parameters unsupported by a given model may be adapted, ignored, or trigger an error, depending on that model’s compatibility rules.
- In production, we recommend pinning model IDs and preparing a fallback strategy for critical business flows.
- For optional capabilities like tool calling, structured outputs, visual input, and streaming usage statistics, validate them in a test environment before going live.
Enterprise integration recommendations
Section titled “Enterprise integration recommendations”- Wrap your RouteAPI Token on the server side so business frontends never hold the key directly.
- Use different Tokens for different business systems, to make independent quotas, auditing, and troubleshooting easier.
- Pin model IDs and protocol paths — don’t rely on temporary aliases or display names.
- Log request ID, model ID, status code, latency, and token usage, so you can investigate latency and cost anomalies.
- For core business flows, enable streaming timeouts, failure retries, and fallback model plans to reduce the impact of a single model service disruption.
What’s next
Section titled “What’s next”- Authentication — create Tokens, configure quotas and permissions.
- Errors and debugging — status code meanings and a troubleshooting order.
- Migrating from OpenAI — a switchover checklist for existing applications.
- Client integration — specific configuration for Cursor, Claude Code, LangChain, and more.
- Billing and quotas — usage statistics and billing conventions.