> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# CrewAI

> Use TokenLab models in CrewAI agents through OpenAI-compatible LLM settings

## Overview

CrewAI supports OpenAI-compatible LLMs by setting the model, API key, and base URL on environment variables or on the `LLM` class.

<Note>
  **Type**: Agent Framework

  **Primary Path**: OpenAI-compatible chat completions

  **Support Confidence**: Supported custom endpoint path
</Note>

## Environment Variables

```python theme={null}
import os

os.environ["OPENAI_API_KEY"] = "sk-your-tokenlab-key"
os.environ["OPENAI_API_BASE"] = "https://api.tokenlab.sh/v1"
os.environ["OPENAI_MODEL_NAME"] = "claude-sonnet-5"
```

## LLM Class

```python theme={null}
from crewai import Agent, LLM

llm = LLM(
    model="claude-sonnet-5",
    base_url="https://api.tokenlab.sh/v1",
    api_key="sk-your-tokenlab-key",
)

agent = Agent(
    role="Research analyst",
    goal="Summarize technical tradeoffs clearly",
    backstory="You produce concise implementation notes.",
    llm=llm,
)
```

## Model Suggestions

Use `gpt-5.4-mini` for routine crews, `claude-sonnet-5` or `gpt-5.4` for planning-heavy agents, and `deepseek-v4-flash` for faster low-cost iterations.

## Endpoint Notes

CrewAI's OpenAI-compatible path is best for Chat Completions style agent calls. Use TokenLab native endpoints directly only when the tool or SDK you choose can speak those native protocols.
