POST /v1/audio/speech
OpenAI-compatible text-to-speech against an installed local runtime that serves the speech modality. The response is binary audio in the requested `response_format`. Pass a `model` id from `GET /v1/models`.

Authentication

Bearer Token (b3iq_local) API Key (header: X-B3IQ-API-Key) Bearer Token API Key (header: X-B3IQ-Router-Signature)

Request Body required

application/json
model string REQUIRED
input string REQUIRED
voice string
response_format string
Audio container, e.g. mp3, wav, or opus.
speed number
runtime_id string

Responses

200 Synthesized audio bytes in the requested format.
audio/mpeg
string (binary)
default B3IQ-native problem response.
curl -X POST 'http://127.0.0.1:8831/v1/audio/speech' \  -H 'Authorization: Bearer YOUR_API_TOKEN' \  -H 'Content-Type: application/json' \  -d '{  "model": "string",  "input": "string",  "voice": "string",  "response_format": "string",  "speed": 0,  "runtime_id": "string"}'
const response = await fetch('http://127.0.0.1:8831/v1/audio/speech', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN",      "Content-Type": "application/json"  },  body: JSON.stringify({    "model": "string",    "input": "string",    "voice": "string",    "response_format": "string",    "speed": 0,    "runtime_id": "string"  })});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('http://127.0.0.1:8831/v1/audio/speech', headers=headers, json={  "model": "string",  "input": "string",  "voice": "string",  "response_format": "string",  "speed": 0,  "runtime_id": "string"})print(response.json())
200 Response
"<binary>"
Ask a question... ⌘I