Create speech

Create speech

post

Generate speech from provided text.

Authorizations
Body
textstringRequired

The text to generate speech from.

localestring · enumOptional

The locale of the text.

Default: autoPossible values:
voice_idstringRequired

The voice to use for speech generation. See the List voices endpoint.

wait_for_generationbooleanOptional

If false, this endpoint immediately returns the incomplete speech record, and you can poll the Get speech endpoint until the task completes. If true, this endpoint waits until the speech generation completes, then returns the complete speech record. Defaults to false.

Default: false
Responses
200
Successful response
application/json
post
POST /api/v1/audio/speech HTTP/1.1
Host: shortgenius.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 77

{
  "text": "text",
  "locale": "auto",
  "voice_id": "text",
  "wait_for_generation": false
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "text",
  "updated_at": null,
  "url": null,
  "user_id": "123e4567-e89b-12d3-a456-426614174000",
  "transcript": {
    "words": [
      {
        "text": "text",
        "start": 1,
        "end": 1,
        "confidence": 1
      }
    ]
  },
  "state": "pending",
  "text": "text",
  "locale": "af-ZA",
  "voice": {
    "id": "text",
    "name": "text",
    "description": null,
    "avatar_url": null,
    "flag_url": null,
    "tags": {
      "language": null,
      "accent": null,
      "age": null,
      "category": null,
      "gender": null,
      "tone": null,
      "useCase": null
    },
    "preview_url": null,
    "locale": "af-ZA",
    "source": "Cartesia"
  },
  "duration": null,
  "lufs": null
}

Last updated