List runs
Returns the org's agent runs across EVERY agent, newest first — what ran here, for whom, on which model, how long it took, and why it failed.
GET /v1/agent/runs
| Address | https://api.hanzo.ai/v1/agent/runs |
| Method | GET |
| Operation | get_agent_runs |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns the org's agent runs across EVERY agent, newest first — what ran here, for whom, on which model, how long it took, and why it failed.
It is the feed the per-agent history could not be: an operator asking "what is this tenant's agent plane doing" does not start out knowing an agent ref, and answering by listing the agents and then paging each one's history is N+1 round trips to reconstruct one ordering the database already has (RunsSince, ordered by created_at over the org index).
The org is the CALLER's, resolved from identity by tenantStore — never a parameter. There is deliberately no org field on orgRunsQuery to forge: run history is the tenant's own record, and the only tenant this can answer for is the one asking.
Request
2 fields.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | — | Limit caps how many runs come back, newest first. |
status | query | string | — | Status keeps only runs with this outcome ("ok" or "error"). Empty keeps both. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | agent.runList | ok |
default | problem-details | refused |
200 body — 16 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
runs | body | agent.agentRunView[] | — | Runs is the agent's executions, newest first. |
runs[].actor | body | string | — | Actor is the "org/sub" identity the run was executed and billed AS. |
runs[].agent | body | string | — | What an operator needs to answer "what ran, for whom, and what did it do" — and, through traceId, to leave this record for the waterfall of the very same run… |
runs[].completionTokens | body | integer (int64) | — | CompletionTokens is the same measurement for what the model produced, on the same final completion. |
runs[].createdAt | body | string | — | CreatedAt is when the run finished, RFC 3339 in UTC to the second — the duration above already says how long it had been going. |
runs[].durationMs | body | integer (int64) | — | DurationMs is wall-clock milliseconds around the completion, including a failover's retries. |
runs[].error | body | string | — | Error is why an "ok"-less run failed, as the failing call reported it. |
runs[].id | body | string | — | ID is the run's handle, minted as "run_" + 32 hex characters. |
runs[].input | body | string | — | Input is the text the run was given, verbatim. |
runs[].micro_usd | body | integer (int64) | — | MicroUSD is what the run spent, integer micro-USD. |
runs[].model | body | string | — | Model is the model that actually SERVED this run, which is not always the one the agent is defined on — a failover records what answered. |
runs[].output | body | string | — | Output is what the model produced. Empty on an error run, and empty is also a legitimate answer from a run that succeeded with nothing to say — Status is what… |
runs[].promptTokens | body | integer (int64) | — | PromptTokens is what the gateway reported for the run's FINAL completion, and only that one — a tool loop's earlier rounds are the metering ledger's account,… |
runs[].status | body | string | — | Status is the run's outcome, and there are exactly two: "ok" when the model answered, "error" when it did not. |
runs[].toolCalls | body | integer (int64) | — | ToolCalls is how many tool dispatches the run made — a count of ACTIONS, which is a different measurement from the token counts above and from the turns a… |
runs[].traceId | body | string | — | TraceID is the trace this run IS, so the record and its spans are one thing to move between: it opens the waterfall for THIS run rather than a search that… |
Failure carries the platform error shape — see Errors.
Examples
hanzo agent runs-allimport { Configuration, AgentApi } from 'hanzoai';
const api = new AgentApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAgentRuns();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AgentApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AgentApi(client).get_agent_runs()cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.AgentAPI.GetAgentRuns(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, agent_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = agent_api::get_agent_runs(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AgentApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new AgentApi(client).getAgentRuns();The method above is the one at the current release of the document. [email protected] (npm) was generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl https://api.hanzo.ai/v1/agent/runs \
-H "Authorization: Bearer $HANZO_API_KEY"MCP reaches agent through the agents tool, which names its 36 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_agent_conversations"
}
}
}'How is this guide?