Description
Currently experiencing consistent authentication failures when trying to connect Agentic Browser to Claude API. The configuration appears correct but results in 401 errors.
Current Behavior
- API key is valid and works with direct API calls (verified via curl)
- Browser launches and navigates successfully
- Consistently receives "Failed to export batch code: 401, reason: unknown token" error
- Steel Dev CDP connection fails (falls back to local browser)
Expected Behavior
- Successful authentication with Claude API using valid API key
- No 401 errors when configured correctly
Steps to Reproduce
- Configure environment with valid API key:
AGENTIC_BROWSER_TEXT_MODEL="claude-3-5-sonnet-20241022"
AGENTIC_BROWSER_TEXT_API_KEY="sk-ant-***"
AGENTIC_BROWSER_TEXT_BASE_URL="https://api.anthropic.com"
- Launch Agentic Browser
- Observe 401 authentication error in logs
Environment
- Valid API key (verified working via curl)
- Latest Claude model string: claude-3-5-sonnet-20241022
- Correct base URL: https://api.anthropic.com
Logs
[2025-02-07 17:16:53,314] ERROR {__init__.py:172} - Failed to export batch code: 401, reason: unknown token
Verification Steps Taken
- Verified API key works directly with Anthropic API via curl
- Confirmed correct model string and base URL
- Tried both with and without "x-api-key:" prefix
- Browser successfully launches and navigates despite authentication failure
Questions
- Is there a specific format required for API key configuration beyond what's documented?
- Are there additional environment variables needed for authentication?
- Could there be a version mismatch between the authentication module and current Claude API requirements?
Suggested Next Steps
- Add detailed authentication debugging logs
- Document expected API key format and configuration
- Consider adding authentication verification step on startup
- Improve error messages to specify exact authentication failure reason
Additional Context
The API key works perfectly with direct API calls but fails specifically within Agentic Browser, suggesting a potential issue with how the authentication is being handled internally rather than an invalid key problem.
Description
Currently experiencing consistent authentication failures when trying to connect Agentic Browser to Claude API. The configuration appears correct but results in 401 errors.
Current Behavior
Expected Behavior
Steps to Reproduce
Environment
Logs
Verification Steps Taken
Questions
Suggested Next Steps
Additional Context
The API key works perfectly with direct API calls but fails specifically within Agentic Browser, suggesting a potential issue with how the authentication is being handled internally rather than an invalid key problem.