Audio Transcription
Convert audio into text — ideal for meetings, interviews, voice messages, and media content processing.
/v1/audio/transcriptionsmoss-transcribe-1.0Create 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>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.FieldTypeRequirementDescriptionCurrently, use
moss-transcribe-1.0.A local audio file uploaded using
multipart/form-data.Transcription result format. Available values are
jsonandtext; the default isjson.Request body model=moss-transcribe-1.0 file=@./audio.mp3 response_format=jsonCorresponding 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"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" }'Retrieve the task result
For synchronous calls, read
textdirectly from the response. Passingasync=truereturns atask_id; query the task result viaGET /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"Verify success
Success indicator: you obtain the transcribed text.