Also, when running the example for remote runtime ...
# proj-agent
b
Also, when running the example for remote runtime API (https://github.com/OpenHands/software-agent-sdk/blob/main/examples/02_remote_agent_server/04_convo_with_api_sandboxed_server.py), I keep getting API-Key authentication errors (for the runtime API key). The same key worked for me a couple days back. Do we need a special runtime API key (other than what we had for OpenHands) to run agent-sdk? I have attached error logs in thread.
Copy code
[11/04/25 01:24:46] INFO     $ git rev-parse --verify HEAD (cwd=None)                                                  build.py:55
[11/04/25 01:24:46] INFO     $ git symbolic-ref -q --short HEAD (cwd=None)                                             build.py:55
[11/04/25 01:24:46] DEBUG    Error fetching model info from proxy: Extra data: line 1 column 5 (char 4)                 llm.py:774
[11/04/25 01:24:46] DEBUG    Setting max_output_tokens to 64000 for litellm_proxy/claude-sonnet-4-5-20250929            llm.py:804
[11/04/25 01:24:46] DEBUG    LLM ready: model=litellm_proxy/claude-sonnet-4-5-20250929                                  llm.py:369
                             base_url=https://llm-proxy.app.all-hands.dev/ reasoning_effort=None                                  
[11/04/25 01:24:46] DEBUG    Sending GET request to                                                               workspace.py:246
                             https://runtime.eval.all-hands.dev/sessions/agent-server-d15f3a8c-e1df-42cb-ae57-9e1                 
                             2ed49c8d5                                                                                            
[11/04/25 01:24:46] DEBUG    Client headers: {}                                                                   workspace.py:247
[11/04/25 01:24:46] DEBUG    Request headers: Headers({'host': 'runtime.eval.all-hands.dev', 'accept': '*/*',     workspace.py:252
                             'accept-encoding': 'gzip, deflate', 'connection': 'keep-alive', 'user-agent':                        
                             'python-httpx/0.28.1'})                                                                              
[11/04/25 01:24:46] INFO     API request failed: {'error': 'Unauthorized. Please provide a valid API key in the   workspace.py:255
                             X-API-Key header.'}                                                                                  
Traceback (most recent call last):
  File "/home/adityabs/software-agent-sdk/examples/02_remote_agent_server/04_convo_with_api_sandboxed_server.py", line 49, in <module>
    with APIRemoteWorkspace(
         ^^^^^^^^^^^^^^^^^^^
  File "/home/adityabs/software-agent-sdk/.venv/lib/python3.12/site-packages/pydantic/main.py", line 250, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/adityabs/software-agent-sdk/.venv/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py", line 146, in wrapped_model_post_init
    original_model_post_init(self, context)
  File "/home/adityabs/software-agent-sdk/openhands-workspace/openhands/workspace/remote_api/workspace.py", line 84, in model_post_init
    self._start_or_attach_to_runtime()
  File "/home/adityabs/software-agent-sdk/openhands-workspace/openhands/workspace/remote_api/workspace.py", line 92, in _start_or_attach_to_runtime
    if not self._check_existing_runtime():
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/adityabs/software-agent-sdk/openhands-workspace/openhands/workspace/remote_api/workspace.py", line 104, in _check_existing_runtime
    resp = self._send_api_request(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/adityabs/software-agent-sdk/openhands-workspace/openhands/workspace/remote_api/workspace.py", line 250, in _send_api_request
    response.raise_for_status()
  File "/home/adityabs/software-agent-sdk/.venv/lib/python3.12/site-packages/httpx/_models.py", line 829, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'https://runtime.eval.all-hands.dev/sessions/agent-server-d15f3a8c-e1df-42cb-ae57-9e12ed49c8d5'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401
/home/adityabs/software-agent-sdk/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/async_client_cleanup.py:66: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
[11/04/25 01:24:46] DEBUG    Using selector: EpollSelector                                                   selector_events.py:64
l
AFAIK @chilly-france-44439 is working on this now
c
The same key worked for me a couple days back.
this seems very weird to me though
are you sure you have enough credits in that API key? are you using neulab shared key?
b
I am using the shared key that Graham sir shared with me a couple months back (which I guess is being used a couple of CMU students). I think it has non-zero budget: https://runtime.all-hands.dev/key/1af3d713-4be9-4d63-bc0d-af8b2186ce13
c
hmm, i can repro it
lemme see if i can check the log
b
Just for reference, the budget has become zero now (perhaps someone was running experiments with it). But when I reported this error, the budget was non-zero, so the root cause is not the budget here.
c
i think i figured out the reason
there's a server related change in one of the parent class of APIRemoteWorkspace 😅
basically it regress the script so that no API Key header was ever sent to the remot eruntime
lolsob 1
b
So the python execution logs were actually right to point this out.
c
expect a PR comming soon lolsob
🙏 1
This should fix the issue with runtime API, but i'm still running into issue (maybe agent-server related, so may or maynot impact your task) https://github.com/OpenHands/software-agent-sdk/pull/1090
LMK if it works for you
b
Thanks for looking into this! Actually both the runtime API keys I have (given by you and Graham sir) have 0$ left right now, so not sure if I can reliably test it 😅