Hanzo
OpenapiAgents

Returns one agent with its system prompt and its 20 most recent runs.

Returns one agent with its system prompt and its 20 most recent runs.

GET /v1/agents/{ref}

Addresshttps://api.hanzo.ai/v1/agents/{ref}
MethodGET
Operationget_agents_by_ref
AuthAuthorization: Bearer $HANZO_API_KEY

Returns one agent with its system prompt and its 20 most recent runs. The ref is the agent's public id or its org-unique name — a created agent is immediately gettable by whatever create handed back.

Request

1 field.

FieldInTypeRequiredDescription
refpathstringyesRef is the agent's public id (the agent_… handle create and list return) or its org-unique name, from the path.

Response

StatusBodyMeaning
200agentDetailok

200 body — 29 fields.

FieldInTypeAlwaysDescription
computeRefbodystring
createdAtbodystring
descriptionbodystring
executionModebodystring
idbodystring
instructionsbodystringInstructions is the agent's system prompt, verbatim, up to 32 KiB.
modelbodystring
namebodystring
recentRunsbodyagentRunView[]RecentRuns is the agent's 20 most recent executions, newest first.
recentRuns[].actorbodystringActor is the "org/sub" identity the run was executed and billed AS.
recentRuns[].agentbodystringWhat 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…
recentRuns[].completionTokensbodyintegerCompletionTokens is the same measurement for what the model produced, on the same final completion.
recentRuns[].createdAtbodystringCreatedAt is when the run finished, RFC 3339 in UTC to the second — the duration above already says how long it had been going.
recentRuns[].durationMsbodyintegerDurationMs is wall-clock milliseconds around the completion, including a failover's retries.
recentRuns[].errorbodystringError is why an "ok"-less run failed, as the failing call reported it.
recentRuns[].idbodystringID is the run's handle, minted as "run_" + 32 hex characters.
recentRuns[].inputbodystringInput is the text the run was given, verbatim.
recentRuns[].modelbodystringModel is the model that actually SERVED this run, which is not always the one the agent is defined on — a failover records what answered.
recentRuns[].outputbodystringOutput 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…
recentRuns[].promptTokensbodyintegerPromptTokens 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,…
recentRuns[].statusbodystringStatus is the run's outcome, and there are exactly two: "ok" when the model answered, "error" when it did not.
recentRuns[].toolCallsbodyintegerToolCalls 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…
recentRuns[].traceIdbodystringTraceID 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…
runsbodyinteger
schedulebodystring
serviceAccountIdbodystring
statusbodystring
toolsbodystring[]
updatedAtbodystring

Failure carries the platform error shape — see Errors.

Examples

hanzo agents get <ref>

Agents API · All Hanzo APIs · Interactive reference

How is this guide?

On this page