---
title: Audio formats
sidebar_label: Audio formats
sidebar_position: 2
description: "Accepted input formats and available output formats across transcription, speech generation, audio in chat, and voice agents."
---

# Audio formats

This page lists the audio formats each audio API accepts and returns. The feature pages link here instead of repeating the lists.

<SectionTab as="h2" sectionId="transcription-input">Transcription input</SectionTab>

Each transcription mode takes audio in a different form:

| Mode | How you send audio | Formats | Details |
| --- | --- | --- | --- |
| File transcription | One file per request: `file` (upload), `file_url` (a URL of up to 2,083 characters), or `file_id` (a file uploaded to `/v1/files` with `purpose=audio`) |  | [File transcription](/studio/audio/speech-to-text/transcribe-files#choose-input) |
| Realtime transcription | Raw audio in base64 chunks, described by `audio_format` in `session.update` | `pcm_s16le` (16-bit signed little-endian PCM, mono). Default sample rate: 16,000 Hz.  | [Realtime transcription](/studio/audio/speech-to-text/transcribe-in-realtime#session-fields) |

<SectionTab as="h2" sectionId="speech-output">Speech output</SectionTab>

Speech generation returns audio in the format you set with `response_format`:

| Format | Use it for |
| --- | --- |
| `mp3` (default) | Playback in browsers and apps, when file size matters |
| `opus` | Streaming and playback over limited bandwidth |
| `wav` | Editing, or when you need uncompressed audio in a standard file |
| `flac` | Lossless archiving at a smaller size than WAV |
| `pcm` | Raw pipelines and telephony bridges that take raw samples, with no file header |

Generated speech is mono at 24 kHz. To set the format in a request, see [Response formats](/studio/audio/text-to-speech/generate-speech#response-formats).

<SectionTab as="h2" sectionId="reference-audio">Reference audio</SectionTab>

Two features take a short recording of a voice as a reference:

| Use | Format | Number and length | Details |
| --- | --- | --- | --- |
| Speaker references for diarization | The base64 encoding of an audio file, keyed by a speaker name | Up to 8 clips, 3 to 15 seconds each | [Name speakers with reference clips](/studio/audio/speech-to-text/diarize-speakers#speaker-references) |
| Voice cloning | An MP3 or WAV file, base64-encoded. A URL isn't accepted. | A few seconds to a few minutes | [Prepare a reference clip](/studio/audio/text-to-speech/voice-cloning#prepare-a-reference-clip) |

<SectionTab as="h2" sectionId="audio-in-chat">Audio in chat completions</SectionTab>

Audio in chat completions takes the audio inline, in the message:

| How you send audio | Formats | Details |
| --- | --- | --- |
| An `input_audio` content part with the base64 encoding of the file |  | [Audio in chat completions](/studio/audio/audio-in-chat) |

<SectionTab as="h2" sectionId="voice-agents-sdk">Voice agents SDK</SectionTab>

The Voice Agents SDK uses one audio format of its own, for input and output:

| Integration | Format | Details |
| --- | --- | --- |
| Custom audio interface, or audio sent manually | 16-bit signed PCM, mono, 48 kHz | [Custom audio](/studio/audio/voice-agents/custom-audio) |
| Browser | The page's media tracks: you don't handle any format | [Voice agents in the browser](/studio/audio/voice-agents/browser) |

<SectionTab as="h2" sectionId="going-further">Going further</SectionTab>

<UsefullLinkContainer>
  <LinkCard href="/studio/audio/specs-and-limits/limits" title="Limits" />
  <LinkCard href="/studio/audio/speech-to-text/transcribe-files" title="File transcription" />
  <LinkCard href="/studio/audio/text-to-speech/generate-speech" title="Speech generation" />
</UsefullLinkContainer>