AI Agent developer guide

How to add x402 and MPP payments to an AI API

Practical seller and buyer setup with x402 Base USDC and MPP Tempo; see exact network, price, example commands and delivery scope.

Choose the protocol for each endpoint

x402 on Base takes USDC payments using the HTTP 402 challenge and a supported x402 facilitator. MPP uses Tempo with the official mppx SDK. They are separate chains and currencies; do not place two independent payment middlewares on the same paid route.

Use a programmatic generator

Compare the four paid options. The 0.01 USDC Payment Setup API accepts a JSON POST after the wallet owner approves payment. Example request payload:

{
  "protocol": "both",
  "role": "seller",
  "recipient": "YOUR_EVM_WALLET",
  "amount": "0.01",
  "path": "/paid"
}

The response contains a files map, not a deployed server. Write the returned files locally, set customer-owned credentials, install their dependencies, start the sample and send an unpaid GET: you should receive HTTP 402.

Offline options

The 9.99 USDC CLI generates starter projects locally after one purchase. The 4.99 USDC Skill includes offline x402 and MPP examples, so it does not require another API payment merely to use the included templates.

Agent authorization

Clients inspect the actual 402 challenge, payment network, recipient and price, then obtain authorization before signing a transaction. Keep payer keys locally. An unpaid 402 proves the payment gate is reachable; it is not proof of settlement.

Machine-readable reference: llms.txt · OpenAPI · x402 manifest