Repository navigation
Make diarized transcription duration and task optional #802
Description
Update: July 30, 2026
I ran the same reproduction again today, and the API response now includes both duration and task:
{
"text": "And so, my fellow Americans, ask not what your country can do for you, ask what you can do for your country.",
"task": "transcribe",
"duration": 11.0,
"segments": [
{
"type": "transcript.text.segment",
"text": " And so, my fellow Americans,",
"speaker": "A",
"start": 0.0,
"end": 2.0999999999999996,
"id": "seg_0"
},
{
"type": "transcript.text.segment",
"text": " ask not what your country can do for you, ask what you can do for your country.",
"speaker": "A",
"start": 2.3,
"end": 10.3,
"id": "seg_1"
}
],
"usage": {
"type": "tokens",
"total_tokens": 432,
"input_tokens": 110,
"input_token_details": {
"text_tokens": 0,
"audio_tokens": 110
},
"output_tokens": 322
}
}Original report: July 18, 2026
Bug
TranscriptionDiarized models both duration and task as required, but the diarized_json transcription response can omit both fields.
A direct response from the OpenAI API contained text, segments, and usage, but no duration or task properties.
This causes two problems:
TranscriptionDiarized.duration()throwsOpenAIInvalidDataException:durationis not set.TranscriptionDiarized.validate()fails because an absenttaskdoes not match the expectedtranscribevalue.
Reproduction
Audio file: https://github.com/openai/whisper/blob/main/tests/jfk.flac
A direct request to the OpenAI audio transcriptions endpoint with response_format=diarized_json returned:
{
"text": "And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country.",
"segments": [
{
"type": "transcript.text.segment",
"text": " And so my fellow Americans, ask not what your country can do for you,",
"speaker": "A",
"start": 0.0,
"end": 7.499999999999999,
"id": "seg_0"
},
{
"type": "transcript.text.segment",
"text": " ask what you can do for your country.",
"speaker": "A",
"start": 8.15,
"end": 10.3,
"id": "seg_1"
}
],
"usage": {
"type": "tokens",
"total_tokens": 431,
"input_tokens": 110,
"input_token_details": {
"text_tokens": 0,
"audio_tokens": 110
},
"output_tokens": 321
}
}The response contains no duration nor task property.
I opened a issue on openai/openapi to track the schema correction.
Expected behavior
duration and task should be optional in TranscriptionDiarized, since it can be absent from a valid API response.
Activity
[-]Make diarized transcription duration optional[/-][+]Make diarized transcription duration and task optional[/+]tzolov commentedon Jul 30, 2026
@wskr00 I believe this issue is still present and needs to be re-open
wskr00 commentedon Jul 30, 2026
@tzolov sure, sorry
reopening
Enrich OpenAI transcription options and responses