allmodels.ioDocs
API ReferenceElevenLabs SDK

Create Speech Engine

Creates a reusable Speech Engine configuration that connects client audio to STT, forwards transcripts to your application, and streams synthesized responses back to the client.

POST/el/v1/speech-engine

Creates a reusable Speech Engine configuration that connects client audio to STT, forwards transcripts to your application, and streams synthesized responses back to the client.

Authorization

xi-api-key<token>

Tenant key (ElevenLabs SDK convention).

In: header

Query Parameters

stt[model]?string

AllModels streaming STT model. The router selects an eligible provider automatically.

stt[provider]?string

Optional STT provider pin. Omit to use automatic provider routing.

stt[provider_options][name]?string

Provider-specific STT setting with no standard Speech Engine field. Replace name with the option name; the JavaScript SDK accepts stt: { provider_options: { ... } }.

stt[input][name]?string

Portable STT setting with no standard Speech Engine field, such as turn_detection. Replace name with the setting name; the JavaScript SDK accepts stt: { input: { ... } }.

tts[model]?string

AllModels streaming TTS model. The router selects an eligible provider automatically.

tts[provider]?string

Optional TTS provider pin. Omit to use automatic provider routing.

tts[provider_options][name]?string

Provider-specific TTS setting with no standard Speech Engine field. Replace name with the option name; the JavaScript SDK accepts tts: { provider_options: { ... } }.

tts[input][name]?string

Portable TTS setting with no standard Speech Engine field. Supported names are text_buffer_mode, text_buffer_min_characters, text_buffer_target_characters, and text_buffer_max_characters.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

ElevenLabs-compatible Speech Engine configuration. Use standard ASR and TTS fields first. Use the stt and tts query extensions only to select non-ElevenLabs models or pass settings that have no standard Speech Engine field.

Response Body

application/json

application/json

application/json

application/json

application/json

Client
Language
import { writeFile } from "node:fs/promises";const response = await fetch("https://api.allmodels.io/el/v1/speech-engine?stt%5Bmodel%5D=deepgram%2Fnova-3&tts%5Bmodel%5D=cartesia%2Fsonic-3", {  method: "POST",  headers: { ...{ Authorization: `Bearer ${process.env.ALLMODELS_API_KEY}` }, "Content-Type": "application/json" },  body: JSON.stringify({  "name": "Voice agent",  "speech_engine": {    "ws_url": "wss://app.example.com/voice-agent"  },  "asr": {    "user_input_audio_format": "pcm_16000"  },  "tts": {    "voice_id": "YOUR_CARTESIA_VOICE_ID",    "agent_output_audio_format": "pcm_16000",    "speed": 1.1  },  "language": "en"})});if (!response.ok) throw new Error(`AllModels request failed: ${response.status}`);console.log(await response.json());
{  "speech_engine_id": "string",  "name": "string",  "speech_engine": {    "ws_url": "string",    "request_headers": {      "property1": "string",      "property2": "string"    }  },  "allmodels": {    "stt": {      "model_id": "string",      "provider": "string",      "provider_options": {        "property1": null,        "property2": null      },      "input": {        "property1": null,        "property2": null      }    },    "tts": {      "model_id": "string",      "provider": "string",      "provider_options": {        "property1": null,        "property2": null      },      "input": {        "property1": null,        "property2": null      }    }  },  "property1": null,  "property2": null}

{  "error": "missing_api_key"}

{  "detail": {    "message": "string",    "status": "string",    "property1": null,    "property2": null  }}
{  "detail": {    "message": "string",    "status": "string",    "property1": null,    "property2": null  }}
{  "detail": {    "message": "string",    "status": "string",    "property1": null,    "property2": null  }}