Open
Description
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