API Platform

Audio Transcription

Convert audio into text — ideal for meetings, interviews, voice messages, and media content processing.

Workflow

POST /v1/audio/transcriptions

Endpoint

moss-transcribe

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

    Set model to moss-transcribe and provide the audio to transcribe (file, file_id, url, or audio_url).

    file / file_id / url / audio_url: audio to transcribe model: moss-transcribe response_format: json / text, etc.

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

    Send a request to POST /v1/audio/transcriptions; a synchronous request returns the transcription result 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 transcription 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 the transcribed text.

Next steps