Skip to content

API Overview

RouteAPI provides enterprise-oriented unified AI API access, aggregating model capabilities such as OpenAI, Claude, Gemini, Azure, and AWS Bedrock into a stable, observable, and measurable interface system. Business systems only need to connect to RouteAPI to call different model services with unified authentication, unified model IDs, and unified logs.

RouteAPI supports three mainstream protocols: OpenAI-compatible, Claude Messages, and Google Gemini. You can keep using existing SDKs or clients and only 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, Claude-native message clients
Google Gemini/v1beta/models/{model}:generateContentGoogle GenAI SDK, Gemini REST clients

Requests entering through different protocols are adapted inside RouteAPI as needed. From the business side, choose the protocol natively supported by the current client first.

OpenAI-compatible and Claude Messages protocols use by default:

https://www.routeapi.ai/v1

Google Gemini protocol uses by default:

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

All protocols use the same type of RouteAPI Token. Store Tokens on the server side and do not expose them in browsers, mobile apps, or public repositories.

RouteAPI tries to preserve the native calling experience of each protocol while forwarding requests to suitable model services. Actual support depends on model, service capability, and request parameters:

CapabilityDescription
Chat CompletionsRecommended basic chat API for most OpenAI SDK compatible clients
ResponsesSuitable for clients and coding agents that support OpenAI Responses
EmbeddingsUsed for vector search, semantic search, and RAG
StreamingReturns incremental content through SSE
Claude MessagesSupports Claude-native message structure, suitable for Claude Code and 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
  • Request parameters are preserved as much as possible and forwarded according to the protocol.
  • Optional scalar parameters explicitly passed as 0 or false should be treated as explicit values, not dropped as defaults.
  • Parameters unsupported by different models may be adapted, ignored, or trigger errors, depending on model compatibility rules.
  • In production, fix model IDs and prepare fallback strategies for key business flows.
  • For optional capabilities such as tool calling, structured output, visual input, and streaming usage statistics, validate in a test environment before launch.
  • Encapsulate RouteAPI Tokens on the server side and avoid exposing keys directly to business frontends.
  • Use different Tokens for different business systems to simplify independent limits, auditing, and troubleshooting.
  • Fix model IDs and protocol paths; do not rely on temporary aliases or display names.
  • Record request ID, model ID, status code, latency, and token usage to troubleshoot latency and cost anomalies.
  • Enable streaming timeouts, failure retries, and alternative model options for core business flows to reduce the impact of a single model service issue.