Use CrewAI with amazee.ai
CrewAI is a framework for building multi-agent AI systems. Connect it to amazee.ai to run your crews through your regional endpoint with full data residency and budget controls.
Prerequisites
- CrewAI installed (
pip install crewaioruv add crewai) - An amazee.ai API key
Connect CrewAI to amazee.ai
Option 1 — Environment variables
Set these before running your crew:
export OPENAI_API_KEY="your-amazee-ai-api-key"
export OPENAI_API_BASE="https://llm.[your-region].amazee.ai/v1"
Replace [your-region] with your region code (e.g. ch103, us103, de103).
Then use the model in your crew definition:
from crewai import LLM
llm = LLM(model="openai/claude-sonnet-4-5")
Option 2 — Explicit configuration in code
from crewai import LLM
llm = LLM(
model="openai/claude-sonnet-4-5",
api_key="your-amazee-ai-api-key",
base_url="https://llm.[your-region].amazee.ai/v1",
temperature=0.7,
)
Option 3 — YAML configuration
In your crew's YAML config:
llm:
provider: openai
config:
model: openai/claude-sonnet-4-5
api_key: your-amazee-ai-api-key
base_url: https://llm.[your-region].amazee.ai/v1
Verify
Run your crew and check my.amazee.io → Usage to confirm requests are flowing through your amazee.ai endpoint.
Troubleshooting
Auth errors
: Make sure OPENAI_API_KEY is set or api_key is passed directly to the LLM constructor.
Model not found
: Prefix the model ID with openai/ (e.g. openai/claude-sonnet-4-5). CrewAI uses LiteLLM under the hood, which requires the provider prefix.
Import errors
: If using LiteLLM features, install with pip install 'crewai[litellm]'.