# Show what a session spent

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

[Docs](https://everruns.com/docs/)/[API reference](https://everruns.com/docs/api/)/[Sessions & workspaces](https://everruns.com/docs/api/groups/sessions-workspaces/)/Show what a session spent

# Show what a session spent

Preview

Show what a session spent: totals by cost category (uncached prompt, cache read, cache write, output), spend per hour and per turn, what started the turns, tool calls, and sandbox running time.

Public APIEverruns Cloud and self-hosted Platform

GET`/v1/sessions/{session_id}/cost`

See [authentication](https://everruns.com/docs/sre/runbooks/authentication/) for credentials and permissions.

## Parameters

### Path Parameters

**session_id**

required

string

Prefixed public identifier

## Responses

200Success

### 200

Success

Media typeapplication/json

What a session spent, split by cost category, over time, by what started each turn, by tool, and by sandbox.

object

**categories**

required

Spend and tokens per cost category, in a fixed order: `uncached_input`, `cache_read`, `cache_write`, `output`.

Array\<object>

Spend and tokens of one cost category.

object

**key**

required

`uncached_input`, `cache_read`, `cache_write` or `output`.

string

**tokens**

required

Tokens in this category across every model call.

integer format: int64

**usd**

required

USD, from each call’s cost split by the model’s price table.

number format: double

**hours**

required

Spend per UTC hour that had model calls, oldest first.

Array\<object>

Spend in one UTC hour, by category.

object

**cache_read_usd**

required

USD of prompt tokens read from cache.

number format: double

**cache_write_usd**

required

USD of prompt tokens written to cache.

number format: double

**hour**

required

Start of the hour (UTC).

string format: date-time

**model_calls**

required

Model calls made in the hour.

integer format: int64

**output_usd**

required

USD of output tokens.

number format: double

**unattributed_usd**

required

Spend with no category split (see `SessionCost.unattributed_usd`).

number format: double

**uncached_input_usd**

required

USD of prompt tokens not read from cache.

number format: double

**model_calls**

required

Model calls recorded for the session.

integer format: int64

**models**

required

Spend per model, largest first.

Array\<object>

Spend of one model.

object

**calls**

required

Model calls made with this model.

integer format: int64

**model**

required

Model id as the provider reported it.

string

**provider**

Provider driver that served the model, when known.

string | null

**usd**

required

Spend in USD on this model.

number format: double

**sandboxes**

required

Sandboxes the session ran, oldest first.

Array\<object>

A sandbox the session ran and how long it ran.

object

**created_at**

required

When the sandbox was created.

string format: date-time

**paused_seconds**

required

Seconds the sandbox spent paused.

integer format: int64

**profile_name**

Sandbox template profile, when one was used.

string | null

**provider**

required

Sandbox provider, e.g. `daytona` or `e2b`.

string

**running_seconds**

required

Seconds the sandbox spent running.

integer format: int64

**sandbox_id**

required

Sandbox’s prefixed public identifier.

string

**spans**

required

Lifecycle spans, oldest first.

Array\<object>

A span of time a Sandbox spent in one state.

object

**current**

required

The Sandbox is still in this state.

boolean

**end**

required

string format: date-time

**generation**

required

Incarnation during the span.

integer format: int64

**start**

required

string format: date-time

**state**

required

Fleet state during the span.

string

**session_id**

required

Session’s prefixed public identifier.

string

**sources**

required

Turns and spend by what started them, largest spend first.

Array\<object>

Turns and spend of one origin.

object

**active**

The schedule still fires: enabled and not deleted.

boolean | null

**cron**

Cron expression of a recurring schedule.

string | null

**kind**

required

`user`, `schedule`, `agent_trigger`, `channel`, …

string

**name**

The schedule’s description, when it is a session schedule.

string | null

**source_id**

The schedule, trigger or channel, when there is one.

string | null

**turns**

required

Turns this origin started.

integer format: int64

**usd**

required

Spend in USD on those turns.

number format: double

**tools**

required

Tool calls across the session.

object

**calls**

required

Tool calls across the session.

integer format: int64

**duration_ms**

required

Summed running time of every call.

integer format: int64

**failed**

required

Tool calls that ended in an error.

integer format: int64

**items**

required

Per tool, most calls first.

Array\<object>

Calls, failures and running time of one tool.

object

**calls**

required

Calls of this tool.

integer format: int64

**duration_ms**

required

Summed running time of its calls.

integer format: int64

**failed**

required

Calls of this tool that ended in an error.

integer format: int64

**name**

required

Tool name.

string

**total_usd**

required

Total spend in USD: the provider-reported cost of each model call where reported, otherwise the price-table estimate.

number format: double

**turns**

required

Spend per turn, oldest first; the newest turns when `turns_truncated`.

Array\<object>

Spend of one turn.

object

**prompt_tokens**

required

Prompt tokens of the turn, cached and uncached.

integer format: int64

**source_kind**

required

What started the turn: `user`, `schedule`, `agent_trigger`, `channel`, …

string

**started_at**

required

When the turn started.

string format: date-time

**status**

required

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

string

**turn**

required

Per-session turn number, 1-based.

integer format: int32

**turn_id**

required

Turn’s prefixed public identifier.

string

**usd**

required

Spend in USD on the model calls of the turn.

number format: double

**turns_truncated**

required

Older turns were left out of `turns`.

boolean

**unattributed_usd**

required

Spend of model calls whose split by category is unknown: the provider reported a cost but the model has no price table.

number format: double

**unpriced_calls**

required

Model calls with no reported cost and no price-table estimate. They count tokens but add nothing to `total_usd`.

integer format: int64

### Example

```json
{
  "categories": [
    {
      "key": "uncached_input",
      "tokens": 1060877013,
      "usd": 106.09
    }
  ],
  "model_calls": 3811,
  "models": [
    {
      "calls": 3811,
      "model": "meta/muse-spark-1.3-contributor",
      "provider": "openrouter",
      "usd": 106.26
    }
  ],
  "sandboxes": [
    {
      "paused_seconds": 1860,
      "provider": "daytona",
      "running_seconds": 4320,
      "sandbox_id": "sandbox_01a1510c99c8714eabb22a463e7c1fa1",
      "spans": [
        {
          "state": "running"
        }
      ]
    }
  ],
  "session_id": "session_01a1510c99c8714eabb22a463e7c1fa1",
  "sources": [
    {
      "cron": "*/5 * * * *",
      "kind": "schedule",
      "name": "Shipmail claim poll",
      "source_id": "sched_01a1510ebffc7370a495ed68cc7f9ab3",
      "turns": 1845,
      "usd": 106.11
    }
  ],
  "tools": {
    "calls": 1977,
    "duration_ms": 645000,
    "failed": 14,
    "items": [
      {
        "calls": 1180,
        "duration_ms": 627000,
        "failed": 13,
        "name": "web_fetch"
      }
    ]
  },
  "total_usd": 106.26,
  "turns": [
    {
      "prompt_tokens": 2034790,
      "source_kind": "schedule",
      "status": "completed",
      "turn": 1162,
      "turn_id": "turn_01a124cd7e9571ac95c312b3c6d0cd82",
      "usd": 0.2
    }
  ],
  "unattributed_usd": 0,
  "unpriced_calls": 0
}
```

FetchcURL

Request

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


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

Request

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

Additional language examples require JavaScript. The default request example is available above.

200

200 · Success

```json
{
  "categories": [
    {
      "key": "uncached_input",
      "tokens": 1060877013,
      "usd": 106.09
    }
  ],
  "hours": [
    {
      "cache_read_usd": 0,
      "cache_write_usd": 0,
      "hour": "2026-10-12T09:00:00Z",
      "model_calls": 0,
      "output_usd": 0,
      "unattributed_usd": 0,
      "uncached_input_usd": 0
    }
  ],
  "model_calls": 3811,
  "models": [
    {
      "calls": 3811,
      "model": "meta/muse-spark-1.3-contributor",
      "provider": "openrouter",
      "usd": 106.26
    }
  ],
  "sandboxes": [
    {
      "created_at": "2026-10-12T09:00:00Z",
      "paused_seconds": 1860,
      "provider": "daytona",
      "running_seconds": 4320,
      "sandbox_id": "sandbox_01a1510c99c8714eabb22a463e7c1fa1",
      "spans": []
    }
  ],
  "session_id": "session_01a1510c99c8714eabb22a463e7c1fa1",
  "sources": [
    {
      "cron": "*/5 * * * *",
      "kind": "schedule",
      "name": "Shipmail claim poll",
      "source_id": "sched_01a1510ebffc7370a495ed68cc7f9ab3",
      "turns": 1845,
      "usd": 106.11
    }
  ],
  "tools": {
    "calls": 1977,
    "duration_ms": 645000,
    "failed": 14,
    "items": [
      {}
    ]
  },
  "total_usd": 106.26,
  "turns": [
    {
      "prompt_tokens": 2034790,
      "source_kind": "schedule",
      "started_at": "2026-10-12T09:00:00Z",
      "status": "completed",
      "turn": 1162,
      "turn_id": "turn_01a124cd7e9571ac95c312b3c6d0cd82",
      "usd": 0.2
    }
  ],
  "turns_truncated": true,
  "unattributed_usd": 0,
  "unpriced_calls": 0
}
```

## Matching endpoints