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

# OpenHands

> Run the OpenHands CLI and agent server on the AI Reserve gateway with three LLM_* environment variables.

<Card title="Create your API key →" icon="key" href="https://portal.aireserve.com/profile#api-keys" horizontal>
  Mint an `aireserve_api_…` key in the portal — every OpenHands agent step is
  then metered and billed through your organization.
</Card>

OpenHands routes all model traffic through LiteLLM, so the gateway plugs in
with the standard three variables
([OpenHands custom-endpoint docs](https://docs.openhands.dev/openhands/usage/llms/local-llms)).
The `openai/` prefix on the model id means "OpenAI-compatible endpoint" — it
routes Claude models too:

```bash theme={"dark"}
export LLM_MODEL="openai/gpt-5.4-mini"              # or openai/claude-sonnet-4-6
export LLM_BASE_URL="https://api.aireserve.com/v1"  # /v1 suffix
export LLM_API_KEY="$AIRESERVE_API_KEY"             # your aireserve_api_… key
```

Install the CLI and run a task headlessly (`uv tool install openhands`, or
`pipx install openhands`):

```bash theme={"dark"}
openhands --headless --override-with-envs -t "write a hello-world script"
```

<Note>
  **`--override-with-envs` is required.** Without it the CLI ignores the
  `LLM_*` variables in favor of `~/.openhands/` settings — and on a fresh
  install it waits for the interactive first-run wizard instead. Interactive
  sessions (`openhands` with no flags) can also set the same three values in
  the settings UI: Custom Model, Base URL, API Key.
</Note>

The Docker GUI takes the same three variables as `-e LLM_MODEL=…`,
`-e LLM_BASE_URL=…`, `-e LLM_API_KEY=…` on `docker run`.

## Verify

Run the headless one-liner above from an empty directory. The agent completes
the task and exits, and each LLM step appears on your
[usage page](https://portal.aireserve.com/profile) — one request per agent
turn, all metered against your key.
