Skip to main content
Chucky supports multiple AI providers, giving you flexibility to choose the best model for each task.

Supported Providers

ProviderModelsAPI Key Required
AnthropicClaude Opus, Sonnet, HaikuYes (bring your own)
OpenAIGPT-5.2, GPT-5, o3, o4Yes (bring your own)
OpenRouter100+ modelsYes (bring your own)

Using Different Models

Anthropic (Default)

const session = client.createSession({
  model: 'claude-sonnet-4-5-20250929',
});

OpenAI

Use your own OpenAI API key for GPT models:
const session = client.createSession({
  model: 'gpt-5.2',  // Automatically routes to OpenAI
});
Add your OpenAI API key in the project settings at app.chucky.cloud.

OpenRouter

Access 100+ models through OpenRouter using the or: prefix:
const session = client.createSession({
  model: 'or:mistralai/mistral-large',
});

// Or without prefix for unknown models (auto-detected)
const session = client.createSession({
  model: 'deepseek/deepseek-chat',  // Routes to OpenRouter
});
Add your OpenRouter API key in the project settings. Get one at openrouter.ai.

Model Detection

Chucky automatically routes requests based on the model name:
PatternProvider
or:*OpenRouter (explicit)
claude-*Anthropic
gpt-*, o1*, o3*, o4*OpenAI
Everything elseOpenRouter (fallback)

Examples

// Anthropic
'claude-sonnet-4-5-20250929'  // → Anthropic
'claude-opus-4-5-20251101'    // → Anthropic

// OpenAI
'gpt-5.2'                     // → OpenAI
'o4-mini'                     // → OpenAI

// OpenRouter (explicit)
'or:mistralai/mistral-large'  // → OpenRouter
'or:google/gemini-pro'        // → OpenRouter

// OpenRouter (auto-detected)
'deepseek/deepseek-chat'      // → OpenRouter (unknown model)
'meta-llama/llama-3-70b'      // → OpenRouter (unknown model)

Environment Variables

Configure Claude Code model behavior via environment variables passed to sessions:

Primary Model

VariableDescription
ANTHROPIC_MODELPrimary model for the session
const session = client.createSession({
  env: {
    ANTHROPIC_MODEL: 'claude-opus-4-5-20251101',
  },
});

Model Aliases

Override the default models for each alias tier:
VariableDescriptionDefault
ANTHROPIC_DEFAULT_OPUS_MODELModel for opus aliasclaude-opus-4-5-20251101
ANTHROPIC_DEFAULT_SONNET_MODELModel for sonnet aliasclaude-sonnet-4-5-20250929
ANTHROPIC_DEFAULT_HAIKU_MODELModel for haiku alias and background tasksclaude-haiku-4-5-20251001

Subagent Model

VariableDescription
CLAUDE_CODE_SUBAGENT_MODELModel used for subagent/background tasks
const session = client.createSession({
  env: {
    ANTHROPIC_MODEL: 'claude-sonnet-4-5-20250929',
    CLAUDE_CODE_SUBAGENT_MODEL: 'claude-haiku-4-5-20251001',
    ANTHROPIC_DEFAULT_HAIKU_MODEL: 'or:mistralai/devstral-2512:free',
  },
});

Prompt Caching

Control prompt caching behavior:
VariableDescription
DISABLE_PROMPT_CACHINGSet to 1 to disable all caching
DISABLE_PROMPT_CACHING_HAIKUSet to 1 to disable for Haiku
DISABLE_PROMPT_CACHING_SONNETSet to 1 to disable for Sonnet
DISABLE_PROMPT_CACHING_OPUSSet to 1 to disable for Opus
These environment variables are passed to the Claude Code sandbox and affect how models are selected for different tasks within a session.

Custom Pricing

For OpenRouter and other non-standard models, you can configure custom pricing to ensure accurate cost tracking.

Why Custom Pricing?

  • OpenRouter models have varying prices
  • Some models are free (e.g., mistralai/devstral-2512:free)
  • Accurate billing for your users

Setting Up Custom Pricing

  1. Go to Billing → Custom Pricing in the portal
  2. Add pricing entries for models you use
FieldDescriptionExample
Model PatternExact name or wildcardmistralai/*
Input PriceUSD per 1M input tokens2.00
Output PriceUSD per 1M output tokens6.00

Wildcard Patterns

Use /* suffix to match all models from a provider:
mistralai/*           → All Mistral models
meta-llama/*          → All Llama models
deepseek/*            → All DeepSeek models

Pricing Priority

When calculating costs, Chucky checks in order:
  1. Custom exact match - Your pricing for the exact model name
  2. Custom wildcard - Your pricing matching provider/*
  3. Built-in pricing - Known Anthropic/OpenAI prices
  4. Default fallback - Sonnet-level pricing (3/3/15 per 1M tokens)
If you use free models without custom pricing, they’ll be billed at the default rate. Add custom pricing with $0 for free models.

Example: Free Models

For free OpenRouter models:
Model PatternInput PriceOutput Price
mistralai/devstral-2512:free00
meta-llama/llama-3-8b:free00

Provider Configuration

Adding API Keys

In the portal at Projects → [Your Project] → Settings:
1

Anthropic API Key

Required for Claude models. Get one at console.anthropic.com.
2

OpenAI API Key

Required for GPT models. Get one at platform.openai.com.
3

OpenRouter API Key

Required for OpenRouter models. Get one at openrouter.ai.

Custom OpenRouter Endpoint

For self-hosted OpenRouter or compatible APIs:
Endpoint: https://your-openrouter-instance.com/api/v1

Model Recommendations

Use CaseRecommended ModelWhy
General codingclaude-sonnet-4-5-20250929Best balance of speed/quality
Complex reasoningclaude-opus-4-5-20251101Highest capability
High volumeclaude-3-5-haiku-20241022Fastest, cheapest
Cost-sensitiveor:deepseek/deepseek-chatVery cheap, good quality
Free tieror:mistralai/devstral-2512:freeNo cost

Troubleshooting

”No API key configured”

You’re using a model that requires your own API key:
{
  "error": {
    "type": "authentication_error",
    "message": "No OpenRouter API key configured for issuer: xxx"
  }
}
Fix: Add the API key in project settings.

Model Not Found

OpenRouter may not have the model:
{
  "error": {
    "type": "api_error",
    "message": "OpenRouter error: Model not found"
  }
}
Fix: Check model name at openrouter.ai/models.

Unexpected Costs

Model billed at default rate instead of actual price: Fix: Add custom pricing for the model in Billing → Custom Pricing.

Next Steps