人工智能
BlockRun和Incarna如何使用 Amazon Bedrock Agent Core 付款
当一个AI agent运行时,它经常需要购买一些东西来完成一个任务:模型推论,API响应,访问网络内容,或者呼叫另一个agent. 这些采购规模小而且频繁,有时是每批一分钱的一小部分,它们发生在agent的圈子内,无人批准。
Amazon Bedrock Agent Core的付款可以消除这种负担。 它为agents提供了按需支付服务款的管理方式,支出限制由基础设施而不是模型强制实施。 在本文中,我们审视Incarna如何使用Agent Core付款让其agents支付BlockRun一次模型推断一个请求。 BlockRun是一个现收现付的推论路由器,服务于超过15家供应商的90多个型号,超过x402,每个电话被引用并独立结算。 Agent Core支付工作采用x402-兼容的终点,包括Amazon Bedrock推断终点。 随着这项服务,Incarna团队将增加x402支付支持的工作从数月到数日削减,并将一个端到端的按推算的流量投入生产。
挑战:根据请求作出推论
按推算付费是一种高频低值模式。 agent可能在一个会话中做数百件小买卖,每件都值一分钱。 卡片网络不是用来支付小费的。 建设自己的rails意味着同时解决几个难题。 您必须决定资金的持有地点和每次支付如何签署,支持像 x402 这样的新兴支付协议,并避免一个自主的 agent 超支。
代理Core支付
Amazon Bedrock Agent Core是一个在规模上构建,连接,并优化agents的平台,拥有任何框架或模型。 Agent Core支付是一种Amazon Bedrock Agent Core的管理能力,构建者可以使用它来在几行代码中添加他们的agents支付。 它处理支付协议,连接钱包,签署交易,并强制执行支出限制。 建造者通过一个管理服务进行整合,而不是自行组装部件。 有几件事是适合按工资推断的
- 管理钱包。 使用 Coinbase CDP 连接器提供 agent 的钱包。 客户拥有它,并授权Incarna使用钱包。
- 本地协议处理。 当一个付费的终点用HTTP 402(“支付要求”)回答时,agent使用AgentCore付款支付超过x402的付款。 它用配置的钱包签名交易,并将加密证明返回给商家。
- 基础设施治理开支。 代理Core支付在模式之外执行限制,所以agent即使其提示被操纵也不能超过。
- 和解,你可以审计。 付款以马币结算。 Incarna在Base网络上使用USDC,每笔交易都是可核查的链上交易。
以下图表说明了端到端的架构。 Agent Core 运行 agent, BlockRun 服务于计量吸入器推论,Agent Core 付款连接到客户的钱包,执行支出限制,并代表 agent 的 Incarna 身份签注每次付款。
资料来源:incarna.io/aws-blockrun-incarna-Partnership。
先决条件
Incarna遵循的路径是向其他团队开放的,Agent Core支付为您提供棋子。 您可以在AWS(在Claude Code,Kiro,或Codex)的Agent工具箱中与Agent Core支付技能进行引导性对话来设置它们。 也可以用Core CLI特工,Core SDK特工,或AWS SDK各自创建。
首先将您的 Coinbase CDP 或 Stripe Privy 证书存储为支付证书提供者,该证书将秘密保存在 AWS 秘密管理器中而不是您的代码中。 建立一个支付管理器和连接器来协调支付,然后创建支付工具,嵌入式钱包agent从中支付。 终端用户为它提供资金,并通过重定向URL给予签名许可,在一个测试网络上,您可以用测试网USDC为它提供资金。
流量:买卖一个推论
在这个整合中,BlockRun是销售者。 BlockRun从实时目录中提供模拟推论,每一次通话都引用,付费,并自行结算。 单一推论的流程是直截了当的:
- agent需要一个模型呼叫。 它与BlockRun(英语:BlockRun)集成,后者处理供应商的选择和交付。 不需要每个供应商订阅。
- BlockRun回答要求支付的挑战以及具体电话的价格
- 它打开一个支付会话,并呼叫进程支付。 Agent Core 付款将报价与为会话设定的支出限额对照,并在 agent 自己的钱包地址上签名授权。
- 卖方核实付款签字。
- BlockRun提供推论并记录充电,少量的每个呼叫量。
因为每个请求都会发生和解,所以agent只支付使用费,一个呼叫agent选择不产生任何成本。
Agent Core支付支持两个x402支付计划:准确和最新。 当价格在前面已知时,通常使用精确的计数。 最新计划以动态定价来适应资源。 agent授权上限金额,推论提供方在最终结算实际使用,最高达到该上限。
控制开支
使建设者感到舒适的让agent移动真实资金的作品是支付会话。 会话设置上限,agent 能花费最多,Agent Core 付款在基础设施层强制实施该上限。 agent自己的代码和提示不能改变它。 每届届会也有一段到期时间,Incarna的会期为一天的预算。 如果agent的逻辑出错,甚至连今天不使用会话级预算的集成,更多关于这些控制的运作情况,请参见“允许使用内置护栏的安全代理付款”。
结果
印卡纳将付费-推算流投入基地生产,由BlockRun服务于销售方,代理Core支付管理每笔交易。
“下一代AI agents不应该在业绩好和可持续经济学之间做出选择。 BlockRun的开源路由器让开发者完全控制自己的模型集,同时不断受益于BlockRun正在进行的基准测试驱动的路由改进——以较低的象征性成本交付更高的任务成功率。 再加上Core代理付款和x402提供支出控制agents需要,这种情报可以用来在现实世界安全工作。”
-Vicky Fu,创始人,布洛克伦
Incarna团队在三天内完成了Core代理付款的完整整合:一个用于建设,两个用于测试。 这是大约200行的应用代码,而原先是2至3个月。 在整个β区,agents已处理了1,000多笔付款,每笔付款从0.001美元到0.05美元不等,每笔付款都按单项支付。
" 代理Core支付涵盖了agent支付超过x402所需的一切:客户拥有的钱包,资金和撤销流量,支出限制平台执行,以及处理两个版本的x402的签名。 他们没有写任何一篇。
——周杰伦,Incarna创始人。
结论
Agent Core支付给agents一个受管制的,按需支付他们使用的服务。 BlockRun和Incarna展示了它是如何一起结束的:支付推论的agent,一个测量和结算它的提供者,以及拥有交易的身份。 若您正在建设 agents,需要购买服务,您可以通过单一的、 规范的整合点与 Agent Core 支付。
开始
准备好给你的agents加薪了吗?如何开始:
- 设立Core代理付款。 创建一个带有钱包连接和开支政策的支付管理器。 连接一个 Coinbase CDP 钱包作为您的证书提供者。 见Agent Core支付开发者指南分步指示。
- 开一个支付会与你的预算。 在 agent 开始任务前,开一个符合工作量的支出上限的会话。 agent在天花板内进行交易,基础设施强制实施。
- 找一个付薪的终点将你的agent指向一个x402-兼容服务(如BlockRun). 当端点返回HTTP 402时,用付款细节拨打ProcessPayment. AgentCore支付处理签名,返回证明agent可以提供访问服务。
为了探索代码,参见GitHub上的Agent Core支付样本。
学更多
- Amazon Bedrock Agent Core现普遍可用:使agents能够安全自主地进行规模交易
- 技术深度潜水:代理支付和代理商业创新
- 允许使用内置护栏的安全代理付款
关于布洛克伦和因卡纳
BlockRun是一个现收现付的推论路由器,为x402支付协议的模型推论服务。 Agents通过一个单一的MIM端点达到一个模型的实时目录。 每一次通话都是独立引用、授权、支付和在基地(USDC)结算的。 BlockRun处理提供者的选择和交付,所以agents通过一个集成访问许多模型,而没有每个提供者的订阅或计费关系。
由SplaceX建造的Incarna赋予AI agents一个持续的身份,在会话,模型和运行时间中存活下来。 每个身份都带有自己的钱包,电子邮件地址,社会账户,以及一个行动历史,它始终附着在一个ID的横行上。 当agent支付服务费时,链上支付者是agent自己的身份而不是共享的平台密钥,使每笔交易都归属于一个单一的耐用实体。 Incarna在Base主网直播,有真实的结算。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Artificial Intelligence
Pay-per-inference for AI agents: How BlockRun and Incarna use Amazon Bedrock AgentCore payments
When an AI agent runs, it often needs to buy something to finish a task: a model inference, an API response, access web content, or a call to another agent. These purchases are small and frequent, sometimes a fraction of a cent each, and they happen inside the agent’s loop with no person available to approve them.
Amazon Bedrock AgentCore payments removes that burden. It gives agents a managed way to pay for services on demand, with spending limits enforced by the infrastructure rather than by the model. In this post, we look at how Incarna used AgentCore payments to let its agents pay BlockRun for model inference one request at a time. BlockRun is a pay-as-you-go inference router serving more than 90 models from more than 15 providers over x402, each call quoted and settled independently. AgentCore payments works with x402-compatible endpoints, including Amazon Bedrock inference endpoints. With the service, the Incarna team cut the work of adding x402 payment support from months to days, and put an end-to-end pay-per-inference flow into production.
The challenge: Paying for inference by the request
Paying per inference is a high-frequency, low-value pattern. An agent might make hundreds of small purchases in a single session, each worth a fraction of a cent. Card networks weren’t built for sub-cent payments. Building your own rails means solving several hard problems at once. You must decide where the money is held and how each payment is signed, support emerging payment protocols such as x402, and keep an autonomous agent from overspending.
What AgentCore payments provides
Amazon Bedrock AgentCore is a platform to build, connect, and optimize agents at scale, with any framework or model. AgentCore payments is a managed capability of Amazon Bedrock AgentCore that builders can use to add payments to their agents in a few lines of code. It handles the payment protocol, connects to a wallet, signs the transaction, and enforces spending limits. Builders integrate through one managed service instead of assembling the parts on their own. A few things make it a good fit for pay-per-inference:
- Managed wallets. Incarna provisions each agent’s wallet using the Coinbase CDP connector. The customer owns it and grants Incarna a delegated authorization to use the wallet.
- Native protocol handling. When a paid endpoint answers with HTTP 402 (“Payment Required”), the agent uses AgentCore payments to make the payment over x402. It signs the transaction with the configured wallet and returns cryptographic proof to the merchant.
- Spending governance at the infrastructure layer. AgentCore payments enforces limits outside the model, so an agent can’t exceed them even if its prompt is manipulated.
- Settlement you can audit. Payments settle in a stablecoin. Incarna uses USDC on the Base network, and each transaction is verifiable on-chain.
The following diagram illustrates the end-to-end architecture. AgentCore runs the agent, BlockRun serves metered inference, and AgentCore payments connects to the customer’s wallet, enforces the spending limit, and signs each payment on behalf of the agent’s Incarna identity.
Source: incarna.io/aws-blockrun-incarna-partnership
Prerequisites
The path Incarna followed is open to other teams, and AgentCore payments provisions the pieces for you. You can set them up through a guided conversation with the AgentCore payments skill in the Agent Toolkit for AWS (in Claude Code, Kiro, or Codex). You can also create each one yourself with the AgentCore CLI, the AgentCore SDK, or the AWS SDK.
Start by storing your Coinbase CDP or Stripe Privy credentials as a payment credential provider, which keeps the secrets in AWS Secrets Manager instead of your code. Create a Payment Manager and connector to coordinate payments against those credentials, and set a default spending limit while you’re there. Then create a payment instrument, the embedded wallet the agent pays from. The end user funds it and grants signing permission through a redirect URL, and on a test network you can fund it with testnet USDC.
The flow: Buying and selling one inference
In this integration, BlockRun is the seller. BlockRun serves metered model inference from a live catalog, and each call is quoted, paid, and settled on its own. The flow for a single inference is straightforward:
- The agent needs a model call. It integrates with BlockRun, which handles provider selection and delivery. No per-provider subscription required.
- BlockRun answers with PaymentRequired challenge and a price for that specific call.
- It opens a payment session and calls ProcessPayment. AgentCore payments checks the quote against the spending limits set for the session and signs the authorization from the agent’s own wallet address.
- The seller verifies the payment signature.
- BlockRun serves the inference and records the charge, a small per-call amount.
Because settlement happens per request, the agent pays only for what it uses, and a call the agent chooses not to make costs nothing.
AgentCore payments supports two x402 payment schemes: exact and upto. The exact scheme is usually used when the price is known up front. The upto scheme suits resources with dynamic pricing. The agent authorizes a ceiling amount, and the inference provider settles for actual usage at the end, up to that ceiling.
Keeping spend under control
The piece that makes builders comfortable letting an agent move real money is the payment session. A session sets a ceiling, the most the agent can spend, and AgentCore payments enforces that ceiling at the infrastructure layer. The agent’s own code and prompt can’t change it. Each session also carries an expiry time, and Incarna sizes its sessions to a day’s budget. If something goes wrong in the agent’s logic, it still can’t spend past the limit the customer set. Even integrations that don’t use session-level budgets today can adopt it without code changes. For more on how these controls work, see Enable safe agentic payments with built-in guardrails.
Results
Incarna put the pay-per-inference flow into production on Base, with BlockRun serving the sell side and AgentCore payments governing every transaction.
“The next generation of AI agents shouldn’t have to choose between better performance and sustainable economics. BlockRun’s open source router gives developers full control over their own model set, while continuously benefiting from BlockRun’s ongoing benchmark-driven routing improvements—delivering higher task success rates at lower token cost. And with AgentCore payments and x402 providing the spending controls agents need, that intelligence can be put to work safely in the real world.”
— Vicky Fu, Founder, BlockRun
The Incarna team completed the full AgentCore payments integration in three days: one to build and two to test. That was roughly 200 lines of application code, against the two to three months originally scoped. Across the beta, agents have processed over 1,000 payments ranging from $0.001 to $0.05 per call, each settling individually on-chain.
“AgentCore payments covered everything we needed for an agent to pay over x402: a wallet the customer owns, a funding and revocation flow, a spending limit the platform enforces, and signing that handles both versions of x402. We wrote none of it.”
— Justin Zhou, Founder, Incarna
Conclusion
AgentCore payments gives agents a governed, on-demand way to pay for the services they use. BlockRun and Incarna show how it comes together end to end: an agent that pays for inference, a provider that meters and settles it, and an identity that owns the transaction. If you’re building agents that need to buy services as they run, you can add that capability through a single, governed integration point with AgentCore payments.
Getting started
Ready to add pay-per-inference to your agents? Here’s how to start:
- Set up AgentCore payments. Create a Payment Manager with your wallet connection and spending policies. Connect a Coinbase CDP wallet as your credential provider. See the AgentCore payments developer guide for step-by-step instructions.
- Open a payment session with your budget. Before the agent starts a task, open a session with a spending cap that fits the workload. The agent transacts within that ceiling and the infrastructure enforces it.
- Call a paid endpoint. Point your agent at an x402-compatible service (like BlockRun). When the endpoint returns HTTP 402, call ProcessPayment with the payment details. AgentCore payments handles the signing and returns proof the agent can present to access the service.
To explore the code, see the AgentCore payments samples on GitHub.
Learn more
- Amazon Bedrock AgentCore payments is now generally available: Enabling agents to transact safely and autonomously at scale
- Technical deep dive: AgentCore payments and innovation in agentic commerce
- Enable safe agentic payments with built-in guardrails using AgentCore payments
About BlockRun and Incarna
BlockRun is a pay-as-you-go inference router that serves model inference over the x402 payment protocol. Agents reach a live catalog of models through a single metered endpoint. Each call is independently quoted, authorized, paid, and settled on Base (USDC). BlockRun handles provider selection and delivery so agents access many models through one integration without per-provider subscriptions or billing relationships.
Incarna, built by SpreadX, gives AI agents a persistent identity that survives sessions, models, and runtimes. Each identity carries its own wallet, email address, social accounts, and an action history that stays attached to one ID across runs. When an agent pays for a service, the on-chain payer is the agent’s own identity rather than a shared platform key, making every transaction attributable to a single durable entity. Incarna is live on Base mainnet with real settlement.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.