Synthesize Speech
synthesize_speechGenerate speech from input. Consumes usage in the connected project; live usage can be billed. Before generation, use whoami to verify project, environment, scopes, credit and limits. Returns inline MCP audio or an expiring resource_link, never a local file path. Host playback support varies. For integration code only, use get_started.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"input": "Your appointment is confirmed.",
"response_format": "wav"
},
"name": "synthesize_speech"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Text to synthesize. Maximum 2000 characters; longer text answers `400 input_too_long` naming the limit and the length you sent. Split longer scripts into several requests. | |
| model | No | Defaults to pyai-speak. | |
| voice | No | Voice id from list_voices. Omit for the account default. | |
| response_format | No | Defaults to mp3. | mp3 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True for success; false for an error. Success requires mime_type and bytes; errors require error and omit audio metadata. | |
| code | Yes | ok on success; a non-ok error code on failure. | |
| data | No | Optional backward-compatible alias: audio metadata on success, or an error object on failure; excludes outcome fields. | |
| bytes | No | Audio byte count, not base64 length. | |
| error | No | ||
| docs_url | Yes | Integration and error-handling guide. | |
| audio_url | No | Expiring HTTPS download capability. Present with expires_at on the hosted OAuth server; absent for inline-only loopback HTTP. | |
| mime_type | No | MIME type of the audio content. | |
| expires_at | No | Download expiry as Unix milliseconds, not seconds. Does not guarantee access after connection revocation. |