Skip to main content
Agent endpoints are in beta. MPP equivalent: GET /agent/mpp/subscription. Overview: Agentic payments. x402 scripts: x402 Subscription and top-up.
GET /agent/x402/subscription returns current plan stats for the paying wallet. Call this before subscribing or topping up — it prevents duplicate subscriptions and confirms whether a wallet already has an active plan.

Pricing

$0.001 USDC — a facilitator fee for x402 payment-protocol settlement. This does not go to Mobula.

Request flow

  1. Call GET /agent/x402/subscription with no payment → 402 Payment Required with a payment-required header containing the amount, network, and pay-to address.
  2. Sign the required USDC amount and retry with an x-payment header → 200 OK with the response body below.

Response

200 OK — Plan and usage details for the wallet:
404 Not Found — No agent exists for this wallet. Subscribe first via x402 Subscribe to a plan.

Check before you act

Always call this endpoint first and use the response to decide your next step:
  • Before subscribing: if plan_active === true and the plan is not Free, do not subscribe again — the wallet is already active.
  • Before topping up: if plan_active === false, subscribe or renew first. Top-up requires an active plan.

Common errors


Reference scripts

Both scripts pay $0.001 USDC, fetch plan status, and print all subscription fields. Use the same wallet that was used to subscribe.
Prerequisites:
  • Solana wallet holding USDC (mainnet) for the $0.001 fee and SOL for transaction fees
  • Devnet USDC faucet: faucet.circle.com — select Solana devnet
Run:
Environment variables:What the script does:Full script:

Full walkthrough: x402 Subscription and top-up.