---
title: "Get AI Gateway session threads"
method: GET
path: "/api/v2/ai-gateway/sessions/{session_id}"
tags: ["AI Gateway"]
---

# Get AI Gateway session threads

`GET /api/v2/ai-gateway/sessions/{session_id}`

Alias: also available at /api/v2/aibridge/sessions/{session_id} for backward compatibility.

## Path parameters

- `session_id` string, required

## Query parameters

- `after_id` string
- `before_id` string
- `limit` integer

## Response `200`

OK

- CodersdkAIBridgeSessionThreadsResponse
  - `client` string
  - `ended_at` string, date-time
  - `id` string
  - `initiator` CodersdkMinimalUser
    - `avatar_url` string, uri
    - `id` string, uuid, required
    - `name` string
    - `username` string, required
  - `metadata` object
  - `models` string[]
  - `network_call_logs` CodersdkAgentFirewallLog[] — NetworkCallLogs is the chronological list of individual network calls made during the session, holding the earliest calls up to a server-side cap. NetworkCalls remains authoritative for whole-session totals, so a shorter list than NetworkCalls.Total means the list was truncated. Empty when the session did not pass through Agent Firewall.
    - `allowed` boolean
    - `captured_at` string, date-time
    - `created_at` string, date-time
    - `detail` string
    - `id` string, uuid
    - `matched_rule` string
    - `method` string
    - `proto` string
    - `sequence_number` integer
    - `session_id` string, uuid
  - `network_calls` CodersdkAIBridgeSessionNetworkCallSummary
    - `blocked` integer
    - `total` integer
  - `network_domain_count` integer
  - `network_top_domains` CodersdkAIBridgeSessionNetworkDomain[] — NetworkTopDomains lists the most contacted destination hosts, ordered by call count descending. NetworkDomainCount is the total number of distinct domains, used to render a "+N more" overflow beyond the listed domains.
    - `count` integer
    - `domain` string
  - `page_ended_at` string, date-time
  - `page_started_at` string, date-time
  - `providers` string[]
  - `started_at` string, date-time
  - `threads` CodersdkAIBridgeThread[]
    - `agent_firewall_sequence_number` integer — AgentFirewallSequenceNumber is the firewall sequence number from the root interception. Used to determine the position of this LLM request in the firewall event stream. Nil when the request did not pass through the agent firewall.
    - `agent_firewall_session_id` string, uuid — AgentFirewallSessionID links this thread to an agent firewall confinement session. Nil when the request did not pass through the agent firewall.
    - `agentic_actions` CodersdkAIBridgeAgenticAction[]
      - `model` string
      - `thinking` CodersdkAIBridgeModelThought[]
        - `text` string
      - `token_usage` CodersdkAIBridgeSessionThreadsTokenUsage
        - `cache_read_input_tokens` integer
        - `cache_write_input_tokens` integer
        - `input_tokens` integer
        - `metadata` object
        - `output_tokens` integer
      - `tool_calls` CodersdkAIBridgeToolCall[]
        - `created_at` string, date-time
        - `id` string, uuid
        - `injected` boolean
        - `input` string
        - `interception_id` string, uuid
        - `metadata` object
        - `provider_response_id` string
        - `server_url` string
        - `tool` string
    - `credential_hint` string
    - `credential_kind` string
    - `ended_at` string, date-time
    - `error_message` string — ErrorMessage is the raw terminal upstream error message from the root interception. Nil when the interception succeeded.
    - `error_type` string — ErrorType is the categorized terminal upstream error from the root interception, or nil when the interception succeeded. See the aibridge_interception_error_type enum for possible values.
    - `id` string, uuid
    - `model` string
    - `prompt` string
    - `provider` string
    - `started_at` string, date-time
    - `token_usage` CodersdkAIBridgeSessionThreadsTokenUsage
      - `cache_read_input_tokens` integer
      - `cache_write_input_tokens` integer
      - `input_tokens` integer
      - `metadata` object
      - `output_tokens` integer
  - `token_usage_summary` CodersdkAIBridgeSessionThreadsTokenUsage
    - `cache_read_input_tokens` integer
    - `cache_write_input_tokens` integer
    - `input_tokens` integer
    - `metadata` object
    - `output_tokens` integer

---

[API](https://skmtc.net/coder/apis/coder-api.md) · [All operations](https://skmtc.net/coder/apis/coder-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/coder/coder-api/versions/56b6e9f08540/schema)
