claude-3-5-sonnet-latest goes to Anthropic and gemini-2.0-flash goes to Google — no prefix required.
Quick Start
1
Just name the model
Name the model and PraisonAI routes it to the right vendor.
2
Be explicit when the name isn't enough
Add a
provider/ prefix for custom-named or gateway models the bare name would not resolve.How It Works
PraisonAI runs four checks in order to resolve every model string. An explicitprovider/model prefix wins over everything, including a custom baseURL.
Routing Decision Table
This table is the single source of truth for user-visible routing behaviour.The baseURL Exception
Pointing at a proxy that serves
claude-* over an OpenAI-shaped API is a real deployment, so a bare name plus a custom baseURL stays on the OpenAI-compatible path — prefix inference would otherwise route it away from the endpoint you explicitly asked for. An explicit provider/model prefix still wins, because that request is unambiguous.Per-Agent Credentials
PassapiKey on the agent and PraisonAI honours it for whichever provider the model routes to.
apiKey is honoured for every provider — env vars are optional, not required.
Best Practices
Prefer the bare name for major models
Prefer the bare name for major models
claude-3-5-sonnet-latest reads more clearly than anthropic/claude-3-5-sonnet-latest and routes the same way.Add the provider/ prefix when you're using a gateway
Add the provider/ prefix when you're using a gateway
A
baseURL keeps a bare name on the OpenAI-compatible path; an explicit provider/model prefix overrides that.Pass apiKey per agent when running multiple tenants
Pass apiKey per agent when running multiple tenants
No env-var juggling, no cross-tenant leakage — each agent carries its own key.
Do not name your own model claude-... or gemini-... unless you mean it
Do not name your own model claude-... or gemini-... unless you mean it
The prefix inference is deliberate — a custom model with that name will route to Anthropic or Google.
Related
Providers
Full provider reference and configuration
Multi-Provider Agents (AI SDK)
Build agents across 30+ providers

