Gateway: CrewAI

Platform

Point crewai.LLM at Traccia with base_url and extra_headers. LiteLLM under the hood. Prefix openai/ or anthropic/.

CrewAI's LLM accepts base_url (and api_base). Extra kwargs, including extra_headers, are stored as additional_params and forwarded on the LiteLLM fallback. Newer CrewAI uses a native OpenAI provider unless you force LiteLLM. Set is_litellm=True so both Traccia headers actually leave the process. Use the openai/ or anthropic/ model prefix so LiteLLM picks the matching provider path.

Install LiteLLM Support

CrewAI's LiteLLM path needs crewai[litellm]. Native OpenAI / Anthropic classes do not document extra_headers. is_litellm=True is the path that forwards those headers.

What this Gateway accepts

OpenAI: POST /openai/v1/chat/completions and GET /openai/v1/models. Anthropic: POST /anthropic/v1/messages. Gemini Developer API: POST /google/{v1beta|v1}/models/{model}:generateContent and :streamGenerateContent. Embeddings, the OpenAI Responses API, Assistants, Azure OpenAI paths, Vertex AI paths, and Anthropic Batches are not this Gateway. Those requests 404.

Headers

HeaderValue
X-Traccia-Api-KeyWorkspace key from Settings → API Keys
X-Traccia-Agent-IdSame Agent ID you would pass to init

Keep the provider API key on the client. The Gateway forwards it and does not store it. Missing Traccia key returns 401. Missing agent ID returns 400.

OpenAI

Set base_url to https://gateway.traccia.ai/openai/v1. Do not append /chat/completions.

python
import os
from crewai import LLM
llm = LLM(
model="openai/gpt-4o-mini",
is_litellm=True,
api_key=os.environ["OPENAI_API_KEY"],
base_url="https://gateway.traccia.ai/openai/v1",
extra_headers={
"X-Traccia-Api-Key": os.environ["TRACCIA_API_KEY"],
"X-Traccia-Agent-Id": "billing-bot",
},
)

Anthropic

Same LiteLLM suffix rule as the LiteLLM page: base_url is https://gateway.traccia.ai/anthropic with no /v1. LiteLLM appends /v1/messages.

python
import os
from crewai import LLM
llm = LLM(
model="anthropic/claude-sonnet-4-5",
is_litellm=True,
api_key=os.environ["ANTHROPIC_API_KEY"],
base_url="https://gateway.traccia.ai/anthropic",
extra_headers={
"X-Traccia-Api-Key": os.environ["TRACCIA_API_KEY"],
"X-Traccia-Agent-Id": "billing-bot",
},
)

SDK Tracing Is Separate

Traccia's CrewAI integration traces crews and tasks when you call init(). That is observe. This page is only the Gateway PEP for the provider call.

Next Steps

© 2026 Traccia.