--json doesn't output reasoning items when using API Key auth

Open 💬 7 comments Opened Feb 5, 2026 by terzioglub
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

CLI 0.94.0

What subscription do you have?

Business

Which model were you using?

gpt-5.2-codex

What platform is your computer?

_No response_

What terminal emulator and version are you using (if applicable)?

_No response_

What issue are you seeing?

Body
When running Codex CLI with --json, no "type":"reasoning" items are included in the JSONL output.
Only command_execution and agent_message events appear. Reasoning output used to be present and still appears for other users on the same version.

This seems account/org dependent. If intentional, please document or provide a flag to enable it.

What steps can reproduce the bug?

Repro:
npm install -g @openai/codex@0.94.0
codex exec --json "analyze this repo"
Expected: JSONL includes reasoning items
Actual: No reasoning items emitted

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

7 Comments

terzioglub · 5 months ago

Found the cause: reasoning output depends on how Codex is authenticated.
With web login:
codex login
→ --json includes "type":"reasoning" items.
With API key:
export OPENAI_API_KEY=...
→ No reasoning items are emitted.
So reasoning only appears with web auth, not API key auth.
Is there a way to enable reasoning output when using API key authentication as well? If this is intentional, could this be documented or exposed via a flag/config?

etraut-openai contributor · 5 months ago

Thanks for reporting.

Looks like this isn't a regression, but it is a bug — not intended behavior.

terzioglub · 5 months ago

Thanks for confirming.
Happy to help if there’s anything that can be done on the CLI side, but from what I can tell this looks like a backend/auth behavior difference (web vs API key), since the CLI never receives reasoning items in API-key mode.
Let me know if there’s anything I can test or contribute on the client side.

terzioglub · 4 months ago

Hey @etraut-openai have you had a chance to tackle this issue ? this is causing some trouble for us for the past few weeks

terzioglub · 3 months ago

Hello Team

I was wondering if there is any updates on this issue and I would be also glad to tackle this issue , if it can be fixed on the open source side of things , do you accept contributions ?
cc @etraut-openai

karakanb · 3 months ago

hi folks, any updates on this?

terzioglub · 1 month ago

hey team this issue has been open for the past three months , is there anyway someone picks this up soon ?