> For the complete documentation index, see [llms.txt](https://docs.tensorx.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tensorx.ai/ai-agents-and-chatbots/agent-zero.md).

# Agent Zero

Configure Agent Zero to use TensorX models.

***

## Overview

[Agent Zero](https://agent-zero.ai) is an open-source agent framework. It uses LiteLLM for model providers and can connect to TensorX as a custom provider.

***

## Prerequisites

* **Python** 3.10+ and **Node.js** 22+
* **Docker** (recommended for sandboxed execution)
* A TensorX API key ([sign up here](https://app.tensorx.ai/register))

***

## Installation

```bash
git clone https://github.com/agent0ai/agent-zero.git
cd agent-zero
pip install -r requirements.txt
```

***

## Configuration

### Option 1: Web UI Setup

1. Start Agent Zero:

   ```bash
   python run_ui.py
   ```
2. Open `http://localhost:50001` in your browser
3. Go to **Settings** and configure:

| Setting                 | Value                              |
| ----------------------- | ---------------------------------- |
| **Chat Model Provider** | `Other OpenAI compatible`          |
| **Chat Model Name**     | An ID returned by `GET /v1/models` |
| **Chat Model API Key**  | Your TensorX API key               |
| **Chat Model API Base** | `https://api.tensorx.ai/v1`        |

4. Set the **Utility Model** to a TensorX model ID as well

### Option 2: Environment Variables

Create a `.env` file in the Agent Zero root directory:

```bash
# Chat model (main agent)
CHAT_MODEL_PROVIDER=other
CHAT_MODEL_NAME=<MODEL_ID>
API_KEY_OTHER=your-tensorx-api-key-here
CHAT_MODEL_API_BASE=https://api.tensorx.ai/v1

# Utility model (background tasks)
UTILITY_MODEL_PROVIDER=other
UTILITY_MODEL_NAME=<MODEL_ID>
UTILITY_MODEL_API_BASE=https://api.tensorx.ai/v1
```

{% hint style="warning" %}
Replace `your-tensorx-api-key-here` with your actual TensorX API key from [app.tensorx.ai](https://app.tensorx.ai/dashboard).
{% endhint %}

***

## Model selection

Call `GET /v1/models` with your TensorX API key and use one of the returned IDs. If the integration depends on a capability or token limit, query `GET /v1/model/info` before selecting the model. See [Models](/api-reference/models.md) for examples.

***

## Usage

Start the web UI and interact with your agent:

```bash
python run_ui.py
```

Agent Zero will autonomously:

* Break down complex tasks into steps
* Create and execute tools
* Search the web for information
* Write and run code
* Self-correct when errors occur

***

## Troubleshooting

### Agent Not Responding

1. Check your API key and base URL in Settings
2. Verify your TensorX credit balance at [app.tensorx.ai](https://app.tensorx.ai/dashboard)
3. Check the terminal logs for error messages

### Tool Execution Errors

Ensure Docker is running if you're using sandboxed execution mode.

***

## See Also

* [Agent Zero Documentation](https://agent-zero.ai/p/docs/get-started/)
* [Agent Zero GitHub](https://github.com/agent0ai/agent-zero)
* [TensorX Models](https://tensorx.ai/models)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tensorx.ai/ai-agents-and-chatbots/agent-zero.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
