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

# GET /api/ai-sessions — List Active AI Sessions

> GET /api/ai-sessions — returns all currently active AI sessions for your account, including client type, policy summary, smart account, and expiry time.

Retrieve every currently active AI session associated with your account. Each session represents an authorized AI client — such as Cursor, Claude, or ChatGPT — that has been granted permission to initiate Stellar transactions on your behalf within the bounds of a spending policy. Use this endpoint to audit which AI assistants are active and to identify sessions that should be revoked.

## Endpoint

```
GET /api/ai-sessions
```

## Authentication

All requests must include a valid bearer token in the `Authorization` header, or a `pay3_session` cookie obtained during wallet authentication.

```
Authorization: Bearer <token>
```

## Response

Returns an array of active AI session objects, ordered newest first. Only sessions with `ACTIVE` status and a future expiry time are returned — expired and revoked sessions are excluded. To revoke a session, see [Revoke Sessions](https://pay3.mintlify.site/api-reference/ai-sessions/revoke.md).

### Response fields

**id** `string` *required*

Unique UUID identifying this AI session.

**clientType** `string` *required*

The AI client associated with this session. One of `CURSOR`, `CLAUDE`, `CHATGPT`, `GEMINI`, or `OTHER`.

**sessionPublicKey** `string` *required*

The Ed25519 public key (Stellar G-address) of the ephemeral session keypair registered on-chain. This key signs transactions submitted by the AI on your behalf.

**expiresAt** `string` *required*

ISO 8601 timestamp after which the session automatically becomes inactive.

**createdAt** `string` *required*

ISO 8601 timestamp when the session was created.

**policy** `object` *required*

Summary of the spending policy governing this session's transaction limits.

**policy fields**

**id** `string` *required*

UUID of the spending policy.

**name** `string` *required*

Display name of the policy.

**preset** `string` *required*

Policy preset. One of `CONSERVATIVE`, `BALANCED`, `DEFI`, or `CUSTOM`.

**smartAccount** `object` *required*

The smart account (Soroban contract) this session is authorized to operate on.

**smartAccount fields**

**id** `string` *required*

UUID of the smart account record.

**contractId** `string` *required*

On-chain Soroban contract ID (C-address).

## Example request

```bash theme={null}
curl https://api.pay3.dev/api/ai-sessions \
  -H "Authorization: Bearer <token>"
```

## Example response

```json theme={null}
[
  {
    "id": "e3b0c442-98fc-1c14-9afb-f4c8996fb924",
    "clientType": "CURSOR",
    "sessionPublicKey": "GDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "expiresAt": "2025-07-15T14:30:00.000Z",
    "createdAt": "2025-07-08T14:30:00.000Z",
    "policy": {
      "id": "f9e8d7c6-dcba-4321-fedc-ba9876543210",
      "name": "Balanced Preset",
      "preset": "BALANCED"
    },
    "smartAccount": {
      "id": "a1b2c3d4-1234-5678-abcd-ef0123456789",
      "contractId": "CCHD3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  },
  {
    "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "clientType": "CLAUDE",
    "sessionPublicKey": "GEYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY",
    "expiresAt": "2025-07-15T09:00:00.000Z",
    "createdAt": "2025-07-08T09:00:00.000Z",
    "policy": {
      "id": "c2d3e4f5-0000-1111-2222-333344445555",
      "name": "My Custom Policy",
      "preset": "CUSTOM"
    },
    "smartAccount": {
      "id": "a1b2c3d4-1234-5678-abcd-ef0123456789",
      "contractId": "CCHD3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  }
]
```

> [!NOTE]
>
> This endpoint returns **only active sessions** — those that are currently valid and have not yet expired. To revoke one or all sessions, see [Revoke Sessions](https://pay3.mintlify.site/api-reference/ai-sessions/revoke.md). Revoked and expired sessions are not returned here, but their associated transactions remain visible in [GET /api/transactions](https://pay3.mintlify.site/api-reference/transactions/list.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.