For setting up the OpenHands Software Agent SDK lo...
# general
l
For setting up the OpenHands Software Agent SDK locally, which API key should I use?
if I create a key from OpenHands Cloud >API Keys >Create Key and use it
Copy code
export LLM_API_KEY="your-api-key"
c
You need an LLM key, you can use from Cloud yes, or any key from the LLM you'd like to use
l
I think I need to set up the LLM, but what should I add in the API key?
c
Ah, wait. • to run the SDK locally, you do not have to fill in that page at all • you can get an API key from the Api Keys page ( https://app.all-hands.dev/settings/api-keys ) and that's it, you're done with the cloud for now • then use it with the SDK locally
You may want to use the SDK programmatically (there are examples/ in its repository), or via CLI application: https://github.com/OpenHands/OpenHands-CLI
l
@calm-artist-7206 Thanks for your helpful answer and quick reply. Is my understanding correct? I'm getting the same error — is it because it's expecting an Anthropic API key, but I'm using the OpenHands Cloud key
c
You can use OH Cloud key, and access Anthropic. Do I understand correctly the
echo
, you didn’t have LLM_API_KEY set? The OH cloud key should be the value of LLM_API_KEY
Wait, did you take a key from this? This is for LLM, so this is what you need
Not the other
l
The LLM is set, and it's the same as the OH Cloud key.
c
LLM_API_KEY=this_llm_key should be in env
Which one, sorry I insist
In that page, there are 2 possible keys you could make
“LLM key” and “API key”, this one should be from LLM key section, could you please confirm that?
And then, in the script you are running, please set “openhands/claude-sonnet…” - maybe this is the problem?
l
this one from the api key section
c
In the API keys page, there are 2 sections though
That page, yes, but it’s split in 2 : one for LLM keys, and one for API keys
(I realize that page is confusing… I’m sorry)
l
Both give me the same error. I previously tried the OH API keys
c
Should be OH LLM key, not “pure API”
OK, could you please use “openhands/“ prefix on the model name, so “openhands/claude-…”
l
Huge thanks, @calm-artist-7206 — now it works. I’m not sure how the SDK works. I followed the documentation, and they suggested running the command:
uv run python examples/01_standalone_sdk/01_hello_world.py
I think in the example the provider is set to Claude.
c
(Just to note, you can always use it with Anthropic account too, you just have to set the right provider then, “anthropic/“ prefix. It just means “openhands/“ prefix uses the models via OH Cloud. I think for anthropic models in particular, OH Cloud has much better rate limits than regular accounts that access Claude directly from Anthropic itself, so it’s kinda cool)
❤️ 1
w
Anything in particular you're trying to do with the SDK?