x402 agent endpoints are in beta. For the full flow and reference scripts, see x402 Agent Subscription and Top-Up.
Agents only. This endpoint is for agents (wallet-based, programmatic access). Dashboard customers create API keys at admin.mobula.io, not via this x402 endpoint.
GET /x402/agent/api-keys/create creates a new API key for your agent. No query parameters. The paying wallet is verified against your subscription; the new key is tied to the same agent. Cost: $0.001 USDC (facilitator fee). You must have an active plan (subscribe first).
Request flow
- Call
GET /x402/agent/api-keys/createwith no payment → 402 Payment Required with $0.001 USDC. - Sign the payment and retry with an
x-paymentheader → 200 OK withapi_keyanduser_id.
Reference scripts
Uses the same wallet as for subscribe.- Solana
- EVM (Base)
Prerequisites: Solana wallet with USDC for $0.001 and SOL for fees.Full script (uses
@solana/kit, @x402/core, @x402/svm). Inline base58ToBytes below, or use import { base58ToBytes } from './base58.ts' when running from scripts/src/x402/.To revoke an API key: Revoke Agent API Key. Full walkthrough: x402 Agent Subscription and Top-Up.