# Create a Quicknode Endpoint — Autonomous 3-Step Walkthrough

For AI agents with a funded EVM wallet and no Quicknode account. Provision a production RPC endpoint without human signup.

**URL:** https://www.quicknode.com/agents/create-endpoint

---

## The flow

1. **Pay via x402 or MPP** → `POST https://www.quicknode.com/api/v1/agent/subscriptions` → receive `QN_*` API key
2. **Create endpoint** → `POST https://api.quicknode.com/v0/endpoints` (Admin API) → receive RPC URL
3. **Use the RPC** → `POST <http_url>` for JSON-RPC calls

---

## Step 1 — Create subscription + receive API key

Pay via x402 or MPP. No email verification link; the account is created synchronously in the same request.

```shell
curl -X POST https://www.quicknode.com/api/v1/agent/subscriptions \
  -H "PAYMENT-SIGNATURE: <x402 v2 signed payload>" \
  -H "Content-Type: application/json" \
  -d '{
    "plan_name": "b6_build",
    "interval": "monthly",
    "email": "agent-abc@example.com",
    "password": "<strong password>",
    "password_confirmation": "<strong password>",
    "full_name": "Autonomous Agent",
    "name": "Agent Account",
    "billing_address": {
      "line1": "123 Main St",
      "city": "New York",
      "postal_code": "10001",
      "country": "US"
    }
  }'
```

Success response:
```json
{
  "api_key": "QN_abc123...",
  "plan": "b6_build",
  "admin_api_docs": "https://www.quicknode.com/docs/admin-api"
}
```

### Request body fields

| Field | Required | Notes |
|---|---|---|
| `plan_name` | required for charge | One of `b6_build`, `b6_accelerate`, `b6_scale`, `b6_business`. Omit to receive a 402 listing all plans + prices. |
| `interval` | optional | `monthly` (default) or `yearly`. |
| `email` | required | Used for account lookup / resume on retry. |
| `password` + `password_confirmation` | required | The password lets you resume if a retry is needed; without it the on-chain payer address would be the only secret. |
| `full_name` | required | Primary user's full name. |
| `name` | required | Account display name. |
| `billing_address.line1` | required | — |
| `billing_address.city` | required | — |
| `billing_address.postal_code` | required | — |
| `billing_address.country` | required | ISO-3166 alpha-2 (e.g. `US`, `GB`). |

### Payment headers

- **x402 v2:** `PAYMENT-SIGNATURE: <base64-encoded signed payload>`. If the header is missing, the server returns `402 Payment Required` with a body listing plans, accepted networks, `payTo` addresses, and asset contract addresses — everything needed to construct the payment. The response also sets a `PAYMENT-REQUIRED` header (base64 x402 requirement). SDK: `@quicknode/x402` (npm) or `x402` (pip) handles this automatically.
- **MPP:** `Authorization: Payment <mpp credential>`. The server also sets a `WWW-Authenticate: Payment ...` challenge header. SDK: `mppx` (npm) polyfills `fetch` so 402s auto-sign and retry.

### Rate limits

- `POST /api/v1/agent/subscriptions` — 20/min/IP, 5/hour/email

---

## Step 2 — Create RPC endpoint via Admin API

Use the `QN_*` key returned in Step 1 to create an endpoint on any supported chain.

**Base URL:** `https://api.quicknode.com`
**Auth:** `x-api-key: QN_...` (or `Authorization: Bearer QN_...`)

```shell
curl -X POST https://api.quicknode.com/v0/endpoints \
  -H "x-api-key: QN_abc123..." \
  -H "Content-Type: application/json" \
  -d '{"chain": "base", "network": "mainnet"}'
```

Success response (HTTP 200):
```json
{
  "data": {
    "id": "<endpoint_id>",
    "label": null,
    "status": "active",
    "chain": "base",
    "network": "mainnet",
    "http_url": "https://<name>.base-mainnet.quiknode.pro/<token>/",
    "wss_url":  "wss://<name>.base-mainnet.quiknode.pro/<token>/",
    "security": { "...": "..." },
    "rate_limits": { "...": "..." },
    "tags": []
  },
  "error": null
}
```

- `id` is a string.
- Required response fields: `id`, `chain`, `network`, `http_url`, `security`.
- `wss_url` is nullable on chains that don't support WebSocket.

Full Admin API spec — chains, networks, security, rate limits, tags, multichain, logs: https://www.quicknode.com/api-docs/v0/swagger.json
Admin API docs: https://www.quicknode.com/docs/admin-api

---

## Step 3 — Use the RPC endpoint

Standard JSON-RPC; no additional auth headers (the token is in the URL path).

```shell
curl -X POST https://<name>.base-mainnet.quiknode.pro/<token>/ \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
```

---

## Managing the subscription

### Top up credits — `POST https://www.quicknode.com/api/v1/agent/top_up`

Requires `x-api-key: QN_*` (or `Authorization: Bearer`) AND a fresh payment header.

Request:
```shell
curl -X POST https://www.quicknode.com/api/v1/agent/top_up \
  -H "x-api-key: QN_abc123..." \
  -H "PAYMENT-SIGNATURE: <x402 v2 signed payload>" \
  -H "Content-Type: application/json" \
  -d '{"amount": 10.00}'
```

- `amount` is in **USD dollars** (not cents). Must be > 0 and ≤ 25000.
- Idempotent on payment tx hash.
- Rate limit: 30/min.

Response:
```json
{
  "balance_cents": 1000000,
  "payment_amount_cents": 10000
}
```

### Check balance — `GET https://www.quicknode.com/api/v1/agent/balance`

Requires `x-api-key: QN_*`. Rate limit: 60/min.

Response:
```json
{
  "balance_cents": 1000000
}
```

### Manage endpoints

List, update, configure security, delete — all via the Admin API at `https://api.quicknode.com/v0/endpoints/{id}`. See https://www.quicknode.com/api-docs/v0/swagger.json for the full surface.

---

## Related

- Decision tree (x402 / MPP / Agent Subscription / API key / MCP / Skills): https://www.quicknode.com/agents.md
- A2A Agent Card (machine-readable skill manifest): https://www.quicknode.com/.well-known/agent.json
- Pricing (plans available for subscription): https://www.quicknode.com/pricing.md
- Admin API docs: https://www.quicknode.com/docs/admin-api
- Admin API full OpenAPI spec: https://www.quicknode.com/api-docs/v0/swagger.json
- x402 gateway (per-request RPC, no subscription): https://x402.quicknode.com
- MPP gateway (per-request RPC, no subscription): https://mpp.quicknode.com
