Quickstart
- Agent Setup
- Build a Conversational App
- Twilio Integration
Libraries & SDKs
API Reference
- WebSocket
- Agents
- Conversations
- Knowledge Base
- Phone Numbers
- Widget
Agents
Get Agent
Retrieve config for an agent
GET
/
v1
/
convai
/
agents
/
{agent_id}
Copy
Ask AI
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.conversational_ai.get_agent(
agent_id="21m00Tcm4TlvDq8ikWAM",
)
Copy
Ask AI
{
"agent_id": "<string>",
"name": "<string>",
"conversation_config": {
"agent": {
"prompt": {
"prompt": "",
"llm": "gpt-4o-mini",
"temperature": 0,
"max_tokens": -1,
"tools": [
{
"type": "webhook",
"name": "<string>",
"description": "<string>",
"api_schema": {
"url": "<string>",
"method": "GET",
"path_params_schema": {},
"query_params_schema": {
"properties": {},
"required": [
"<string>"
]
},
"request_body_schema": {
"type": "object",
"properties": {},
"required": [
"<string>"
],
"description": "<string>"
},
"request_headers": {}
}
}
],
"knowledge_base": [
{
"type": "file",
"name": "<string>",
"id": "<string>"
}
],
"custom_llm": {
"url": "<string>",
"model_id": "<string>",
"api_key": {
"secret_id": "<string>"
}
}
},
"first_message": "",
"language": "en"
},
"asr": {
"quality": "high",
"provider": "elevenlabs",
"user_input_audio_format": "pcm_16000",
"keywords": [
"<string>"
]
},
"turn": {
"turn_timeout": 7,
"mode": "silence"
},
"tts": {
"model_id": "eleven_turbo_v2",
"voice_id": "cjVigY5qzO86Huf0OWal",
"agent_output_audio_format": "pcm_16000",
"optimize_streaming_latency": 0,
"stability": 0.5,
"similarity_boost": 0.8,
"pronunciation_dictionary_locators": [
{
"pronunciation_dictionary_id": "<string>",
"version_id": "<string>"
}
]
},
"conversation": {
"max_duration_seconds": 600,
"client_events": [
"conversation_initiation_metadata"
]
}
},
"metadata": {
"created_at_unix_secs": 123
},
"platform_settings": {
"auth": {
"enable_auth": false,
"allowlist": [
{
"hostname": "<string>"
}
],
"shareable_token": "<string>"
},
"evaluation": {
"criteria": [
{
"id": "<string>",
"name": "<string>",
"type": "prompt",
"conversation_goal_prompt": "<string>"
}
]
},
"widget": {
"variant": "compact",
"avatar": {
"type": "orb",
"color_1": "#2792dc",
"color_2": "#9ce6e6"
},
"feedback_mode": "none",
"custom_avatar_path": "<string>",
"bg_color": "#ffffff",
"text_color": "#000000",
"btn_color": "#000000",
"btn_text_color": "#ffffff",
"border_color": "#e1e1e1",
"focus_color": "#000000",
"border_radius": 123,
"btn_radius": 123,
"action_text": "<string>",
"start_call_text": "<string>",
"end_call_text": "<string>",
"expand_text": "<string>",
"listening_text": "<string>",
"speaking_text": "<string>",
"shareable_page_text": "<string>"
},
"data_collection": {},
"overrides": {
"conversation_config_override": {
"agent": {
"prompt": {
"prompt": false
},
"first_message": false,
"language": false
},
"tts": {
"voice_id": false
}
},
"custom_llm_extra_body": false
},
"ban": {
"at_unix": 123,
"reason": "<string>",
"reason_type": "safety"
},
"safety": {
"ivc": {
"is_unsafe": true,
"llm_reason": "<string>",
"safety_prompt_version": 123,
"matched_rule_id": [
"sexual_minors"
]
},
"non_ivc": {
"is_unsafe": true,
"llm_reason": "<string>",
"safety_prompt_version": 123,
"matched_rule_id": [
"sexual_minors"
]
}
},
"privacy": {
"record_voice": true
}
},
"secrets": [
{
"type": "stored",
"secret_id": "<string>",
"name": "<string>"
}
]
}
Headers
Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.
Path Parameters
The id of an agent. This is returned on agent creation.
Response
200
application/json
Successful Response
The response is of type object
.
Was this page helpful?
Copy
Ask AI
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.conversational_ai.get_agent(
agent_id="21m00Tcm4TlvDq8ikWAM",
)
Copy
Ask AI
{
"agent_id": "<string>",
"name": "<string>",
"conversation_config": {
"agent": {
"prompt": {
"prompt": "",
"llm": "gpt-4o-mini",
"temperature": 0,
"max_tokens": -1,
"tools": [
{
"type": "webhook",
"name": "<string>",
"description": "<string>",
"api_schema": {
"url": "<string>",
"method": "GET",
"path_params_schema": {},
"query_params_schema": {
"properties": {},
"required": [
"<string>"
]
},
"request_body_schema": {
"type": "object",
"properties": {},
"required": [
"<string>"
],
"description": "<string>"
},
"request_headers": {}
}
}
],
"knowledge_base": [
{
"type": "file",
"name": "<string>",
"id": "<string>"
}
],
"custom_llm": {
"url": "<string>",
"model_id": "<string>",
"api_key": {
"secret_id": "<string>"
}
}
},
"first_message": "",
"language": "en"
},
"asr": {
"quality": "high",
"provider": "elevenlabs",
"user_input_audio_format": "pcm_16000",
"keywords": [
"<string>"
]
},
"turn": {
"turn_timeout": 7,
"mode": "silence"
},
"tts": {
"model_id": "eleven_turbo_v2",
"voice_id": "cjVigY5qzO86Huf0OWal",
"agent_output_audio_format": "pcm_16000",
"optimize_streaming_latency": 0,
"stability": 0.5,
"similarity_boost": 0.8,
"pronunciation_dictionary_locators": [
{
"pronunciation_dictionary_id": "<string>",
"version_id": "<string>"
}
]
},
"conversation": {
"max_duration_seconds": 600,
"client_events": [
"conversation_initiation_metadata"
]
}
},
"metadata": {
"created_at_unix_secs": 123
},
"platform_settings": {
"auth": {
"enable_auth": false,
"allowlist": [
{
"hostname": "<string>"
}
],
"shareable_token": "<string>"
},
"evaluation": {
"criteria": [
{
"id": "<string>",
"name": "<string>",
"type": "prompt",
"conversation_goal_prompt": "<string>"
}
]
},
"widget": {
"variant": "compact",
"avatar": {
"type": "orb",
"color_1": "#2792dc",
"color_2": "#9ce6e6"
},
"feedback_mode": "none",
"custom_avatar_path": "<string>",
"bg_color": "#ffffff",
"text_color": "#000000",
"btn_color": "#000000",
"btn_text_color": "#ffffff",
"border_color": "#e1e1e1",
"focus_color": "#000000",
"border_radius": 123,
"btn_radius": 123,
"action_text": "<string>",
"start_call_text": "<string>",
"end_call_text": "<string>",
"expand_text": "<string>",
"listening_text": "<string>",
"speaking_text": "<string>",
"shareable_page_text": "<string>"
},
"data_collection": {},
"overrides": {
"conversation_config_override": {
"agent": {
"prompt": {
"prompt": false
},
"first_message": false,
"language": false
},
"tts": {
"voice_id": false
}
},
"custom_llm_extra_body": false
},
"ban": {
"at_unix": 123,
"reason": "<string>",
"reason_type": "safety"
},
"safety": {
"ivc": {
"is_unsafe": true,
"llm_reason": "<string>",
"safety_prompt_version": 123,
"matched_rule_id": [
"sexual_minors"
]
},
"non_ivc": {
"is_unsafe": true,
"llm_reason": "<string>",
"safety_prompt_version": 123,
"matched_rule_id": [
"sexual_minors"
]
}
},
"privacy": {
"record_voice": true
}
},
"secrets": [
{
"type": "stored",
"secret_id": "<string>",
"name": "<string>"
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.