apicheats.dev anthropic/llms.txt Raw .md
GET

GET /v1/sessions?beta=true — Claude API

Beta

Anthropic API key (required); https://api.anthropic.com

Claude API

List Sessions

Base URL
https://api.anthropic.com
Auth
x-api-key: <ANTHROPIC_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 336 tokens · Vary: Accept

Critical gotchas

Authentication uses the x-api-key header and requests also require an anthropic-version header.

The official OpenAPI URL is discovered from the SDK repository manifest and must remain under Anthropic's trusted Stainless storage prefix.

cURL

curl -X GET 'https://api.anthropic.com/v1/sessions?beta=true&limit=10&page=example-page&include_archived=true&created_at%5Bgte%5D=example-created-at%5Bgte%5D&created_at%5Bgt%5D=example-created-at%5Bgt%5D&created_at%5Blte%5D=example-created-at%5Blte%5D&created_at%5Blt%5D=example-created-at%5Blt%5D&agent_id=agent-id&agent_version=10&order=asc&memory_store_id=memory-store-id&deployment_id=deployment-id&statuses%5B%5D=example' \  -H "x-api-key: $ANTHROPIC_API_KEY" \  -H 'anthropic-version: 2023-06-01'

Parameters

Name In Type Required Description
limit query integer No Maximum number of results to return.
page query string No Opaque pagination cursor from a previous response.
include_archived query boolean No When true, includes archived sessions. Default: false (exclude archived).
created_at[gte] query string No Return sessions created at or after this time (inclusive).
created_at[gt] query string No Return sessions created after this time (exclusive).
created_at[lte] query string No Return sessions created at or before this time (inclusive).
created_at[lt] query string No Return sessions created before this time (exclusive).
agent_id query string No Filter sessions created with this agent ID.
agent_version query integer No Filter by agent version. Only applies when `agent_id` is also set.
order query string No Sort direction for results, ordered by `created_at`. Defaults to `desc` (newest first).
memory_store_id query string No Filter sessions whose resources contain a `memory_store` with this memory store ID.
deployment_id query string No Filter sessions created by this deployment ID.
statuses[] query string[] No Filter by session status. Repeat the parameter to match any of multiple statuses.

Response 200 OK

{
  "data": [],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=",
  "prev_page": "page_MjAyNS0wNS0xM1QwMDowMDowMFo="
}
Get a free Claude API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.