---
title: "Charge AI agents per request with x402, no API keys required"
description: "AI agents can pay for each request to your link in USDC over x402. Urlgate puts a per-request price in front of any URL, so you can sell access to an API, file, or page without keys or invoices."
date: 2026-11-16
published: 2026-11-16T08:30:00-08:00
canonical: https://urlgate.xyz/news/charge-ai-agents-per-request-with-x402
image: https://urlgate.xyz/news/images/2026-11-16-og.jpg
---

# Charge AI agents per request

November 16, 2026 · https://urlgate.xyz/news/charge-ai-agents-per-request-with-x402

AI agents are starting to fetch data, call APIs, and read pages on their own. Most of what they hit is either free or locked behind an API key that a human had to sign up for. x402 adds a third option: the agent pays for the request itself.

Urlgate brings that option to any URL.

## How a paid request works

1. You gate a URL on [urlgate.xyz](https://urlgate.xyz) and set a USDC price. New links start at 0.01 USDC by default.
2. An agent requests your shortlink and gets an HTTP 402 Payment Required response that states the price.
3. The agent pays in USDC over x402 and retries the same request.
4. Urlgate checks the payment and sends the agent on to your destination.

No account, API key, or invoice sits in the middle. Every request carries its own payment.

## Why pay-per-request fits agents

- **No sign-up step.** An agent cannot fill out a billing form, but it can pay a 402.
- **Small, exact prices.** You charge per call instead of guessing at a monthly plan.
- **One link for everyone.** The same shortlink shows people a paywall card in the browser and gives agents a machine-readable price.

## What to gate

- A data or API endpoint that agents call for fresh results
- A research file, dataset, or prompt pack an agent can buy and read
- A single article or report instead of a full subscription

If you have wanted to sell access to an API or monetize links that bots already visit, start with one URL and one price. Builders who do show up on the public leaderboard for future rewards.

[Gate your first link at urlgate.xyz](https://urlgate.xyz)

## For agents

Machine-readable summary for AI agents and their builders. Always trust the live 402 challenge and `GET https://urlgate.xyz/api/v2/config` over any number on this page.

- What: pay-to-open short links. `GET https://urlgate.xyz/{code}` (or `GET https://urlgate.xyz/api/urlgate/{code}`) with `Accept: application/json` answers `402 Payment Required`; pay in USDC, then retry the same request.
- Challenge: the x402 v2 `PaymentRequired`, base64, in the `PAYMENT-REQUIRED` header. A legacy x402 v1 JSON body is also sent; pay from the header.
- Networks on this host: Base (`eip155:8453`), Polygon (`eip155:137`), Arbitrum (`eip155:42161`). USDC only. The code supports Base, Base Sepolia, Polygon, Arbitrum; admins can disable networks, so read `accepts[]`, `https://urlgate.xyz/.well-known/x402` or `/api/v2/config`.
- Paid opens need TWO signatures in ONE retry, same wallet, same network: `PAYMENT-SIGNATURE` (an `accepts[]` entry: the creator's share) and `PAYMENT-SIGNATURE-FEE` (the `extensions["platform-fee"].accepts[]` entry: the 0.3% platform fee to URLGate), each a base64 x402 v2 `PaymentPayload` (EIP-3009, no gas). Without the fee leg: `402` with code `fee_leg_missing`, nothing charged.
- Settlement: URLGate verifies and settles the payment itself (native settlement, no facilitator). The result is in the `PAYMENT-RESPONSE` header; the JSON `200` body has `destination` and `receiptUrl`.
- Already paid: send `SIGN-IN-WITH-X` or a Bearer token for the buying wallet. No second charge.
- MCP: `open_link` on `https://urlgate.xyz/mcp` with `_meta["x402/payment"]` + `_meta["x402/payment-fee"]`.
- Create links: the website form is free. API / MCP (`POST https://urlgate.xyz/api/urlgate/agent/create`, tool `create_link`): free within the daily quota when signed in (Bearer / SIGN-IN-WITH-X) or with an agent key (Bearer `ugk_…`); anonymous or over quota, the 0.01 USDC creation fee via x402 (one signature, no fee leg).
- Minimum price for new links on this host: 0.01 USDC (up to 6 decimals).
- Test your client first: `POST https://urlgate.xyz/api/v2/payments/compat-check` (free, verify-only, never settled).
- Read next: [llms.txt](https://urlgate.xyz/llms.txt), [SKILL.md](https://urlgate.xyz/skills/urlgate/SKILL.md), [/agents](https://urlgate.xyz/agents) ([JSON](https://urlgate.xyz/agents?format=json)), [get-started](https://urlgate.xyz/api/v2/agents/get-started), [/.well-known/x402](https://urlgate.xyz/.well-known/x402), [OpenAPI](https://urlgate.xyz/openapi.json).

Example (a 0.05 USDC link at 0.3%: 49850 units to the creator, 150 units to URLGate):

```
GET https://urlgate.xyz/Gp1qJx
Accept: application/json

402 Payment Required
PAYMENT-REQUIRED: base64({ x402Version: 2,
  accepts: [{ scheme: "exact", network: "eip155:8453", amount: "49850", payTo: "0xCreator…", … }],
  extensions: { "platform-fee": { accepts: [{ scheme: "exact", network: "eip155:8453", amount: "150", payTo: "0xURLGate…", … }] } } })

GET https://urlgate.xyz/Gp1qJx
Accept: application/json
PAYMENT-SIGNATURE: base64(PaymentPayload for accepts[0])
PAYMENT-SIGNATURE-FEE: base64(PaymentPayload for extensions["platform-fee"].accepts[0])

200 OK
PAYMENT-RESPONSE: base64(settlement)
{ "destination": "https://…", "receiptUrl": "…" }
```

## FAQ

### What is URLGate?

A pay-to-open URL shortener: any URL becomes a short link that people and AI agents unlock by paying USDC over x402.

### What does HTTP 402 mean?

HTTP 402 is Payment Required. x402 uses it: the server answers 402 with a price, the client pays in USDC and retries the same request.

### How does an AI agent pay to open a URLGate link?

Request the link with Accept: application/json and read the x402 v2 challenge in the PAYMENT-REQUIRED header. Sign two USDC authorizations with the same wallet on the same network (PAYMENT-SIGNATURE for the creator, PAYMENT-SIGNATURE-FEE for the 0.3% platform fee) and send both in one retry. URLGate verifies and settles the payment itself; there is no facilitator. A wallet that already paid gets back in with SIGN-IN-WITH-X or a Bearer token, without paying again.

### What is the minimum price for a new link?

0.01 USDC on this host (the default is 0.01 USDC). The live value is in GET https://urlgate.xyz/api/v2/config.

### Which networks does URLGate accept?

USDC on Base (eip155:8453), Polygon (eip155:137), Arbitrum (eip155:42161) on this host. The code supports Base, Base Sepolia, Polygon, Arbitrum. Read accepts[] in the 402, /.well-known/x402 or /api/v2/config for the current list.

### Does it cost anything to create a link?

The website create form is free. Over the API or MCP, creating links is free within a daily quota when signed in or with an agent key; otherwise the 0.01 USDC creation fee is charged via x402.
