For the complete documentation index, see llms.txt. This page is also available as Markdown.

CrewAI

CrewAI is a framework for orchestrating role-playing AI agents. Connect it to TensorX using the OpenAI-compatible configuration.

Prerequisites

  • Python 3.10+

  • CrewAI installed

  • TensorX API key from app.tensorx.ai

Installation

pip install crewai
# or with OpenAI support
pip install "crewai[openai]"

Configuration

Environment Variables

Set environment variables in your .env file:

OPENAI_API_KEY=your-tensorx-api-key
OPENAI_BASE_URL=https://api.tensorx.ai/v1
MODEL=openai/claude-sonnet-4-20250514

Direct Code Configuration

Basic Usage

Creating Agents

Creating Tasks

Running a Crew

YAML Configuration

For larger projects, use YAML configuration:

agents.yaml

tasks.yaml

Advanced Configuration

Custom Parameters

Multiple Models per Crew

Available Models

See TensorX Models for all available models.

Model
Best For

openai/claude-sonnet-4-20250514

Complex reasoning, agents

openai/claude-3-5-sonnet-20241022

General tasks

openai/gpt-4o

Multi-modal, tool use

openai/gpt-4o-mini

Fast, cost-effective

Note: Prefix model names with openai/ when using with CrewAI.

Troubleshooting

Connection errors

Ensure environment variables are set:

Model not found

Use the openai/ prefix for model names:

Timeout issues

Increase timeout for complex tasks:

Resources

Last updated

Was this helpful?