Skip to content

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.

If you’re already using any OpenAI-compatible SDK, you can get it running by changing just two settings:

Terminal window
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": "你好" }]
}'
  1. Change the Base URL to https://api.routeapi.ai/v1.
  2. Change the API Key to your RouteAPI Token (create one on the API Keys page in the console).
  3. Change model to a model ID available on your account. Look it up with GET /v1/models.

For the complete migration steps for an existing OpenAI application, see Migrating from OpenAI.

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.

ProtocolTypical endpointsSuitable scenarios
OpenAI compatible/v1/chat/completions, /v1/responses, /v1/embeddingsOpenAI SDK, Cursor, OpenCode, LangChain, LiteLLM, and other compatible clients
Claude Messages/v1/messagesClaude Code, Anthropic SDK, and clients using Claude’s native message format
Google Gemini/v1beta/models/{model}:generateContentGoogle 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.

The OpenAI-compatible and Claude Messages protocols use this by default:

https://api.routeapi.ai/v1

The Google Gemini protocol uses this by default:

https://api.routeapi.ai/v1beta
Authorization: Bearer sk-your-routeapi-token
Content-Type: application/json

All 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.

Pick the entry point based on what you’re trying to do:

What I want to doWhich endpointDocs
Standard multi-turn chat/v1/chat/completionsChat Completions
Coding agents, new-protocol clients/v1/responsesResponses
Vector search, semantic search, RAG/v1/embeddingsEmbeddings
Look up available models and capabilities/v1/modelsModels
Let the model call external functionstools parameterTool calling
Have the model output in a fixed JSON structureresponse_format parameterStructured outputs
Pass images to the model for understandingmultimodal contentMultimodal input
Stream responses token by token, lower time-to-first-tokenstream: trueStreaming
AI music generationSuno REST APISuno API

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:

CapabilityDescription
Chat CompletionsThe recommended basic chat endpoint, suitable for most OpenAI SDK compatible clients
ResponsesSuitable for clients and coding agents that support the OpenAI Responses protocol
EmbeddingsUsed for vector search, semantic search, and RAG
StreamingReturns incremental content using SSE
Claude MessagesSupports Claude’s native message structure, suitable for Claude Code and the Anthropic SDK
Google GeminiSupports Gemini generateContent-style requests
Tool CallingDepends on whether the model supports tool calling
Structured OutputsDepends on whether the model supports JSON mode or JSON Schema
Vision / MultimodalDepends 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.

  • Request parameters are preserved and forwarded according to the protocol whenever possible.
  • If an optional scalar parameter is explicitly passed as 0 or false, 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.
  • 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.