Skip to content

Model Providers ​

Choosing a model ​

Name the model as <provider>/<model id> when you build the agent. The prefix picks the provider, and the rest is passed to that provider's API as the model id.

python
agent = await AgentBuilder("anthropic/claude-haiku-4-5").build()
js
const agent = await new AgentBuilder('anthropic/claude-haiku-4-5').build()
rust
let agent = AgentBuilder::new("anthropic/claude-haiku-4-5").build().await?;

A provider is available once its API key is set in the environment. Ailoy reads the keys the first time an agent is built, so set them before that:

sh
export ANTHROPIC_API_KEY=...

Building an agent for a provider with no key set fails with no entry for model '...' in lang_model_provider 'default'.

Providers ​

PrefixProviderEnvironment variableExample
openai/OpenAIOPENAI_API_KEYopenai/gpt-5.6-luna
anthropic/AnthropicANTHROPIC_API_KEYanthropic/claude-haiku-4-5
google/Google GeminiGEMINI_API_KEYgoogle/gemini-2.5-flash
x-ai/xAI GrokXAI_API_KEYx-ai/grok-4-fast
deepseek/DeepSeekDEEPSEEK_API_KEYdeepseek/deepseek-chat
moonshotai/Moonshot AI (Kimi)KIMI_API_KEYmoonshotai/kimi-k2-thinking
openrouter/OpenRouterOPENROUTER_API_KEYopenrouter/openai/gpt-5
bedrock/Amazon BedrockAWS_BEARER_TOKEN_BEDROCKbedrock/global.anthropic.claude-sonnet-5
  • OpenRouter takes OpenRouter's own model ids, which include the vendor: openrouter/openai/gpt-5 sends openai/gpt-5.
  • Bedrock takes Bedrock model or inference-profile ids. The region comes from AWS_REGION, then AWS_DEFAULT_REGION, and defaults to us-east-1.