Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
This repository was archived by the owner on May 29, 2026. It is now read-only.

explain_puzzles.ipynb - You didn't provide an API key #6

Description

@BenWare144

When I try to run explain_puzzles.ipynb, It is telling me I didn't provide an API key. But I the api key is already set in the os.environ["OPENAI_API_KEY"] from having added the API key to both ~/.zshrc and ~/.bash_profile as suggested here: https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
And I have tried removing the key from those files and manually setting it in the notebook as suggested, and the error persists.

Output:

puzzle_name='colors'
{'error': {'message': 'The model: `gpt-4` does not exist', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}

and this error:

HTTPStatusError: Client error '404 Not Found' for url 'https://api.openai.com/v1/chat/completions'
For more information check: https://httpstatuses.com/404

That url displays the following error:

"You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys."

I am getting this error whether I run the notebook with jupyter labs or jupyter notebook.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions