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

Uncaught AuthenticationError in utils.py line 8062 #2071

Open
unmalnickname opened this issue Oct 16, 2024 · 0 comments
Open

Uncaught AuthenticationError in utils.py line 8062 #2071

unmalnickname opened this issue Oct 16, 2024 · 0 comments

Comments

@unmalnickname
Copy link

Aider version: 0.59.1
Python version: 3.12.7
Platform: macOS-14.7-arm64-arm-64bit
Python implementation: CPython
Virtual environment: Yes
OS: Darwin 23.6.0 (64bit)
Git version: git version 2.47.0

An uncaught exception occurred:

Traceback (most recent call last):
  File "openai.py", line 907, in completion
    raise e
  File "openai.py", line 825, in completion
    self.make_sync_openai_chat_completion_request(
  File "openai.py", line 683, in make_sync_openai_chat_completion_request
    raise e
  File "openai.py", line 672, in make_sync_openai_chat_completion_request
    raw_response = openai_client.chat.completions.with_raw_response.create(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "_legacy_response.py", line 353, in wrapped
    return cast(LegacyAPIResponse[R], func(*args, **kwargs))
                                      ^^^^^^^^^^^^^^^^^^^^^
  File "_utils.py", line 274, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "completions.py", line 704, in create
    return self._post(
           ^^^^^^^^^^^
  File "_base_client.py", line 1268, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "_base_client.py", line 945, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "_base_client.py", line 1049, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'API key credit limit reached. You can change it on https://openrouter.ai/keys', 'code': 401}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 1999, in completion
    response = openai_chat_completions.completion(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "openai.py", line 914, in completion
    raise OpenAIError(
litellm.llms.OpenAI.openai.OpenAIError: Error code: 401 - {'error': {'message': 'API key credit limit reached. You can change it on https://openrouter.ai/keys', 'code': 401}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 757, in main
    coder.run()
  File "base_coder.py", line 730, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 773, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1212, in send_message
    saved_message = self.auto_commit(edited)
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1895, in auto_commit
    res = self.repo.commit(fnames=edited, context=context, aider_edits=True)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repo.py", line 110, in commit
    commit_message = self.get_commit_message(diffs, context)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repo.py", line 195, in get_commit_message
    commit_message = simple_send_with_retries(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "sendchat.py", line 44, in wrapper
    return decorated_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "sendchat.py", line 102, in simple_send_with_retries
    _hash, response = send_completion(**kwargs)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "sendchat.py", line 83, in send_completion
    res = litellm.completion(**kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "utils.py", line 1086, in wrapper
    raise e
  File "utils.py", line 974, in wrapper
    result = original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "main.py", line 2847, in completion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "utils.py", line 8194, in exception_type
    raise e
  File "utils.py", line 8062, in exception_type
    raise AuthenticationError(
litellm.exceptions.AuthenticationError: litellm.AuthenticationError: AuthenticationError: OpenrouterException - Error code: 401 - {'error': {'message': 'API key credit limit reached. You can change it on https://openrouter.ai/keys', 'code': 401}}

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

1 participant