For AI agents and LLMs: a machine-readable index is available at llms.txt. A plain-Markdown version of any documentation page is available by appending .md to its URL.
Skip to main content
Voice TestingGenerate voice test scenarios
TestMu AI
StatusCommunityBlog
Voice Testing

Generate voice test scenarios

Generate voice agent test scenarios using LLM.

POST
/api/projects/{project_id}/voice-scenarios/generate
Generate voice test scenarios
curl --request POST \
--url "https://agent-testing.lambdatest.com/api/projects/{project_id}/voice-scenarios/generate" \
--header "Authorization: Basic <encoded-value>" \
--header "Content-Type: application/json" \
--data '{
"agent_prompt": "<agent_prompt>",
"num_scenarios": 0,
"categories": []
}'
{
"success": true,
"message": "<string>",
"data": "<string>",
"scenarios": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>",
"persona": "<string>",
"category": "task_completion",
"expected_output": [
"<string>"
],
"max_turns": 123,
"first_speaker": "<string>",
"max_duration_seconds": 123,
"prompt_version_id": "<string>",
"sync_status": "<string>"
}
],
"count": 123
}

Authorizations

Authorizationstringheaderrequired

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

project_idstringrequired

Body

application/json
agent_promptstringrequired

Description of the voice agent being tested

num_scenariosinteger
categoriesarray

Test categories: greeting, task_completion, error_recovery, multi_turn, hold_transfer

Response

application/json

Generation started in the background (poll GET /api/projects/{project_id}/voice-scenarios/saved for results) or completed synchronously (`scenarios` + `count` inline). See the model for both shapes.

successbooleanrequired
messagestring

Status message (background mode only)

dataobject

Always null (background mode only)

scenariosobject[]

Generated scenarios (synchronous mode only)

scenarios.idstring
Example: "<string>"
scenarios.titlestring
Example: "<string>"
scenarios.descriptionstring
Example: "<string>"
scenarios.personastring
Example: "<string>"
scenarios.categorystring
Example: "task_completion"
scenarios.expected_outputstring[]
Example:
["<string>"]
scenarios.max_turnsnumber
scenarios.first_speakerstring
Example: "<string>"
scenarios.max_duration_secondsnumber
scenarios.prompt_version_idstring
Example: "<string>"
scenarios.sync_statusstring
Example: "<string>"
countinteger

Number of generated scenarios (synchronous mode only)

Generate voice test scenarios
curl --request POST \
--url "https://agent-testing.lambdatest.com/api/projects/{project_id}/voice-scenarios/generate" \
--header "Authorization: Basic <encoded-value>" \
--header "Content-Type: application/json" \
--data '{
"agent_prompt": "<agent_prompt>",
"num_scenarios": 0,
"categories": []
}'
{
"success": true,
"message": "<string>",
"data": "<string>",
"scenarios": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>",
"persona": "<string>",
"category": "task_completion",
"expected_output": [
"<string>"
],
"max_turns": 123,
"first_speaker": "<string>",
"max_duration_seconds": 123,
"prompt_version_id": "<string>",
"sync_status": "<string>"
}
],
"count": 123
}