Before you start
You needcurl, jq, uuidgen, an API credential with permission to manage evaluation definitions and create and read runs, and a project agent you can run. The example uses triage-agent in support-assistant.
The example checks whether an answer contains billing. That demonstrates one metric; choose cases and metrics that reflect your application’s requirements.
1. Create the evaluation
CallPOST /projects/{project_reference}/evals to create a source definition:
create-evaluation.sh
id as EVAL_ID. Pass this source definition ID unchanged in the run configuration.
2. Make the definition available to the runtime
Deploy a release containing the new evaluation and its target agent. SetENVIRONMENT_ID to the available environment where that release is deployed.
Set PROJECT_ID to the project’s UUID. The selected environment must belong to that project and contain the evaluation and target agent.
An environment runtime selects that environment’s deployed evaluation source. Managed preview environments resolve to the main-branch source and runtime. See the run creation reference for other runtime selections.
3. Start the evaluation task
CallPOST /runs with the task:eval target:
run-evaluation.sh
id. A credential without read access receives only run_id and status; this walkthrough requires read access.
Reuse the same idempotency key and request body when retrying creation. Use a new key for a separate evaluation run. The task reads the selected evaluation source and runs it against the selected runtime.
4. Inspect status and retrieve the report
ReadGET /runs/{run_id}:
read-evaluation-run.sh
GET /runs/{run_id}/artifacts/{artifact_id}:
read-evaluation-report.sh
API references
- Evaluation definitions lists source selectors and evaluation source operations.
- Run creation and artifacts covers
task:evalexecution and report retrieval. - Evaluation GraphQL operations and MCP tools provide the supported equivalents.