For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DiscordPlatform
DocumentationIntegrationsAPI referenceSDKsChangelog
DocumentationIntegrationsAPI referenceSDKsChangelog
  • API Reference
      • POSTCreate embeddings
      • POSTSpeech to text
      • POSTText to speech
      • GETRetrieve AssemblyAI transcript
  • Reference
    • Filters API Reference
LogoLogo
DiscordPlatform
API ReferenceMultimodal

Text to speech

POST
https://api.respan.ai/api/audio/speech
POST
/api/audio/speech
$curl -X POST https://api.respan.ai/api/audio/speech \
> -H "Authorization: Bearer sk_live_xxxxx" \
> -H "Content-Type: application/json" \
> -d '{
> "model": "tts-1",
> "input": "Hello, how are you?",
> "voice": "alloy"
>}'
Convert text to speech through the Respan gateway with automatic logging.
Was this page helpful?
Previous

Retrieve AssemblyAI transcript

Next
Built with

Headers

AuthorizationstringRequired

Bearer token. Use Bearer YOUR_API_KEY.

X-Data-Respan-ParamsstringOptional

Base64-encoded JSON object of Respan parameters. Legacy X-Data-Keywordsai-Params is still accepted.

Request

This endpoint expects an object.
modelenumRequired
TTS model.
Allowed values:
inputstringRequired
Text to generate audio for. Max 4096 characters.
voiceenumRequired
Voice to use.
response_formatenumOptionalDefaults to mp3
Audio output format.
speeddoubleOptionalDefaults to 1

Audio speed (0.25 to 4.0).

customer_credentialsobjectOptional

Per-customer LLM provider credentials.

disable_logbooleanOptionalDefaults to false

When true, omits input/output from the log. Metrics still recorded.

metadataobjectOptional

Custom key-value metadata.

customer_identifierstringOptional
End user identifier.
thread_identifierstringOptional
Conversation thread ID.

Response

Audio content in the requested format.

Errors

401
Unauthorized Error