OpenAI Codex
OpenAI Codex
Section titled “OpenAI Codex”The OpenAI Codex integration gives Ptah access to the GPT-5 family and Codex CLI agents with reasoning-effort control.
What you need
Section titled “What you need”- An OpenAI account with API access from the OpenAI Platform, or a ChatGPT subscription for the OAuth path.
Configuration
Section titled “Configuration”You have two ways to authenticate:
API key (direct)
Section titled “API key (direct)”- Create an API key at platform.openai.com.
- Open Settings → Providers → OpenAI Codex.
- Paste the key. It’s stored in encrypted
safeStorage.
OAuth (ChatGPT subscription)
Section titled “OAuth (ChatGPT subscription)”- Open Settings → Providers → OpenAI Codex.
- Click Sign in with ChatGPT.
- Approve the Ptah app in your browser.
Non-secret Codex settings live in ~/.ptah/settings.json:
{ "provider.openai-codex.oauthApiEndpoint": "", "provider.openai-codex.modelTier.opus": null, "provider.openai-codex.modelTier.sonnet": null, "provider.openai-codex.modelTier.haiku": null, "agentOrchestration.codexModel": "", "agentOrchestration.codexReasoningEffort": "", "agentOrchestration.codexAutoApprove": true}codexReasoningEffortaccepts"low","medium", or"high"(empty string uses the in-chat effort level).codexAutoApprove: truelets the Codex CLI auto-approve sandbox operations; set tofalseto require manual approval.
Verifying it works
Section titled “Verifying it works”- Open the chat.
- Select a GPT-5 or Codex model.
- Send a prompt that requires reasoning:
Explain the time complexity of quicksort with and without the median-of-three optimization. - You should see a streaming response with thinking tokens visible in the Execution Tree.
Troubleshooting
Section titled “Troubleshooting”invalid_api_key— regenerate the key at platform.openai.com.model_not_available— your org may not have GPT-5 access yet. Trygpt-4oor request access.- Codex CLI not detected as a sub-agent — make sure the Codex CLI is installed and on your
PATH, then restart Ptah. Check thatcodexisn’t inagentOrchestration.disabledClis. - OAuth sign-in fails — requires a ChatGPT Plus/Team/Enterprise plan. Free ChatGPT accounts can’t use the OAuth path; use an API key instead.