Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication Error on Windows when using Claude models despite correct API key #1499

Closed
umayado17 opened this issue Oct 24, 2024 · 3 comments

Comments

@umayado17
Copy link
Contributor

Describe the bug

When running Open Interpreter on Windows with Claude models, it consistently throws an authentication error regardless of whether the API key is correctly set. This occurs both in regular mode and OS mode.

What Happens

  • The interpreter initially starts and recognizes Claude:
    • In OS mode, it shows: "Model set to Claude 3.5 Sonnet (New), OS control enabled"
  • However, when trying to interact with it, it always returns:
    An error occurred: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}}
    

Reproduce

  1. Install Open Interpreter on Windows
  2. Set Anthropic API key using environment variable:
    setx ANTHROPIC_API_KEY your-api-key
    
    or directly in command:
    interpreter --api_key your-api-key
    
  3. Run either:
    interpreter
    
    or
    interpreter --os
    
  4. Try to interact with the interpreter

Expected behavior

The interpreter should properly authenticate with the Anthropic API when a valid API key is provided.

Screenshots

(.venv) PS C:\Users\hirao> interpreter --os
Welcome to Open Interpreter.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
▌ Model set to Claude 3.5 Sonnet (New), OS control enabled
We recommend using our desktop app for the best experience. Type d for early access.
Warning: This AI has full system access and can modify files, install software, and execute commands. By continuing, you
accept all risks and responsibility.
Move your mouse to any corner of the screen to exit. Reduce display resolution for better performance.

Excelを開いて
An error occurred: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}}
Traceback (most recent call last):
File "", line 198, in runmodule_as_main
File "", line 88, in runcode
File "C:\Users\hirao.venv\Scripts\interpreter.exe\main.py", line 4, in
File "C:\Users\hirao.venv\Lib\site-packages\interpreter\init.py", line 54, in
run_async_main()
File "C:\Users\hirao.venv\Lib\site-packages\interpreter\computer_use\loop.py", line 520, in run_async_main
asyncio.run(main())
File "C:\Users\hirao\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\hirao\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\hirao\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\hirao.venv\Lib\site-packages\interpreter\computer_use\loop.py", line 463, in main
user_input = input("> ")
^^^^^^^^^^^
EOFError

Open Interpreter version

0.4.1

Python version

3.11

Operating System name and version

Windows 11

Additional context

Additional Notes

  • Installation Method: pip
  • The error occurs consistently regardless of how the API key is provided (environment variable or command line argument)
  • The initial recognition of Claude suggests that the model selection is working, but the authentication mechanism fails during actual interaction
  • The same API key works correctly with other tools/applications that use Anthropic's API
@umayado17
Copy link
Contributor Author

To reproduce, you follow the instructions described in Issue 1497.

@sokarblue
Copy link

sokarblue commented Oct 25, 2024 via email

@umayado17
Copy link
Contributor Author

No such erros on 0.4.3.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants