Overview
Agent Payments lets an AI agent with a crypto wallet and no account buy access to ScrapeGraphAI on its own. The agent pays an MPP payment challenge and receives a real API key plus credits, the same key any customer uses. Payment replaces signup. Agents can make a one-time credit purchase or start a recurring monthly subscription. Unlike single-use prepaid tokens, a payment mints a durable, refillable account: a user, a workspace, and an API key with a credit balance that persists across purchases.Agent Payments is designed for autonomous agents that hold a wallet and have been authorized
to spend. Human developers should sign up for an API
key the normal way.
How it works
- The agent calls a product endpoint (e.g.
POST /api/scrape) with no key and gets a401whose error body points at the agent-access endpoints. - The agent chooses one-time access at
POST /api/agent/mpp/access/{pack}or recurring access atPOST /api/agent/mpp/subscription/{plan}. An unpaid request returns a402with aWWW-Authenticate: Paymentchallenge (MPP). - The agent’s wallet pays the challenge, then retries the request with
Authorization: Payment <credential>. If the wallet requires approval, the owner approves the payment in their wallet app. - The response contains an API key and credits. The agent sends the key as
SGAI-APIKEYon every request thereafter. The key is returned once, so store it.
Payment method
Payments settle over InFlow, a wallet and payment service for AI agents. The402 challenge advertises it in the WWW-Authenticate: Payment header; pay it
with the InFlow CLI or SDK. Fund the InFlow wallet by sending USDC over the Base network.
- Currency: USDC
- Network: Base
- Method:
inflow(balance rail, via InFlow)
Set up an InFlow wallet
To pay, an agent needs an InFlow account, the CLI (or SDK), and a funded wallet.1
Create an InFlow account
Sign up at inflowpay.ai. This is the account your agent pays
from.
2
Install and authenticate
Install the CLI from inflowcli.ai, then log in to your account:
3
Fund the wallet
Send USDC over the Base network to your InFlow account, then confirm it’s available:
4
Let the agent pay
Give your agent the InFlow CLI (or MCP server) and its
agentic-payments skill. The agent handles the payment on its own:
it hits an
/api/agent/mpp/access/{pack} endpoint, reads the 402 challenge, pays, and
retries with the credential. You only approve the spend if your wallet policy requires
it. The commands below show what that exchange looks like under the hood.
An MPP payment request awaiting approval in the InFlow app
InFlow is one MPP-compatible wallet. Any wallet or agent runtime that speaks MPP and holds
USDC can pay the
inflow challenge. See mpp.dev for the protocol.Credit packs
Credits meter product usage the same way a normal account’s do. A minted account starts on
the free plan (10 requests/min, 1 concurrent crawl, 1 monitor).
Monthly subscriptions
MPP also supports recurring payments. A subscription creates a durable account and stable API key, then grants the plan’s credit allowance for each paid monthly period.
The first period settles when the subscription is activated. The MPP challenge binds the amount,
currency, billing period, plan, and subscription expiration into immutable terms that the wallet
shows for approval.
Endpoints
Getting Started
1. Discover
Free and unauthenticated. Start here to learn the packs, method, and endpoints.cURL
2. Pay and mint
InFlow
3. Use the key
cURL
Subscribe with MPP
Usempp subscribe, not mpp pay, when the challenge has intent: subscription.
1. Inspect the recurring terms
Inspection is read-only and does not create a payment:InFlow
amountandcurrencyperiod_countandperiod_unitsubscription_expiresexternal_idoption_id
2. Start the subscription
Pass theoption_id returned by inspection:
InFlow
approval_url. Open it in the InFlow app or dashboard and approve the recurring
terms. The approval activates the subscription and settles the first monthly period.
For an agent that can wait for approval inline, poll automatically:
InFlow
SGAI-APIKEY on normal ScrapeGraphAI API requests.
3. Use and manage the subscription
List or inspect subscriptions from the buyer account:InFlow
InFlow
Cancel a subscription
Cancellation is immediate and stops future periods. It does not refund a period that already settled:InFlow
Refilling
When credits run low, pay the keyed purchase route with your API key to top up the same account. Keep your key because it is the only way to refill.cURL
POST /api/agent/mpp/access/{pack} again. Every new payment mints a
fresh account.
Terms
- Minimum purchase: the
smallpack (5 USDC). - Idempotency: replaying the same payment credential re-delivers the same result. You are never charged or credited twice for one payment.
- Refunds: payments are handled out-of-band. If a payment settles but access is not
granted (a transient error), retry with the same credential. The flow is idempotent and
self-heals. For anything unrecoverable, contact support
with your payment reference (returned in the
Payment-Receiptheader).
Reference
- OpenAPI:
https://v2-api.scrapegraphai.com/api/openapi.json - Machine-readable guide for agents:
GET /api/agent/protocols