Skip to content

Token usage in jsonl #3433

Closed
Closed

Description

@vjain419

What feature would you like to see?

add Token usage for each step / entry and overall chat in jsonl. I am creating a tool which will generate some report / dashboard and in order to be effective I want to have "token" usage per session feature and overall token usage.

Are you interested in implementing this feature?

I can if OAI team agree to look at PR on time.

Additional information

No response

Activity

  1. added
    enhancement
    on Sep 10, 2025
  2. MaurUppi commented on Sep 11, 2025

    @MaurUppi

    https://platform.openai.com/docs/api-reference/responses/object

    {
      "id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41",
      "object": "response",
      "created_at": 1741476777,
      "status": "completed",
      "error": null,
      "incomplete_details": null,
      "instructions": null,
      "max_output_tokens": null,
      "model": "gpt-4o-2024-08-06",
      "output": [
        {
          "type": "message",
          "id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41",
          "status": "completed",
          "role": "assistant",
          "content": [
            {
              "type": "output_text",
              "text": "The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.",
              "annotations": []
            }
          ]
        }
      ],
      "parallel_tool_calls": true,
      "previous_response_id": null,
      "reasoning": {
        "effort": null,
        "summary": null
      },
      "store": true,
      "temperature": 1,
      "text": {
        "format": {
          "type": "text"
        }
      },
      "tool_choice": "auto",
      "tools": [],
      "top_p": 1,
      "truncation": "disabled",
      "usage": {
        "input_tokens": 328,
        "input_tokens_details": {
          "cached_tokens": 0
        },
        "output_tokens": 52,
        "output_tokens_details": {
          "reasoning_tokens": 0
        },
        "total_tokens": 380
      },
      "user": null,
      "metadata": {}
    }
  3. vjain419 commented on Sep 11, 2025

    @vjain419
    ContributorAuthor

    yes its present in oai response object but not in rollout jsonl

  4. bl-ue commented on Sep 15, 2025

    @bl-ue

    Implemented in #1583

  5. vjain419 commented on Sep 30, 2025

    @vjain419
    ContributorAuthor

    Thanks it address my requirement.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions