Use the GLM-ASR-2512 model to transcribe audio files into text, supporting multiple languages and real-time streaming transcription.

post/paas/v4/audio/transcriptions

Request

  • Base URL
    https://api.z.ai/api
  • URL
    https://api.z.ai/api/paas/v4/audio/transcriptions
  • Auth
    HTTP bearer

Request body multipart/form-data

filestring binary required

The audio file to be transcribed. Supported audio file formats: .wav / .mp3. Specifications: file size ≤ 25 MB, audio duration ≤ 30 seconds.

file_base64string

Base64 encoded audio file. Only one of file_base64 or file needs to be provided (if both are provided, file takes precedence).

model'glm-asr-2512' required

The model ID to invoke.

promptstring

In long text scenarios, you can provide previous transcription results as context. Recommended to be less than 8000 characters.

hotwordsstring[]

Hotword list to improve recognition accuracy for domain-specific vocabulary. Format example: ["person_name","place_name"]. Recommended not to exceed 100 items.

streamboolean

This parameter should be set to false or omitted when using synchronous calls. It indicates that the model returns all content at once after generating all content. Default is false. If set to true, the model will return generated content in chunks via standard Event Stream. When the Event Stream ends, a data: [DONE] message will be returned.

request_idstring

Passed by the user side, needs to be unique; used to distinguish each request, 6–64 characters. If not provided by the user side, the platform will generate one by default.

user_idstring

Unique ID for the end user, 6–128 characters. Avoid using sensitive information.

Response

Request processed successfully

idstring

Task ID

createdinteger

Request creation time, as a Unix timestamp in seconds.

request_idstring

Passed by the client, must be unique. A unique identifier to distinguish each request. If not provided by the client, the platform will generate one by default.

modelstring

Model name

textstring

The complete transcribed content of the audio.

Changes

    • breaking

      the request property's minLength was increased from 0 to 6

    • breaking

      the request property's minLength was increased from 0 to 6

    • warning

      the request property's maxLength was set to 64

    • warning

      the request property's maxLength was set to 128