I'm trying to use the openhands cloud llm api key ...
# questions
q
I'm trying to use the openhands cloud llm api key - unable to do it at the moment seeing this error in đź§µ I'm using the following params and the api key I copied from my settings page
Copy code
model="litellm_proxy/anthropic/claude-sonnet-4-20250514",
base_url="https://llm-proxy.eval.all-hands.dev",
Copy code
13:22:38 - openhands:ERROR: agent_controller.py:365 - [Agent Controller 6328767d-fa9a-46-7badc0121a5e2b7] Error while running the agent (session ID: 6328767d-fa9a-46-7badc0121a5e2b7): litellm.AuthenticationError: AuthenticationError: Litellm_proxyException - Authentication Error, Invalid proxy server token passed. Received API Key = sk-...7ZNw, Key Hash (Token) =a45081dbb1171adb7b6468b88395ebf24abb9b40fbce4457e2506b1345a3ce55. Unable to find token in cache or `LiteLLM_VerificationTokenTable`. Traceback: Traceback (most recent call last):
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 736, in completion
    raise e
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 664, in completion
    ) = self.make_sync_openai_chat_completion_request(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/litellm_core_utils/logging_utils.py", line 237, in sync_wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 482, in make_sync_openai_chat_completion_request
    raise e
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 464, in make_sync_openai_chat_completion_request
    raw_response = openai_client.chat.completions.with_raw_response.create(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/openai/_legacy_response.py", line 364, in wrapped
    return cast(LegacyAPIResponse[R], func(*args, **kwargs))
                                      ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/openai/_utils/_utils.py", line 287, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/openai/resources/chat/completions/completions.py", line 1150, in create
    return self._post(
           ^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/openai/_base_client.py", line 1259, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/openai/_base_client.py", line 1047, in request
    raise self._make_status_error_from_response(err.response) from None
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Authentication Error, Invalid proxy server token passed. Received API Key = sk-...7ZNw, Key Hash (Token) =a45081dbb1171adb7b6468b88395ebf24abb9b40fbce4457e2506b1345a3ce55. Unable to find token in cache or `LiteLLM_VerificationTokenTable`', 'type': 'token_not_found_in_db', 'param': 'key', 'code': '401'}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/main.py", line 2039, in completion
    raise e
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/main.py", line 2012, in completion
    response = openai_chat_completions.completion(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 747, in completion
    raise OpenAIError(
litellm.llms.openai.common_utils.OpenAIError: Error code: 401 - {'error': {'message': 'Authentication Error, Invalid proxy server token passed. Received API Key = sk-...7ZNw, Key Hash (Token) =a45081dbb1171adb7b6468b88395ebf24abb9b40fbce4457e2506b1345a3ce55. Unable to find token in cache or `LiteLLM_VerificationTokenTable`', 'type': 'token_not_found_in_db', 'param': 'key', 'code': '401'}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/openhands/controller/agent_controller.py", line 363, in _step_with_exception_handling
    await self._step()
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/openhands/controller/agent_controller.py", line 870, in _step
    action = self.agent.step(self.state)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/openhands/agenthub/tom_codeact_agent/tom_codeact_agent.py", line 146, in step
    action = super().step(state)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/openhands/agenthub/codeact_agent/codeact_agent.py", line 215, in step
    response = self.llm.completion(**params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/tenacity/__init__.py", line 338, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/tenacity/__init__.py", line 477, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/tenacity/__init__.py", line 378, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/tenacity/__init__.py", line 400, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/tenacity/__init__.py", line 480, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/openhands/llm/llm.py", line 305, in wrapper
    resp: ModelResponse = self._completion_unwrapped(*args, **kwargs)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/utils.py", line 1342, in wrapper
    raise e
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/utils.py", line 1217, in wrapper
    result = original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/main.py", line 3586, in completion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2301, in exception_type
    raise e
  File "/Users/rohitmalhotra/.cache/uv/archive-v0/XOaVCkVl8KsdLXSJNUsrM/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 456, in exception_type
    raise AuthenticationError(
litellm.exceptions.AuthenticationError: litellm.AuthenticationError: AuthenticationError: Litellm_proxyException - Authentication Error, Invalid proxy server token passed. Received API Key = sk-...7ZNw, Key Hash (Token) =a45081dbb1171adb7b6468b88395ebf24abb9b40fbce4457e2506b1345a3ce55. Unable to find token in cache or `LiteLLM_VerificationTokenTable`

13:22:38 - openhands:ERROR: loop.py:24 - STATUS$ERROR_LLM_AUTHENTICATION
⚠️ Session was interrupted: error
c
Isn’t this key for
/openhands
provider (though I think we map it), or rather, proxy
app
🤷‍♂️ I didn’t think that key is for
eval
c
yeeah the key is for
openhands
provider so you should do
openhands/claude-sonnet-**