Skip to content

codex doesn't recognize OPENAI_API_KEY after setting it #30

Closed

Description

@fschlz

My API key is available in the environment after running source .env, but I'm still getting

Missing OpenAI API key.

Set the environment variable OPENAI_API_KEY and re-run this command.
You can create a key here: https://platform.openai.com/account/api-keys

Does it need to be a special one, or is any OpenAI API Key accepted? (i.e. keys that are assigned to a project vs. default vs. personal)

Activity

  1. wirewalker commented on Apr 16, 2025

    @wirewalker

    i used
    export OPENAI_API_KEY="YOUR KEY"
    codex

  2. fschlz commented on Apr 16, 2025

    @fschlz
    Author

    after generating a new key, and running the export command directly in the terminal it seems to work

  3. added a commit that references this issue on Sep 3, 2025
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