Skip to main content

RouteLLM API Reference

RouteLLM provides an OpenAI-compatible API endpoint that intelligently routes your requests to the most appropriate underlying model based on cost, speed, and performance requirements.

Overview​

RouteLLM is a smart routing layer that automatically selects the best model for your request, balancing performance, cost, and speed. Instead of manually choosing between different models, you can use the route-llm model identifier and let the system make the optimal choice for you.

Key Features​

  • Intelligent Routing: Automatically selects the best model based on request complexity
  • Cost Optimization: Routes to cost-effective models when appropriate
  • Performance Tuning: Uses high-performance models for complex tasks
  • Streaming Support: Real-time response streaming available
  • Tool Calling: Invoke functions from the model response and submit results back for multi-step workflows
  • Multimodal Support: Supports text, audio, and image inputs for compatible models
  • PDF Support: Process and analyze PDF documents as input for compatible models
  • Image Generation: Generate high-quality images from text prompts using state-of-the-art models
  • Audio Understanding: Analyze and transcribe audio inputs using OpenAI GPT-4o Audio and Google Gemini models
  • Audio Generation (TTS): Generate spoken audio responses from text using OpenAI GPT-4o Audio and Google Gemini TTS models

Getting Started​

How It Works​

  1. Sign Up: Sign up as a ChatLLM subscriber to access RouteLLM API
  2. Access the API: Click on the RouteLLM API icon in the lower left corner of the ChatLLM interface to access API documentation and details
  3. Get Your API Key: Obtain your API key from the RouteLLM API page
  4. Start Using: Invoke the API for any LLM and use it in your applications

Why Choose RouteLLM API?​

RouteLLM API comes with your ChatLLM subscription, providing several key benefits:

  • Unified Platform: Use all LLMs (both open-weight and Proprietary) in the ChatLLM Teams UX and via API, all in one place
  • Easy Management: Centralized way to manage all your favorite AI model consumption
  • Flexible Access: Access models through both the user interface and programmatic API
  • Cost-Effective: Competitive pricing with best available rates for open-source models
  • Transparent Pricing: No markup on proprietary LLMs - you pay provider prices

Pricing​

Credit System​

The ChatLLM subscription includes 20,000 credits to get you started. Each API call consumes credits proportional to the cost of the LLM call. RouteLLM is available for unlimited use for ChatLLM subscribers - while it still tracks credits for accounting purposes, you can continue to use RouteLLM even after hitting your monthly credit limit.

Pricing Details​

Proprietary LLMs​

Proprietary LLMs (e.g., OpenAI, Anthropic, Google Gemini, etc.) are priced based on the prices advertised by the provider. We DO NOT charge you more than what the provider does. Prices are updated automatically whenever the provider updates their pricing.

Open-Weight LLMs​

Open-Weight LLMs are typically priced at the best available price on the planet. Our prices typically match the best available price anywhere in the world.

Note: All open weight LLMs are hosted on servers based in the United States.

View Current Pricing​

Pricing for each LLM is published in our RouteLLM API pricing documentation. You can also programmatically retrieve the most up-to-date list of available models and their current pricing via the /v1/models endpoint — both GET /v1/models and listRouteLLMModels resolve to the same underlying API.

Base URLs​

The base URL depends on your organization type:

  • Self-Serve Organizations: https://routellm.abacus.ai/v1
  • Enterprise Platform: https://<workspace>.abacus.ai/v1

Replace <workspace> with your specific workspace identifier for enterprise deployments. To know your correct base url, refer: RouteLLM API.

Authentication​

All API requests require authentication using an API key. Include your API key in the request header:

Authorization: Bearer <your_api_key>

You can obtain your API key from the Abacus.AI platform.

API Endpoints​

RouteLLM exposes three request/response formats behind the same base URL and API key. Pick the one that matches your client or use case — each has its own detailed reference:

EndpointPathFormatBest for
Chat Completions/v1/chat/completionsOpenAI Chat CompletionsMost use cases; works with every text model and any OpenAI-compatible client
Responses API/v1/responsesOpenAI ResponsesReasoning and agentic workflows with built-in tools (GPT-5 family, o-series, Grok)
Anthropic Messages/v1/messagesAnthropic MessagesClaude models and users of the Anthropic SDK

All three endpoints share the same base URLs, authentication, pricing, and credit system described above.

Supported Models​

The RouteLLM API supports a wide range of models for both text generation and image generation. You can specify a model explicitly or use route-llm to let the system decide.

Routing Model​

  • route-llm: Intelligently routes to the best available model based on the complexity of the request. This is the recommended option for most use cases.

Text Generation Models​

You can also directly target specific text generation models. Select a provider below:

Chat ModelsReasoning Models
gpt-5.5o4-mini
gpt-5.4, gpt-5.4-mini, gpt-5.4-nanoo3, o3-mini, o3-pro
gpt-5.3-codex
gpt-5.2, gpt-5.1
gpt-5, gpt-5-mini, gpt-5-nano
gpt-4.1, gpt-4.1-mini, gpt-4.1-nano
gpt-4o, gpt-4o-mini

Note: This list is subject to change as new models are added. Use the /v1/models endpoint to get the most up-to-date list of available models and their pricing.

Image Generation Models​

RouteLLM supports a wide range of image generation models, from dedicated generators to multimodal LLMs with native image output. Models are grouped into two categories:

  • Dedicated image generation models — purpose-built for image synthesis. Examples: flux-kontext, flux-2-pro, dall-e, ideogram, recraft, imagen, seedream, nano-banana-pro, midjourney, and more.
  • Multimodal LLMs — conversational models (OpenAI GPT and Google Gemini) that can generate images alongside text when modalities: ["image"] is specified.

Image generation requests use the same /v1/chat/completions endpoint as text, with the modalities and image_config parameters controlling output type, number of images, aspect ratio, quality, and resolution.

For the complete model catalogue, supported parameters per model, and usage examples, see the Image Analysis & Generation reference.

Audio Models​

Model IDProviderCapabilities
gpt-4o-audio-previewOpenAIAudio input + Audio output
gpt-4o-mini-audio-previewOpenAIAudio input + Audio output
gemini-2.5-flash-preview-ttsGoogleAudio output (TTS)
gemini-2.5-pro-preview-ttsGoogleAudio output (TTS)

For full details on models, pricing, and usage → Audio Capabilities

Best Practices​

  1. Use route-llm for most cases: Let the system choose the optimal model automatically
  2. Include conversation history: Provide full message history for better context
  3. Set appropriate max_tokens: Prevent unnecessarily long responses
  4. Use streaming for long responses: Improve user experience with real-time output
  5. Handle errors gracefully: Implement retry logic for transient errors