Long-lived authentication token
Resolved 💬 2 comments Opened Aug 24, 2025 by Gusarich Closed Nov 27, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What feature would you like to see?
Currently, Codex CLI uses temporary tokens with a refresh mechanism for ChatGPT subscription login. For automation, it would be useful to have the ability to generate a long-lived auth token, similar to how it is possible in Claude Code with the setup-token command. This token does not require refresh logic and is valid for a longer time.
Are you interested in implementing this feature?
I think it requires some backend work from your side, so it is not applicable here.
Additional information
GPT-5 is amazing!
2 Comments
I like to see this just for normal use. I don't use Codex that frequently, and often when I want to use it, I need to login again, which just makes me not want to use it. Claude Code works perfectly with
setup-token.We're unlikely to add long-lived tokens for ChatGPT. We've invested in making the token refresh logic more robust.