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

# CrewAI

> Give a CrewAI agent Octen search APIs and Extract.

For AI agents: [docs.octen.ai/integrations/crewai.md](https://docs.octen.ai/integrations/crewai.md)

Each tool wraps a [Python SDK](https://docs.octen.ai/integrations/python-sdk.md) method.

> [card] [Get API Key](https://octen.ai/platform/api-keys)
>
> Create a key from the API Platform.

> [card] [Python SDK](https://docs.octen.ai/integrations/python-sdk.md)
>
> The `octen` package.

## Install

Requires Python 3.10 to 3.13.

```bash theme={null}
pip install crewai octen
```

## Quick Start

Set your Octen and OpenAI API keys:

```bash theme={null}
export OCTEN_API_KEY="your-api-key"
export OPENAI_API_KEY="your-openai-api-key"
```

Run an agent that answers with Octen Web Search:

```python theme={null}
from crewai import LLM, Agent
from crewai.tools import tool
from octen import Octen

octen = Octen()  # reads OCTEN_API_KEY


@tool
def web_search(query: str) -> list[dict]:
    """Search the live web and return ranked results with titles, URLs, and highlights."""
    return octen.search.search(query=query, count=5).results


agent = Agent(
    role="Web researcher",
    goal="Answer with current information from the web and cite the URLs you used.",
    backstory="You search the web before you answer.",
    llm=LLM(model="openai/gpt-5.4"),
    tools=[web_search],
)
result = agent.kickoff("What is the latest stable release of Python?")
print(result.raw)
```

## Add an Extract Tool

Let the agent read full pages from the URLs it finds, with [Extract](https://docs.octen.ai/capabilities/extract.md). Replace everything from `agent = Agent(` to the end of the Quick Start program with this code:

```python theme={null}
@tool
def extract(urls: list[str]) -> list[dict]:
    """Read up to 20 web pages and return their content as Markdown."""
    return octen.extract.extract(urls=urls).results


agent = Agent(
    role="Web researcher",
    goal="Answer with current information from the web and cite the URLs you used.",
    backstory="You search the web before you answer.",
    llm=LLM(model="openai/gpt-5.4"),
    tools=[web_search, extract],
)
result = agent.kickoff("What are the three biggest changes in Python 3.15? Read the official What's New page before you answer.")
print(result.raw)
```

## Add More Search Tools

Let the agent also use [Web Search Premier](https://docs.octen.ai/capabilities/web-search-premier.md), [Broad Search](https://docs.octen.ai/capabilities/broad-search.md), [News Search](https://docs.octen.ai/capabilities/news-search.md), [Business Search](https://docs.octen.ai/capabilities/business-search.md), [Pulse Search](https://docs.octen.ai/capabilities/pulse-search.md), [Place Search](https://docs.octen.ai/capabilities/place-search.md), [Image Search](https://docs.octen.ai/capabilities/image-search.md), and [Design Search](https://docs.octen.ai/capabilities/design-search.md).

Replace everything from `agent = Agent(` to the end of the program from [Add an Extract Tool](#add-an-extract-tool) with this code. Each tool returns the response `data`, with the same fields as the API reference:

```python theme={null}
@tool
def web_search_premier(query: str) -> dict:
    """Search the web more broadly and rank more carefully than web_search, for a specific fact, a niche document, or a named page, and return ranked pages with query-relevant highlights."""
    return octen.search.search_premier(query=query).data


@tool
def broad_search(query: str) -> dict:
    """Split a broad or comparative question into sub-queries, search them all, and return results grouped per sub-query."""
    return octen.search.broad_search(query=query).data


@tool
def news_search(query: str) -> dict:
    """Search recent news and return ranked articles plus storylines that group related coverage."""
    return octen.search.news_search(query=query).data


@tool
def business_search(query: str) -> dict:
    """Look up companies and people and return their profile cards plus ranked sources."""
    return octen.search.business_search(query=query).data


@tool
def pulse_search(query: str) -> dict:
    """Predict the URLs a query points to, such as official sites, docs, or help pages, and return their titles and URLs."""
    return octen.search.pulse_search(query=query).data


@tool
def place_search(query: str) -> dict:
    """Find places such as restaurants, shops, or hotels and return place cards with address, opening hours, and rating. Include the city or area in the query."""
    return octen.place_search.search(query=query).data


@tool
def image_search(query: str) -> dict:
    """Search the web for images and return image URLs with their source pages."""
    return octen.image_search.search(query=query).data


@tool
def design_search(query: str) -> dict:
    """Search real web pages, app screens, and slides for design references and return them as images with their design values, such as colors and fonts, plus web results."""
    return octen.design_search.search(query=query).data


agent = Agent(
    role="Web researcher",
    goal="Answer with current information from the web and cite the URLs you used.",
    backstory="You search the web before you answer.",
    llm=LLM(model="openai/gpt-5.4"),
    tools=[web_search, extract, web_search_premier, broad_search, news_search, business_search, pulse_search, place_search, image_search, design_search],
)
result = agent.kickoff("Compare Stripe and Adyen, including their latest news.")
print(result.raw)
```

## Use Auto Search

Skip the tool loop and let Octen run the searches server-side with [Auto Search](https://docs.octen.ai/capabilities/auto-search.md). Point the model at the Octen base URL and enable the built-in `octen_search` tool. Your Octen API key is the only key you need:

```python theme={null}
import os

from crewai import LLM, Agent

llm = LLM(
    model="openai/openai/gpt-5.4",
    base_url="https://api.octen.ai/v1",
    api_key=os.environ["OCTEN_API_KEY"],
    extra_body={"tools": [{"type": "octen_search"}]},
)
agent = Agent(
    role="Research assistant",
    goal="Answer questions with current information from the web",
    backstory="You research topics on the web and cite your sources.",
    llm=llm,
)
result = agent.kickoff("What happened in AI this week?")
print(result.raw)
```

The model name starts with `openai/openai/` because CrewAI removes the first `openai/` before sending the request.

***

Last modified on November 24, 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.