AICredits logo
Features

Provider Routing

How AICredits routes requests across LLM providers. Explicit routing, heuristic model detection, and automatic failover.

Use this page with an AI assistant

Opens a new chat with this docs URL and the correct AICredits base URLs.

AICredits routes every request to the right upstream provider based on the model ID you specify. This page explains the routing logic and how to control it.

Routing Logic

Explicit Routing

The most reliable way to route is to prefix your model ID with the provider name:

openai/gpt-4o            → OpenAI
anthropic/claude-sonnet-4.6 → Anthropic
google/gemini-2.0-flash  → Google
deepseek/deepseek-chat   → DeepSeek
mistral/mistral-large    → Mistral
xai/grok-beta            → xAI

Explicit routing guarantees the request goes to the provider you specify, with no ambiguity.

Heuristic Routing

If no provider prefix is given, AICredits uses heuristics to detect the provider from the model name:

Model prefixProvider
gpt-, o1-, o3-, text-embedding-OpenAI
claude-Anthropic
gemini-Google
deepseek-DeepSeek
mistral-, mixtral-Mistral
grok-xAI
UnknownRoutes to aggregated provider pool

Using explicit provider/model prefixes is strongly recommended for production workloads. Heuristics can be ambiguous when providers name new models similarly.

Failover

When the primary provider is unavailable (circuit breaker triggered), AICredits automatically retries the request:

  1. Healthy keys first — round-robin across healthy API keys for the same provider
  2. Exponential backoff — 500ms, 1s, 2s between retries (max 3 attempts)
  3. Fallback provider — if all direct provider keys are unhealthy, routes to an aggregated provider pool as last resort

The circuit breaker marks a provider key as unhealthy for 30 seconds after repeated failures, then recovers automatically.

Supported Providers

ProviderModelsDirect Support
OpenAIGPT-4o, GPT-4o-mini, o1, o3, DALL-E 3, TTS, WhisperYes
AnthropicClaude Opus 4, Sonnet 4, Haiku 4Yes
GoogleGemini 2.0 Flash, Gemini 1.5 Pro/FlashYes
DeepSeekDeepSeek Chat, DeepSeek R1Yes
MistralMistral Large, Small, NemoYes
xAIGrok BetaYes
SarvamBulbul v2 (TTS), Saarika v2 (STT)Yes
Aggregated pool200+ models including open-sourceYes (fallback)

Model Discovery

To see all available models with their provider prefixes, use the models endpoint:

curl https://api.aicredits.in/api/models

Or browse Models → for a searchable list with pricing.

On this page