API Platform

Multi-Speaker Transcription

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

Workflow

POST /v1/audio/transcriptions

Endpoint

moss-transcribe-diarize

Model

  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.

    Example
    export MOSS_API_KEY="<your-api-key>"
    
  2. Prepare the request input

    Multi-speaker transcription reuses the transcription endpoint: set model to moss-transcribe-diarize and pass diarize=true, providing the multi-speaker audio to transcribe.

    file / file_id / url / audio_url: audio to transcribe model: moss-transcribe-diarize diarize: true

    request.json
    {
      "model": "moss-transcribe-diarize",
      "file_id": "<file_id>",
      "diarize": true,
      "response_format": "json"
    }
    
  3. Send your first request

    Send a request to POST /v1/audio/transcriptions; a synchronous request returns the transcription result with speaker information directly.

    curl https://api.mosi.cn/v1/audio/transcriptions \
      -H "Authorization: Bearer $MOSS_API_KEY" \
      -H "Content-Type: application/json" \
      -d @request.json
    
  4. Retrieve the result

    A synchronous request returns the result directly. If you pass async=true, the endpoint first returns a task_id, which you then use to query the transcription task.

    Query the transcription task
    curl https://api.mosi.cn/v1/audio/transcriptions/$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