# Read one step of a session's trace in full: tool input and output, the model request and response, and its raw events.

Source: <https://everruns.com/docs/api/operations/get_session_trace_step/>

GET

/v1/sessions/{session\_id}/trace/turns/{turn}/steps/{step}

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/sessions/example/trace/turns/example/steps/example';
const options = {method: 'GET'};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request GET \
  --url https://app.everruns.com/api/v1/sessions/example/trace/turns/example/steps/example
```

* Production APIapp.everruns.com/api/v1/sessions/{session\_id}/trace/turns/{turn}/steps/{step}

## Parameters

### Path Parameters

**session\_id**

required

string

Prefixed public identifier

**turn**

required

string

Prefixed public identifier

**step**

required

string

Prefixed public identifier

### Query Parameters

**full**

boolean

Return payloads whole, however large.

## Responses

### 200

Success

Media typeapplication/json

Everything about one step, for the inspector.

object

**events**

required

Raw events of the step, in sequence order.

Array\<object>

An event in the session log.

object

**data**

Payload, when small enough to inline.

**id**

required

Event identifier.

string

**sequence**

required

Sequence in the session event log.

integer format: int32

**size\_bytes**

required

Size of the serialized payload.

integer format: int32

**ts**

required

When the event happened.

string format: date-time

**type**

required

Event type, such as `tool.call_completed`.

string

**input**

One of:

* object

  Tool arguments.

  object

  **preview**

  The first part of the serialized value, when it was cut.

  string | null

  **size\_bytes**

  required

  Size of the serialized value.

  integer

  **truncated**

  required

  Whether the value was cut to `preview`.

  boolean

  **value**

  The value, when it fits or `full` was asked for.

* null

  null

**output**

One of:

* object

  Tool result, or error.

  object

  **preview**

  The first part of the serialized value, when it was cut.

  string | null

  **size\_bytes**

  required

  Size of the serialized value.

  integer

  **truncated**

  required

  Whether the value was cut to `preview`.

  boolean

  **value**

  The value, when it fits or `full` was asked for.

* null

  null

**request**

One of:

* object

  The request of a model call: what changed since the previous call.

  object

  **message\_count**

  required

  Messages sent in the call.

  integer format: int32

  **new\_from**

  required

  Messages before this index were already in the previous call.

  integer format: int32

  **new\_messages**

  required

  The new messages, at most 50.

  Array\<object>

  One message of a model request.

  object

  **content**

  The whole message, when asked for and within the limit.

  **index**

  required

  Position in the request.

  integer format: int32

  **preview**

  required

  Start of the message text.

  string

  **role**

  required

  Role as handed to the provider driver: `system`, `user`, `assistant` or `tool`. Stored messages say `agent` and `tool_result`; each driver then maps these four onto its own wire format.

  string

  **size\_bytes**

  required

  Size of the serialized message.

  integer

  **system\_preview**

  Start of the system prompt.

  string | null

  **tool\_count**

  required

  Tools offered in the call.

  integer format: int32

  **usage**

  One of:

  * object

    Token usage of the call, split by prompt cache.

    object

    **cache\_creation\_tokens**

    required

    Prompt tokens written to the provider’s cache.

    integer format: int64

    **cache\_read\_tokens**

    required

    Prompt tokens read from the provider’s cache.

    integer format: int64

    **cache\_reset**

    One of:

    * object

      Set when this call lost most of the prompt prefix the previous model call had cached.

      object

      **idle\_seconds**

      required

      Seconds between the end of the previous call and the start of this one.

      integer format: int64

      **lost\_tokens**

      required

      How many of those this call did not read back.

      integer format: int64

      **previous\_cached\_tokens**

      required

      Prompt tokens the previous call left in the cache (read plus written).

      integer format: int64

      **reason**

      required

      Likely cause, the first difference found: `model_changed`, `tools_changed`, `system_changed`, `history_changed`, `expired` (idle longer than the cache retention), or `unknown`.

      string

    * null

      null

    **cached\_through**

    Estimated index of the last message inside the cached prefix: the cache-read share of the prompt laid over the messages by size. `-1` when only the tools fit; absent when nothing was read from cache.

    integer | null format: int32

    **caching\_would\_help**

    A long prompt sent with caching off that neither read nor wrote the cache: turning on prompt caching would likely make calls like it cheaper.

    boolean

    **input\_tokens**

    required

    Prompt tokens neither read from nor written to the cache.

    integer format: int64

    **output\_tokens**

    required

    Completion tokens.

    integer format: int64

    **prompt\_cache**

    How prompt caching was requested, such as `auto` or `anthropic_cache_control`; absent when caching was off.

    string | null

  * null

    Set when this call lost most of the prompt prefix the previous model call had cached.

    object

    **idle\_seconds**

    required

    Seconds between the end of the previous call and the start of this one.

    integer format: int64

    **lost\_tokens**

    required

    How many of those this call did not read back.

    integer format: int64

    **previous\_cached\_tokens**

    required

    Prompt tokens the previous call left in the cache (read plus written).

    integer format: int64

    **reason**

    required

    Likely cause, the first difference found: `model_changed`, `tools_changed`, `system_changed`, `history_changed`, `expired` (idle longer than the cache retention), or `unknown`.

    string

  * object

    null

  * null

    null

* null

  Token usage of the call, split by prompt cache.

  object

  **cache\_creation\_tokens**

  required

  Prompt tokens written to the provider’s cache.

  integer format: int64

  **cache\_read\_tokens**

  required

  Prompt tokens read from the provider’s cache.

  integer format: int64

  **cache\_reset**

  One of:

  * object

    Set when this call lost most of the prompt prefix the previous model call had cached.

    object

    **idle\_seconds**

    required

    Seconds between the end of the previous call and the start of this one.

    integer format: int64

    **lost\_tokens**

    required

    How many of those this call did not read back.

    integer format: int64

    **previous\_cached\_tokens**

    required

    Prompt tokens the previous call left in the cache (read plus written).

    integer format: int64

    **reason**

    required

    Likely cause, the first difference found: `model_changed`, `tools_changed`, `system_changed`, `history_changed`, `expired` (idle longer than the cache retention), or `unknown`.

    string

  * null

    null

  **cached\_through**

  Estimated index of the last message inside the cached prefix: the cache-read share of the prompt laid over the messages by size. `-1` when only the tools fit; absent when nothing was read from cache.

  integer | null format: int32

  **caching\_would\_help**

  A long prompt sent with caching off that neither read nor wrote the cache: turning on prompt caching would likely make calls like it cheaper.

  boolean

  **input\_tokens**

  required

  Prompt tokens neither read from nor written to the cache.

  integer format: int64

  **output\_tokens**

  required

  Completion tokens.

  integer format: int64

  **prompt\_cache**

  How prompt caching was requested, such as `auto` or `anthropic_cache_control`; absent when caching was off.

  string | null

* object

  Set when this call lost most of the prompt prefix the previous model call had cached.

  object

  **idle\_seconds**

  required

  Seconds between the end of the previous call and the start of this one.

  integer format: int64

  **lost\_tokens**

  required

  How many of those this call did not read back.

  integer format: int64

  **previous\_cached\_tokens**

  required

  Prompt tokens the previous call left in the cache (read plus written).

  integer format: int64

  **reason**

  required

  Likely cause, the first difference found: `model_changed`, `tools_changed`, `system_changed`, `history_changed`, `expired` (idle longer than the cache retention), or `unknown`.

  string

* null

  null

* object

  null

* null

  null

**step**

required

The step itself.

object

**child\_session\_id**

Session a `spawn_agent` call started.

string | null

**duration\_ms**

Wall time of the step; absent while running.

integer | null format: int64

**end\_sequence**

Last event sequence of the step.

integer | null format: int32

**input\_tokens**

Prompt tokens of a model call.

integer | null format: int32

**kind**

required

`model`, `answer`, `tool`, `approval`, `agent` or `send`.

string

**model**

Model that served the call, for model steps.

string | null

**name**

Tool name, or model for model calls.

string | null

**narration**

What the model said alongside this call (model calls and answers).

string | null

**offset\_ms**

required

Start relative to the turn’s start.

integer format: int64

**output\_tokens**

Completion tokens of a model call.

integer | null format: int32

**requested\_tool\_call\_ids**

Tool calls this model call asked for.

Array\<string>

**result**

Short result or error.

string | null

**start\_sequence**

required

First event sequence of the step.

integer format: int32

**started\_at**

required

When the step started.

string format: date-time

**status**

required

`running`, `success`, `error` or `cancelled`.

string

**step**

required

Per-turn step number, 1-based.

integer format: int32

**target**

What the call acted on, from the tool’s narration.

string | null

**tool\_call\_id**

Tool call identifier, for tool steps.

string | null

**turn**

required

Turn the step belongs to.

integer format: int32

##### Example

```json
{
  "events": [
    {
      "id": "event_01a124cd8a1b7f02a5c4e6d1b2f3a4c5",
      "sequence": 14,
      "size_bytes": 512,
      "type": "tool.started"
    }
  ],
  "input": {
    "size_bytes": 221,
    "truncated": false
  },
  "output": {
    "size_bytes": 221,
    "truncated": false
  },
  "request": {
    "message_count": 14,
    "new_from": 12,
    "new_messages": [
      {
        "index": 12,
        "role": "tool",
        "size_bytes": 244
      }
    ],
    "tool_count": 9,
    "usage": {
      "cache_creation_tokens": 0,
      "cache_read_tokens": 12529,
      "cache_reset": {
        "idle_seconds": 42,
        "lost_tokens": 18420,
        "previous_cached_tokens": 18420,
        "reason": "tools_changed"
      },
      "cached_through": 11,
      "input_tokens": 10295,
      "output_tokens": 197,
      "prompt_cache": "auto"
    }
  },
  "step": {
    "duration_ms": 269,
    "end_sequence": 21,
    "kind": "tool",
    "model": "gpt-6.1-sol",
    "name": "bash",
    "offset_ms": 3010,
    "start_sequence": 14,
    "status": "success",
    "step": 2,
    "tool_call_id": "call_PzDcvnFaUll8os3tPhWj",
    "turn": 1240
  }
}
```