API reference
Text to speech
/v1/audio/speechSynthesizes speech and returns model-specific audio bytes on success. The selected model determines the default format. When file archival is enabled, response headers such as X-Gloop-File-Id/X-Gloop-Storage-Status describe the saving stage. Do not treat audio as JSON.
Authentication and permissions
Use your current GloopAPI key. Available models, capabilities and permissions depend on its catalog and the endpoint documentation.
Authorization: Bearer $GLOOP_API_KEYAuthentication schemes: BearerAuth
Request
Request body · application/json
- Type
- object
- Required fields
modelinputvoice
Request body required
modelstringRequiredinputstringRequiredText to synthesize; length limits depend on the selected model. There is no universal 4096-character limit.
voicestringRequiredSpecific support and limits depend on the selected model; no uniform defaults are guaranteed.
response_formatstringOptionalRequested audio output format; supported values and the format used when omitted depend on the selected model. The platform's general endpoint does not assign mp3 as a default.
speednumberOptionalSpecific support and limits depend on the selected model; no uniform defaults are guaranteed.
instructionsstringOptionalModel-specific speech instructions.
stream_formatstringOptionalModel-specific streaming format; SSE support is not guaranteed for every model.
Responses and errors
HTTP 200
Audio generated successfully
audio/mpeg
- Type
- string
- Format
- binary
- Description
- Audio byte stream; save as a file.
{
"type": "string",
"format": "binary",
"description": "音频字节流,保存为文件。"
}audio/wav
- Type
- string
- Format
- binary
- Description
- Audio byte stream; save as a file.
{
"type": "string",
"format": "binary",
"description": "音频字节流,保存为文件。"
}audio/ogg
- Type
- string
- Format
- binary
- Description
- Audio byte stream; save as a file.
{
"type": "string",
"format": "binary",
"description": "音频字节流,保存为文件。"
}audio/flac
- Type
- string
- Format
- binary
- Description
- Audio byte stream; save as a file.
{
"type": "string",
"format": "binary",
"description": "音频字节流,保存为文件。"
}audio/aac
- Type
- string
- Format
- binary
- Description
- Audio byte stream; save as a file.
{
"type": "string",
"format": "binary",
"description": "音频字节流,保存为文件。"
}application/octet-stream
- Type
- string
- Format
- binary
- Description
- Audio byte stream; save as a file.
{
"type": "string",
"format": "binary",
"description": "音频字节流,保存为文件。"
}HTTP 401
The key is missing, invalid, expired, or revoked.
application/json
- Type
- object
- Required fields
error
errorobjectRequirederror child fields (4)
codestringOptionalmessagestringOptionaltypestringOptionalrequest_idstringOptional
HTTP 403
Insufficient IP, account, model, or tool permissions.
application/json
- Type
- object
- Required fields
error
errorobjectRequirederror child fields (4)
codestringOptionalmessagestringOptionaltypestringOptionalrequest_idstringOptional
HTTP 429
Request/queue rate limit.
application/json
- Type
- object
- Required fields
error
errorobjectRequirederror child fields (4)
codestringOptionalmessagestringOptionaltypestringOptionalrequest_idstringOptional
HTTP 500
Internal authentication or data storage failure.
application/json
- Type
- object
- Required fields
error
errorobjectRequirederror child fields (4)
codestringOptionalmessagestringOptionaltypestringOptionalrequest_idstringOptional