# Audio transcription

> Audio Generation

Configure the transcription in `generationConfig.audioTranscriptionConfig`; the model then transcribes the input audio. Pass audio in `contents[].parts[]` (`fileData.fileUri` or `inlineData`) instead of a text prompt.

Results are returned in `candidates[].content.parts[].audioTranscription` (`text`, `languageCode`, `speakerLabel`, `words`, and offsets). With streaming, the same fields arrive in chunks and `finished` indicates whether the current segment is complete.

**Streaming requests**: the path documented here is the non-streaming endpoint. To receive a streaming response, you must replace `generateContent` in the request path with `streamGenerateContent`, i.e. `/v1beta/models/gemini-3.5-transcribe:streamGenerateContent`. Headers and request body are identical to the non-streaming call.

## Endpoint

`POST https://api.modelverse.cn/v1beta/models/gemini-3.5-transcribe:generateContent`

## Request Body

## Responses

- **200** — Transcription result. The text is in `candidates[].content.parts[].text` and the structured transcription is in `audioTranscription` of the same part.
Streaming responses use text/event-stream, where each `data` payload is one `GenerateContentResponse` chunk and `audioTranscription.finished` indicates whether the current segment is complete.
- **4XX** — Client error, for example invalid arguments or `customVocabulary` combined with `diarization`.
- **default** — Error response.

## OpenAPI Definition

```json
{
  "openapi": "3.1.0",
  "x-language": "en-US",
  "info": {
    "title": "gemini-3.5-transcribe Audio Transcription",
    "version": "v1beta",
    "description": "ModelVerse Gemini-compatible synchronous transcription API. `gemini-3.5-transcribe` transcribes a complete pre-recorded audio file in a single request, with a maximum audio duration of 15 minutes.\n\nIt automatically detects more than 85 languages, including code-switching within the same audio. When the language is known, pass a hint in `generationConfig.audioTranscriptionConfig.languageCodes` to improve accuracy.\n\nThe transcription mode is controlled by `mode`: `VERBATIM` (default) returns a word-for-word transcript that keeps filler words, repetitions, pauses, and slips of the tongue; `SMART` removes fillers and stutters, resolves spoken self-corrections, adds paragraphs and lists, and formats dates, currencies, and numbers.\n\nOptional capabilities: `wordTimestamp` returns word-level timestamps (experimental, reduces accuracy); `diarization` separates up to 8 speakers (experimental); `customVocabulary` supplies up to 1,000 terms to bias recognition, with roughly 100 or fewer giving the best results. `customVocabulary` cannot be combined with `diarization` or `wordTimestamp`; requests specifying both are rejected.\n\nAudio can be supplied as an accessible audio file URL via `fileData.fileUri`, or as Base64-encoded audio bytes via `inlineData` (about 20 MB request body limit). Transcription results are returned in `candidates[].content.parts[].audioTranscription` and are also written to `text` of the same part.\n\nThe path documented here is the non-streaming endpoint. For a streaming response, replace `generateContent` in the path with `streamGenerateContent`; headers and request body stay identical."
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "Mainland China"
    },
    {
      "url": "https://api.umodelverse.ai",
      "description": "Global"
    },
    {
      "url": "https://api-us-ca.umodelverse.ai",
      "description": "Los Angeles, US"
    },
    {
      "url": "https://api-sg.umodelverse.ai",
      "description": "Singapore"
    },
    {
      "url": "https://api-ge-fra.umodelverse.ai",
      "description": "Frankfurt"
    }
  ],
  "tags": [
    {
      "name": "gemini-3.5-transcribe",
      "description": "Audio transcription. Converts pre-recorded audio files into text, with verbatim and smart transcription modes, automatic language detection, word-level timestamps, speaker diarization, and custom vocabulary."
    }
  ],
  "security": [
    {
      "xGoogApiKey": []
    }
  ],
  "externalDocs": {
    "description": "Gemini 3.5 Transcribe official documentation.",
    "url": "https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-5-transcribe"
  },
  "paths": {
    "/v1beta/models/gemini-3.5-transcribe:generateContent": {
      "post": {
        "tags": [
          "gemini-3.5-transcribe"
        ],
        "operationId": "generateContentGemini35TranscribeEn",
        "summary": "Audio transcription",
        "description": "Configure the transcription in `generationConfig.audioTranscriptionConfig`; the model then transcribes the input audio. Pass audio in `contents[].parts[]` (`fileData.fileUri` or `inlineData`) instead of a text prompt.\n\nResults are returned in `candidates[].content.parts[].audioTranscription` (`text`, `languageCode`, `speakerLabel`, `words`, and offsets). With streaming, the same fields arrive in chunks and `finished` indicates whether the current segment is complete.\n\n**Streaming requests**: the path documented here is the non-streaming endpoint. To receive a streaming response, you must replace `generateContent` in the request path with `streamGenerateContent`, i.e. `/v1beta/models/gemini-3.5-transcribe:streamGenerateContent`. Headers and request body are identical to the non-streaming call.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateContentRequest"
              },
              "examples": {
                "nonStreamingUrl": {
                  "summary": "Audio transcription from a file URL",
                  "description": "Non-streaming call to `/v1beta/models/gemini-3.5-transcribe:generateContent` with audio supplied as a publicly accessible URL.",
                  "value": {
                    "contents": [
                      {
                        "role": "user",
                        "parts": [
                          {
                            "fileData": {
                              "fileUri": "https://storage.googleapis.com/modelverse-sz-modelverse01/xxxx.mp3",
                              "mimeType": "audio/mp3"
                            }
                          }
                        ]
                      }
                    ],
                    "generationConfig": {
                      "audioTranscriptionConfig": {
                        "languageCodes": [
                          "zh-CN"
                        ]
                      }
                    }
                  }
                },
                "nonStreamingInlineData": {
                  "summary": "Audio transcription with inlineData",
                  "description": "Non-streaming call with Base64-encoded audio in `inlineData.data`; the request body is limited to about 20 MB.",
                  "value": {
                    "contents": [
                      {
                        "role": "user",
                        "parts": [
                          {
                            "inlineData": {
                              "mimeType": "audio/mp3",
                              "data": "<AUDIO_BASE64>"
                            }
                          }
                        ]
                      }
                    ],
                    "generationConfig": {
                      "audioTranscriptionConfig": {
                        "languageCodes": [
                          "zh-CN"
                        ]
                      }
                    }
                  }
                },
                "smartModeWithTimestamps": {
                  "summary": "Smart transcription with word-level timestamps",
                  "description": "`mode: SMART` enables smart transcription and `wordTimestamp: true` returns word-level timestamps. `wordTimestamp` is experimental, may reduce accuracy, and cannot be combined with `customVocabulary`.",
                  "value": {
                    "contents": [
                      {
                        "role": "user",
                        "parts": [
                          {
                            "fileData": {
                              "fileUri": "https://storage.googleapis.com/modelverse-sz-modelverse01/meeting.mp3",
                              "mimeType": "audio/mp3"
                            }
                          }
                        ]
                      }
                    ],
                    "generationConfig": {
                      "audioTranscriptionConfig": {
                        "languageCodes": [
                          "zh-CN"
                        ],
                        "mode": "SMART",
                        "wordTimestamp": true
                      }
                    }
                  }
                },
                "diarization": {
                  "summary": "Two-speaker transcription with diarization",
                  "description": "`diarization: true` enables speaker separation, reported through `audioTranscription.speakerLabel` (experimental, up to 8 speakers). It cannot be combined with `customVocabulary`.",
                  "value": {
                    "contents": [
                      {
                        "role": "user",
                        "parts": [
                          {
                            "fileData": {
                              "fileUri": "https://storage.googleapis.com/modelverse-sz-modelverse01/interview.mp3",
                              "mimeType": "audio/mp3"
                            }
                          }
                        ]
                      }
                    ],
                    "generationConfig": {
                      "audioTranscriptionConfig": {
                        "languageCodes": [
                          "zh-CN"
                        ],
                        "diarization": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transcription result. The text is in `candidates[].content.parts[].text` and the structured transcription is in `audioTranscription` of the same part.\nStreaming responses use text/event-stream, where each `data` payload is one `GenerateContentResponse` chunk and `audioTranscription.finished` indicates whether the current segment is complete.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateContentResponse"
                },
                "examples": {
                  "transcription": {
                    "summary": "Non-streaming transcription result",
                    "value": {
                      "candidates": [
                        {
                          "content": {
                            "role": "model",
                            "parts": [
                              {
                                "text": "Let's discuss our Q3 goals today.",
                                "audioTranscription": {
                                  "text": "Let's discuss our Q3 goals today.",
                                  "languageCode": "en-US",
                                  "startOffset": "0s",
                                  "endOffset": "2.4s",
                                  "finished": true
                                }
                              }
                            ]
                          },
                          "finishReason": "STOP",
                          "index": 0
                        }
                      ],
                      "usageMetadata": {
                        "promptTokenCount": 320,
                        "candidatesTokenCount": 18,
                        "totalTokenCount": 338
                      }
                    }
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Client error, for example invalid arguments or `customVocabulary` combined with `diarization`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "xGoogApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-goog-api-key",
        "description": "Gemini-compatible API key header."
      }
    },
    "schemas": {
      "Status": {
        "type": "object",
        "description": "Standard error response with an error code, message, and details.",
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32",
            "description": "Status code, matching a google.rpc.Code enum value, for example 3 for INVALID_ARGUMENT or 8 for RESOURCE_EXHAUSTED."
          },
          "message": {
            "type": "string",
            "description": "Developer-facing, human-readable error message."
          },
          "details": {
            "type": "array",
            "description": "Structured supplementary error details.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "GenerateContentRequest": {
        "type": "object",
        "description": "Transcription request. Put the audio in `contents` and the transcription parameters in `generationConfig.audioTranscriptionConfig`.",
        "properties": {
          "contents": {
            "type": "array",
            "minItems": 1,
            "description": "Input content. Transcription needs a single `role: user` item whose `parts` contain the audio (`fileData` or `inlineData`); do not put text prompts here.",
            "items": {
              "$ref": "#/components/schemas/Content"
            }
          },
          "generationConfig": {
            "description": "Generation settings. Transcription parameters live in `audioTranscriptionConfig`.",
            "$ref": "#/components/schemas/GenerationConfig"
          }
        },
        "required": [
          "contents",
          "generationConfig"
        ]
      },
      "Content": {
        "type": "object",
        "description": "A single conversation content item.",
        "properties": {
          "role": {
            "type": "string",
            "description": "Content role; `user` in requests and `model` in responses.",
            "enum": [
              "user",
              "model"
            ]
          },
          "parts": {
            "type": "array",
            "minItems": 1,
            "description": "Content parts. Audio parts in requests; transcribed text and structured transcription in responses.",
            "items": {
              "$ref": "#/components/schemas/Part"
            }
          }
        },
        "required": [
          "parts"
        ]
      },
      "Part": {
        "type": "object",
        "description": "A content part. Carries audio data in requests and transcribed text plus `audioTranscription` in responses.",
        "properties": {
          "fileData": {
            "description": "Audio file referenced by URL; suitable for larger files.",
            "$ref": "#/components/schemas/FileData"
          },
          "inlineData": {
            "description": "Inline audio data; suitable for smaller files, with a request body limit of about 20 MB.",
            "$ref": "#/components/schemas/Blob"
          },
          "text": {
            "type": "string",
            "description": "Text content. Not used in requests; holds the transcribed text in responses."
          },
          "audioTranscription": {
            "description": "Output only. Structured transcription with the full text, language, speaker labels, and word-level timestamps.",
            "readOnly": true,
            "$ref": "#/components/schemas/Transcription"
          }
        },
        "additionalProperties": true
      },
      "FileData": {
        "type": "object",
        "description": "File data referenced by URI.",
        "properties": {
          "fileUri": {
            "type": "string",
            "format": "uri",
            "description": "URL of the audio file reachable by the server."
          },
          "mimeType": {
            "type": "string",
            "description": "Audio MIME type, for example `audio/mp3`, `audio/wav`, `audio/m4a`, `audio/flac`, or `audio/ogg`."
          }
        },
        "required": [
          "fileUri",
          "mimeType"
        ]
      },
      "Blob": {
        "type": "object",
        "description": "Inline binary data.",
        "properties": {
          "mimeType": {
            "type": "string",
            "description": "Audio MIME type; must match the actual audio format."
          },
          "data": {
            "type": "string",
            "contentEncoding": "base64",
            "description": "Base64-encoded audio bytes."
          }
        },
        "required": [
          "mimeType",
          "data"
        ]
      },
      "GenerationConfig": {
        "type": "object",
        "description": "Generation settings. Transcription models only need `audioTranscriptionConfig`.",
        "properties": {
          "audioTranscriptionConfig": {
            "description": "Audio transcription settings controlling language hints, transcription mode, timestamps, speaker diarization, and custom vocabulary.",
            "$ref": "#/components/schemas/AudioTranscriptionConfig"
          }
        },
        "required": [
          "audioTranscriptionConfig"
        ]
      },
      "AudioTranscriptionConfig": {
        "type": "object",
        "description": "Audio transcription settings. Apart from `languageCodes`, `customVocabulary`, `diarization`, `wordTimestamp`, and `SMART` mode are experimental.",
        "properties": {
          "languageCodes": {
            "type": "array",
            "description": "Optional. Language hints for languages that may appear in the audio, as BCP-47 codes such as `zh-CN`, `en-US`, or `ja-JP`. Hints improve accuracy when the language is known; when omitted, the language is detected automatically (more than 85 languages, including code-switching within one audio file).",
            "items": {
              "type": "string"
            }
          },
          "customVocabulary": {
            "type": "array",
            "description": "Optional. Terms that steer the model toward domain jargon, brand names, or proper nouns. Up to 1,000 terms are accepted, but roughly 100 or fewer give the best results. Cannot be combined with `diarization` or `wordTimestamp`; such requests are rejected.",
            "items": {
              "type": "string"
            }
          },
          "diarization": {
            "type": "boolean",
            "description": "Optional. Whether to enable speaker diarization. When enabled, `audioTranscription.speakerLabel` labels each speaker (for example `spk_1`, `spk_2`), supporting up to 8 speakers. Experimental. Cannot be combined with `customVocabulary`."
          },
          "wordTimestamp": {
            "type": "boolean",
            "description": "Optional. Whether to return word-level timestamps. When enabled, `audioTranscription.words[]` contains each recognized word with `startOffset` and `endOffset`. Experimental and may reduce transcription accuracy. Cannot be combined with `customVocabulary`."
          },
          "mode": {
            "type": "string",
            "description": "Optional. Transcription mode. `VERBATIM` (default) returns a word-for-word transcript that keeps filler words, repetitions, pauses, and slips of the tongue; `SMART` removes fillers and stutters, resolves spoken self-corrections, adds paragraphs and lists, and formats dates, currencies, and numbers.",
            "enum": [
              "MODE_UNSPECIFIED",
              "VERBATIM",
              "SMART"
            ],
            "x-enumDescriptions": [
              "Unspecified; behaves like `VERBATIM`.",
              "Word-for-word transcript that keeps filler words, repetitions, pauses, and slips of the tongue.",
              "Smart transcription with fluency cleanup, structuring, and formatting."
            ],
            "default": "VERBATIM"
          }
        },
        "example": {
          "languageCodes": [
            "en-US"
          ],
          "mode": "SMART"
        }
      },
      "GenerateContentResponse": {
        "type": "object",
        "description": "Transcription response. Non-streaming calls return the complete result; for streaming, each SSE `data` payload is a JSON chunk of this structure.",
        "properties": {
          "candidates": {
            "type": "array",
            "description": "Candidate results.",
            "items": {
              "$ref": "#/components/schemas/Candidate"
            }
          },
          "usageMetadata": {
            "description": "Token usage.",
            "$ref": "#/components/schemas/UsageMetadata"
          },
          "modelVersion": {
            "type": "string",
            "description": "Output only. Model version that served the request.",
            "readOnly": true
          },
          "responseId": {
            "type": "string",
            "description": "Output only. Unique identifier of this response.",
            "readOnly": true
          }
        },
        "additionalProperties": true
      },
      "Candidate": {
        "type": "object",
        "description": "A single candidate result.",
        "properties": {
          "content": {
            "description": "Model output; transcribed text and structured results are in `parts[]`.",
            "$ref": "#/components/schemas/Content"
          },
          "finishReason": {
            "type": "string",
            "description": "Output only. Why generation stopped; `STOP` for a normal finish and `MAX_TOKENS` when the output limit was reached.",
            "readOnly": true
          },
          "index": {
            "type": "integer",
            "format": "int32",
            "description": "Output only. Candidate index, starting from 0.",
            "readOnly": true
          }
        },
        "additionalProperties": true
      },
      "Transcription": {
        "type": "object",
        "description": "Structured transcription, returned in `part.audioTranscription` when transcription is enabled through `audioTranscriptionConfig`.",
        "properties": {
          "text": {
            "type": "string",
            "description": "Output only. Transcribed text of this segment.",
            "readOnly": true
          },
          "languageCode": {
            "type": "string",
            "description": "Output only. BCP-47 language code of the transcript.",
            "readOnly": true
          },
          "speakerLabel": {
            "type": "string",
            "description": "Output only. Speaker label of this segment, for example `spk_1`; returned only when `diarization` is enabled.",
            "readOnly": true
          },
          "words": {
            "type": "array",
            "description": "Output only. Word-level transcript with timing; returned only when `wordTimestamp` is enabled.",
            "readOnly": true,
            "items": {
              "$ref": "#/components/schemas/WordInfo"
            }
          },
          "startOffset": {
            "type": "string",
            "format": "google-duration",
            "description": "Output only. Start offset of this segment relative to the audio start, for example `1.5s`.",
            "readOnly": true
          },
          "endOffset": {
            "type": "string",
            "format": "google-duration",
            "description": "Output only. End offset of this segment relative to the audio start, for example `4.2s`.",
            "readOnly": true
          },
          "finished": {
            "type": "boolean",
            "description": "Output only. Whether this segment is complete; useful in streaming to tell when the current segment ends.",
            "readOnly": true
          }
        },
        "additionalProperties": true
      },
      "WordInfo": {
        "type": "object",
        "description": "A single recognized word, returned only when `wordTimestamp` is enabled.",
        "properties": {
          "word": {
            "type": "string",
            "description": "Output only. Recognized word.",
            "readOnly": true
          },
          "startOffset": {
            "type": "string",
            "format": "google-duration",
            "description": "Output only. Start offset of the word relative to the audio start.",
            "readOnly": true
          },
          "endOffset": {
            "type": "string",
            "format": "google-duration",
            "description": "Output only. End offset of the word relative to the audio start.",
            "readOnly": true
          }
        },
        "additionalProperties": true
      },
      "UsageMetadata": {
        "type": "object",
        "description": "Token usage.",
        "properties": {
          "promptTokenCount": {
            "type": "integer",
            "format": "int32",
            "description": "Input token count; audio is counted in tokens."
          },
          "candidatesTokenCount": {
            "type": "integer",
            "format": "int32",
            "description": "Output token count, i.e. tokens used by the transcript."
          },
          "totalTokenCount": {
            "type": "integer",
            "format": "int32",
            "description": "Total token count."
          }
        },
        "additionalProperties": true
      }
    }
  }
}
```
