> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.athenaintel.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.athenaintel.com/_mcp/server.

# List per-session token usage for a workspace

GET https://api.athenaintel.com/api/v0/workspaces/{workspace_id}/usage/sessions

Per-session LLM token usage for one workspace — the same rows as the workspace usage CSV export, as JSON. Each session yields one row per provider/model/status combination with its token breakdown and billed cost; dry-run (test) sessions are excluded. Pick the window with `from`/`to` (UTC dates, inclusive, at most 365 days) or a rolling `days`. Pages are keyset-paginated newest first: `limit` counts sessions, and `next_cursor` is returned while more sessions remain. Requires workspace owner or manager (or Athena admin) permissions.

Reference: https://docs.athenaintel.com/api-reference/workspaces/list-usage-sessions

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Path parameters

- `workspace_id` (string, required) — Unique identifier of the workspace

### Query parameters

- `from` (string, optional, nullable) — First UTC day of the window (YYYY-MM-DD); requires `to`
- `to` (string, optional, nullable) — Last UTC day of the window, inclusive (YYYY-MM-DD); requires `from`
- `days` (integer, optional, default: 30) — Rolling window in days ending now; ignored when `from`/`to` are given
- `cursor` (string, optional, nullable) — `next_cursor` from the previous page
- `limit` (integer, optional, default: 100) — Maximum sessions per page (each may yield several rows)

## Response

### 200

One page of session rows

- `next_cursor` (string, required, nullable) — Pass as `cursor` to fetch the next page; null when the window is exhausted
- `sessions` (list of WorkspaceUsageSessionRowOut, required) — Rows for this page, newest session first
- `window` (WorkspaceUsageWindowOut, required) — The reporting window a usage page covers.
- `workspace_id` (string, required) — Workspace the rows belong to

## Errors

### 400 Bad Request Error

Invalid date window or page cursor

- `any`

### 403 Forbidden Error

User is not a workspace owner, manager or admin

- `any`

### 404 Not Found Error

Workspace not found

- `any`

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### WorkspaceUsageSessionRowOut

Token usage of one session for one provider/model/status combination.

- `aop_id` (string, required, nullable) — AOP asset id when started by an AOP run
- `aop_title` (string, required, nullable) — Title of that AOP
- `billed_to` (string, required, nullable) — Billing attribution of the session
- `cache_creation_input_tokens` (integer, required, nullable) — Null for an `untracked` row
- `cache_read_input_tokens` (integer, required, nullable) — Null for an `untracked` row
- `first_event_at` (datetime, required, nullable) — Earliest model call in the row
- `input_tokens` (integer, required, nullable) — Null for an `untracked` row
- `last_event_at` (datetime, required, nullable) — Latest model call in the row
- `origin_kind` (string, required, nullable) — How the session was started (user_chat, aop_execution, public_api, ...)
- `origin_kind_label` (string, required, nullable) — Human label for origin_kind
- `output_tokens` (integer, required, nullable) — Null for an `untracked` row
- `project_id` (string, required, nullable) — Project asset id, if any
- `project_title` (string, required, nullable) — Title of that project
- `provider` (string, required) — LLM provider
- `reasoning_output_tokens` (integer, required, nullable) — Null for an `untracked` row
- `requested_model` (string, required, nullable) — Model the session asked for
- `resolved_model` (string, required) — Model that actually served the calls
- `row_total_cost_usd` (double, required) — Billed cost of this row in USD; safe to sum across rows
- `run_count` (integer, required) — Model calls aggregated into this row
- `session_created_at` (datetime, required) — When the session was created
- `session_id` (string, required) — Session (conversation) asset id
- `session_total_cost_usd` (double, required, nullable) — Billed cost of the whole session in USD, carried by the session's first row only and null on its other rows, so summing the column never double-counts (same convention as the CSV export)
- `status` (string, required) — Outcome of the aggregated calls; `untracked` marks a session metered before token tracking existed, whose token counters are null
- `total_tokens` (integer, required, nullable) — Null for an `untracked` row
- `trigger_type` (string, required, nullable) — AOP trigger type, if any
- `uncached_input_tokens` (integer, required, nullable) — Null for an `untracked` row
- `usage_period_end_exclusive` (datetime, required, nullable) — Window end (exclusive) the row was bounded to
- `usage_period_start` (datetime, required) — Window start the row was bounded to
- `user_email` (string, required, nullable) — Email of the member who ran the session
- `user_name` (string, required, nullable) — Display name of that member

### WorkspaceUsageWindowOut

The reporting window a usage page covers.

- `days` (integer, required) — Number of days the window spans
- `end_date` (date, required, nullable) — Last UTC day (inclusive) of an explicit window; null for a rolling window
- `start_date` (date, required, nullable) — First UTC day of an explicit `from`/`to` window; null for a rolling window
- `usage_period_end_exclusive` (datetime, required, nullable) — Window end (exclusive); null means 'now' for a rolling window
- `usage_period_start` (datetime, required) — Window start (inclusive)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "next_cursor": "MjAyNi0wMS0zMFQwOToxNTowMCswMDowMHxhc3NldF9jb252ZXJzYXRpb25fMDFq",
  "sessions": [
    {
      "aop_id": "string",
      "aop_title": "string",
      "billed_to": "workspace",
      "cache_creation_input_tokens": 0,
      "cache_read_input_tokens": 31400,
      "first_event_at": "2026-01-30T09:15:04Z",
      "input_tokens": 41200,
      "last_event_at": "2026-01-30T09:16:41Z",
      "origin_kind": "user_chat",
      "origin_kind_label": "User chat",
      "output_tokens": 2600,
      "project_id": "string",
      "project_title": "string",
      "provider": "anthropic",
      "reasoning_output_tokens": 0,
      "requested_model": "claude-sonnet-4-5",
      "resolved_model": "claude-sonnet-4-5-20250929",
      "row_total_cost_usd": 0.19,
      "run_count": 3,
      "session_created_at": "2026-01-30T09:15:00Z",
      "session_id": "asset_conversation_01j9x4z8q6k2m3n4p5r6s7t8u9",
      "session_total_cost_usd": 0.19,
      "status": "completed",
      "total_tokens": 43800,
      "trigger_type": "string",
      "uncached_input_tokens": 9800,
      "usage_period_end_exclusive": "2026-02-01T00:00:00Z",
      "usage_period_start": "2026-01-01T00:00:00Z",
      "user_email": "ada@example.com",
      "user_name": "Ada Lovelace"
    }
  ],
  "window": {
    "days": 31,
    "end_date": "2026-01-31",
    "start_date": "2026-01-01",
    "usage_period_end_exclusive": "2026-02-01T00:00:00Z",
    "usage_period_start": "2026-01-01T00:00:00Z"
  },
  "workspace_id": "workspace_eb171baf"
}
```

**SDK Code**

```python workspaces_list_usage_sessions_example
import requests

url = "https://api.athenaintel.com/api/v0/workspaces/workspace_id/usage/sessions"

headers = {"X-API-KEY": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript workspaces_list_usage_sessions_example
const url = 'https://api.athenaintel.com/api/v0/workspaces/workspace_id/usage/sessions';
const options = {method: 'GET', headers: {'X-API-KEY': '<apiKey>'}};

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

```go workspaces_list_usage_sessions_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.athenaintel.com/api/v0/workspaces/workspace_id/usage/sessions"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-KEY", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby workspaces_list_usage_sessions_example
require 'uri'
require 'net/http'

url = URI("https://api.athenaintel.com/api/v0/workspaces/workspace_id/usage/sessions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java workspaces_list_usage_sessions_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.athenaintel.com/api/v0/workspaces/workspace_id/usage/sessions")
  .header("X-API-KEY", "<apiKey>")
  .asString();
```

```php workspaces_list_usage_sessions_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.athenaintel.com/api/v0/workspaces/workspace_id/usage/sessions', [
  'headers' => [
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp workspaces_list_usage_sessions_example
using RestSharp;

var client = new RestClient("https://api.athenaintel.com/api/v0/workspaces/workspace_id/usage/sessions");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-KEY", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift workspaces_list_usage_sessions_example
import Foundation

let headers = ["X-API-KEY": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.athenaintel.com/api/v0/workspaces/workspace_id/usage/sessions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```