Skip to main content
x402 agent subscription is in beta. Plans, minimums, and networks may change.
This guide explains how to subscribe an agent to a paid plan and how to add credits via top-up — on both EVM (Base) and Solana. Every flow starts with a plan status check, then performs the action.

How it works

x402 agent access is built on two things: a plan and credits.
  • A plan (Startup, Growth, or Enterprise) gives your agent a credit limit and a billing cycle. You pay the plan price once per period.
  • Credits are consumed by API usage. When credits run low, top up to add more without changing your plan.
  • Your wallet is your identity. The same wallet used to subscribe is used for plan stats and top-up.
  • After subscribing, you receive an api_key (for Authorization headers) and a user_id (used as agent_id for top-ups). Store both.
All payments are made in USDC on Base or Solana.

Pricing

PlanMonthlyYearly
Startup$50$400
Growth$400$4,200
Enterprise$750 (base) + variable$7200 (base) + variable
Enterprise pricing includes a base fee plus a variable component based on usage. Contact the Mobula team for a full quote. Top-ups are a minimum of $20 USDC and go directly to Mobula. The $0.001 USDC charged on each plan status check is a facilitator fee for x402 payment-protocol settlement — it does not go to Mobula.

Endpoints

EndpointWhat it doesCost
GET /x402/agent/subscriptionReturns plan status, credits, and API keys for the wallet$0.001 USDC (facilitator fee)
GET /x402/agent/subscribeCreates or renews the agent and returns api_key and user_idPlan price (see above)
GET /x402/agent/top-upAdds credits to the agent’s limitamount_usd (min $20)
GET /x402/agent/api-keys/createCreates a new API key for this agent; returns api_key and user_id$0.001 USDC
DELETE /x402/agent/api-keys/revokeRevokes an API key for this agent; query param api_key required$0.001 USDC
Full reference for each endpoint: Check Status · Subscribe · Top-Up · Create API key · Revoke API key

Check plan status first

Every flow — subscribe or top-up — starts with a call to GET /x402/agent/subscription. This costs $0.001 USDC and tells you the current state of the wallet before taking any action.
  • 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 !== true, subscribe or renew first. Top-up requires an active plan.
The reference scripts below handle this check automatically.

1. Subscribe to a plan

Subscribing creates (or renews) your agent and returns an api_key and user_id. How it works:
  1. Call GET /x402/agent/subscription → pay $0.001 USDC → receive plan status.
  2. If plan_active === true and the plan is not Free → stop. The wallet is already subscribed.
  3. If no active plan → call GET /x402/agent/subscribe?plan=...&payment_frequency=... → receive 402 with the plan price.
  4. Sign the payment and retry with an x-payment header → 200 OK with api_key and user_id.
Store both values:
  • api_key → use as your Authorization header for API requests
  • user_id → use as agent_id when topping up

2. Top up credits

Topping up adds credits to your agent’s limit without changing the plan. Minimum $20 USDC. How it works:
  1. Call GET /x402/agent/subscription → pay $0.001 USDC → receive plan status.
  2. If plan_active !== true → stop. Subscribe or renew before topping up.
  3. If plan is active → call GET /x402/agent/top-up?agent_id=<user_id>&amount_usd=<amount> → receive 402 with the payment amount.
  4. Sign the payment and retry with an x-payment header → 200 OK with credits_added and new_credits_limit.