> ## 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.

# LlamaIndex

> Give a LlamaIndex agent Octen search APIs and Extract.

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

The `OctenToolSpec` in `llama-index-tools-octen` provides the ready-made tools listed in [Tools](#tools).

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

> [card] [PyPI](https://pypi.org/project/llama-index-tools-octen/)
>
> The `llama-index-tools-octen` package.

> [card] [GitHub](https://github.com/Octen-Team/llama-index-tools-octen)
>
> View the source and changelog.

## Install

Requires Python 3.11+.

```bash theme={null}
pip install llama-index-tools-octen llama-index-llms-openai
```

## 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}
import asyncio

from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.octen import OctenToolSpec

agent = FunctionAgent(
    tools=OctenToolSpec().to_tool_list(spec_functions=["search"]),
    llm=OpenAI(model="gpt-5.4"),
    system_prompt="Answer with current information from the web and cite the URLs you used.",
)


async def main():
    response = await agent.run("What is the latest stable release of Python?")
    print(response)


asyncio.run(main())
```

## Tools

`to_tool_list()` returns all 13 tools below. Pass `spec_functions` to choose some of them, as in the Quick Start.

| Tool | Octen API | Returns |
| - | - | - |
| `search` | [Web Search](https://docs.octen.ai/api-reference/search.md) | Ranked pages with title, URL, and relevant `highlight` |
| `search_and_retrieve_documents` | [Web Search](https://docs.octen.ai/api-reference/search.md) | Each page's `full_content` as a LlamaIndex `Document` |
| `search_and_retrieve_highlights` | [Web Search](https://docs.octen.ai/api-reference/search.md) | Each page's `highlight` as a LlamaIndex `Document` |
| `broad_search` | [Broad Search](https://docs.octen.ai/api-reference/broad-search.md) | Ranked results grouped per generated sub-query |
| `news_search` | [News Search](https://docs.octen.ai/api-reference/news-search.md) | Ranked articles plus storylines in `subjects` |
| `business_search` | [Business Search](https://docs.octen.ai/api-reference/business-search.md) | Company and person cards plus ranked sources |
| `pulse_search` | [Pulse Search](https://docs.octen.ai/api-reference/pulse-search.md) | Predicted titles and URLs, plus page content with `pulse_search_options={"mode": "standard"}` (default `lite`) |
| `place_search` | [Place Search](https://docs.octen.ai/api-reference/place-search.md) | Place cards with address, coordinates, phone, opening hours, and rating |
| `search_premier` | [Web Search Premier](https://docs.octen.ai/api-reference/search-premier.md) | Ranked pages with relevant `highlight`, from deeper retrieval and reranking |
| `image_search` | [Image Search](https://docs.octen.ai/api-reference/image-search.md) | Ranked images with source page, dimensions, and thumbnail |
| `design_search` | [Design Search](https://docs.octen.ai/api-reference/design-search.md) | Design screenshots with their design values, plus ranked web results |
| `extract` | [Extract](https://docs.octen.ai/api-reference/extract.md) | Clean content of each URL, or relevant `highlights` when the model passes a `query` |
| `current_date` | None (runs locally) | Today's date, for building date filters |

## 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.

Install the LLM class for OpenAI-compatible APIs:

```bash theme={null}
pip install llama-index-llms-openai-like
```

Run the model:

```python theme={null}
import os

from llama_index.core.llms import ChatMessage
from llama_index.llms.openai_like import OpenAILike

llm = OpenAILike(
    model="openai/gpt-5.4",
    api_base="https://api.octen.ai/v1",
    api_key=os.environ["OCTEN_API_KEY"],
    is_chat_model=True,
    additional_kwargs={"extra_body": {"tools": [{"type": "octen_search"}]}},
)
print(llm.chat([ChatMessage(role="user", content="What happened in AI this week?")]).message.content)
```

***

Last modified on November 24, 2026


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