Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
The OpenAI.Beta.Realtime.RealtimeResponseUsage.InputTokenDetails type has 3 properties:
text_tokens
audio_tokens
cached_tokens
But in fact, the API returns a fourth property (which is indeed very important):
cached_tokens_details, an object with 2 properties text_tokens and audio_tokens.
This information is needed to accurately evaluate the cost of generating the response.
To Reproduce
- Open a websocket connection with the realtime API at
wss://api.openai.com/v1/realtime.
- Send a
session.update and a response.create event.
- Inspect the content of the
response.done event sent by the server, in particular response.usage.input_token_details
Code snippets
OS
Windows
Node version
Node v20
Library version
openai 5.11.0
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
The
OpenAI.Beta.Realtime.RealtimeResponseUsage.InputTokenDetailstype has 3 properties:text_tokensaudio_tokenscached_tokensBut in fact, the API returns a fourth property (which is indeed very important):
cached_tokens_details, an object with 2 propertiestext_tokensandaudio_tokens.This information is needed to accurately evaluate the cost of generating the response.
To Reproduce
wss://api.openai.com/v1/realtime.session.updateand aresponse.createevent.response.doneevent sent by the server, in particularresponse.usage.input_token_detailsCode snippets
OS
Windows
Node version
Node v20
Library version
openai 5.11.0