# List a page of a session's turns with their steps: model calls, tool calls, approvals, sub-agents and messages, with repeated calls folded into batches.

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

GET

/v1/sessions/{session\_id}/trace/turns

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/sessions/example/trace/turns';
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
```

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

## Parameters

### Path Parameters

**session\_id**

required

string

Prefixed public identifier

### Query Parameters

**before**

integer format: int32

Turns before this turn number. Without a cursor, the last turns.

**after**

integer format: int32

Turns after this turn number.

**around**

integer format: int32

Turns centered on this turn number.

**sequence**

integer format: int32

Turns centered on the turn holding this event sequence.

**limit**

integer format: int32

Turns per page, 1 to 50. Defaults to 20.

## Responses

### 200

Success

Media typeapplication/json

A page of turns with their steps.

object

**has\_earlier**

required

Turns exist before the first one returned.

boolean

**has\_later**

required

Turns exist after the last one returned.

boolean

**turn\_count**

required

Turns in the session.

integer format: int64

**turns**

required

Turns in turn order.

Array\<object>

One turn: what the user asked, how it went, and what happened.

object

**duration\_ms**

Wall time of the turn.

integer | null format: int64

**end\_sequence**

Last event sequence of the turn; absent while running.

integer | null format: int32

**ended\_at**

When the turn ended; absent while running.

string | null format: date-time

**error**

Why the turn failed, when it did.

string | null

**error\_count**

required

Failed steps in the turn.

integer format: int32

**input\_tokens**

required

Prompt tokens across the turn’s model calls.

integer format: int64

**items**

required

Steps, with repeated calls folded into batches and the middle of very long turns folded into a gap.

Array

One of:

* object

  One row of a turn.

  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

  **type**

  required

  string

  Allowed values: step

* object

  One row of a turn.

  object

  **count**

  required

  Calls in the batch.

  integer format: int64

  **failed**

  required

  Calls that failed.

  integer format: int64

  **failures**

  required

  The first failed calls, at most 20; page the rest with the steps list.

  Array\<object>

  A model call, tool call, approval, sub-agent or message. Empty fields are left out: a page carries hundreds of these.

  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

  **first\_step**

  required

  First step number in the batch.

  integer format: int32

  **last\_step**

  required

  Last step number in the batch.

  integer format: int32

  **name**

  required

  Tool name shared by every call.

  string

  **offset\_ms**

  required

  Start relative to the turn’s start.

  integer format: int64

  **p50\_ms**

  Median call duration.

  integer | null format: int64

  **p95\_ms**

  95th percentile call duration.

  integer | null format: int64

  **running**

  required

  Calls still running.

  integer format: int64

  **started\_at**

  required

  When the first call started.

  string format: date-time

  **succeeded**

  required

  Calls that succeeded.

  integer format: int64

  **turn**

  required

  Turn the batch belongs to.

  integer format: int32

  **wall\_ms**

  From the first start to the last end.

  integer | null format: int64

  **type**

  required

  string

  Allowed values: batch

* object

  One row of a turn.

  object

  **count**

  required

  Steps not returned.

  integer format: int64

  **errors**

  required

  Failed steps among them.

  integer format: int64

  **first\_step**

  required

  First step number not returned.

  integer format: int32

  **last\_step**

  required

  Last step number not returned.

  integer format: int32

  **turn**

  required

  Turn the gap belongs to.

  integer format: int32

  **type**

  required

  string

  Allowed values: gap

**model\_calls**

required

Model calls in the turn.

integer format: int32

**output\_tokens**

required

Completion tokens across the turn’s model calls.

integer format: int64

**prompt**

The user message that started the turn.

string | null

**start\_sequence**

required

First and last event sequence of the turn, for links into Events.

integer format: int32

**started\_at**

required

When the turn started.

string format: date-time

**status**

required

`running`, `completed`, `failed`, `cancelled` or `sealed`.

string

**step\_count**

required

Steps in the turn.

integer format: int32

**subagent\_calls**

required

Sub-agent calls in the turn.

integer format: int32

**tool\_calls**

required

Tool calls in the turn.

integer format: int32

**turn**

required

Per-session turn number, 1-based.

integer format: int32

**turn\_id**

required

Public turn identifier.

string

##### Example

```json
{
  "has_earlier": true,
  "has_later": false,
  "turn_count": 1240,
  "turns": [
    {
      "duration_ms": 4998,
      "end_sequence": 31,
      "error_count": 0,
      "input_tokens": 4210,
      "items": [
        {
          "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,
          "type": "step"
        }
      ],
      "model_calls": 2,
      "output_tokens": 129,
      "prompt": "Check the links on the docs site",
      "start_sequence": 12,
      "status": "completed",
      "step_count": 3,
      "subagent_calls": 0,
      "tool_calls": 1,
      "turn": 1240,
      "turn_id": "turn_01a124cd7e9571ac95c312b3c6d0cd82"
    }
  ]
}
```