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

> ## Agent Instructions
> Xintel agents pay for shared report bodies only via x402 — never profile, posts, or edges.
> Preferred flow: GET /api/intel/list → GET /api/intel/reports?username= (menu) → select=all|range with X-402-Payment.
> Docs: https://docs.xintel.aispace.bot — App: https://xintel.aispace.bot — Agent playbook: /agents.md

# Auth and payment

> The agent API has no login. The only gate is an x402 payment on report bodies.

Agents hold no session, key, or token. The only checkpoint is payment, and it applies only to report bodies. Read the [Quickstart](/agent-api/quickstart) first for the surrounding flow.

<h2 id="no-session">
  No session
</h2>

The public agent endpoints require no OAuth, no account, and no API key. An agent stays anonymous until it requests report **bodies**, then authenticates by paying — not by identifying itself. First-party app traffic is authorized through a separate internal path that is out of scope here.

## Free vs paid

| Call                                             | Requirement     |
| ------------------------------------------------ | --------------- |
| `GET /api/intel/list`                            | None            |
| `GET /api/intel/reports?username=` (no `select`) | None            |
| `GET …&select=all` or `select=range`             | x402 settlement |

## The 402 challenge

A paid `select` with no payment returns **402** with this body:

```json theme={null}
{
  "x402Version": 2,
  "error": "Payment required",
  "accepts": [
    {
      "protocol": "x402",
      "version": 2,
      "network": "eip155:8453",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "10000",
      "payTo": "0x…"
    }
  ],
  "extensions": {
    "chainId": 8453,
    "tokenDecimals": 6,
    "unitPriceUsd": 0.01,
    "reportCount": 1,
    "select": "all",
    "resource": "/api/intel/reports?username=…"
  }
}
```

`amount` is USDC base units (6 decimals — `10000` = \$0.01). The asset is USDC on **Base** (chain `8453`). `extensions` tells you how many reports you are buying and the unit price. `payTo` is the deployment's receiver wallet.

## Payment header

Settle the challenge, then resend the identical request with the payment attached in one of:

* `X-402-Payment: <payload>` (preferred)
* `X-Payment: <payload>` (fallback — the standard x402 header, so off-the-shelf x402 clients work unchanged)

The underlying instrument is an EIP-3009 `TransferWithAuthorization` for USDC on **Base**. Because it is signed off-chain and settled for you, the payer wallet needs USDC but not ETH for gas.

## How to pay

<Note>
  **Prerequisite:** a wallet funded with USDC on **Base** (chain `8453`). Browsing (`list` and the menu) needs nothing — only report bodies are gated.
</Note>

Use a standard [x402](https://www.x402.org/) client to turn the 402 into a payment. It reads `accepts[0]`, signs the authorization with your Base wallet, and produces the header — no hand-rolled signing required.

```bash theme={null}
npm install x402 viem
```

```js theme={null}
import { createPaymentHeader } from 'x402/client'
import { privateKeyToAccount } from 'viem/accounts'

// challenge = the parsed 402 JSON body; url = the same URL that returned it
const accept = challenge.accepts[0]
const signer = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY)

const payment = await createPaymentHeader(signer, 2, {
  scheme: 'exact',
  network: 'base',
  maxAmountRequired: accept.amount, // USDC base units (6dp)
  resource: challenge.extensions.resource,
  description: 'Xintel report bodies',
  mimeType: 'application/json',
  payTo: accept.payTo,
  maxTimeoutSeconds: 300,
  asset: accept.asset, // USDC on Base
  extra: { name: 'USD Coin', version: '2' },
})

const res = await fetch(url, { headers: { 'X-402-Payment': payment } })
const body = await res.json()
// { username, select, reportCount, chargedUsd, reports: IntelReportSnapshot[] }
```

Always build the payment from the values in the **latest** 402 response rather than hardcoding `amount`, `payTo`, or `asset`.

### Common rejections

* Underpayment → **402** `insufficient_payment` (with `requiredUsd` and `paidUsd`)
* Reused `nonce` / payment id → **409** `payment_already_used`
* Bad signature or payer/receiver mismatch → **402** with the specific error string

## Related

* [Pricing](/agent-api/pricing)
* [Errors](/agent-api/errors)
* [Free / BYOK / x402](/concepts/free-byok-x402)
