Console

Audio Transcription

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

Endpoint
POST/v1/audio/transcriptions
Model name
moss-transcribe-1.0
  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 audio file and submit the file and transcription parameters together using multipart/form-data; you do not need to call the file upload endpoint first.

    FieldTypeRequirementDescription
    model: stringRequired

    Currently, use moss-transcribe-1.0.

    file: fileRequired

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

    response_format: stringOptional

    Transcription result format. Available values are json and text; the default is json.

    Request body
    model=moss-transcribe-1.0
    file=@./audio.mp3
    response_format=json

    Corresponding complete cURL:

    curl -X POST "https://api.mosi.cn/v1/audio/transcriptions" \
      -H "Authorization: Bearer $MOSS_API_KEY" \
      -F "model=moss-transcribe-1.0" \
      -F "file=@./audio.mp3" \
      -F "response_format=json"
  3. Send your first request

    Send a request to the scenario endpoint. A synchronous request returns transcription text or speaker segments; an asynchronous request returns a task object.

    Request example
    curl https://api.mosi.cn/v1/audio/transcriptions \
      -H "Authorization: Bearer $MOSS_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "model": "moss-transcribe-1.0",
      "file_id": "<file_id>",
      "response_format": "json"
    }'
  4. Retrieve the task result

    For synchronous calls, read text directly from the response. 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 the transcribed text.

Next steps