API Platform

Quickstart: Single-Speaker Speech Generation

Synthesize a piece of text into speech with a single voice, suited to narration, customer-service scripts, announcements, and audio content generation.

Workflow

POST /v1/audio/speech

Endpoint

moss-tts-1.5-flash

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

    Fill in the text and the voice. For streaming, use stream=true.

    {
      "model": "moss-tts-1.5-flash",
      "input": "Welcome to the Moss API.[pause 0.8s]Now generating speech.",
      "voice_id": "94aa4989-c7e9-5007-ae42-ab401823e6c9",
      "response_format": "mp3",
      "delivery_method": "url"
    }
    

    Preview a voice and copy its Voice ID into your request.

    15 voices

    Browse more voices in the Mossland voice library.

    PreviewVoice nameVoice IDDescriptionLanguage
    Mambo (Accented)c6c0a40a-ea82-4468-9a21-333d3c4a76f6Anime, Character Dubbing · Brisk, Cute, FunnyChinese · Mandarin
    Ming Taizu (Hongwu Emperor)f80b6698-0066-430b-88a0-f0fb8796db34Character Dubbing, Film & TV · Aloof, Calm, Domineering CEOChinese · Mandarin
    VOX AKUMAddc6e38b-6f55-4415-b21b-a88cad2cc1d9Podcast, Social Media · Lazy, Magnetic, ProfessionalEnglish · British English
    Li Bai7662a8a1-700c-466a-b66b-57ece9e2e231Film & TV, People · Ancient Style, PassionateChinese · Mandarin
    Jake (Narrator)f9a1416b-d006-4b77-9581-8f0e8ec1e401Character Dubbing, People · Calm, Magnetic, ProfessionalEnglish · British English
    Experienced Female Teacherfaf7f550-0627-4fc6-8db0-d3bfdad49358Education, Social Media · Aloof, NaturalChinese · Mandarin
    Youthful Male Voicefe85a513-9bf3-4ef7-aa0b-8b2d11e4db93Audiobook, Narration · Gentle, Magnetic, NaturalChinese · Mandarin
    Male History Narrator0804710c-8e5e-4b67-acda-5785ef13c309Audiobook, Film & TV Commentary · Calm, MagneticChinese · Mandarin
    Elegant British Lady9d1e88e9-3b9c-4992-a414-7a1cb3ff7ab5Film & TV, People · Gentle, Magnetic, NaturalEnglish · British English
    Bright & Lively Female Voice806c9695-6160-404e-8722-4f788d935af3Customer Service, Trending Play · Brisk, Lively, NaturalChinese · Mandarin
    Classical Chinese Poetry Recitation2fdf194e-c16e-4587-9027-0d3464e09b4eEducation, Narration · Calm, Magnetic, ProfessionalChinese · Mandarin
    Forbidden City Documentary133bd03b-d717-4a55-8974-7ffc9afc1b51Documentary, Narration · Calm, Magnetic, ProfessionalChinese · Mandarin
    Brother Hu (Northeast China)26838557-6890-4505-bc7c-e8198443a141Entertainment, Social Media · Funny, LazyChinese · Mandarin
    Melancholy Autumn19411508-8731-4b68-901d-7e4b8a98e23fFilm & TV, People · Gentle, LazyChinese · Mandarin
    Agriculture & Rural Affairs Narrator944eb93b-3820-49f3-b2c0-4e37a31d1161Documentary, Narration · Brisk, Magnetic, ProfessionalChinese · Mandarin
  3. Send the first request

    Send a request to POST /v1/audio/speech. Non-streaming returns JSON and a result URL synchronously when delivery_method=url; streaming returns an SSE event stream when stream_format=sse.

    curl https://api.mosi.cn/v1/audio/speech \
      -H "Authorization: Bearer $MOSS_API_KEY" \
      -H "Content-Type: application/json" \
      -d @request.json
    
  4. Retrieve the result

    When delivery_method=url, read the result URL from the JSON of the synchronous response. If you pass async=true, the endpoint first returns a task_id, which you then use to query the 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 result audio (delivery_method=audio) or a result URL (delivery_method=url), and can download or play the generated audio.

Control pauses

input supports the inline pause marker [pause X.Ys], which inserts a pause at the specified position. X.Y is the pause duration in seconds and supports values from 0.1 to 10.0, for example [pause 1.5s]. Pause control applies to both non-streaming and streaming calls.

Pause example
{
  "model": "moss-tts-1.5-flash",
  "input": "Please note[pause 1.5s]After payment succeeds, the system automatically sends a confirmation message.",
  "voice_id": "<voice_id>",
  "response_format": "mp3",
  "delivery_method": "url"
}

Short pauses may overlap with punctuation and the model's natural rhythm. For a clearly audible pause, use 1.0s or longer. Use the standard format [pause 1.5s].

Next steps