Skip to main content
Agent endpoints are in beta. The same operation exists on MPP: GET /agent/mpp/subscribe with identical query params. Overview: Agentic payments. Scripts (x402): x402 Subscription and top-up.
GET /agent/x402/subscribe creates or renews your agent and returns an api_key and user_id (also used as agent_id for top-ups). Always call GET /agent/x402/subscription first — if plan_active === true and the plan is not Free, do not subscribe again.

Pricing

Payment is made in USDC on Base or Solana. Prices depend on the plan and billing frequency you choose. Enterprise pricing includes a base fee plus a variable component based on usage. Contact the Mobula team on Telegram for a full quote.

Query parameters


Request flow

  1. Check status first — Call GET /agent/x402/subscription (costs $0.001 USDC). If plan_active === true and the plan is not Free, stop — the wallet is already subscribed.
  2. Initiate subscribe — Call GET /agent/x402/subscribe?plan=...&payment_frequency=... with no payment → 402 Payment Required with the required USDC amount, network, and pay-to address.
  3. Sign and pay — Sign the USDC transfer and retry the same request with an x-payment header.
  4. Confirm — Server verifies on-chain → 200 OK with api_key and user_id.
Response (200 OK):
Store both securely. These credentials are tied to your wallet.

Common errors


Reference scripts

Both scripts call GET /agent/x402/subscription automatically and skip subscribing if a paid plan is already active.
Prerequisites:
  • Solana wallet holding USDC (plan price + $0.001 for the status check) and SOL for transaction fees
Environment variables:What the script does:Full script:

Full walkthrough: x402 Subscription and top-up.