Generate playground AI response
Runs a one-off playground turn against the specified prompt using the caller-supplied conversation history. Used by the prompt editor to preview replies; does not persist conversation state. ADMIN and SUPERADMIN callers also receive the captured MessageMetric for the turn.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The latest user turn to send into the agent. Appended to conversation server-side; do not include it twice.
Identifies the saved prompt to run this turn against. Required — the playground refuses to run without a target prompt.
Optional id of an existing conversation used for context lookup (variables, business context). The playground does not persist back into it.
Prior turns the editor is replaying for this playground session. The server does not load history from storage — whatever is sent here is the entire visible history.
Response
AI response generated
Playground turn result. approvalCards is only set when the agent paused for tool approval; messageMetric is only set for ADMIN/SUPERADMIN.
true MessageMetric snapshot captured for the playground turn — only included for ADMIN/SUPERADMIN callers. Surfaces underlying AI calls and tool calls for debugging.
{
"organizationId": "64a1b2c3d4e5f60012345678",
"metricRunId": "run_64d2f9c5e8a1d4e001a0b1c2",
"aiAgentName": "Leasing Specialist",
"aiCalls": [
{
"provider": "anthropic",
"model": "claude-sonnet-4-6",
"inputTokens": 412,
"outputTokens": 88,
"durationMs": 1742
}
],
"toolCalls": [
{
"name": "getContact",
"args": { "phone": "+14165550100" },
"durationMs": 84
}
]
}