> 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-coding-assistants/openhands.md).

# OpenHands

Use TensorX models with [OpenHands](https://docs.openhands.dev/), the open-source AI software developer.

## Prerequisites

OpenHands runs as a Docker container. Ensure you have Docker installed and running.

## Quick Start

1. Pull and run OpenHands:

```bash
docker pull docker.openhands.dev/openhands/runtime:1.0-nikolaik
docker run -it --rm --pull=always \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.openhands.dev/openhands/runtime:1.0-nikolaik \
    -e LOG_ALL_EVENTS=true \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v ~/.openhands:/.openhands \
    -p 3000:3000 \
    --add-host host.docker.internal:host-gateway \
    --name openhands-app \
    docker.openhands.dev/openhands/openhands:1.0
```

2. Open `http://localhost:3000` in your browser

## Configuration

1. When prompted, click **"see advanced settings"** to open the LLM Settings page
2. Enable the **Advanced** toggle at the top
3. Configure the following:

| Setting      | Value                       |
| ------------ | --------------------------- |
| Custom Model | `openai/<MODEL_ID>`         |
| Base URL     | `https://api.tensorx.ai/v1` |
| API Key      | Your TensorX API key        |

4. Click **Save Settings**

{% hint style="info" %}
**Note:** The Custom Model format is `openai/<model-id>`. The `openai/` prefix tells OpenHands to use the OpenAI-compatible API format.
{% 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.

***

## Tips

* **Model selection**: Query `GET /v1/model/info` and check the capabilities required by the workflow
* **Context size**: Check the selected model's context metadata before setting a client-side value
* **Usage**: OpenHands can issue many prompts; monitor usage in the TensorX dashboard

## Troubleshooting

| Issue                 | Solution                                        |
| --------------------- | ----------------------------------------------- |
| Empty responses       | Check model ID is correct with `openai/` prefix |
| Connection errors     | Verify Base URL is `https://api.tensorx.ai/v1`  |
| Authentication errors | Verify your API key is correct                  |

## Resources

* [OpenHands Documentation](https://docs.openhands.dev/)
* [OpenHands LLM Configuration](https://docs.openhands.dev/openhands/usage/llms/llms)
* [TensorX API Reference](/api-reference/overview.md)


---

# 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-coding-assistants/openhands.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.
