integrations/framework/CrewAI
CR

CrewAI + AIgateway

Multi-agent orchestration — route every Crew agent through AIgateway with a single env var.

CrewAI builds role-based multi-agent workflows. Each agent can target a different LLM. Point CrewAI's underlying litellm at AIgateway and every Crew agent picks up the full catalog without per-agent SDK wiring.

CrewAI homepage →
Setup

Three steps or fewer.

STEP 01

Install CrewAI

pip install crewai crewai-tools
STEP 02

Point LiteLLM at AIgateway

CrewAI uses litellm under the hood. Setting these two env vars routes every model call through AIgateway. Model strings use AIgateway's provider/model format.

export OPENAI_API_KEY="sk-aig-..."
export OPENAI_API_BASE="https://api.aigateway.sh/v1"
STEP 03

Build a crew across multiple models

Mix model providers per agent without juggling API keys. Researcher on Opus 4.7, drafter on Kimi K2.6 (cheap), reviewer on GPT-5.4 — all one key, one bill.

from crewai import Agent, Task, Crew, LLM

researcher = Agent(
    role="Researcher",
    goal="Find primary sources",
    llm=LLM(model="openai/anthropic/claude-opus-4.7"),
)

drafter = Agent(
    role="Drafter",
    goal="Write the first draft",
    llm=LLM(model="openai/moonshot/kimi-k2.6"),
)

crew = Crew(agents=[researcher, drafter], tasks=[
    Task(description="Research and draft a memo on edge AI.",
         agent=researcher),
])
crew.kickoff()
Notes
  • The leading `openai/` prefix in CrewAI's LLM model string is litellm's provider router — it means "use the OpenAI-compatible client", not OpenAI the company. AIgateway lives under that router.
  • Tool calling and structured outputs work because AIgateway preserves the OpenAI function schema.
  • For agent-platform builders: issue a sub-account key per end-user crew so spend lands attributed.
More integrations

Same key. Every other tool.