Create speech (PydanticAI - OpenAI TTS)
Generates audio from text using OpenAI TTS via PydanticAI.
AuthorizationBearer <token>
Bearer token authentication. Use your MPilot virtual-key JWT or admin JWT.
Virtual keys (prefixed with sk-bf-) can also be passed here.
In: header
modelstring
Model identifier (e.g., tts-1, tts-1-hd)
inputstring
Text to convert to speech
voice?string
Voice to use
Value in
"alloy" | "echo" | "fable" | "onyx" | "nova" | "shimmer"response_format?string
Value in
"mp3" | "opus" | "aac" | "flac" | "wav" | "pcm"speed?number
Range
0.25 <= value <= 4stream_format?string
Set to 'sse' for streaming
Value in
"sse"fallbacks?array<string>
Response Body
curl -X POST "https://loading/{AI_GATEWAY_URL}/pydanticai/v1/audio/speech" \ -H "Content-Type: application/json" \ -d '{ "model": "tts-1", "input": "string" }'"string"{
"event_id": "string",
"type": "string",
"is_bifrost_error": true,
"status_code": 0,
"error": {
"type": "string",
"code": "string",
"message": "string",
"param": "string",
"event_id": "string"
},
"extra_fields": {
"provider": "openai",
"model_requested": "string",
"request_type": "string"
}
}{
"event_id": "string",
"type": "string",
"is_bifrost_error": true,
"status_code": 0,
"error": {
"type": "string",
"code": "string",
"message": "string",
"param": "string",
"event_id": "string"
},
"extra_fields": {
"provider": "openai",
"model_requested": "string",
"request_type": "string"
}
}