Skip to content

Make diarized transcription duration and task optional #802

Open

Description

@wskr00

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() throws OpenAIInvalidDataException: duration is not set.
  • TranscriptionDiarized.validate() fails because an absent task does not match the expected transcribe value.

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

  1. changed the title [-]Make diarized transcription duration optional[/-] [+]Make diarized transcription duration and task optional[/+] on Jul 19, 2026
  2. tzolov commented on Jul 30, 2026

    @tzolov

    @wskr00 I believe this issue is still present and needs to be re-open

  3. wskr00 commented on Jul 30, 2026

    @wskr00
    Author

    @tzolov sure, sorry

    reopening

  4. reopened this on Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions