Skip to main content
A trial is one task, one agent/model arm, and one attempt. Get its id from jobs.trials(jobId); its record includes the parent job_id.
For every method’s inputs, return values, and language differences, see the trials method reference.
Examples reuse the SDK setup. Run Python snippets inside the async function shown in the Python guide.

Read the result

A reward of 0 is a scored result. A missing reward is not automatically zero. See statuses and nullable values.

Read the trace

This drains stored events. It does not remain connected waiting for future events. Both accept cursor, limit, type, grep, and tail. TypeScript uses one options object; Python uses keywords. grep is a case-insensitive POSIX regex over event type and content. tail selects the newest matching events; the server caps it at 10,000.

Read per-call model usage

Use gatewayUsageOf / gateway_usage_of to find the gateway’s token and cost readings. Other events, including the harness’s own usage reports, return null / None.
These fields live under call.usage / call["usage"]. Do not add the harness’s usage to these readings: they describe the same run from different sources. Use the trial’s usage for its aggregate reading.

Read stored artifacts

Null / None means no content is served, including output withheld because it belongs to an earlier retry attempt. Read the artifact reason with withReason / with_reason when you need to distinguish that case. trace-parsed belongs to trace; filesystem belongs to the filesystem client.

Read individual files

The actual files depend on what was produced and retained. Use files() to discover them.
files accepts limit and cursor. file returns Buffer / bytes; byte ranges accept start, inclusive end, or suffix for the last N bytes. A suffix takes precedence. These are stored result files. To browse sandbox paths, use client.filesystem(trialId) and the filesystem methods.

Stop, retry, or regrade

stop accepts up to 100 trial or analysis ids. Its response separates stopped, stopped_analyses, already_terminal, and not_found. Check each group; one missing id does not erase the rest of the result. Retry requires a settled trial. Regrade requires retained inputs from an eligible separate verifier. Job operations describe the differences.
Last modified on November 9, 2026