fix: replace --api-key with --with-api-key in codex login

This commit is contained in:
Michael Bolin
2025-10-02 22:59:11 -07:00
parent 231c36f8d3
commit a1008bcddf
3 changed files with 59 additions and 3 deletions
+9 -1
View File
@@ -5,9 +5,17 @@
If you prefer to pay-as-you-go, you can still authenticate with your OpenAI API key:
```shell
codex login --api-key "your-api-key-here"
printenv OPENAI_API_KEY | codex login --with-api-key
```
Alternatively, read from a file:
```shell
codex login --with-api-key < my_key.txt
```
The legacy `--api-key` flag now exits with an error instructing you to use `--with-api-key` so that the key never appears in shell history or process listings.
This key must, at minimum, have write access to the Responses API.
## Migrating to ChatGPT login from API key