clean-battery-30674
03/30/2026, 3:36 PMgentle-apple-32922
03/30/2026, 3:51 PMclean-battery-30674
03/30/2026, 4:18 PMclean-battery-30674
03/30/2026, 4:31 PMgentle-apple-32922
03/30/2026, 4:34 PMnutritious-balloon-65098
03/30/2026, 4:34 PMnutritious-balloon-65098
03/30/2026, 4:38 PMAnthropicException ... authentication_error ... invalid x-api-key
- I checked the OpenHands PR review docs and the current PR review plugin behavior.
- I did not make any code changes.
### Answer restated
The workflow is most likely failing because LLM_API_KEY is being used as a direct Anthropic API key, but you supplied an OpenHands key instead.
Your workflow’s default model is typically:
yaml
llm-model: anthropic/claude-sonnet-4-5-20250929
That means the action sends requests directly to Anthropic. So:
- if llm-model starts with anthropic/
- then LLM_API_KEY must be a valid Anthropic API key
An OpenHands key or OpenHands credits will not satisfy Anthropic auth, which matches the exact error:
- invalid x-api-key
### What I concluded
- [x] Identified the most likely root cause
- [x] Explained why OpenHands credits are probably not being used here
- [x] Offered concrete solutions
- [x] Kept the response focused on diagnosis, since you asked why it is failing
### Suggested fixes
- If staying on Anthropic: set LLM_API_KEY to a real Anthropic API key
- If using another provider: make sure llm-model, llm-base-url, and LLM_API_KEY all match that provider
- If you specifically want to use OpenHands credits: you likely need a different setup than this stock PR review action
### Extra note
A secondary thing to verify is whether the PR comes from a fork, since GitHub can withhold secrets from forked PR workflows. But based on the exact error, the stronger explanation is that a key is present but is the wrong kind of key.
No changes were made, so there is nothing to commit or push.gentle-apple-32922
03/30/2026, 5:50 PMOption 1: Keep Anthropic
If your workflow uses:
Copy codellm-model: anthropic/claude-sonnet-4-5-20250929
then set:
•= a real Anthropic API keyLLM_API_KEY
Not:
• OpenHands key
• GitHub token
• OpenRouter key
• any other provider key
Option 2: Use a different provider
If you want OpenAI, OpenRouter, etc., then the model, base URL, and API key must match.
Examples:
•→ OpenAI keyopenai/...
• OpenRouter model/base URL → OpenRouter key
• custom LiteLLM proxy → proxy base URL + proxy key
Option 3: Use OpenHands-backed credits
If your goal is specifically to use OpenHands credits, then this stock workflow is probably the wrong setup as-is. You’d want a workflow/integration that routes model execution through OpenHands, not directly to Anthropic.
One more thing to check
If the PR is from a fork, GitHub often does not expose repo secrets toworkflows. That can also break auth-related workflows.pull_request
That said, your error looks more like:
• a key is present
• but it’s the wrong key type
What is not the root cause
This warning is probably unrelated:
Saving conversation state without cipher ... secret(s) will be redacted...
That’s a warning about persistence/redaction, not the auth failure.
My recommendation
Most likely fix:
leave the workflow as Anthropic
• replacein GitHub Actions secrets with a valid Anthropic API keyLLM_API_KEY
If you paste your workflow here, I can tell you the exact line to change and whether you’re configured for:
• Anthropic direct
• OpenRouter
• or an OpenHands-based path
Relevant docs:
OpenHands PR review workflow: https://docs.openhands.dev/sdk/guides/github-workflows/pr-review
• PR review plugin README: https://github.com/OpenHands/extensions/tree/main/plugins/pr-review
gentle-apple-32922
03/30/2026, 5:51 PMelegant-branch-54423
03/30/2026, 6:04 PMllm-model field is set to openhands/claude-sonnet-4-5-20250929 (note the 'openhands/' prefix)
• the llm-base-url is: <https://llm-proxy.app.all-hands.dev>calm-artist-7206
03/30/2026, 6:16 PMthe^^ Please make sure of this. Joe, I think the second shouldn't be necessary, we rewrite to it under the hoodfield is set tollm-model(note the 'openhands/' prefix)openhands/claude-sonnet-4-5-20250929
elegant-branch-54423
03/30/2026, 6:21 PMclean-battery-30674
03/31/2026, 12:32 AMclean-battery-30674
03/31/2026, 12:32 AMllm-model: openhands/claude-sonnet-4-5-20250929
llm-base-url: <https://llm-proxy.app.all-hands.dev>clean-battery-30674
03/31/2026, 12:32 AM