Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

cached_token_details is missing from realtime_response_usage #2355

Copy link
Copy link
Open
@jverkoey

Description

@jverkoey
Issue body actions

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

InputTokenDetails has the following structure when using the realtime API:

InputTokenDetails(audio_tokens=0, cached_tokens=192, text_tokens=239, cached_tokens_details={'text_tokens': 192, 'audio_tokens': 0})

But the InputTokenDetails type has the following definition:


class InputTokenDetails(BaseModel):
    audio_tokens: Optional[int] = None
    """The number of audio tokens used in the Response."""

    cached_tokens: Optional[int] = None
    """The number of cached tokens used in the Response."""

    text_tokens: Optional[int] = None
    """The number of text tokens used in the Response."""

Note that cached_tokens_details is missing.

To Reproduce

See the above.

Code snippets

OS

macOS

Python version

Python v3.13

Library version

v1.78.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.