🤖 Agents

2installs

This skill helps you build and manage ElevenLabs voice AI agents with multi-LLM support, tools, and real-time conversation across platforms.

QUICK INSTALL
npx playbooks add skill elevenlabs/skills --skill agents

Agents instructions

ElevenLabs Agents Platform

Build voice AI agents with natural conversations, multiple LLM providers, custom tools, and easy web embedding.

> Setup, before writing any code: if ELEVENLABS_API_KEY isn't set for this project, run npx -y @elevenlabs/cli@latest onboard init from the app's folder first and follow what it prints: it signs the user in and stores a key for the project, so nobody copies one by hand. When the user approved in the browser, that also signed the ElevenLabs CLI in, so don't run elevenlabs auth login after it. When they added the key by hand (on a remote machine), or a CLI command answers 401, load the env file into the command instead, for example (set -a && . ./.env.local && set +a && npx -y @elevenlabs/cli@latest agents list); the CLI reads a .env on its own. Otherwise see the [Installation Guide](references/installation.md) for CLI and SDK setup.

Quick Start with CLI

The ElevenLabs CLI is the recommended way to create and manage agents:

# Install CLI and authenticate. After onboarding, skip these two lines and run each
# command below through npx instead, e.g. `npx -y @elevenlabs/cli@latest agents init`
npm install -g @elevenlabs/cli
elevenlabs auth login

# Initialize project and create an agent
elevenlabs agents init
elevenlabs agents add "My Assistant" --template default

# Push to ElevenLabs platform
elevenlabs agents push

Available templates: default, minimal, voice-only, text-only, customer-service, assistant

Once the agent exists, give the user its links: they can talk to it at https://elevenlabs.io/app/talk-to?agent_id=<agent-id> and edit it at https://elevenlabs.io/app/agents/agents/<agent-id>. On a data residency account, use its region's host instead of elevenlabs.io, such as eu.residency.elevenlabs.io. The talk-to page only opens public agents, which is the default; for an agent with authentication enabled, give only the dashboard link.

Python

from elevenlabs import ElevenLabs

client = ElevenLabs()

agent = client.conversational_ai.agents.create(
    name="My Assistant",
    conversation_config={
        "agent": {
            "first_message": "Hello! How can I help?",
            "language": "en",
            "prompt": {
                "prompt": "You are a helpful assistant. Be concise and friendly.",
                "llm": "gemini-3.5-flash",
                "temperature": 0.7
            }
        },
        "tts": {"voice_id": "JBFqnCBsd6RMkjVDRZzb"}
    }
)

JavaScript

import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
const client = new ElevenLabsClient();

const agent = await client.conversationalAi.agents.create({
  name: "My Assistant",
  conversationConfig: {
    agent: {
      firstMessage: "Hello! How can I help?",
      language: "en",
      prompt: {
        prompt: "You are a helpful assistant.",
        llm: "gemini-3.5-flash",
        temperature: 0.7
      }
    },
    tts: { voiceId: "JBFqnCBsd6RMkjVDRZzb" }
  }
});

CLI

The CLI reads ELEVENLABS_API_KEY from the environment automatically:

elevenlabs agents create \
  --json '{"name": "My Assistant", "conversation_config": {"agent": {"first_message": "Hello!", "language": "en", "prompt": {"prompt": "You are helpful.", "llm": "gemini-3.5-flash"}}, "tts": {"voice_id": "JBFqnCBsd6RMkjVDRZzb"}}}'

Starting Conversations

Authenticated WebRTC: Request a session token from your backend. The response includes both
the token and the conversation ID:

session = client.conversational_ai.conversations.get_webrtc_token(
    agent_id="your-agent-id",
)
print(session.token, session.conversation_id)

Server-side (Python): Get signed URL for client connection:

signed_url = client.conversational_ai.conversations.get_signed_url(
    agent_id="your-agent-id",
    environment="staging",
)

Client-side (JavaScript):

import { Conversation } from "@elevenlabs/client";

const conversation = await Conversation.startSession({
  agentId: "your-agent-id",
  environment: "staging",
  overrides: { asr: { keywords: ["ElevenLabs", "TechCorp"] } },
  onMessage: (msg) => console.log("Agent:", msg.message),
  onUserTranscript: (t) => console.log("User:", t.message),
  onPing: (event) => console.log("Estimated latency:", event.ping_ms),
  onContextUsage: ({ model, context_tokens, context_limit_tokens }) =>
    console.log(`${model}: ${context_tokens}/${context_limit_tokens} context tokens`),
  onError: (e) => console.error(e)
});

React Hook: Wrap hook consumers in ConversationProvider. Prefer granular hooks such as
useConversationControls and useConversationStatus for session controls and UI state;
useConversation remains available as the convenience all-in-one hook. Pass provider-level
callbacks such as onError when you want React to handle conversation errors in one place.

import {
  ConversationProvider,
  useConversationControls,
  useConversationStatus,
} from "@elevenlabs/react";

function Agent({ signedUrl }: { signedUrl: string }) {
  const { startSession, endSession } = useConversationControls();
  const { status } = useConversationStatus();

  if (status === "connected") {
    return <button onClick={endSession}>End conversation</button>;
  }

  return (
    <button onClick={() => startSession({ signedUrl })}>
      Start conversation
    </button>
  );
}

function App({ signedUrl }: { signedUrl: string }) {
  return (
    <ConversationProvider
      onError={(error) => console.error("Conversation error:", error)}
      onPing={(event) => console.log("Estimated latency:", event.ping_ms)}
      onContextUsage={({ model, context_tokens, context_limit_tokens }) =>
        console.log(`${model}: ${context_tokens}/${context_limit_tokens} context tokens`)
      }
    >
      <Agent signedUrl={signedUrl} />
    </ConversationProvider>
  );
}

Configuration

| Provider | Models |
|----------|--------|
| OpenAI | gpt-6.1-sol, gpt-6.1-terra, gpt-6-sol, gpt-6-luna, gpt-6-astra, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.5-2026-04-23, gpt-5.4, gpt-5.4-mini, gpt-5.4-nano, gpt-5.4-2026-03-05, gpt-5.4-mini-2026-03-17, gpt-5.4-nano-2026-03-17, gpt-4.1, gpt-4.1-mini, gpt-4o, gpt-4o-mini |
| Anthropic | claude-opus-5-5, claude-opus-5, claude-sonnet-5-5, claude-opus-4-7, claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5 |
| Google | gemini-4-argon, gemini-3.8-flash, gemini-3.7-flash, gemini-3.6-flash, gemini-3.5-flash, gemini-3.5-flash-lite, gemini-3.1-flash-lite-preview, gemini-3.1-pro-preview, gemini-3-pro-preview, gemini-3-flash-preview, gemini-2.5-flash, gemini-2.5-flash-lite |
| ElevenLabs | glm-52, deepseek-v41-flash, glm-45-air-fp8, qwen3-30b-a3b, qwen36-35b-a3b, qwen35-35b-a3b, qwen35-397b-a17b, nemotron-35-super-vl-nvfp4, gpt-oss-120b |
| Custom | custom-llm (bring your own endpoint) |

Use GET /v1/convai/llm/list to inspect the current model catalog, including deprecation state, token/context limits, capability flags such as image-input support, and model-specific reasoning effort support.

To run an agent on an ElevenLabs Realtime model instead of a separate LLM and TTS model (conversation_config.realtime_model), use the realtime skill.

Popular voices: JBFqnCBsd6RMkjVDRZzb (George), EXAVITQu4vr4xnSDxMaL (Sarah), onwK4e9ZLuTAKqWW03F9 (Daniel)

Turn eagerness: patient (waits longer for user to finish), normal, or eager (responds quickly)

See [Agent Configuration](references/agent-configuration.md) for all options.

System Prompt Structure

Section the prompt with markdown headings — the model prioritizes and interprets instructions more reliably ([prompting guide](https://elevenlabs.io/docs/eleven-agents/best-practices/prompting-guide)):

# Personality   – named character, 2-3 traits
# Environment   – where they work, who they talk to
# Tone          – vocal style as 4-5 bullets
# Goal          – what success looks like (numbered for multi-step flows)

Keep instructions short and action-based. Mark critical steps with "This step is important." For critical refusal/safety rules, include concise instructions in the prompt and also configure independent custom Guardrails via platform_settings.guardrails (see [Guardrails](#guardrails)).

Tools

Extend agents with webhook, client, or built-in system tools. Tools are defined inside conversation_config.agent.prompt:

Workspace environment variables can resolve per-environment server tool URLs, headers, and auth connections, and runtime system variables such as {{system__conversation_history}} can pass full conversation context into tool calls when needed.

"prompt": {
    "prompt": "You are a helpful assistant that can check the weather.",
    "llm": "gemini-3.5-flash",
    "tools": [
        # Webhook: server-side API call
        {"type": "webhook", "name": "get_weather", "description": "Get weather",
         "api_schema": {"url": "https://api.example.com/weather", "method": "POST",
             "request_body_schema": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}}},
        # Client: runs in the browser
        {"type": "client", "name": "show_product", "description": "Display a product",
         "parameters": {"type": "object", "properties": {"productId": {"type": "string"}}, "required": ["productId"]}}
    ],
    "built_in_tools": {
        "end_call": {},
        "transfer_to_number": {"transfers": [{"transfer_destination": {"type": "phone", "phone_number": "+1234567890"}, "condition": "User asks for human support"}]}
    }
}

Client tools run in browser:

clientTools: {
  show_product: async ({ productId }) => {
    document.getElementById("product").src = `/products/${productId}`;
    return { success: true };
  }
}

See [Client Tools Reference](references/client-tools.md) for complete documentation.

Built-in System Tools

Set under conversation_config.agent.prompt.built_in_tools. {} enables defaults; provide description to customize; omit to disable.

| Tool | Enable for |
|------|------------|
| end_call | All agents |
| language_detection | Multilingual agents |
| transfer_to_number | Phone-based human escalation |
| transfer_to_agent | Multi-agent workflows |
| skip_turn | Tutoring / coaching (silent listening) |
| voicemail_detection | Outbound calling |
| play_keypad_touch_tone | IVR navigation |

start_procedure and end_procedure are not configured here. The platform adds them automatically whenever the agent has at least one procedure (see [Procedures](#procedures)).

run_subagent is a system tool for delegating a task to another configured agent. Add it to
conversation_config.agent.prompt.tools with params.system_tool_type: "run_subagent" and an
agents array. Each entry requires agent_id and description; branch_id and a JSON-schema
parameters object are optional.

knowledge_base is a system tool for letting the model choose how to inspect attached knowledge.
Add it to conversation_config.agent.prompt.tools with type: "system", a name, and
params.system_tool_type: "knowledge_base". Use enabled_strategies to expose any combination of
cat, keyword, semantic, and ls:

{
  "type": "system",
  "name": "knowledge_base",
  "description": "Search the attached knowledge base.",
  "params": {
    "system_tool_type": "knowledge_base",
    "enabled_strategies": ["semantic", "keyword"]
  }
}

Integration Tools

Pre-built connectors managed by the platform. Create a connection with credentials, then attach via tool_ids:

| Integration | Use case |
|-------------|----------|
| calcom | Scheduling appointments |
| salesforce | CRM lookups, case creation |
| hubspot | CRM, marketing, contacts |
| zendesk | Support ticketing |

Three-step flow: POST /v1/convai/api-integrations/{id}/connections → GET /v1/convai/api-integrations/{id}/tools → POST /v1/convai/tools with api_integration_id and api_integration_connection_id. Attach to the agent with "prompt": {"tool_ids": ["tool_xxxx"]}. Inline tools and tool_ids can coexist — prefer an integration over a duplicate custom webhook.

Public-API Webhook Examples

No-auth APIs useful for prototypes (URLs must be HTTPS):

| Tool | URL | Purpose |
|------|-----|---------|
| get_weather | https://wttr.in/{location}?format=j1 | Current weather |
| search_wikipedia | https://en.wikipedia.org/api/rest_v1/page/summary/{topic} | Topic summary |
| get_exchange_rate | https://open.er-api.com/v6/latest/{base_currency} | FX rates |

Build Tools in Code

The Python and JavaScript SDKs include a tool builder (Tool, Schema, Header, and SystemTool; imported from elevenlabs.agent_tools in Python and from the package root in JavaScript) that produces the request for tools.create() and tools.update(). Start with Tool.webhook(name, description), Tool.client(name, description), or a SystemTool constructor, then chain calls such as get()/post(), path_param()/pathParam(), body(), header(), and assign(). Every literal parameter needs exactly one value source: describe() (the LLM fills it), from_variable()/fromVariable(), constant(), system_provided()/systemProvided(), or omit(). build() checks the whole tool and raises one ToolValidationError listing every problem. Reference: [Tools as code](https://elevenlabs.io/docs/eleven-agents/customization/agents-as-code/tools).

from elevenlabs import ElevenLabs
from elevenlabs.agent_tools import Header, Schema, Tool

client = ElevenLabs()

get_order = (
    Tool.webhook("get_order", "Look up an order by the number the caller gives")
    .get("https://api.example.com/orders/{order_id}")
    .path_param("order_id", Schema.string().describe("The order number, e.g. A-1042"))
    .header("Authorization", Header.secret("sec_orders_api"))
    .assign("order_status", "order.status")
)

tool = client.conversational_ai.tools.create(request=get_order.build())
import { ElevenLabsClient, Header, Schema, Tool } from "@elevenlabs/elevenlabs-js";

const client = new ElevenLabsClient();

const getOrder = Tool.webhook("get_order", "Look up an order by the number the caller gives")
  .get("https://api.example.com/orders/{order_id}")
  .pathParam("order_id", Schema.string().describe("The order number, e.g. A-1042"))
  .header("Authorization", Header.secret("sec_orders_api"))
  .assign("order_status", "order.status");

const tool = await client.conversationalAi.tools.create(getOrder.build());

Attach the created tool with tool_ids; for system tools, build_config() / buildConfig() returns the entry for built_in_tools. To edit an existing tool, load it with Tool.from_response() / Tool.fromResponse(), change it, and push it back with tools.update(). to_json_string() / toJSONString() and Tool.from_json() / Tool.fromJSON() store tools as JSON in version control.

Workflows

Route conversations through discrete steps with branching logic. Define under the agent's top-level workflow field. Reference: [Agent Workflows](https://elevenlabs.io/docs/eleven-agents/customization/agent-workflows).

Node types: start (ID must be "start_node"), end (outcome records the conversation as success, the default, or failure), override_agent (subagent step with label + additional_prompt), dispatch_tool (executes a tool with success/failure routing), agent_transfer, transfer_to_number.

Edge types: unconditional, llm (natural-language condition), expression (deterministic data check). Tool nodes have separate success/failure edges.

Scope tools per step with additional_tool_ids on a node — prevents the wrong tool firing at the wrong step. Set additional_tool_ids: [] on conversational routing nodes such as greeting and classify_intent so they only converse:

{
  "type": "override_agent",
  "label": "Book Appointment",
  "additional_prompt": "Discuss preferred dates and doctors. Show the booking form once agreed.",
  "entry_behavior": "wait_for_user",
  "additional_tool_ids": ["show_booking_form", "display_appointment_card"],
  "position": {"x": 0, "y": 400}
}

Include position ({x, y}) on every node so the editor renders cleanly. Start at y=0, put end at the bottom, and space branches horizontally at x=-150 and x=150; suggested spacing is 200px vertical between levels and 300px horizontal between branches. Keep workflows to 4-7 nodes and always have a path to end.

Use entry_behavior on override_agent nodes to choose whether a sub-agent speaks immediately (generate_immediately), waits for user input (wait_for_user), or lets the platform decide (auto).

For nested agent transfers, set enable_nesting on a standalone_agent node and
return_when_nested on an end node that should return control to the parent workflow.

Build Workflows in Code

The Python and JavaScript SDKs include a Workflow builder that produces the workflow value for agents.create() and agents.update(). Chain converse, tool, transfer, and end steps, and route between them with when (a string is an LLM condition; an Expr is an expression on dynamic variables), on_success / on_failure, and go_to. build() assigns start_node, edge IDs, edge_order, and editor positions, and raises one WorkflowValidationError listing every workflow graph problem. Reference: [Workflows as code](https://elevenlabs.io/docs/eleven-agents/customization/agent-workflows-as-code).

from elevenlabs import ElevenLabs
from elevenlabs.agent_workflows import Destination, Workflow

client = ElevenLabs()

wf = Workflow()
triage = wf.converse("triage", "Greet the caller and find out why they're calling")
lookup = triage.when("Caller gave an order number").tool("lookup_order", ["tool_get_order"])
lookup.on_result(
    success=lambda ok: ok.converse("resolve", "Explain the order status").when("Caller is satisfied").end(),
    failure=lambda failed: failed.go_to(triage),
)
triage.when("Caller wants a human").transfer("human", Destination.phone("+15551234567"))

client.conversational_ai.agents.update("agent_id", workflow=wf.build())
import { Destination, ElevenLabsClient, Workflow } from "@elevenlabs/elevenlabs-js";

const client = new ElevenLabsClient();

const wf = new Workflow();
const triage = wf.converse("triage", "Greet the caller and find out why they're calling");
const lookup = triage.when("Caller gave an order number").tool("lookup_order", ["tool_get_order"]);
lookup.onResult({
  success: (ok) => ok.converse("resolve", "Explain the order status").when("Caller is satisfied").end(),
  failure: (failed) => failed.goTo(triage),
});
triage.when("Caller wants a human").transfer("human", Destination.phone("+15551234567"));

await client.conversationalAi.agents.update("agent_id", { workflow: wf.build() });

To edit an existing workflow, load it with Workflow.from_agent(agent) / Workflow.fromAgent(agent), then change nodes with wf.node(id).update(...), insert_between / insertBetween, or remove; IDs and positions are kept. to_json_string() / toJSONString() and Workflow.from_json() / Workflow.fromJSON() store workflows as JSON in version control, and elevenlabs agents workflow diagram <file> draws a workflow file as a flowchart (--format mermaid for Mermaid output).

A Start procedure node starts an attached procedure at a chosen point in the workflow graph. See [Procedures](#procedures) for the start_procedure node and its continuation behavior.

Procedures

Reusable instruction blocks an agent runs when a trigger matches or a Start procedure workflow node starts it. A procedure i

Related Skills

Get the best new skills
in your inbox

Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.