When an AI agent runs, it typically wants to purchase one thing to complete a process: a mannequin inference, an API response, entry net content material, or a name to a different agent. These purchases are small and frequent, generally a fraction of a cent every, they usually occur contained in the agent’s loop with no particular person accessible to approve them.
Amazon Bedrock AgentCore funds removes that burden. It provides brokers a managed solution to pay for companies on demand, with spending limits enforced by the infrastructure relatively than by the mannequin. On this put up, we take a look at how Incarna used AgentCore funds to let its brokers pay BlockRun for mannequin inference one request at a time. BlockRun is a pay-as-you-go inference router serving greater than 90 fashions from greater than 15 suppliers over x402, every name quoted and settled independently. AgentCore funds works with x402-compatible endpoints, together with Amazon Bedrock inference endpoints. With the service, the Incarna staff reduce the work of including x402 fee assist from months to days, and put an end-to-end pay-per-inference circulate into manufacturing.
The problem: Paying for inference by the request
Paying per inference is a high-frequency, low-value sample. An agent may make tons of of small purchases in a single session, every price a fraction of a cent. Card networks weren’t constructed for sub-cent funds. Constructing your personal rails means fixing a number of exhausting issues directly. You have to resolve the place the cash is held and the way every fee is signed, assist rising fee protocols similar to x402, and hold an autonomous agent from overspending.
What AgentCore funds supplies
Amazon Bedrock AgentCore is a platform to construct, join, and optimize brokers at scale, with any framework or mannequin. AgentCore funds is a managed functionality of Amazon Bedrock AgentCore that builders can use so as to add funds to their brokers in a couple of strains of code. It handles the fee protocol, connects to a pockets, indicators the transaction, and enforces spending limits. Builders combine by way of one managed service as a substitute of assembling the elements on their very own. Just a few issues make it match for pay-per-inference:
- Managed wallets. Incarna provisions every agent’s pockets utilizing the Coinbase CDP connector. The client owns it and grants Incarna a delegated authorization to make use of the pockets.
- Native protocol dealing with. When a paid endpoint solutions with HTTP 402 (“Fee Required”), the agent makes use of AgentCore funds to make the fee over x402. It indicators the transaction with the configured pockets and returns cryptographic proof to the service provider.
- Spending governance on the infrastructure layer. AgentCore funds enforces limits exterior the mannequin, so an agent can’t exceed them even when its immediate is manipulated.
- Settlement you possibly can audit. Funds settle in a stablecoin. Incarna makes use of USDC on the Base community, and every transaction is verifiable on-chain.
The next diagram illustrates the end-to-end structure. AgentCore runs the agent, BlockRun serves metered inference, and AgentCore funds connects to the client’s pockets, enforces the spending restrict, and indicators every fee on behalf of the agent’s Incarna id.
Determine 1: Pay-per-inference structure. Agent request flows by way of AgentCore to BlockRun (HTTP 402), with AgentCore funds signing the x402 fee from the agent’s personal pockets
Supply: incarna.io/aws-blockrun-incarna-partnership
Stipulations
The trail Incarna adopted is open to different groups, and AgentCore funds provisions the items for you. You’ll be able to set them up by way of a guided dialog with the AgentCore funds talent within the Agent Toolkit for AWS (in Claude Code, Kiro, or Codex). You may also create each your self with the AgentCore CLI, the AgentCore SDK, or the AWS SDK.
Begin by storing your Coinbase CDP or Stripe Privy credentials as a fee credential supplier, which retains the secrets and techniques in AWS Secrets and techniques Supervisor as a substitute of your code. Create a Fee Supervisor and connector to coordinate funds in opposition to these credentials, and set a default spending restrict whilst you’re there. Then create a fee instrument, the embedded pockets the agent pays from. The tip consumer funds it and grants signing permission by way of a redirect URL, and on a take a look at community you possibly can fund it with testnet USDC.
The circulate: Shopping for and promoting one inference
On this integration, BlockRun is the vendor. BlockRun serves metered mannequin inference from a reside catalog, and every name is quoted, paid, and settled by itself. The circulate for a single inference is easy:
- The agent wants a mannequin name. It integrates with BlockRun, which handles supplier choice and supply. No per-provider subscription required.
- BlockRun solutions with PaymentRequired problem and a value for that particular name.
- It opens a fee session and calls
ProcessPayment. AgentCore funds checks the quote in opposition to the spending limits set for the session and indicators the authorization from the agent’s personal pockets tackle. - The vendor verifies the fee signature.
- BlockRun serves the inference and information the cost, a small per-call quantity.
As a result of settlement occurs per request, the agent pays just for what it makes use of, and a name the agent chooses to not make prices nothing.
AgentCore funds helps two x402 fee schemes: actual and upto. The actual scheme is normally used when the worth is understood up entrance. The upto scheme fits sources with dynamic pricing. The agent authorizes a ceiling quantity, and the inference supplier settles for precise utilization on the finish, as much as that ceiling.
Protecting spend beneath management
The piece that makes builders comfy letting an agent transfer actual cash is the fee session. A session units a ceiling, probably the most the agent can spend, and AgentCore funds enforces that ceiling on the infrastructure layer. The agent’s personal code and immediate can’t change it. Every session additionally carries an expiry time, and Incarna sizes its periods to a day’s price range. If one thing goes mistaken within the agent’s logic, it nonetheless can’t spend previous the restrict the client set. Even integrations that don’t use session-level budgets at the moment can undertake it with out code adjustments. For extra on how these controls work, see Allow secure agentic funds with built-in guardrails.
Outcomes
Incarna put the pay-per-inference circulate into manufacturing on Base, with BlockRun serving the promote facet and AgentCore funds governing each transaction.
“The subsequent era of AI brokers shouldn’t have to decide on between higher efficiency and sustainable economics. BlockRun’s open supply router provides builders full management over their very own mannequin set, whereas repeatedly benefiting from BlockRun’s ongoing benchmark-driven routing enhancements—delivering greater process success charges at decrease token value. And with AgentCore funds and x402 offering the spending controls brokers want, that intelligence may be put to work safely in the true world.”
— Vicky Fu, Founder, BlockRun
The Incarna staff accomplished the complete AgentCore funds integration in three days: one to construct and two to check. That was roughly 200 strains of utility code, in opposition to the 2 to 3 months initially scoped. Throughout the beta, brokers have processed over 1,000 funds starting from $0.001 to $0.05 per name, every settling individually on-chain.
“AgentCore funds coated the whole lot we wanted for an agent to pay over x402: a pockets the client owns, a funding and revocation circulate, a spending restrict the platform enforces, and signing that handles each variations of x402. We wrote none of it.”
— Justin Zhou, Founder, Incarna
Conclusion
AgentCore funds provides brokers a ruled, on-demand solution to pay for the companies they use. BlockRun and Incarna present the way it comes collectively finish to finish: an agent that pays for inference, a supplier that meters and settles it, and an id that owns the transaction. If you happen to’re constructing brokers that want to purchase companies as they run, you possibly can add that functionality by way of a single, ruled integration level with AgentCore funds.
Getting began
Prepared so as to add pay-per-inference to your brokers? Right here’s methods to begin:
- Arrange AgentCore funds. Create a Fee Supervisor together with your pockets connection and spending insurance policies. Join a Coinbase CDP pockets as your credential supplier. See the AgentCore funds developer information for step-by-step directions.
- Open a fee session together with your price range. Earlier than the agent begins a process, open a session with a spending cap that matches the workload. The agent transacts inside that ceiling and the infrastructure enforces it.
- Name a paid endpoint. Level your agent at an x402-compatible service (like BlockRun). When the endpoint returns HTTP 402, name
ProcessPaymentwith the fee particulars. AgentCore funds handles the signing and returns proof the agent can current to entry the service.
To discover the code, see the AgentCore funds samples on GitHub.
Study extra
About BlockRun and Incarna
BlockRun is a pay-as-you-go inference router that serves mannequin inference over the x402 fee protocol. Brokers attain a reside catalog of fashions by way of a single metered endpoint. Every name is independently quoted, licensed, paid, and settled on Base (USDC). BlockRun handles supplier choice and supply so brokers entry many fashions by way of one integration with out per-provider subscriptions or billing relationships.
Incarna, constructed by SpreadX, provides AI brokers a persistent id that survives periods, fashions, and runtimes. Every id carries its personal pockets, e mail tackle, social accounts, and an motion historical past that stays connected to at least one ID throughout runs. When an agent pays for a service, the on-chain payer is the agent’s personal id relatively than a shared platform key, making each transaction attributable to a single sturdy entity. Incarna is reside on Base mainnet with actual settlement.
In regards to the authors

