1. API reference
MyVocal AI语音大模型API文档
English
  • 中文
  • English
  • 文字转语音大模型
    • API reference
      • Voice management
        • List voices
        • Create a voice
        • Delete a voice
      • HTTP synthesis
        • Streaming HTTP synthesis
        • Non-streaming HTTP synthesis
      • WebSocket synthesis
        • Standard TTS · Single connection
        • Standard TTS · Multiple contexts
        • Dialogue · Multiple contexts
      • Usage and request history
        • Get master key usage
        • Look up a request by ID
        • Get usage by voice
      • Sub-key management
        • Create a sub-key
        • List sub-keys
        • Get sub-key details
        • Update a sub-key
        • Get sub-key usage
    • Overview and quickstart
      • Models
      • Choose a model and endpoint
      • Supported languages
      • Audio formats and playback
      • FAQ
      • SDKs and examples
  • 金融行业定制TTS模型
    • Skyblight text to speech
      • Streaming text to speech
      • Non-streaming text to speech
      • List voices
      • Delete a voice
      • Create a voice
      • Get usage
    • Full-duplex communication
      • WebSocket integration guide
      • V2 bidirectional streaming synthesis (WebSocket)
  • 语音转文字ASR
    • Overview and quickstarts
      • Realtime transcription quickstart
      • File transcription quickstart
      • Models and capabilities
      • Changelog
    • API reference
      • Realtime transcription over WebSocket
      • Create a file transcription
        POST
      • Get ASR usage
        GET
  • 企业客户声音定制服务
    • Your custom brand voice
  1. API reference

Create a file transcription

POST
https://openapi.myvocal.ai/asr/v1/transcriptions
Upload a recording and receive its transcript and related information. Start with the file transcription quickstart.

Authentication and input#

Pass your enterprise ASR key in the API-Key header. Use multipart/form-data for the request body.
model_id is required. Provide exactly one input: file for a local upload or cloud_url for a remote recording.
See Models and capabilities. The quickstart for the medical model echo_v2_medical uses a file upload.

Number formatting and multilingual recordings#

File model echo_v2 only.
For example, a meeting may be mainly in English with some Chinese and Spanish, and your order system may require digits. Set the main language for echo_v2 and submit one additional_language_codes form field for each additional language.
number_style=digits returns digits. words spells numbers out in the spoken language. Omit the field to let the model choose.
For a hosted recording, replace file with cloud_url, for example --form-string 'cloud_url=https://example.com/sample.wav'.

Configuration by use case#

What you want to doHow to configure itApplies to
Upload an existing recordingSet model_id in the form and upload file.All four file models
Choose how numbers appearnumber_style=digits returns digits. number_style=words spells them in the spoken language. Omit to let the model choose.echo_v2
Transcribe a multilingual meetingSet the main language and repeat additional_language_codes for each additional language.echo_v2
Distinguish speakersSet speaker_diarization=true and read speaker IDs from words[].speaker_id.Verified with echo_v2
Use hotwords, entity detection or transcript cleanupUse hotwords, content_detection or clean_transcript, respectively.echo_v1
For speaker diarization use speaker_diarization, or its alias diarize. speakers is the expected maximum number of speakers. To use detect_speaker_roles, enable speaker diarization or supply a positive speakers value. Use separate_channel to transcribe channels separately. It cannot be combined with role detection.

Response#

A successful response returns HTTP 200. Read the full transcript from text and word details from words. With speaker features enabled, entries may contain speaker_id. Allow for missing and additional fields as model and options change.
See the response definition and examples below.

Error handling#

ResponseMeaningWhat to do
HTTP 401Missing or invalid authenticationCheck the API-Key header.
HTTP 400 / missing_inputNo audio inputUpload a file or provide an accessible recording URL.
HTTP 400 / validation_errorInvalid model or parametersRead the error message and check the named field and parameter combination.
An invalid model ID returns HTTP 400. Read detail.status for the category and detail.message for the reason.
{"detail":{"status":"validation_error","message":"model_id: invalid model_id"}}
Read the returned body for other errors. It may contain an error field.

Billing and usage#

File transcription is billed on the full recording duration, including silence, in seconds. Pricing follows your enterprise agreement. See Get usage for account statistics.

请求参数

Header 参数

Body 参数multipart/form-data

返回响应

🟢200Success
application/json
Successful response.
Bodyapplication/json

请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location 'https://openapi.myvocal.ai/asr/v1/transcriptions' \
--header 'API-Key: YOUR_API_KEY' \
--form 'model_id="echo_v2"' \
--form 'file=@"sample.wav"'
响应示例响应示例
Example transcription response.
{
  "language": "en",
  "confidence_score": 0.98,
  "text": "Hello.",
  "words": [
    {
      "text": "Hello.",
      "start_time": 0,
      "end_time": 0.5,
      "confidence_score": 0.98,
      "token_type": "word"
    }
  ]
}
上一页
Realtime transcription over WebSocket
下一页
Get ASR usage
Built with