Quickstart
Make your first API call with a minimal request. You only need an API Key and a valid voice_id.
Get an API Key
Go to the API Key Management Platform to create an API Key. The complete key is shown only once. Store it in a server-side environment variable or secret manager, and never put it in browser code or a public repository.
Configure an environment variable
For local development, configure the API Key as an environment variable.
export MOSS_API_KEY="<your_api_key>"Make your first request
The following call uses the single-speaker speech endpoint. You can obtain a voice_id from List Voices or Create Voice.
curl -X POST "https://api.mosi.cn/v1/audio/speech" \
-H "Authorization: Bearer $MOSS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "moss-tts-1.5-flash",
"input": "Welcome to Moss API. [pause 0.8s]Now let us generate speech.",
"voice_id": "94aa4989-c7e9-5007-ae42-ab401823e6c9",
"response_format": "mp3",
"delivery_method": "url"
}'Read the result
This request uses delivery_method=url. After it succeeds, read the url field to get the generated audio. For an asynchronous request, use the returned task_id with GET /v1/audio/tasks/{task_id} to query the final status and result.
Next steps
View the model list
Confirm model IDs, capabilities, and versions.
Integrate by scenario
Explore transcription, multi-speaker speech, and multimodal examples.
View request parameters
Review the complete speech request and response contract.
Errors and limits
Troubleshoot failed calls and request limits.