Add support for token usage reporting for Azure endpoint
Resolved 💬 4 comments Opened Sep 6, 2025 by eugene-kim Closed Feb 12, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.29.0
Which model were you using?
gpt-5
What platform is your computer?
Darwin 24.6.0 arm64 arm
What steps can reproduce the bug?
Use an azure deployment. Here's my config.toml (deployment name redacted):
model_provider = "azure"
model = "gpt-5"
[model_providers.azure]
name = "Azure"
base_url = "https://redacted.openai.azure.com/openai/deployments/gpt-5"
env_key = "AZURE_OPENAI_API_KEY"
query_params = { api-version = "2024-12-01-preview" }
# wire_api = "chat"
model_reasoning_summary = "detailed"
What is the expected behavior?
I should see tokens used in the session after I send messages.
What do you see instead?
📂 Workspace
• Path: ~/Projects/ti
• Approval Mode: on-request
• Sandbox: workspace-write
• AGENTS files: AGENTS.md
🧠 Model
• Name: gpt-5
• Provider: Azure
📊 Token Usage
• Session ID: a249b4c6-57e0-4a3c-8288-428ee9b323de
• Input: 0
• Output: 0
• Total: 0
Additional information
I also don't see context remaining either.
4 Comments
out of the scope of this bug probably, but are you able to set the reasoning effort through /model ?
Yes
On Sun, Sep 7, 2025 at 8:54 PM Omar Habra @.***> wrote:
Token usage reporting and accounting are handled differently by Microsoft and OpenAI. The codex CLI currently supports the OpenAI mechanism for token reporting. To make this work with Azure endpoints, the Azure team would need to publish and document a mechanism for token usage reporting.
I've changed this from a bug report to an enhancement request.
This feature request hasn't received enough upvotes in the past two months, so I'm going to close it.