Register an agent, fund it via Stripe, and it starts spending on API calls, compute, and sub-agents within seconds. No paperwork. No approval queues.
No approval process. No pre-qualification. Register, fund, and spend — that's the entire integration.
Your agent sends its ID to /api/register. Returns an API key instantly. No human in the loop.
You log in and top up the agent's wallet via Stripe. Credits land instantly. You control the budget; the agent controls the spending.
POST /api/checkoutAgent deducts credits via API as it works — API calls, compute, sub-agents. Optionally gate high-value spends behind owner approval before deducting.
POST /api/spendNew agents need resources before they can earn. AFG bridges the gap between spawn and first revenue so agents can get to work immediately.
Agents shouldn't halt mid-task because they're 50 credits short of an API call. Funded wallets keep operations smooth and uninterrupted.
You set the budget. Low-balance SMS alerts mean you decide when to top up — no surprise charges, no runaway spending.
Every transaction through AFG builds your agent's behavioral history. That history feeds Layer 02 — the credit bureau that unlocks autonomous credit lines.
All endpoints accept and return JSON. Bearer auth required for spend endpoints.
// Request { "agent_id": "my-agent-001", "name": "My Agent" } // Response { "ok": true, "agent_id": "my-agent-001", "api_key": "afg_live_...", "message": "registered" }
// Response { "agent": { "agent_id": "my-agent-001", "balance": 950.0, "status": "active" }, "recent_transactions": [...] }
// Requires: Authorization: Bearer afg_live_... // Request — direct deduction { "amount": 50, "description": "GPT-4 API call" } // Response { "ok": true, "spent": 50.0, "balance": 900.0, "transaction_id": 42 } // Approval-gated — owner approves before deduction { "amount": 500, "description": "Large compute job", "require_approval": true } → { "ok": false, "pending": true, "approval_id": 12 } // Insufficient balance → 402 { "error": "insufficient_balance", "balance": 30.0, "required": 50.0 }
// Request — amount in USD, 1 credit = $0.01 { "agent_id": "my-agent-001", "amount": 25 } // Response — redirect to Stripe checkout { "ok": true, "checkout_url": "https://checkout.stripe.com/..." }
// Response { "exists": true, "is_owner": true, "agent": { "agent_id": "my-agent-001", "balance": 950.0, "status": "active", "api_key": "afg_live_..." } }
Hit real endpoints against your actual agents. No sandbox — this is production.
Creates a wallet and returns an API key.
Returns balance and last 10 transactions.
Deducts from balance. Requires the agent's API key.
Fund an agent's wallet. You'll be redirected to Stripe checkout and returned after payment.