# OffRail > OffRail is an OpenAI-compatible API gateway that routes, manages, and analyzes LLM requests across 40+ providers (OpenAI, Anthropic, Google, and more) through a single unified API. Switch providers without changing code, manage API keys centrally, track usage and cost, add caching and guardrails, and self-host or use the managed cloud. ## Key facts - One OpenAI-compatible API for 40+ providers and 200+ models. - Migrate by changing only the base URL (`https://api.offrail.ai/v1`) and your API key — no code rewrites. - Built-in usage analytics, per-model/provider cost breakdowns, automatic routing, fallbacks, caching, and guardrails. - API base URL: `https://api.offrail.ai/v1` · Docs: https://docs.offrail.ai · Site: https://offrail.ai ## Product pages - [Home](https://offrail.ai): Unified API for multiple LLM providers. - [Models](https://offrail.ai/models): Browse 200+ supported models with pricing and capabilities. - [Providers](https://offrail.ai/providers): All supported LLM providers. - [Pricing](https://offrail.ai/pricing): Plans and pricing. - [Enterprise](https://offrail.ai/enterprise): Self-hosting, SSO, and team features. - [Token Cost Calculator](https://offrail.ai/token-cost-calculator): Estimate and compare LLM costs across models. - [OffRail vs LiteLLM](https://offrail.ai/compare/litellm) - [OffRail vs OpenRouter](https://offrail.ai/compare/open-router) - [OffRail vs Portkey](https://offrail.ai/compare/portkey) ## Getting Started - [Introduction to OffRail](https://docs.offrail.ai/): OffRail is a unified API gateway for Large Language Models. Route requests to multiple providers, manage API keys, track usage, and optimize costs. - [Overview](https://docs.offrail.ai/overview): Introduction to OffRail, a unified API gateway for LLMs. - [Quickstart](https://docs.offrail.ai/quick-start): Fastest way to start using OffRail in any language or framework. - [AI SDK Gateway protocol](https://docs.offrail.ai/developers/ai-sdk-gateway-protocol): Point an app built on the Vercel AI Gateway at OffRail without changing its code - [Image Generation with the AI SDK](https://docs.offrail.ai/developers/ai-sdk-images): Generate images with generateImage or stream image output through chat using the AI SDK - [Using the AI SDK](https://docs.offrail.ai/developers/ai-sdk): Generate text, stream responses, and call tools with the Vercel AI SDK and OffRail - [Overview](https://docs.offrail.ai/developers): Build AI applications on OffRail with MCP and the AI SDK - [Model Context Protocol (MCP)](https://docs.offrail.ai/developers/mcp): Use OffRail as an MCP server for Claude Code, Cursor, and other MCP-compatible clients - [AWS](https://docs.offrail.ai/self-host/aws): Deploy OffRail on AWS with EKS, RDS for Postgres, ElastiCache, and Secrets Manager. - [Azure](https://docs.offrail.ai/self-host/azure): Deploy OffRail on Azure with AKS, Azure Database for PostgreSQL, Azure Cache for Redis, and Key Vault. - [Docker Compose](https://docs.offrail.ai/self-host/docker-compose): Run OffRail with Docker Compose — each service in its own container for more control. - [Docker](https://docs.offrail.ai/self-host/docker): Run OffRail as a single Docker container — the fastest way to a working instance. - [Google Cloud](https://docs.offrail.ai/self-host/gcp): Deploy OffRail on Google Cloud with GKE, Cloud SQL, Memorystore, and Secret Manager. - [Self Host OffRail](https://docs.offrail.ai/self-host): Deploy OffRail on your own infrastructure with Docker, Docker Compose, or Kubernetes on AWS, GCP, and Azure. - [Kubernetes](https://docs.offrail.ai/self-host/kubernetes): Deploy OffRail to any Kubernetes cluster with the official Helm chart. ## Features - [Anthropic API Compatibility](https://docs.offrail.ai/features/anthropic-endpoint): Use the Anthropic-compatible endpoint to access any LLM model through the familiar Anthropic API format. - [API Keys & IAM Rules](https://docs.offrail.ai/features/api-keys): Comprehensive guide to API key management and Identity Access Management (IAM) rules for fine-grained access control - [Audit Logs](https://docs.offrail.ai/features/audit-logs): Track all organization activity with comprehensive audit logs - [Compliance](https://docs.offrail.ai/features/compliance): Restrict routing to providers that meet your compliance requirements (SOC 2, ISO 27001, GDPR, no prompt training, no prompt logging) - [Cost Breakdown](https://docs.offrail.ai/features/cost-breakdown): Get real-time cost information for each API request directly in the response. - [Custom Providers](https://docs.offrail.ai/features/custom-providers): Learn how to integrate custom OpenAI-compatible providers with OffRail for enhanced flexibility and control. - [Data Retention](https://docs.offrail.ai/features/data-retention): Store and access your full request and response data for debugging, analytics, and compliance. - [Document Reading](https://docs.offrail.ai/features/documents): Learn how to send PDFs and other document data to document-capable models. - [Dynamic Routes](https://docs.offrail.ai/features/dynamic-routes): Define named, versioned routing flows with conditions, percentage splits, and model targets, and invoke them via dynamic/ in the model field. - [Embeddings](https://docs.offrail.ai/features/embeddings): Generate vector embeddings using OpenAI-compatible embedding models. - [Guardrails](https://docs.offrail.ai/features/guardrails): Protect your LLM usage with content guardrails that detect and block harmful content - [Image Generation](https://docs.offrail.ai/features/image-generation): Generate images using AI models through the OpenAI-compatible images API or chat completions API - [Master Keys](https://docs.offrail.ai/features/master-keys): Provision projects, gateway API keys, and custom providers/models — and pull per-member usage and cost data — programmatically with org-scoped bearer tokens (Enterprise only) - [Metadata](https://docs.offrail.ai/features/metadata): Send additional context and metadata to OffRail using custom headers. - [Org Models Directory](https://docs.offrail.ai/features/models-directory): One directory of every model your organization can use — catalog and custom — with per-model compliance eligibility. - [Moderations](https://docs.offrail.ai/features/moderations): Classify unsafe text and image inputs with the OpenAI-compatible moderations API - [OCR](https://docs.offrail.ai/features/ocr): Extract text and structure from documents and images as markdown with the OCR API - [Realtime API](https://docs.offrail.ai/features/realtime): Low-latency speech-to-speech conversations over WebSockets through the OpenAI-compatible realtime API - [Reasoning](https://docs.offrail.ai/features/reasoning): Learn how to use reasoning-capable models that show their step-by-step thought process. - [Rerank](https://docs.offrail.ai/features/rerank): Reorder candidate documents by relevance to a query with the rerank API - [Response Healing](https://docs.offrail.ai/features/response-healing): Automatically repair malformed JSON responses from AI models. - [Routing](https://docs.offrail.ai/features/routing): Learn how OffRail intelligently routes your requests to the best available models and providers. - [Service Tiers](https://docs.offrail.ai/features/service-tiers): Trade latency against cost on supported OpenAI, Google, and Fireworks models with Flex and Priority processing tiers. - [Sessions](https://docs.offrail.ai/features/sessions): Group related requests into a session to keep provider routing sticky and to observe a conversation end-to-end in the activity log. - [Source Attribution](https://docs.offrail.ai/features/source): Use the X-Source header to identify your domain for public usage statistics. - [Speech Generation](https://docs.offrail.ai/features/speech-generation): Generate speech (text-to-speech) using ElevenLabs, Gemini, OpenAI, and Qwen models through the OpenAI-compatible audio API - [Request Timeouts](https://docs.offrail.ai/features/timeouts): Per-request time limits on the gateway, how they interact with streaming and agentic workloads, and how to change them. - [Transcription](https://docs.offrail.ai/features/transcription): Transcribe audio into text (speech-to-text) with word-level timestamps through the audio transcriptions API - [Video Generation](https://docs.offrail.ai/features/video-generation): Generate videos with an OpenAI-compatible async API and signed completion callbacks - [Vision Support](https://docs.offrail.ai/features/vision): Learn how to send images to vision-enabled models using URLs or inline base64 data. - [Native Web Search](https://docs.offrail.ai/features/web-search): Enable real-time web search capabilities to get up-to-date information from the internet. - [Gateway Caching](https://docs.offrail.ai/features/caching/gateway-caching): Serve byte-identical requests entirely from OffRail at $0 cost. - [Caching](https://docs.offrail.ai/features/caching): Overview of the two types of caching available in OffRail. - [Provider Cache Control](https://docs.offrail.ai/features/caching/provider-cache-control): Use provider-side prompt caching to reduce the cost of long, reused prompts in chat and coding tools. - [Microsoft Entra ID](https://docs.offrail.ai/features/sso/entra): Set up SAML single sign-on and SCIM provisioning for your organization with Microsoft Entra ID (formerly Azure AD). - [Google Workspace](https://docs.offrail.ai/features/sso/google): Let members of your Google Workspace domain auto-join your organization when they sign in with Google — no SAML app or SCIM required. - [SSO](https://docs.offrail.ai/features/sso): Per-organization SAML single sign-on and SCIM directory provisioning for enterprise teams (Enterprise only). - [Okta](https://docs.offrail.ai/features/sso/okta): Set up SAML single sign-on and SCIM provisioning for your organization with Okta. ## Guides & AI Tooling - [Autohand Code Integration](https://docs.offrail.ai/guides/autohand): Use GPT-5, Claude, Gemini, or any model with Autohand Code's autonomous coding agent. Simple config, full cost tracking. - [Claude Code Integration](https://docs.offrail.ai/guides/claude-code): Point Claude Code at Kimi K3, GPT-5, Gemini, or 200+ models with three environment variables. Works with any pay-as-you-go API key. - [Cline Integration](https://docs.offrail.ai/guides/cline): Run Cline, the autonomous VS Code coding agent, on Kimi K3 or 200+ models through OffRail. One OpenAI-compatible endpoint, full cost tracking. - [Codex CLI Integration](https://docs.offrail.ai/guides/codex-cli): Point OpenAI's Codex CLI at Claude, Gemini, Kimi K3, or 200+ models through OffRail. One config file entry, unified billing, full cost tracking. - [Continue CLI Integration](https://docs.offrail.ai/guides/continue): Point Continue CLI at Kimi K3, GPT-5, Claude, or 200+ models through OffRail. One config file, unified billing, full cost tracking. - [Crush Integration](https://docs.offrail.ai/guides/crush): Use GPT-5, Claude, Gemini, or any model with Charm's Crush coding agent. One provider entry, 200+ models, full cost tracking. - [Cursor Integration](https://docs.offrail.ai/guides/cursor): Point Cursor's plan and agent modes at Kimi K3, GPT-5, Claude, or 200+ models through OffRail. One base URL override, plus what stays on Cursor's backend. - [GitHub Copilot App Integration](https://docs.offrail.ai/guides/github-copilot): Use any tool-calling model in GitHub's Copilot desktop app through OffRail. One BYOK provider, full cost tracking. - [Hermes Agent Integration](https://docs.offrail.ai/guides/hermes-agent): Use any model with Hermes Agent through OffRail. One config change, full cost tracking, 200+ models. - [Kilo Code Integration](https://docs.offrail.ai/guides/kilo-code): Use OffRail with Kilo Code in VS Code. Built-in provider — just search, connect your API key, and start coding. - [Kimi Code Integration](https://docs.offrail.ai/guides/kimi-code): Install Kimi Code CLI on macOS, Linux, or Windows, then point it at GPT-5, Claude, Kimi K3, or 200+ models through OffRail. Provider setup in six steps. - [MiMo Code Integration](https://docs.offrail.ai/guides/mimocode): Use GPT-5.5, Claude, Gemini, Kimi K3, or 200+ models with MiMo Code. Custom provider configuration in a few steps, with full cost tracking. - [N8n Integration](https://docs.offrail.ai/guides/n8n): Connect n8n workflow automation to OffRail for AI-powered workflows - [OpenClaw Integration](https://docs.offrail.ai/guides/openclaw): Use GPT-5.4, Claude Opus, Gemini, or any model with OpenClaw across Discord, WhatsApp, Telegram, and more - [OpenCode Desktop Integration](https://docs.offrail.ai/guides/opencode-desktop): Connect OpenCode Desktop to 200+ models through OffRail. No config files — just open Settings, connect, and start building. - [OpenCode Integration](https://docs.offrail.ai/guides/opencode): Connect OpenCode to 200+ models via OffRail's built-in provider. No config files — select, authenticate, and code. Kimi K3, GPT-5 and Claude included. - [Pi Integration](https://docs.offrail.ai/guides/pi): Use any model with Pi coding agent through OffRail — GPT-5.5, Gemini, Claude, DeepSeek, and 200+ others in your terminal. ## Provider Integrations - [AWS Bedrock Integration](https://docs.offrail.ai/integrations/aws-bedrock): Connect AWS Bedrock to OffRail for access to foundation models - [Azure Integration](https://docs.offrail.ai/integrations/azure): Connect Azure to OffRail for enterprise-grade OpenAI models - [Vertex AI Anthropic Integration](https://docs.offrail.ai/integrations/vertex-anthropic): Connect Google Cloud Vertex AI to OffRail to run Claude models on your own GCP project ## Platform & Dashboard - [Activity](https://docs.offrail.ai/learn/activity): View and inspect every API request made through OffRail - [Agents Monitoring](https://docs.offrail.ai/learn/agents): Track cost, tokens, and sessions for every coding agent in a project - [Analytics](https://docs.offrail.ai/learn/analytics): Break down cost, requests, and tokens by model for any project - [API Keys](https://docs.offrail.ai/learn/api-keys): Create, limit, and control API keys for authenticating with OffRail - [Audit Logs](https://docs.offrail.ai/learn/audit-logs): Track every action taken within your organization - [Billing](https://docs.offrail.ai/learn/billing): Manage your credits, subscription plan, and payment methods - [Lounge Memberships](https://docs.offrail.ai/learn/chat-plans): Monthly membership plans for Lounge, the OffRail chat app - [Coding Agents](https://docs.offrail.ai/learn/coding-agents): See which coding tools your API key is being used with - [Dashboard](https://docs.offrail.ai/learn/dashboard): Your central hub for monitoring LLM usage, costs, and performance - [Dynamic Routes](https://docs.offrail.ai/learn/dynamic-routes): Build named, versioned routing flows visually and invoke them via dynamic/ in the model field - [Guardrails](https://docs.offrail.ai/learn/guardrails): Configure content safety rules to protect your LLM usage - [Introduction](https://docs.offrail.ai/learn): Learn how to navigate and use the OffRail dashboard - [Invoices](https://docs.offrail.ai/learn/invoices): Download invoices and credit notes for every payment - [Master Keys](https://docs.offrail.ai/learn/master-keys): Provision projects and API keys programmatically with org-scoped master keys - [Member Analytics](https://docs.offrail.ai/learn/member-analytics): See organization usage and cost broken down per team member - [Model Categories](https://docs.offrail.ai/learn/model-categories): How models are categorized in the gateway - [Model Usage](https://docs.offrail.ai/learn/model-usage): Track usage breakdown by individual model - [Models](https://docs.offrail.ai/learn/models): Browse every model your organization can use — catalog and custom — with compliance eligibility - [Organization Analytics](https://docs.offrail.ai/learn/org-analytics): Roll cost, requests, and tokens up across every project in your organization, broken down by model, project, or API key - [Org Preferences](https://docs.offrail.ai/learn/org-preferences): Manage your organization's name, billing email, and billing details - [Audio Studio](https://docs.offrail.ai/learn/playground-audio): Generate speech from text using AI voices - [Group Chat](https://docs.offrail.ai/learn/playground-group): Watch multiple AI models discuss and collaborate on your prompt - [Image Studio](https://docs.offrail.ai/learn/playground-image): Generate and edit images using AI models - [Voice Calls](https://docs.offrail.ai/learn/playground-realtime): Have a live speech-to-speech conversation with a model in the browser - [Video Studio](https://docs.offrail.ai/learn/playground-video): Generate videos using AI models - [Lounge Chat](https://docs.offrail.ai/learn/playground): Chat with any LLM interactively in Lounge, the OffRail chat app - [Policies](https://docs.offrail.ai/learn/policies): Configure data retention and other organization policies - [Preferences](https://docs.offrail.ai/learn/preferences): Configure project-level settings including caching and project mode - [Provider Keys](https://docs.offrail.ai/learn/provider-keys): Bring your own provider API keys to use without additional fees - [Referrals](https://docs.offrail.ai/learn/referrals): Earn credits by referring other users to OffRail - [Payments SDK](https://docs.offrail.ai/learn/sdk-settings): Configure end-user sessions and platform secret keys for the Payments SDK (Embeddable Payments) - [Security Events](https://docs.offrail.ai/learn/security-events): Monitor guardrail violations and content policy events - [Structured outputs](https://docs.offrail.ai/learn/structured-outputs): Soft JSON output vs strict JSON output schema — what OffRail declares and how it enforces each - [Team](https://docs.offrail.ai/learn/team): Manage team members and their roles within your organization - [Transactions](https://docs.offrail.ai/learn/transactions): View your complete payment and credit history - [Usage & Metrics](https://docs.offrail.ai/learn/usage-metrics): Detailed analytics for requests, models, errors, caching, and costs ## Migration Guides - [Migrate from LiteLLM](https://docs.offrail.ai/migrations/litellm): Switch from self-hosted LiteLLM to managed OffRail. Same API format, zero infrastructure to maintain. - [Migrate from OpenRouter](https://docs.offrail.ai/migrations/openrouter): Switch to OffRail for built-in analytics, self-hosting options, and simpler API. Two-line code change. - [Migrate from Vercel AI Gateway](https://docs.offrail.ai/migrations/vercel-ai-gateway): Keep your Vercel AI SDK code, add response caching, detailed analytics, and smart routing. One provider for all models. ## Resources - [Error Handling](https://docs.offrail.ai/resources/error-handling): How OffRail returns errors in an OpenAI-compatible format on the OpenAI-compatible endpoints. - [Rate Limits](https://docs.offrail.ai/resources/rate-limits): Understanding rate limits per organization, endpoint, and plan on OffRail. ## API Reference - [Health check](https://docs.offrail.ai/health): Health check endpoint. - [Create speech](https://docs.offrail.ai/v1_audio_speech): >- - [Create transcription](https://docs.offrail.ai/v1_audio_transcriptions): >- - [Chat Completions](https://docs.offrail.ai/v1_chat_completions): Create a completion for the chat conversation - [Embeddings](https://docs.offrail.ai/v1_embeddings): >- - [Edit image](https://docs.offrail.ai/v1_images_edits): Creates an edited image from one or more source images and a prompt. - [Create image](https://docs.offrail.ai/v1_images_generations): >- - [Retrieve key status](https://docs.offrail.ai/v1_key_retrieve): >- - [Anthropic Messages](https://docs.offrail.ai/v1_messages): Create a message using Anthropic's API format - [Models](https://docs.offrail.ai/v1_models): List all available models - [Moderations](https://docs.offrail.ai/v1_moderations): Classify text or multimodal inputs with OpenAI moderation. - [OCR](https://docs.offrail.ai/v1_ocr): >- - [Rerank](https://docs.offrail.ai/v1_rerank): >- - [Video content](https://docs.offrail.ai/v1_videos_content): >- - [Create video](https://docs.offrail.ai/v1_videos_create): >- - [Video log content](https://docs.offrail.ai/v1_videos_log_content): >- - [Retrieve video](https://docs.offrail.ai/v1_videos_retrieve): Retrieves the current state of a video generation job.