From dc706089b4ff1b6a22b69abb81c6e3b455579f18 Mon Sep 17 00:00:00 2001 From: Alona King Date: Fri, 12 Dec 2025 19:16:19 -0500 Subject: [PATCH 1/2] Add documentation for using OpenHands LLM provider with the SDK - Document how to use OpenHands API key with the SDK - Show environment variable configuration (LLM_API_KEY, LLM_MODEL) - Explain that openhands/ prefix auto-configures the base URL - Include Python code examples - List available models with openhands/ prefix - Add network requirements note for firewall restrictions --- openhands/usage/llms/openhands-llms.mdx | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/openhands/usage/llms/openhands-llms.mdx b/openhands/usage/llms/openhands-llms.mdx index 03f98704..8c87b692 100644 --- a/openhands/usage/llms/openhands-llms.mdx +++ b/openhands/usage/llms/openhands-llms.mdx @@ -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 +## 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. + + +If your network has firewall restrictions, ensure the `all-hands.dev` domain is allowed. The SDK connects to `llm-proxy.app.all-hands.dev`. + + ## Pricing Pricing follows official API provider rates. Below are the current pricing details for OpenHands models: From 64ac00dd69e74ba5c8cd791be5c14a0252f798e9 Mon Sep 17 00:00:00 2001 From: Alona King Date: Fri, 12 Dec 2025 19:23:03 -0500 Subject: [PATCH 2/2] Fix gemini-3-pro-preview cached input cost to match LiteLLM DB --- openhands/usage/llms/openhands-llms.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openhands/usage/llms/openhands-llms.mdx b/openhands/usage/llms/openhands-llms.mdx index 8c87b692..3c1cf984 100644 --- a/openhands/usage/llms/openhands-llms.mdx +++ b/openhands/usage/llms/openhands-llms.mdx @@ -95,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 |