Rivier/ Reference/ models

Models speech create

post/models/v1/audio/speech

Text spoken in a voice of the voice catalogue (the voices live sessions use), through a speech route: 16-bit 24 kHz PCM, a WAV file, 8 kHz mu-law for a telephone line, or Ogg Opus where the deployment has the encoder. Spoken a sentence at a time: stream to hear the first sentence before the rest is made, or ask for the sentences apart with their text to cache and reorder them. Each sentence is a call under the project's limits.

Before you call

Credential
Authorization: Bearer $KEY
Scope
models:write
Sdk
models.speech.create
Cli
models speech create

Request bodyapplication/json, required

  • modelstringrequired
    A speech route this project can call (GET /models/v1/models, kind speech) Pattern: ^[a-z][a-z0-9._-]{0,39}$.
  • inputstringrequired
    At most 5000 characters.
  • voicestringrequired
    A voice id from GET /voice/catalogue, the same voices live sessions use At most 40 characters.
  • languagestring
    Pattern: ^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$.
  • stylestring
    How to say it, in words: "warmly", "slowly and clearly" At most 200 characters.
  • formatstring
    pcm: 16-bit 24 kHz mono; wav: the same in a WAV file; mulaw: 8 kHz for a telephone line; opus: Ogg Opus One of: pcm, wav, mulaw, opus. Default: wav.
  • streamboolean
    Send the sound as each sentence is spoken Default: false.
  • sentencesboolean
    Answer each sentence apart, as JSON with its text and its sound, so it can be cached and reordered Default: false.
  • purposestring or null

Responses

  • 200text/event-stream
    Success

    string

  • 400application/json
    The request was malformed
    • errorstringrequired
    • messagestring
  • 401application/json
    No valid credential
    • errorstringrequired
    • messagestring
  • 403application/json
    The credential lacks the scope, origin or address
    • errorstringrequired
    • messagestring
  • 429application/json
    Over the key's rate limit; see Retry-After
    • errorstringrequired
    • messagestring

This page as Markdown