Skip to content
Agents API
Agents API

Observability and usage

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

On this pageInspect a TurnRead tool activityToken usageExecution tracing

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. Use required_actions to identify work handled by your application. Built-in server tools may also produce function-call Items. 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.

Execution tracing

Rebyte supports Langfuse execution tracing for Agents API Turns, model calls and server tool spans. Open an API Agent, Session or Turn in Platform to view its traces. Trace metadata identifies the organization, Agent, Session and Turn. See Tracing for viewing instructions, recorded data and the managed Agents API tracing boundary.

Protocol referenceOpenAI Agents API ↗