Just don't export it?
OPENAI_API_KEY="your-api-key-here" codex OPENAI_API_KEY="your-api-key-here" codexYou could however wrap the export variable and codex command in a script and just call that. This way the variable would only be part of that script’s environment.
Now I know I should be careful examining code not formatted in a code block.