DEVELOPER TOOLS
API Integration with EA BRAIN
Quickly build and deploy custom voice agents for your website or product with our comprehensive API suite
ea-brain-example.js
// 1. Install EA BRAIN package
// npm install @eleven-agents/ea-brain
// 2. Import and initialize
import { ElevenAgents } from '@eleven-agents/ea-brain';
async function startConversation() {
// First, check for microphone permission
const hasMicPermission = await requestMicrophonePermission();
if (!hasMicPermission) {
console.warn("Microphone permission is required for the conversation.");
return;
}
// Initialize with your API key
const signedURL = await getSignedUrl();
// Create conversation with session
const conversation = await ElevenAgents.Conversation.startSession({
signedUrl: signedURL,
// Use agentID directly for public agents
agentId: "ea_customer_service_v2"
});
// Handle connection events
conversation.onConnect = () => {
console.log("Connected!");
updateStatus(true);
startButton.disabled = true;
endButton.disabled = false;
};
// Handle disconnection
conversation.onDisconnect = () => {
updateStatus(false);
toggleButtons(false);
};
}
REST API
Simple REST endpoints for seamless integration with your existing systems. Full documentation with examples available.
GET, POST, PUT, DELETE
WebSocket API
Real-time bidirectional communication for dynamic chat applications and live agent interactions with minimal latency.
wss://api.elevenagents.com/v1/ws
Multiple SDKs
Native SDKs for JavaScript, Python, React, and Swift to integrate voice agents into any application or platform.
npm install @eleven-agents/ea-brain
Custom Agents
Create and customize voice agents with specific knowledge, personalities, and capabilities for your use case.
100+ voice options available