curl --request POST \
--url https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/voice/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({voice: '<string>'})
};
fetch('https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/voice/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/voice/preview"
payload = { "voice": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"audio": "<string>",
"characters": 123,
"cost": 123
}Listen to a voice of the catalog
One short sentence read by a voice of a speech model, returned as an
MP3 data URL a browser plays as is (the listen buttons of AI
Governance). voice must match a voice of the catalog: only the
catalog’s ids reach the provider. Platform administrators hear any
voice of the catalog; other callers, the voices their organization may
use (visible to it and in its allowed models) and that their role and
API key grant.
Rate limited per user (config.voice.quotas.per_user.previews_per_hour,
30 by default). The characters and their cost
(pricing.per_1m_characters) are counted in analytics.llm.voice.
Requires the llm-gateway:models:audio-transcriptions permission.
curl --request POST \
--url https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/voice/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({voice: '<string>'})
};
fetch('https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/voice/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/voice/preview"
payload = { "voice": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"audio": "<string>",
"characters": 123,
"cost": 123
}Authorizations
User-bound credential carrying an identity: either a session JWT
or a user access token (at:*) generated from the user settings UI.
Send as Authorization: Bearer <token>.
Org API keys (iak_*) are not accepted here - they carry
no user identity. Use the x-prismeai-api-key header instead
(see OrgApiKeyAuth).
Body
Was this page helpful?