Expiration is a response object parameter you can obtain.
audio_data = choice.get('audio', {})
audio_expires_at = audio_data.get('expires_at', 0)
We have to produce our own documentationā¦
sending API request
API request: success
-- choices list received --
Welcome! I am your AI assistant, here to assist you with your needs. I can provide information, answer questions, and help you navigate through various tasks. I'm ready to help whenever you need!
{'prompt_tokens': 179, 'completion_tokens': 424, 'total_tokens': 603, 'prompt_tokens_details': {'cached_tokens': 0, 'audio_tokens': 0, 'text_tokens': 179, 'image_tokens': 0}, 'completion_tokens_details': {'reasoning_tokens': 0, 'audio_tokens': 364, 'accepted_prediction_tokens': 0, 'rejected_prediction_tokens': 0, 'text_tokens': 60}}
Response Metadata:
Current Epoch Time: 1733618249
Audio ID: audio_67...
Audio Expiration Epoch: 1733621847
Time to Expiration: 59m 58s remaining
Prompt:
When there is no audio ID, if you continue to try to interact with only the transcript as assistant messages, expect the model to start dropping out of voice, responding with ācontentā. It is pretty obvious it speaks and speaks in its voice only by in-context preparation of audio tokens, and audio-only modality canāt be used (likely because OpenAI has little control and hasnāt simply demoted all public text string token numbers as a solution).
Just the second user input, using assistant transcript, and no voice audio is produced:
sending API request
API request: success
-- choices list received --
Well, I might not have feelings like humans do, but I sure do enjoy helping you out! It's rewarding to be of assistance and to make your tasks a bit easier. You could say I have a friendly AI affection for all my users!
{'prompt_tokens': 235, 'completion_tokens': 50, 'total_tokens': 285, 'prompt_tokens_details': {'cached_tokens': 0, 'audio_tokens': 0, 'text_tokens': 235, 'image_tokens': 0}, 'completion_tokens_details': {'reasoning_tokens': 0, 'audio_tokens': 0, 'accepted_prediction_tokens': 0, 'rejected_prediction_tokens': 0, 'text_tokens': 50}}
Response Metadata:
Current Epoch Time: 1733618526
Audio ID: ...
Audio Expiration Epoch: 0
Time to Expiration: Expired