Skip to content

text_tokens and image_tokens not documented or typed #2554

@abhinav-pola

Description

@abhinav-pola

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

When making a chat completions request to gpt-4o-audio-preview or gpt-4o-mini-audio-preview, the usage response contains text_tokens and image_tokens under prompt_tokens_details:

"prompt_tokens_details": {
      "cached_tokens": 0,
      "audio_tokens": 21,
      "text_tokens": 11,
      "image_tokens": 0
    },

These fields aren't documented or typed in any schemas (also in the js sdk)

To Reproduce

Make a request to chat completions API with model gpt-4o-audio-preview or gpt-4o-mini-audio-preview

Code snippets

OS

macOS

Python version

Python v3.11.4

Library version

openai v1.99.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions