Usage
We follow the OpenAI signature where you can send the input text and the voice option as a part of the API request. All the output formatsmp3, opus, aac, flac, and pcm are supported. Portkey also supports real time audio streaming for TTS models.
Here’s an example:
- OpenAI NodeJS
- OpenAI Python
- Python SDK
- cURL
SSE Streaming
OpenAI and Azure OpenAI support Server-Sent Events (SSE) streaming for the speech endpoint. Setstream_format to "sse" to receive audio data as a stream of events:
- Python
- cURL
Google Vertex AI TTS
Google Vertex AI offers Gemini TTS models with advanced features like multi-speaker synthesis and style control. Portkey supports two methods:- Chat Completions with
speech_config- Use Gemini TTS through the chat completions endpoint - Audio Speech endpoint - OpenAI-compatible
/audio/speechendpoint
- Chat Completions
- Audio Speech
Portkey is now PRISMA AIRS AI Gateway. See it in action.
Contact Us

