Models & Providers
Access 300+ AI models through AICredits. Understand provider routing, model ID formats, and automatic fallback chains.
Use this page with an AI assistant
Opens a new chat with this docs URL and the correct AICredits base URLs.
AICredits supports 300+ models across multiple providers through a single API.
Supported Providers
| Provider | Example Models | Routing |
|---|---|---|
| OpenAI | openai/gpt-4o-mini, openai/gpt-4o | Direct |
| Anthropic | anthropic/claude-sonnet-4.6, anthropic/claude-haiku-4.5 | Direct |
google/gemini-2.5-flash, google/gemini-2.5-pro | Direct | |
| DeepSeek | deepseek/deepseek-chat, deepseek/deepseek-v4-flash | Direct |
| Mistral, xAI and others | See the Models page | Direct |
| More | Additional models via aggregation | Aggregated |
Reasoning models require a higher max_tokens budget
Models that perform internal reasoning (e.g. openai/o3-mini, deepseek/deepseek-reasoner) consume their thinking tokens from the same max_tokens pool as the visible response. If the limit is too low, the model may exhaust all available tokens during its thinking phase and return an empty response — even though tokens were consumed and billed. Set max_tokens to at least 4096 (and ideally 8000–16000) when using reasoning models.
Model ID Format
Use the provider/model-name format for unambiguous routing (recommended):
"model": "openai/gpt-4o-mini"
"model": "anthropic/claude-sonnet-4.6"
"model": "google/gemini-2.5-flash"
"model": "deepseek/deepseek-chat"You can also pass just the model name (for example gpt-4o-mini or claude-haiku-4.5). Well-known prefixes such as gpt, claude, gemini, deepseek, mistral and grok are matched to their provider, and unrecognised names are served from the aggregated provider pool.
Use the explicit format in production. Prefix detection is convenient for quick testing but can route unexpectedly for ambiguous names.
Provider Routing
Each request resolves to a primary provider and an ordered list of secondary routes. Where a model is available from several providers, the routes configured for it are tried in priority order, with an aggregated provider pool as the last resort. The primary provider uses round-robin key selection across healthy keys, and the fallback is automatic and transparent.
You can steer this per request with provider.order and provider.allow_fallbacks. See Provider Routing for details, and check the X-AICredits-Provider response header to see which provider served a call.
Circuit Breaker
AICredits tracks the health of each provider key. If a key fails multiple times, it's temporarily marked as unhealthy and skipped for 30 seconds. This prevents repeated failures from adding latency to your requests.
Model Fallback
Send a models array instead of a single model to enable automatic cross-model fallback. If the first model fails (5xx, rate limit, or model unavailable), the request is automatically retried on the next model — transparently, with no extra code in your application.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.aicredits.in/v1",
apiKey: "sk-your-aicredits-key",
});
const response = await client.chat.completions.create({
// @ts-expect-error — AICredits extension
models: ["openai/gpt-4o-mini", "anthropic/claude-haiku-4.5", "google/gemini-2.5-flash"],
messages: [{ role: "user", content: "Hello!" }],
});
// Check which model actually responded
console.log(response.model);from openai import OpenAI
client = OpenAI(
base_url="https://api.aicredits.in/v1",
api_key="sk-your-aicredits-key",
)
response = client.chat.completions.create(
# models[] is an AICredits extension — pass as extra_body
model="openai/gpt-4o-mini", # required by SDK; overridden by models[] below
extra_body={
"models": ["openai/gpt-4o-mini", "anthropic/claude-haiku-4.5", "google/gemini-2.5-flash"]
},
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.model) # which model actually respondedcurl https://api.aicredits.in/v1/chat/completions \
-H "Authorization: Bearer sk-your-aicredits-key" \
-H "Content-Type: application/json" \
-d '{
"models": ["openai/gpt-4o-mini", "anthropic/claude-haiku-4.5", "google/gemini-2.5-flash"],
"messages": [{"role": "user", "content": "Hello!"}]
}'Billing uses whichever model actually responds. The model field in the response tells you which one was used. The models are tried in the order you provide. When you send models, provider.order is not applied.
Browse Models
View all available models with real-time pricing on the Models page, or query the API:
# Public model catalog endpoint (outside OpenAI /v1 base URL)
curl https://api.aicredits.in/api/modelsDeprecated model redirects
When a provider retires a model, AICredits may redirect requests for the old ID to its replacement so your app keeps working. A redirected request is billed at the replacement model's price, and the response tells you what happened:
| Header | Meaning |
|---|---|
X-Redirected-From | The model ID you requested |
X-Model-Used | The model that actually served the request |
X-Model-Deprecated | true when the requested model is deprecated |
The model field in the response body is the model that served the request. If you need a specific model and want a request to fail instead of being redirected, check X-Redirected-From in your client and alert on it.