Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion openhands/usage/llms/openhands-llms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,49 @@ When running OpenHands, you'll need to set the following in the OpenHands UI thr
When you use OpenHands as an LLM provider in the CLI, we may collect minimal usage metadata and send it to All Hands AI. For details, see our Privacy Policy: https://openhands.dev/privacy
</Note>

## Using OpenHands LLM Provider with the SDK

You can use your OpenHands API key with the [OpenHands SDK](https://docs.openhands.dev/sdk) to build custom agents and automation pipelines.

### Configuration

The SDK automatically configures the correct API endpoint when you use the `openhands/` model prefix. Simply set two environment variables:

```bash
export LLM_API_KEY="your-openhands-api-key"
export LLM_MODEL="openhands/claude-sonnet-4-20250514"
```

### Example

```python
from openhands.sdk import LLM

# The openhands/ prefix auto-configures the base URL
llm = LLM.load_from_env()

# Or configure directly
llm = LLM(
model="openhands/claude-sonnet-4-20250514",
api_key="your-openhands-api-key",
)
```

The `openhands/` prefix tells the SDK to automatically route requests to the OpenHands LLM proxy—no need to manually set a base URL.

### Available Models

When using the SDK, prefix any model from the pricing table below with `openhands/`:
- `openhands/claude-sonnet-4-20250514`
- `openhands/claude-sonnet-4-5-20250929`
- `openhands/claude-opus-4-20250514`
- `openhands/gpt-5-2025-08-07`
- etc.

<Note>
If your network has firewall restrictions, ensure the `all-hands.dev` domain is allowed. The SDK connects to `llm-proxy.app.all-hands.dev`.
</Note>

## Pricing

Pricing follows official API provider rates. Below are the current pricing details for OpenHands models:
Expand All @@ -52,7 +95,7 @@ Pricing follows official API provider rates. Below are the current pricing detai
| devstral-small-2507 | $0.10 | N/A | $0.30 | 128,000 | 128,000 |
| o3 | $2.00 | $0.50 | $8.00 | 200,000 | 100,000 |
| o4-mini | $1.10 | $0.275 | $4.40 | 200,000 | 100,000 |
| gemini-3-pro-preview | $2.00 | $0.125 | $12.00 | 1,048,576 | 65,535 |
| gemini-3-pro-preview | $2.00 | $0.20 | $12.00 | 1,048,576 | 65,535 |
| kimi-k2-0711-preview | $0.60 | $0.15 | $2.50 | 131,072 | 131,072 |
| qwen3-coder-480b | $0.40 | N/A | $1.60 | N/A | N/A |

Expand Down