1

I had codex originally authenticate via openAI web. Since i hit my limit i would now want to upgrade to the "pay per use" via api key. After following all the steps on https://github.com/openai/codex/blob/main/docs/authentication.md#usage-based-billing-alternative-use-an-openai-api-key (set variable in global environment, retrigger authentication

codex --config preferred_auth_method="apikey"

I'm sent to the initial login screen. I select "Provide your own API Key" and see: Login Failed -> as far as i understand this means it does not read my api key correctly. When "enter" i get thrown back to the login screen.

When:

echo $OPENAI_API_KEY

my key, that i have previously set, and charged up with a few bucks, is red successfully and I am also forcing.

# ~/.codex/config.toml
preferred_auth_method = "apikey" 

Expecting to log in via APIKey

1 Answer 1

0

This solution works for me:

codex login --api-key <your_api_key>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.