Skip to main content

Generate audio from text

POST 

/api/v2/Audio/generate

Generates speech audio from the provided text using a text-to-speech model and returns a public URL to the generated audio file. The model can be selected by model id or by model code + vendor. The voice is optional; when not provided a default voice is used. A raw vendor voice id can be sent instead, to use a voice available in the tenant's own vendor account.

Request

Query Parameters

    culture string

    Use this param to override the culture of the response. Options: - en (default) - es

Body

The audio generation request containing the text, the model selection, and an optional voice, voice id and speed.

    text stringrequired

    Possible values: non-empty and <= 4000 characters

    The text to convert into speech.

    voice stringnullable

    Optional voice to use. When not provided, the vendor's default voice is used.

    voiceId stringnullable

    Possible values: <= 128 characters

    Optional raw vendor voice id, to use a voice available in the tenant's own vendor account. Takes precedence over voice.

    speed floatnullable

    Optional speed of the generated audio. Ignored by the models that don't accept a speed; otherwise defaults to 1 when not provided and is clamped to the model's accepted range.

    userIdentifier stringnullable

    Possible values: <= 256 characters

    Optional user identifier for tracking and cost management purposes.

    channel stringnullable

    Possible values: <= 64 characters

    The channel used in the execution.

    aiModelId uuidnullable

    The unique identifier of the AI model to use. Used instead of Vendor and ModelCode.

    modelCode stringnullable

    The model code to use. Used together with Vendor when AIModelId is not provided.

    vendor stringnullable

    The vendor of the model to use. Used together with ModelCode when AIModelId is not provided.

Responses

Returns the audio generation result including the public audio URL.

Schema

    instanceId uuid
    audioUrl stringnullable

    cost

    object

    amount double
    currency stringnullable
Loading...