Skip to content

Add support for token usage reporting for Azure endpoint #3250

Closed as not planned

Description

@eugene-kim

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.

Activity

  1. added
    bug
    on Sep 6, 2025
  2. bro4all commented on Sep 8, 2025

    @bro4all

    out of the scope of this bug probably, but are you able to set the reasoning effort through /model ?

  3. eugene-kim commented on Sep 8, 2025

    @eugene-kim
    Author
  4. added
    azure
    on Nov 9, 2025
  5. changed the title [-]`/status` command shows no token usage for a session with many messages (Azure provider)[/-] [+]Add support for token usage reporting for Azure endpoint[/+] on Dec 25, 2025
  6. added
    enhancement
    and removed
    bug
    on Dec 25, 2025
  7. etraut-openai commented on Dec 25, 2025

    @etraut-openai
    Contributor

    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.

  8. etraut-openai commented on Feb 12, 2026

    @etraut-openai
    Contributor

    This feature request hasn't received enough upvotes in the past two months, so I'm going to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    azureenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions