Use the API to integrate ElevenLabs testing into your workflow.Prerequisites
Configure ElevenLabs credentials in your agent settings:
Required fields:
- Assistant ID: Your ElevenLabs agent ID
- ElevenLabs API Key: Your ElevenLabs API key with access to Agents
To find your Assistant ID, go to your ElevenLabs dashboard and navigate to the Agents section. Go to your particular agent you want to test, open that agent and assistant id (11labs agent id) will be visible just below the header.
API Endpoint
POST https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/
Authentication
Include your API key in the request header:X-CEKURA-API-KEY: <YOUR_API_KEY>
Request Parameters
scenarios (array | integer | string, required): Test scenarios to run
- Array format: List of scenario IDs
[123, 456, 789]
- Integer format: Run first N scenarios for the agent
5
- String format: Run all scenarios for the agent
"all"
agent_id (integer, optional): Your Agent ID in Cekura. Required when using integer or “all” format for scenariosfrequency (integer, optional): Number of times to run each scenario (default: 1)name (string, optional): Custom name for this test runconversation_config_override (object, optional): Override conversation configuration for this runExamples
Single Run (cURL)
curl -X POST \
'https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/' \
-H 'X-CEKURA-API-KEY: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"scenarios": [30]
}'
Multiple Runs (cURL)
curl -X POST \
'https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/' \
-H 'X-CEKURA-API-KEY: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"scenarios": [30, 31, 32],
"frequency": 2,
"name": "ElevenLabs Test Run"
}'
Run First N Scenarios (cURL)
curl -X POST \
'https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/' \
-H 'X-CEKURA-API-KEY: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"scenarios": 5,
"agent_id": 123,
"frequency": 1,
"name": "First 5 Scenarios"
}'
Run All Scenarios (cURL)
curl -X POST \
'https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/' \
-H 'X-CEKURA-API-KEY: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"scenarios": "all",
"agent_id": 123,
"frequency": 1,
"name": "All Scenarios Test"
}'
With Custom Configuration (cURL)
curl -X POST \
'https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/' \
-H 'X-CEKURA-API-KEY: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"scenarios": [30],
"conversation_config_override": {
"tts": {
"voice_id": "custom_voice_id"
}
},
"frequency": 1,
"name": "Custom Config Test"
}'
Python Example
import requests
API_KEY = "<YOUR_API_KEY>"
BASE_URL = "https://api.cekura.ai/test_framework"
headers = {
"X-CEKURA-API-KEY": API_KEY,
"Content-Type": "application/json",
}
payload = {
"scenarios": [30, 31, 32],
"frequency": 2,
"name": "ElevenLabs Test Run"
}
resp = requests.post(
f"{BASE_URL}/v1/scenarios-external/run_scenarios_elevenlabs/",
headers=headers,
json=payload,
)
result = resp.json()
print(result)
Python with Configuration Override
import requests
API_KEY = "<YOUR_API_KEY>"
BASE_URL = "https://api.cekura.ai/test_framework"
headers = {
"X-CEKURA-API-KEY": API_KEY,
"Content-Type": "application/json",
}
payload = {
"scenarios": [30],
"conversation_config_override": {
"tts": {
"voice_id": "custom_voice_id"
}
},
"frequency": 1,
"name": "Custom Config Test"
}
resp = requests.post(
f"{BASE_URL}/v1/scenarios-external/run_scenarios_elevenlabs/",
headers=headers,
json=payload,
)
result = resp.json()
print(result)
Python - Run All Scenarios
import requests
API_KEY = "<YOUR_API_KEY>"
BASE_URL = "https://api.cekura.ai/test_framework"
headers = {
"X-CEKURA-API-KEY": API_KEY,
"Content-Type": "application/json",
}
payload = {
"scenarios": "all",
"agent_id": 123,
"frequency": 1,
"name": "All Scenarios Test"
}
resp = requests.post(
f"{BASE_URL}/v1/scenarios-external/run_scenarios_elevenlabs/",
headers=headers,
json=payload,
)
result = resp.json()
print(result)
Response
{
"id": 16870,
"name": "ElevenLabs Test Run",
"agent": 5,
"status": "in_progress",
"success_rate": 0.0,
"run_as_text": false,
"is_cronjob": false,
"runs": [
{
"id": 34625,
"status": "running",
"scenario": 11547,
"scenario_name": "Customer Support Scenario",
"test_profile_data": {"key": "value"}
}
],
"created_at": "2025-10-16T09:32:59.484534Z",
"updated_at": "2025-10-16T09:32:59.484942Z"
}
Error Responses
Missing ElevenLabs Credentials
{
"elevenlabs_creds": ["Please add ElevenLabs credentials"]
}
Missing ElevenLabs Agent ID
{
"assistant_id": ["ElevenLabs agent ID (assistant_id) is required but not set on the agent."]
}
Invalid Scenarios
{
"scenarios": ["Invalid scenario IDs or scenarios not found"]
}
Insufficient Balance
{
"detail": "Insufficient balance for this operation"
}
Monitor Results
Poll for results using the List Runs with IDs API.