Skip to content

Credentials rejected after adding ChatGPT Plus account via openscience keys add #972

Closed

Description

@JichenDai

Question

Hello,
I added my ChatGPT Plus account using:
openscience keys add
However, when I try to call the related models, the request fails with the following error:
Credentials rejected
OpenAI rejected the request's credentials
(Incorrect API key provided: ''.
You can find your API key at
https://platform.openai.com/account/api-keys)

Update the key under Settings → Models → Provider API keys,
or choose another model.

HTTP 401
It appears that the configured credentials are not being detected, and an empty API key ('') is being sent.
Could you please clarify whether ChatGPT Plus account credentials are supported for these models, or whether an OpenAI API key is required? If ChatGPT Plus accounts are supported, please advise how to correctly configure them.
Environment:

  • openscience version: 2.0.151
  • Operating system: Ubuntu
Image Image

Activity

  1. added
    question
    on Oct 9, 2026
  2. JichenDai commented on Oct 9, 2026

    @JichenDai
    Author

    Additional information:

    • Codex works normally in the same environment with the same account/setup.
    • Openscience was also working normally in this environment until one day ago.
    • No intentional changes were made to the environment or credentials before the issue occurred.
  3. JichenDai commented on Oct 9, 2026

    @JichenDai
    Author

    I finally identified the issue: it was caused by the OpenAI model returning the error "Selected model is at capacity. Please try a different model."

  4. JichenDai commented on Oct 18, 2026

    @JichenDai
    Author

    This issue is caused by a conflict between adding the OpenAI API platform and the ChatGPT Plus account. I used the API to call the model before, but after the API expired, I switched to using the ChatGPT Plus subscription to call the model. However, the API wasn’t deprecated in OpenScience, so when OpenScience calls the model, it prioritizes using the API, which caused the problem. After I removed the OpenAI API from the files, everything went back to normal. Is it possible to prioritize using the subscription when calling OpenAI-related models, or at least have it as an option?

  5. aayambansal commented on Oct 18, 2026

    @aayambansal
    Member

    Thanks for tracking this down. #999 is now squash merged, with a regression that keeps an expired OpenAI API credential saved while selecting the ChatGPT route, then verifies the request uses the ChatGPT OAuth credential and endpoint.

    You can keep both connections: explicitly choose ChatGPT as the model's source in the picker. From the CLI, use an account-supported model under openai-codex/ (for example openscience run -m openai-codex/gpt-6.1-sol); openscience models --flat lists available routes. Automatic selection prefers ChatGPT for a new selection, but an already-saved exact API route stays selected until you change it. That preserves an explicit provider choice and avoids silently switching billing sources. There is no need to delete credential files.

    The provider tests and CI passed, and the connection guide now explains this distinction. Closing with that supported option documented and verified; please reopen if an explicitly selected ChatGPT route still dispatches to the API endpoint. Availability/capacity errors from the selected service can still occur independently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions