Skip to main content
Read the run result to see how a run ended, what it cost, and which gateway request served each model turn. Every result has the final output, the run record with its status, cumulative usage, and one record per step with the request ID, provider and model.

Read usage and cost

Usage has input, output, cached and total tokens, plus cost: inputTokens, outputTokens, cachedTokens, totalTokens, cost in TypeScript and Java; input_tokens and so on in Python, PHP, Ruby and Rust; InputTokens and so on in Go and C#. Each step also has its own usage.

Check how the run ended

Run statuses are queued, running, waiting_for_tools, waiting_for_human, completed, stopped and failed; TypeScript adds cancelled. A result you get back is completed, stopped (a stop condition matched, with the reason in the run’s stop reason), waiting_for_human (see State and approval) or, in TypeScript, cancelled. Failed runs throw or return an error instead; see Events and errors.

Trace a step to its gateway request

Each step record ties one model turn to the gateway request that served it. Search for the request ID in your Phaseo logs, or the native response ID with the upstream provider. Steps are in steps on the result (Steps in Go and C#, steps() in Java). Python’s step records are AgentStepRecord; the others call them RunStep.

Record runs in production

Log the run ID, step index, request ID, native response ID, provider, model, finish reason, tool-call ID and stop reason. Lifecycle hooks give you all of them as the run happens, and run.failed events carry the error text where your language sends them. Don’t log raw prompts, tool inputs or credentials; redact them before events leave your process. For a local record of whole runs during development, use DevTools instead.
Last modified on November 5, 2026