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

# CrewAI

> Integrate Nordlys with CrewAI for Nordlys model in multi-agent AI systems

## Get Your Nordlys API Key

[Sign up here](https://nordlyslabs.com/api-platform/orgs) to create an account and generate your API key.

## Quick Setup

### Installation

<CodeGroup>
  ```bash pip theme={null}
  pip install crewai crewai-tools
  ```

  ```bash uv theme={null}
  uv add crewai crewai-tools
  ```

  ```bash poetry theme={null}
  poetry add crewai crewai-tools
  ```
</CodeGroup>

### Basic Integration

```python theme={null}
from crewai import Agent, Task, Crew, AI model

# Configure Nordlys AI model
llm = AI model(
    model="",
    api_key="your-nordlys-api-key",
    base_url="https://api.nordlyslabs.com/v1"
)

# Create agents
researcher = Agent(
    role='Researcher',
    goal='Research and gather information',
    backstory='A thorough researcher with attention to detail',
    llm=llm
)

writer = Agent(
    role='Writer',
    goal='Create engaging content based on research',
    backstory='A creative writer who transforms data into stories',
    llm=llm
)

# Define tasks
research_task = Task(
    description='Research the latest trends in AI technology',
    agent=researcher,
    expected_output='A comprehensive report on AI trends'
)

writing_task = Task(
    description='Write an article based on the research findings',
    agent=writer,
    expected_output='A well-written article about AI trends'
)

# Create and run the crew
crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, writing_task],
    verbose=True
)

result = crew.kickoff()
print(result)
```

## Key Benefits

* **Nordlys model** - Automatic Nordlys model for each agent interaction
* **Cost optimization** - 30-70% cost reduction across agent executions
* **Tool support** - Nordlys selects function-calling capable models automatically
* **Multi-agent collaboration** - Optimized Nordlys model for each agent's specific needs

## Next Steps

<CardGroup cols={2}>
  <Card title="More Examples" href="/examples/basic-chat" icon="code">
    See complete working examples with multi-agent systems
  </Card>

  <Card title="API Reference" href="/api-reference/chat-completions" icon="book">
    Explore all available options and parameters
  </Card>
</CardGroup>
