Speech Engine conversation WebSocket
Connect using the signed_url returned by the signed URL endpoint. The client sends microphone audio directly to AllModels and receives transcripts, response text, and synthesized audio.
/el/v1/convai/conversationConnect using the signed_url returned by the signed URL endpoint. The client sends microphone audio directly to AllModels and receives transcripts, response text, and synthesized audio.
Query Parameters
Opaque credential included in the signed URL.
Speech Engine id included by ElevenLabs-compatible clients.
Header Parameters
Response Body
application/json
application/json
application/json
import { readFile } from "node:fs/promises";import WebSocket from "ws";const audioChunk = await readFile("chunk.pcm");const ws = new WebSocket("wss://api.allmodels.io/el/v1/convai/conversation?conversation_signature=$CONVERSATION_SIGNATURE&agent_id=$SPEECH_ENGINE_ID");ws.on("open", () => { ws.send(JSON.stringify({ user_audio_chunk: audioChunk.toString("base64") }));});ws.on("message", (data, isBinary) => { if (isBinary) process.stdout.write(data); else console.log(JSON.parse(data.toString()));});ws.on("error", console.error);import asyncioimport base64import jsonimport osfrom pathlib import Pathimport websocketsasync def main(): async with websockets.connect( "wss://api.allmodels.io/el/v1/convai/conversation?conversation_signature=$CONVERSATION_SIGNATURE&agent_id=$SPEECH_ENGINE_ID", ) as socket: audio = base64.b64encode(Path("chunk.pcm").read_bytes()).decode("ascii") await socket.send(json.dumps({"user_audio_chunk": audio})) async for message in socket: print(message if isinstance(message, str) else f"{len(message)} audio bytes")asyncio.run(main())curl --http1.1 -i "https://api.allmodels.io/el/v1/convai/conversation?conversation_signature=$CONVERSATION_SIGNATURE&agent_id=$SPEECH_ENGINE_ID" \ -H "Connection: Upgrade" \ -H "Upgrade: websocket" \ -H "Sec-WebSocket-Version: 13" \ -H "Sec-WebSocket-Key: SGVsbG9BbGxNb2RlbHMhIQ=="import { Conversation } from "@elevenlabs/client";const conversation = await Conversation.startSession({ signedUrl, connectionType: "websocket"});// End the session when your UI is finished.await conversation.endSession();# pip install "elevenlabs[pyaudio]"import osfrom elevenlabs.client import ElevenLabsfrom elevenlabs.conversational_ai.conversation import Conversationfrom elevenlabs.conversational_ai.default_audio_interface import DefaultAudioInterfaceclient = ElevenLabs( api_key=os.environ["ALLMODELS_API_KEY"], base_url="https://api.allmodels.io/el",)conversation = Conversation( client=client, agent_id="seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A", requires_auth=True, audio_interface=DefaultAudioInterface(),)conversation.start_session()try: input("Press Enter to end the conversation...\n")finally: conversation.end_session()print(conversation.wait_for_session_end()){ "detail": { "message": "string", "status": "string", "property1": null, "property2": null }}{ "detail": { "message": "websocket upgrade required", "status": "websocket_upgrade_required" }}{ "detail": { "message": "string", "status": "string", "property1": null, "property2": null }}List account credit transactions GET
Lists organization-level credit events without payment-provider identifiers, reference IDs, or arbitrary metadata. Per-request usage debits are available from the activity endpoint instead.
ElevenLabs SDK-compatible TTS (HTTP streaming) POST
Generates speech with `client.textToSpeech.stream(...)` and returns audio as it is produced. The response `Content-Type` follows `output_format`: `mp3_*` → `audio/mpeg`, `pcm_*` → `audio/L16; rate=N`, otherwise `application/octet-stream`. Use `provider_options` for provider-specific settings. You can also pass supported options directly as query parameters. If both forms set the same option, `provider_options[<name>]=<value>` takes precedence. Recognized enum and boolean option values are case-insensitive and are normalized to each provider's wire spelling; free-form values such as prompts, keyterms, and voice IDs retain their original case.
