AICredits logo
Getting Started

Models & Providers

Access 300+ AI models through AICredits. Understand provider routing, model ID formats, heuristic detection, 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

ProviderExample ModelsRouting
OpenAIgpt-4o, gpt-4o-mini, o1, o3-miniDirect
Anthropicanthropic/claude-sonnet-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-haiku-4.5Direct
Googlegemini-2.0-flash, gemini-2.5-proDirect
DeepSeekdeepseek-chat, deepseek-reasonerDirect
Mistralmistral-large, mistral-smallDirect
xAIgrok-2, grok-3-miniDirect
More300+ models via aggregationAggregated

Reasoning models require a higher max_tokens budget

Models that perform internal reasoning (e.g. openai/o1, 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

You can specify models in two ways: explicit (recommended) or heuristic.

Use the provider/model-name format for unambiguous routing:

Explicit Model IDs
"model": "openai/gpt-4o-mini"
"model": "anthropic/claude-sonnet-4.5"
"model": "google/gemini-2.0-flash"
"model": "deepseek/deepseek-chat"
"model": "mistral/mistral-large-latest"
"model": "xai/grok-2"

Heuristic Format

You can also pass just the model name. AICredits will auto-detect the provider based on the prefix:

PrefixDetected ProviderExample
gpt-, o1-, o3-OpenAIgpt-4o-mini
claude-Anthropicanthropic/claude-sonnet-4.5
gemini-Googlegemini-2.0-flash
deepseek-DeepSeekdeepseek-chat
mistral-Mistralmistral-large-latest
grok-xAIgrok-2
otherAuto-routedany unrecognized model

Use the explicit format for production applications. Heuristic detection is convenient for quick testing but may route unexpectedly for ambiguous names.

Provider Routing

AICredits uses a shadow routing system that automatically handles provider failures. When you make a request, it follows a chain of providers to maximize availability.

Fallback Chain

1. Primary Provider — Direct API call to the provider (e.g., OpenAI, Anthropic) with round-robin key selection.

2. Secondary Provider — If the primary is unavailable, AICredits automatically falls back to an alternative route at no extra cost when possible.

3. Fallback Provider — Last resort fallback through an aggregated provider pool for maximum availability.

This fallback is automatic and transparent. You always receive a response as long as any provider in the chain is available.

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: ["gpt-4o", "anthropic/claude-sonnet-4.5", "gemini-1.5-pro"],
  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="gpt-4o",  # required by SDK; overridden by models[] below
    extra_body={
        "models": ["gpt-4o", "anthropic/claude-sonnet-4.5", "gemini-1.5-pro"]
    },
    messages=[{"role": "user", "content": "Hello!"}],
)

print(response.model)  # which model actually responded
curl https://api.aicredits.in/v1/chat/completions \
  -H "Authorization: Bearer sk-your-aicredits-key" \
  -H "Content-Type: application/json" \
  -d '{
    "models": ["gpt-4o", "anthropic/claude-sonnet-4.5", "gemini-1.5-pro"],
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Billing uses whichever model actually responds. The model field in the response tells you which one was used. List up to 3 models — the fallback chain is tried in the order you provide.

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/models

On this page