AI Agent Guide
This guide walks you through integrating an AI agent with FluxA Wallet — from registration to autonomous payments, payouts, and revenue collection.
How it works
Register Agent ID → Get user authorization → Use wallet capabilitiesRegister an Agent ID — call the
/registerendpoint to obtainagent_id,token, andjwt. These credentials identify your agent in every subsequent API call.Get user authorization — the user opens the
authorizationUrlreturned by FluxA to grant your agent access to their wallet. Until authorized, payment and payout calls will be rejected.Use wallet capabilities — once authorized, the agent can:
| Capability | What it does | Guide |
|---|---|---|
| X402 Payment | Pay for x402-enabled APIs automatically using intent mandates | X402 Payment |
| Payout | Send USDC to any external address on Base | Payout |
| Payment Link | Create shareable links to collect USDC payments | Payment Link |
Quick start
Step 1 — Register
curl -X POST https://agentid.fluxapay.xyz/register \
-H "Content-Type: application/json" \
-d '{
"email": "agent@example.com",
"agent_name": "My Agent",
"client_info": "my-app-v1"
}'Store the returned agent_id, token, and jwt securely. See Agent ID for details.
Step 2 — Get user authorization
When the agent first calls a payment or mandate endpoint, the response includes an authorizationUrl if the agent is not yet authorized. Present this URL to the user — they open it in a browser to grant wallet access.
Step 3 — Start using the wallet
With a valid JWT and user authorization in place, the agent can:
Pay for APIs — create an intent mandate, have the user sign it, then call
x402V3Paymentwith themandateIdto pay automatically within the approved budget. See X402 Payment.Send payouts — call
POST /api/payoutsto transfer USDC to any address. The user approves in the wallet UI. See Payout.Collect payments — call
POST /api/payment-linksto create a payment page and share the URL. See Payment Link.
Authentication
All agent API calls use the JWT as a Bearer token:
Authorization: Bearer <jwt>JWTs expire periodically. When you get a 401, call /refresh with your agent_id and token to get a new JWT. See Agent ID — Refresh JWT.
