Skip to main content
x402 turns any billable NEUS call into pay-as-you-go. When prepaid credits cannot cover a request, NEUS returns HTTP 402 with a signed quote. Pay the quote, then retry the same request with one header. It is built for agents and machine-to-machine APIs that settle value as they go — no subscription, no human in the loop.

Flow

1

Call the API

Make your normal request (for example POST /api/v1/verification).
2

Get a 402 + quote

If credits are short, NEUS responds 402 with a quote in the body and the PAYMENT-REQUIRED response header.
3

Pay the quote

Settle in USDC (or native ETH) via POST /api/v1/payments/verify. NEUS returns a one-time payment receipt.
4

Retry with the receipt

Repeat the original call with the receipt in the PAYMENT-SIGNATURE header. The call now succeeds.

The 402 response

The body carries error.code: "INSUFFICIENT_CREDITS" and an x402 block you can act on directly:
{
  "success": false,
  "error": { "code": "INSUFFICIENT_CREDITS", "remaining": 0, "required": 4 },
  "x402": {
    "scheme": "x402",
    "requiredCredits": 4,
    "remainingCredits": 0,
    "quote": {
      "quoteId": "…",
      "amountUSD": 0.01,
      "amountCents": 1,
      "creditsNeeded": 4,
      "exp": 1713312300000
    },
    "pay": { "pricing": "/api/v1/payments/pricing" },
    "receiptHeader": "PAYMENT-SIGNATURE"
  }
}
The same quote is also sent as JSON in the PAYMENT-REQUIRED response header. exp is a millisecond timestamp — quotes are short-lived, so pay and retry promptly.

Pay and retry

# 1. Original call returns 402 with the quote above.
# 2. Settle the quote (USDC or ETH), then retry with the receipt:
curl -X POST https://api.neus.network/api/v1/verification \
  -H "Content-Type: application/json" \
  -H "PAYMENT-SIGNATURE: <receipt-from-payments-verify>" \
  -d '{ /* the same body as the original request */ }'
Get the receipt by settling the quote through POST /api/v1/payments/verify (type: "x402"). The successful response returns the receipt token and a PAYMENT-RESPONSE header. Each receipt is single-use — reusing one is rejected.

Payment methods

RailWhere it settles
USDCBase mainnet (eip155:8453), with Ethereum mainnet as fallback
Native ETHNEUS treasury
Card (Stripe) is not used for x402 API billing — it is available for gate checkout. Live unit, minimum, and maximum pricing: GET /api/v1/payments/pricing.

Agents that pay on their own

Pair x402 with a scoped delegation so an agent can settle calls within a hard cap. This is how autonomous agents settle API calls inside a scoped budget — identity, authority, and payment context in one receipt.
  • Grant agent-delegation with scope: "payments:x402" and a maxSpend cap.
  • maxSpend is a whole-number string in token base units — for USDC (6 decimals), 25 USDC is "25000000". Use toAgentDelegationMaxSpend('25', 6) from @neus/sdk.
  • The agent can pay per call up to the cap; spend beyond it is refused.
Details: Agent delegation.

Next

Billing

Credits, who pays, and the 402 fallback.

Gate checkout

Charge visitors with USDC or card.

Agent delegation

Spend caps for autonomous agents.
Last modified on June 16, 2026