# x402-policy API – Session Creation

> x402-policy API – Session Creation is a paid API for AI agents from x402-api-seven.vercel.app, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-03).

Creates an AI agent spending policy session with a configurable spend cap via x402 v2 micropayments on Base Mainnet

## Facts

- Endpoint: POST https://x402-api-seven.vercel.app/v1/session?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-policy-api-session-creation-32f4108c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HGRcBNZfmab2gA5jS7Z50

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-policy-api-session-creation-32f4108c -d '<json body>'
```

Example prompt: Set up a new spending policy session for me with a $5 USD spend cap so my agent can make micropayments on Base Mainnet without going over budget.

## When to prefer this

Use this endpoint when you need to programmatically create a controlled spending policy for an AI agent operating autonomously, specifically with x402 v2 micropayment enforcement on Base Mainnet. Prefer this over manual USDC transfers or other payment rails when you want per-call micropayment accountability and a hard spend cap enforced at the session level.

## Known failure modes

- Payment not received or x402 payment header missing — 402 Payment Required
- Insufficient USDC balance for the $0.002 per-call fee — payment rejected
- Invalid spend cap value or malformed request body — 400 Bad Request
- Session creation fails due to network congestion on Base Mainnet — 503 or timeout
- Expired or invalid x402 payment credentials — 401 Unauthorized

## How this service works

AI agent spending policy via x402 v2 micropayments on Base Mainnet.

## Output

Returns a JSON object with the session's active status (true/false), a unique session key ID (e.g. sess_abc123), the amount spent so far in USD (initially 0), the Unix timestamp when the session expires, and the configured spend cap in USD.

## Request schema (JSON Schema)

```json
{
 "type": "object"
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "format": null,
 "example": {
  "active": true,
  "key_id": "sess_abc123",
  "spent_usd": 0,
  "expires_at": 1749254400,
  "spend_cap_usd": 5
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-policy-api-session-creation-32f4108c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-api-seven.vercel.app](https://www.zero.xyz/host/x402-api-seven.vercel.app/llms.txt)
