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.

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.

    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.

    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...