Reference · API

Whisper audio transcription

Last updated

Convert **speech to text** with OpenAI Whisper (or compatible endpoints) — meetings, voice notes, accessibility, and RAG over audio.

Convert **speech to text** with OpenAI Whisper (or compatible endpoints) — meetings, voice notes, accessibility, and RAG over audio.

#When to use

  • Transcribing user-uploaded audio in your app
  • Building captions or searchable meeting archives
  • Pre-processing voice before an LLM summarizes
  • Not ideal for real-time sub-100ms dictation without specialized streaming STT.

    #Endpoint

    POST https://api.openai.com/v1/audio/transcriptions

    #Request shape (sketch)

    Multipart form:

    | Field | Value |

    |-------|-------|

    | `file` | Audio bytes (mp3, wav, m4a, …) |

    | `model` | `whisper-1` |

    | `language` | Optional ISO-639-1 hint |

    | `response_format` | `json`, `text`, `srt`, `vtt` |

    #Python sketch

    from openai import OpenAI
    client = OpenAI()
    with open("meeting.mp3", "rb") as f:
        transcript = client.audio.transcriptions.create(
            model="whisper-1",
            file=f,
            response_format="text",
        )
    print(transcript)

    #Pipeline pattern

    upload audio → transcribe → chunk text → embed → RAG or summarize

    #Common pitfalls

    | Pitfall | Fix |

    |---------|-----|

    | Files over size limits | Split long audio; compress sensibly |

    | No speaker labels | Use diarization elsewhere if needed |

    | PII in recordings | Redact or block sensitive uploads |

    | Skipping language hint | Set `language` when known for accuracy |