Console

Multi-Speaker Transcription

Convert multi-speaker audio into transcription results with speaker information — ideal for meetings, interviews, and podcasts.

Endpoint
POST/v1/audio/transcriptions
Model name
moss-transcribe-diarize-pro
  1. Create an API Key

    Open the API Key management platform, create an API Key, and save it as an environment variable. Do not write the API Key into client-side code or commit it to a repository.

    Environment variable
    MOSS_API_KEY=<your_api_key_here>
  2. Prepare the request input

    Prepare a local multi-speaker audio file and submit the file and transcription parameters together using multipart/form-data; pass diarize=true to enable speaker recognition.

    FieldTypeRequirementDescription
    model: stringRequired

    Currently, use moss-transcribe-diarize-pro.

    file: fileRequired

    A local audio file uploaded using multipart/form-data.

    diarize: booleanRequired

    Set to true to enable speaker recognition.

    response_format: stringOptional

    Transcription result format. Available values are json and text; the default is json. Use json to return speaker and segments.

    Request body
    model=moss-transcribe-diarize-pro
    file=@./audio.mp3
    diarize=true
    response_format=json
  3. Send your first request

    Multi-speaker transcription

    Request example
    curl -X POST "https://api.mosi.cn/v1/audio/transcriptions" \
      -H "Authorization: Bearer $MOSS_API_KEY" \
      -F "model=moss-transcribe-diarize-pro" \
      -F "file=@./audio.mp3" \
      -F "diarize=true" \
      -F "response_format=json"

    Streaming output

    Add stream=true to the same multipart request to read transcription events continuously via SSE. A streaming request cannot also pass async=true.

    curl -N -X POST "https://api.mosi.cn/v1/audio/transcriptions" \
      -H "Authorization: Bearer $MOSS_API_KEY" \
      -H "Accept: text/event-stream" \
      -F "model=moss-transcribe-diarize-pro" \
      -F "file=@./audio.mp3" \
      -F "diarize=true" \
      -F "stream=true" \
      -F "response_format=verbose_json"
  4. Retrieve the task result

    For synchronous calls, read results such as text and segments from the response; when using SSE, read through the transcript.text.done event. Passing async=true returns a task_id; query the task result via GET /v1/audio/tasks/{task_id}.

    Query the transcription task
    curl https://api.mosi.cn/v1/audio/tasks/$TASK_ID \
      -H "Authorization: Bearer $MOSS_API_KEY"
  5. Verify success

    Success indicator: you obtain a transcription result with speaker information. The success response may include segments, where each segment contains start, end, text, and speaker.

Next steps