> ## 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.

# Create and Manage AI Payment Sessions in Pay3 Dashboard

> Create, configure, and revoke AI sessions for Claude, Cursor, ChatGPT, and other MCP-compatible assistants — with on-chain session registration.

A session is a time-limited permission grant that allows a specific AI assistant to request payments on your behalf. Each session is tied to exactly one smart account (the vault it draws from) and one spending policy (the rules it must follow). When the session expires — or when you revoke it — the AI loses all ability to request transactions, even if it still holds the MCP auth token.

## Before you create a session

Make sure you have:

* At least one [smart account](https://pay3.mintlify.site/dashboard/smart-accounts.md) linked to Pay3
* At least one [spending policy](https://pay3.mintlify.site/dashboard/policies.md) created
* Your AI client open and ready to receive configuration

## Creating a session

**1. Open the Sessions page**

Click **Sessions** in the dashboard navigation bar.

**2. Select a smart account**

Under **Create session**, choose the smart account (Soroban vault) this session will draw funds from. The dropdown shows your linked contracts, truncated for readability.

**3. Select a policy**

Choose the spending policy that governs this session. The policy determines daily budgets, per-transaction limits, approval thresholds, allowed assets, and how long the session lasts. Policies are frozen at session creation — changing a policy later will not affect this session.

**4. Choose your AI client**

Select the client type that matches the AI assistant you're configuring:

* **Cursor** — the Cursor code editor
* **Claude** — Anthropic's Claude (desktop or API)
* **ChatGPT** — OpenAI's ChatGPT
* **Gemini** — Google's Gemini
* **Other** — any other MCP-compatible client

**5. Click Create AI session**

Pay3 generates a unique session key pair, registers the session, and returns your MCP auth token along with the full MCP configuration JSON.

## Copying your MCP configuration

After creation, a green confirmation panel appears with your session credentials. Copy the `PAY3_MCP_AUTH_TOKEN` and paste it into your AI client's configuration.

> [!WARNING]
>
> **Your MCP auth token is shown exactly once.** Pay3 does not store the token in a retrievable form after this screen. Copy it immediately and save it somewhere secure. If you lose it, you must revoke the session and create a new one.

The MCP configuration you need to add to your AI client looks like this:

```json theme={null}
{
  "mcpServers": {
    "pay3": {
      "command": "npx",
      "args": ["-y", "@pay3/mcp-server"],
      "env": {
        "PAY3_MCP_AUTH_TOKEN": "<your-token-here>",
        "API_BASE_URL": "https://api.pay3.finance"
      }
    }
  }
}
```

Replace `<your-token-here>` with the token shown in the dashboard. Paste this JSON into your client's MCP server configuration file (the exact location varies by client — consult your client's documentation).

## Registering the session on-chain

After copying your token, you must complete one final step: calling `add_session` on your Soroban vault contract. The dashboard shows the exact parameters you need — including the session public key, expiry timestamp, per-transaction maximum, and daily maximum — ready to paste into the Soroban CLI or Stellar Laboratory.

```bash theme={null}
soroban contract invoke \
  --id <YOUR_CONTRACT_ID> \
  --source <YOUR_WALLET_SECRET_KEY> \
  --network testnet \
  -- add_session \
  --session <SESSION_PUBLIC_KEY> \
  --expires_at <EXPIRES_AT_UNIX> \
  --per_tx_max <PER_TX_MAX_STROOPS> \
  --daily_max <DAILY_MAX_STROOPS>
```

> [!NOTE]
>
> The on-chain registration step is mandatory. Until you call `add_session` on your contract, the smart account will reject any payment requests from this session, even if the MCP token is valid.

This two-step process — off-chain session creation followed by on-chain registration — ensures that the Soroban contract independently verifies every transaction, providing a second layer of protection beyond Pay3's off-chain policy checks.

## Managing existing sessions

The sessions list below the creation form shows all sessions currently active on your account:

| Column | Description |
| - | - |
| **Client type** | The AI assistant this session was created for (e.g., CURSOR, CLAUDE) |
| **Session public key** | The on-chain key registered with your vault contract |
| **Policy** | The spending policy name governing this session |
| **Expiry** | The date and time when this session automatically expires |

### Revoking a session

To revoke a single session, click **Revoke** next to it. The session is immediately invalidated — the AI assistant will receive an authentication error on its next payment attempt.

> [!NOTE]
>
> Each AI assistant should have its own dedicated session. This gives you independent budget tracking per assistant, clean audit logs, and the ability to revoke one assistant's access without affecting others.

### Session expiry

Sessions expire automatically at the time determined by your policy's session duration. An expired session no longer appears in the active sessions list — you cannot reactivate it. Create a new session when you need continued access.


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