Skip to main content
POST
/
v1
/
agents
/
{agentId}
/
generate-audio
Generate a TTS audio preview
curl --request POST \
  --url https://api.us.poly.ai/v1/agents/{agentId}/generate-audio \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "text": "<string>",
  "language": "<string>",
  "config": {},
  "provider": "<string>",
  "storeOnS3": true
}
'
{
  "url": "<string>",
  "text": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.poly.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Path Parameters

agentId
string
required

Body

application/json

Synthesize a short audio preview for a given voice and text. Useful for auditioning a voice or tuning settings before deploying.

text
string
required

Text to synthesize

language
string
required

BCP-47 language tag, e.g. en-US

config
object
required

Provider-specific synthesis config. Typically includes the voice ID and any tuning overrides accepted by the provider.

provider
string

TTS provider key (e.g. eleven_labs, cartesia). Defaults to eleven_labs.

storeOnS3
boolean

When true, store the audio in S3 and return a presigned URL. When false or omitted, returns a short-lived URL only.

Response

URL to the generated audio

Generated audio preview.

url
string
required

URL of the generated audio file

text
string
required

The text that was synthesized

Last modified on May 22, 2026