OpenHands
OpenHands calls models through LiteLLM, so OpenCheap is an openai/ model with a base URL.
What you need
In the app
- 1Open Settings, then the LLM tab, and turn on Advanced.
- 2Set Custom Model.Type
openai/claude-sonnet-5. Theopenai/is LiteLLM's prefix for an OpenAI-compatible endpoint; the id after it is the OpenCheap model. - 3Set Base URL.
https://api.opencheap.si/v1 - 4Paste your key into API Key.Or create a Provider Connection with the key and base URL once, and pick it in the profile's Provider Connection field.
- 5Save, start a new conversation and send a short message.
With the Agent SDK
import os
from pydantic import SecretStr
from openhands.sdk import LLM, Message, TextContent
llm = LLM(
model="openai/claude-sonnet-5",
base_url="https://api.opencheap.si/v1",
api_key=SecretStr(os.environ["OPENCHEAP_API_KEY"]),
usage_id="opencheap",
)
resp = llm.completion(messages=[Message(role="user", content=[TextContent(text="Say hello in five words.")])])
print(resp.message.content[0].text)Install it with pip install openhands-sdk. The same LLM goes into an Agent as usual. To configure it from the environment instead, set LLM_MODEL, LLM_BASE_URL and LLM_API_KEY and call LLM.load_from_env().
The SDK may print "Cost calculation failed: This model isn't mapped yet". It is LiteLLM not knowing the model's price; the call is not affected, and your usage and spend are in the console.
What was checked
Run on October 28, 2026 with openhands-sdk 1.58.2 on claude-sonnet-5: llm.completion as above, and again configured only through LLM_MODEL, LLM_BASE_URL and LLM_API_KEY. The app steps and the Custom Model, Base URL and API Key labels are from the current OpenHands settings source and documentation; the app itself was not run.