> ## Documentation Index
> Fetch the complete documentation index at: https://docs.redpill.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Session

> The immutable attested-session record behind a confidential response.

Returns an [attested session](/confidential-ai/attested-sessions): the immutable, content-addressed
record of the verified TEE channel a confidential request was bound to. A receipt's
`upstream.verified.session_id` references it, so you can trace any confidential response back to the
exact verified security context, with its typed claims and channel binding.

```http theme={null}
GET /v1/aci/sessions/{session_id}
GET /v1/aci/sessions?upstream_name={upstream_name}&model={model}
```

## Get one session

<ParamField path="session_id" type="string" required>
  The 64-character lowercase hex id from a receipt's `upstream.verified.session_id`.
</ParamField>

### Response

| Field             | Type   | Description                                                          |
| ----------------- | ------ | -------------------------------------------------------------------- |
| `api_version`     | string | ACI version token.                                                   |
| `upstream_name`   | string | The service-chosen upstream label for this channel.                  |
| `endpoint`        | string | The verified upstream origin.                                        |
| `verifier_id`     | string | The verifier that produced this result.                              |
| `established_at`  | number | When the material was verified (Unix seconds).                       |
| `expires_at`      | number | Retention deadline (Unix seconds).                                   |
| `identity`        | object | Verified upstream identity keys (for example a signing address).     |
| `channel_binding` | array  | The enforceable binding(s): a TLS SPKI digest or an E2EE public key. |
| `claims`          | object | Typed claims (below).                                                |
| `evidence`        | object | Byte-preserving evidence the verifier checked (`digest` + data URI). |

### Typed claims

Each claim carries a `status` (`asserted` / `refuted` / `unknown`), a `source`
(`hardware_proven` / `verifier_derived` / `provider_asserted` / `operator_asserted`), and a `reason`. The
claim set: `tee_attested`, `tcb_up_to_date`, `os_known_good`, `serving_software_known_good`,
`gpu_attested`, `model_weights_provenance`, plus provider-specific entries in `extra`. See
[Reading TCB and claims](/confidential-ai/tcb-and-claims).

```json theme={null}
{
  "api_version": "aci/1",
  "upstream_name": "near-ai",
  "endpoint": "https://cloud-api.near.ai",
  "verifier_id": "private-ai-verifier/near-ai-gateway/v1",
  "established_at": 1781588840,
  "expires_at": 1781589140,
  "channel_binding": [
    { "type": "tls_spki_sha256", "origin": "https://cloud-api.near.ai", "spki_sha256": "…" }
  ],
  "claims": {
    "tee_attested": { "status": "asserted", "source": "hardware_proven", "reason": "verified TDX quote" },
    "tcb_up_to_date": { "status": "asserted", "source": "hardware_proven" },
    "gpu_attested": { "status": "unknown" }
  },
  "evidence": { "digest": "sha256:…", "data": "data:application/json;base64,…" }
}
```

## List current sessions

`GET /v1/aci/sessions?upstream_name={upstream_name}&model={model}` returns current attested sessions.
Use it as a preflight survey: inspect the verified identity, channel binding, and claims for a model
before sending a prompt.

```bash theme={null}
curl "https://tee.redpill.ai/v1/aci/sessions?upstream_name=near-ai" \
  -H "Authorization: Bearer $REDPILL_AI_API_KEY"
```

Returns `{ "api_version": "aci/1", "sessions": [...] }`. Each list entry includes its `session_id`
but omits the bulky `evidence.data`; fetch the full record before verifying its content hash.

## Why content-addressed

`session_id` is the bare SHA-256 of the full session document in canonical JCS form. Any change
produces a new id, and sessions are never updated in place. Recompute the id after fetching the full
record to confirm it is exactly the document cited by the receipt.

## Related

<CardGroup cols={2}>
  <Card title="Attested sessions concept" icon="link" href="/confidential-ai/attested-sessions" />

  <Card title="Get receipt" icon="receipt" href="/api-reference/receipts" />
</CardGroup>
