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

# Create a session key

> Issue a time-bound, velocity-bound allowance scoped to a mandate: the credential an autonomous agent actually holds.

A session key is what gets handed to an AI agent or automated process. It is checked on every [debit pull](https://docs.openfi.co/api-reference/agentic/create-debit-pull.md) against the on-chain [Allowance State Machine](https://docs.openfi.co/essentials/allowance-state-machine.md), so it can never authorize more than its parent mandate's ceiling for the current epoch.

### Body Parameters

**mandate\_id** `string` *required*

The mandate this session key is scoped to.

**expires\_in** `integer` *required*

Time-to-live in seconds. Common values: `3600` (1 hour), `86400` (1 day).

**max\_amount\_override** `number`

Optional tighter ceiling for this specific key, must be ≤ the parent mandate's `max_amount`.

**restricted\_destinations** `array`

Optional allow-list of destination addresses or account IDs this key may pay out to.

### Response

**id** `string`

Session key ID, prefixed `sk_`.

**status** `string`

`active`, `expired`, or `revoked`.

```bash cURL theme={null}
curl https://api.openfi.co/v1/session-keys \
  -H "Authorization: Bearer $OPENFI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mandate_id": "man_01HZY...",
    "expires_in": 86400
  }'
```

```json 200 theme={null}
{
  "id": "sk_01HZZ...",
  "mandate_id": "man_01HZY...",
  "status": "active",
  "expires_at": "2026-08-28T14:05:00Z"
}
```

## Revoking a session key

```bash theme={null}
curl -X DELETE https://api.openfi.co/v1/session-keys/sk_01HZZ... \
  -H "Authorization: Bearer $OPENFI_API_KEY"
```

Revoking a session key does not affect the parent mandate or any other session keys issued under it.


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