Skip to content
Agents API
Agents APIDevelopment preview

Observability and usage

Inspect turn outcomes, tool activity, and model token usage.

On this pageInspect a TurnRead tool activityToken usageCurrent limits

Use Session state for the current execution status, Turns for work outcomes, and Items for the recorded conversation and tool output. This gives your application a durable view alongside live events.

Inspect a Turn

const turns = await client.beta.agents.sessions.turns.list(sessionId);
for (const turn of turns.data) {
  console.log(turn.id, turn.status, turn.error, turn.usage);
}

Turn states include queued, in_progress, waiting, completed, failed, and cancelled. A Session returning to idle does not itself mean its last Turn succeeded.

Read tool activity

Retrieve Session Items in ascending order to display stored messages and execution results. Function calls identify work handled by your application; MCP calls retain their result or error status. Correlate events and records using Session, Turn, and Item IDs.

A live stream provides immediate progress. Its GET subscription does not replay history, so use persisted Items and Turns when reconstructing the UI after a disconnect.

Token usage

Turn usage records input, output, and total tokens, with supported detail fields such as cached input and reasoning output tokens. Read the values returned by the selected model adapter. Usage may be null while unavailable or incomplete; it does not mean zero tokens were consumed.

Token counts describe model usage, not the complete monetary cost of a Session. Rebyte's model, compute, storage, and billing behavior should not be inferred from OpenAI pricing.

Current limits

There is no Agents API tracing export or trace viewer integration in this implementation. The previous application's Run traces do not describe these new Session resources. See Tracing for the current status.

Protocol referenceOpenAI Agents API ↗