API Documentation
RouterShift API Overview
RouterShift provides a unified OpenAI-compatible API to access hundreds of AI models from dozens of providers. Use a single API key to route requests intelligently across providers with built-in load balancing, failover, and cost optimization.
Key Features
- OpenAI-compatible API — drop-in replacement for any OpenAI SDK client
- Smart routing with configurable strategies (weighted, round-robin, latency-based, failover)
- Built-in circuit breaker and rate limiting to protect your application
- Semantic caching to reduce latency and costs on repeated queries
- Comprehensive logging, monitoring, and spend analytics
- Multi-provider support with automatic failover when a provider is unavailable
Base URL
All API requests use the following base URL. The API is fully compatible with the OpenAI client libraries — just change the base URL and use your RouterShift API key.
https://api.routershift.com/v1Anthropic-Compatible Base URL
For Anthropic SDK or Claude Code. Note: no /v1 suffix — the SDK auto-appends /v1/messages.
https://api.routershift.comOpenAI Compatibility
RouterShift is a drop-in replacement for the OpenAI API. If you already use the OpenAI Python or Node.js SDK, you can switch to RouterShift by changing only the base URL and API key. All standard endpoints — chat completions, embeddings, and models listing — work identically.
Supported Model Categories
RouterShift provides access to chat, code generation, vision, image generation, reasoning, and audio models from leading AI providers.
Getting Help
If you encounter issues or have questions, check the sections below for detailed guides. For billing inquiries, contact support through the console. For real-time status updates, visit the Status page.
Full Endpoint List
All API endpoints share a single base URL and authentication method. One API key works across every endpoint.
| Method | Path | Description |
|---|---|---|
| POST | /v1/chat/completions | Chat Completions (OpenAI-compatible) |
| POST | /v1/messages | Messages API (Anthropic-compatible) |
| POST | /v1/models/gemini/:model/generateContent | Gemini Generate Content |
| POST | /v1/models/gemini/:model/streamGenerateContent | Gemini Stream Generate Content |
| POST | /v1/embeddings | Text Embeddings |
| POST | /v1/images/generations | Image Generation |
| POST | /v1/audio/transcriptions | Audio Transcription |
| POST | /v1/audio/speech | Text to Speech |
| POST | /v1/rerank | Rerank |
| POST | /v1/midjourney/imagine | Midjourney Image Generation |
| POST | /v1/suno/generate | Suno Music Generation |
| POST | /v1/batch | Batch Processing |
| POST | /v1/chat/completions/async | Async Task — Submit |
| GET | /v1/chat/completions/async/:id | Async Task — Check Status |
| GET | /v1/chat/completions/async/:id/result | Async Task — Get Result |
| GET | /v1/models | Model Listing |
Protocol Correspondence
RouterShift is compatible with multiple API protocols. The table below shows the base URL and SDK configuration for each.
| Base URL | Example Model Parameter | Auth Header |
|---|---|---|
https://api.routershift.com/v1 Standard OpenAI SDK — just change base_url | gpt-4o, claude-sonnet-4-6 | Authorization: Bearer |
https://api.routershift.com Standard Anthropic SDK — just change base_url | claude-sonnet-4-6 | x-api-key: sk-xxx |
https://api.routershift.com/v1 Gemini native format, call generateContent directly | gemini-2.5-flash | Authorization: Bearer |
Unified Authentication
All endpoints use the same authentication. Both header formats work identically:
OpenAI-compatible format
Authorization: Bearer sk-xxxAnthropic-compatible format
x-api-key: sk-xxx