`POST /api/intelligence/agent-experiments` — create an experiment. Admin-only. Variant names must be unique within the experiment (case-insensitively) — including against each other inside this one payload; a collision is a `409`.
const url = 'https://example.com/api/intelligence/agent-experiments';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"dataset":"example","evaluators":"example","name":"example","project_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","purpose":"example","status":"example","stop_criteria":"example","variants":[{"budget_policy":"example","config":"example","endpoint":"example","harness":"example","is_control":true,"model":"example","name":"example","prompt_policy":"example","provider":"example","runner":"example","tool_profile":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/intelligence/agent-experiments \ --header 'Content-Type: application/json' \ --data '{ "dataset": "example", "evaluators": "example", "name": "example", "project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "purpose": "example", "status": "example", "stop_criteria": "example", "variants": [ { "budget_policy": "example", "config": "example", "endpoint": "example", "harness": "example", "is_control": true, "model": "example", "name": "example", "prompt_policy": "example", "provider": "example", "runner": "example", "tool_profile": "example" } ] }'POST /api/intelligence/agent-experiments — create an experiment. Admin-only.
Variant names must be unique within the experiment (case-insensitively) — including
against each other inside this one payload; a collision is a 409.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Example generated
{ "dataset": "example", "evaluators": "example", "name": "example", "project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "purpose": "example", "status": "example", "stop_criteria": "example", "variants": [ { "budget_policy": "example", "config": "example", "endpoint": "example", "harness": "example", "is_control": true, "model": "example", "name": "example", "prompt_policy": "example", "provider": "example", "runner": "example", "tool_profile": "example" } ]}Responses
Section titled “Responses”OK
object
#838 E1 — the experiment’s live attempts, queued ones included.
One materialised (variant, dataset case) attempt that has not reached a terminal
state (#838 E1). The board needs this because the recorded-run telemetry
(AgentExperimentRun) is written from a task OUTCOME — an attempt that is queued,
pending or still running appears in it nowhere.
object
The RUN’s status: queued | pending | starting | running | waiting.
Read from the run, not the task mirror — the mirror maps a queued run onto
pending (issue #110), and that is exactly the distinction shown here.
object
object
object
object
object
object
AUD-INT-003 — this run’s tokens priced against one frozen price list; None = unmeasured.
object
object
object
Example generated
{ "attempts": [ { "dataset_case_id": "example", "run_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "status": "example", "task_class": "example", "task_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "task_label": "example", "variant_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ], "experiment": { "completed_at": "2026-04-15T12:00:00Z", "created_at": "2026-04-15T12:00:00Z", "created_by": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "dataset": "example", "evaluators": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "purpose": "example", "recommendation": "example", "recommendation_confidence": 1, "status": "example", "stop_criteria": "example", "updated_at": "2026-04-15T12:00:00Z", "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "harness_comparison": [ { "accepted_runs": 1, "cost_per_accepted_patch": 1, "cost_usd": 1, "cost_waste_usd": 1, "harness": "example", "key": "example", "label": "example", "minutes_per_accepted_patch": 1, "model": "example", "provider": "example", "regression_rate": 1, "retry_rate": 1, "review_acceptance_rate": 1, "runner": "example", "sample_size": 1, "scope_violation_rate": 1, "score": 1, "success_rate": 1, "test_pass_rate": 1, "timeout_rate": 1, "tokens_per_accepted_patch": 1, "tool_error_rate": 1 } ], "leaderboard": [ { "accepted_runs": 1, "cost_per_accepted_patch": 1, "cost_usd": 1, "cost_waste_usd": 1, "harness": "example", "key": "example", "label": "example", "minutes_per_accepted_patch": 1, "model": "example", "provider": "example", "regression_rate": 1, "retry_rate": 1, "review_acceptance_rate": 1, "runner": "example", "sample_size": 1, "scope_violation_rate": 1, "score": 1, "success_rate": 1, "test_pass_rate": 1, "timeout_rate": 1, "tokens_per_accepted_patch": 1, "tool_error_rate": 1 } ], "model_comparison": [ { "accepted_runs": 1, "cost_per_accepted_patch": 1, "cost_usd": 1, "cost_waste_usd": 1, "harness": "example", "key": "example", "label": "example", "minutes_per_accepted_patch": 1, "model": "example", "provider": "example", "regression_rate": 1, "retry_rate": 1, "review_acceptance_rate": 1, "runner": "example", "sample_size": 1, "scope_violation_rate": 1, "score": 1, "success_rate": 1, "test_pass_rate": 1, "timeout_rate": 1, "tokens_per_accepted_patch": 1, "tool_error_rate": 1 } ], "recommendations": [ { "basis": "example", "confidence": 1, "recommendation": "example", "sample_size": 1, "scope": "example" } ], "runs": [ { "accepted": true, "active_ms": 1, "artifacts": "example", "bridge_events": "example", "cache_read_tokens": 1, "cache_write_tokens": 1, "cost_usd": 1, "created_at": "2026-04-15T12:00:00Z", "dataset_case_id": "example", "experiment_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "finished_at": "2026-04-15T12:00:00Z", "human_rating": 1, "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "input_tokens": 1, "lint_passed": true, "output_tokens": 1, "price_snapshot_id": "example", "reasoning_tokens": 1, "regression": true, "result": "example", "retry_count": 1, "review_accepted": true, "run_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "scope_violation": true, "standardized_cost_usd": 1, "started_at": "2026-04-15T12:00:00Z", "status": "example", "task_class": "example", "task_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "task_label": "example", "tests_passed": true, "timeout": true, "tool_error_count": 1, "turns": 1, "variant_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "wall_ms": 1, "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ], "task_class_matrix": [ { "task_class": "example", "variants": [ { "accepted_runs": 1, "cost_per_accepted_patch": 1, "cost_usd": 1, "cost_waste_usd": 1, "harness": "example", "key": "example", "label": "example", "minutes_per_accepted_patch": 1, "model": "example", "provider": "example", "regression_rate": 1, "retry_rate": 1, "review_acceptance_rate": 1, "runner": "example", "sample_size": 1, "scope_violation_rate": 1, "score": 1, "success_rate": 1, "test_pass_rate": 1, "timeout_rate": 1, "tokens_per_accepted_patch": 1, "tool_error_rate": 1 } ], "winner_key": "example", "winner_label": "example" } ], "variants": [ { "budget_policy": "example", "config": "example", "created_at": "2026-04-15T12:00:00Z", "endpoint": "example", "experiment_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "harness": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "is_control": true, "model": "example", "name": "example", "prompt_policy": "example", "provider": "example", "runner": "example", "tool_profile": "example", "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]}Two variants share a name
The canonical JSON body of every error response. Every AppError serializes as
this exact shape; code is the generated stable machine-readable vocabulary.
object
Present only on an MCP budget refusal (429) — the refusing layer + retry hint.
object
The refusing layer.
The layer’s budget.
Seconds until a retry can pass, or null when it never will for this session.
Calls already counted in the layer.
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.
object
Weighted workspace slots already held by starting/running agent runs.
The budget cap that refused.
Effective spend of the refusing budget scope (spend + in-flight reservations).
The workspace’s configured agent-concurrency cap.
The provider whose budget cap refused; absent for the workspace-wide cap.
Runner labels a fail-policy placement required and no runner offered.
Example
{ "code": "not_found"}