ShortGenius API
ShortGeniusDevelopers
  • Introduction
  • Quickstart
  • Authentication & Essentials
  • API reference
    • Videos
      • Draft video
      • Draft video from script
      • Draft video from URL
      • Draft quiz video
      • Draft news video
      • Create video
      • List videos
      • Get video
      • Generate video topics
    • Video series
      • Generate video topics
      • Create series
      • List series
      • Get series
    • Images
      • Create image
      • List images
      • Get image
      • Get image styles
    • Audio
      • Create speech
      • List audio
      • Get audio
      • List voices
      • Get voice
    • Music
      • List music genres
      • List music
    • Publishing
      • List connections
    • Administration
      • Get usage
      • Health check
  • Guides
    • Video Generation
    • Video Series
    • Image Generation
    • Audio Generation
    • Music
    • Publishing
    • Usage & Credits
  • Resources
    • Realtime logs
    • API keys
    • OpenAPI spec
    • TypeScript SDK
    • Python SDK
    • ShortGenius
Powered by GitBook
On this page
  1. API reference
  2. Audio

Create speech

PreviousAudioNextList audio

Last updated 3 months ago

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
400
Invalid request
application/json
401
Unauthorized request
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
}