◈ AWS AGENTCORE BLUEPRINTS
PART IV · GOVERNANCE AND TRANSACTIONS · CHAPTER 28 / 36
TOCCONSULTING.FR
AMAZON BEDROCK / SERVICE DETAIL S12 PAYMENTS

AGENTCORE PAYMENTSPRACTICAL

CHAPTER 28 / 36
TOPIC wallet, budget, then the agent pays an x402 endpoint
REV 2026.07
IN PLAIN WORDS

You will set up a managed wallet, give it a budget, and let a Strands agent pay a paid endpoint automatically when it hits an HTTP 402. Terms: credential provider = your wallet provider's keys (stored in Identity); manager + connector = the managed plumbing; instrument = the actual wallet; session = a budget + time limit.

$ pip install boto3 bedrock-agentcore[strands-agents] strands-agents strands-agents-tools $ aws sts get-caller-identity # region: us-east-1, us-west-2, eu-central-1, ap-southeast-2
First get keys from a wallet provider: Coinbase CDP (API Key ID, API Key Secret, Wallet Secret) or Stripe / Privy (App ID, App Secret, Authorization ID + Private Key).
[ 1 ] SET UP THE PLUMBING (control plane)
import boto3, time
cp = boto3.client("bedrock-agentcore-control", region_name="us-west-2")

cred = cp.create_payment_credential_provider(          # keys are kept in AgentCore Identity
    name="my-coinbase-credentials", credentialProviderVendor="CoinbaseCDP",
    coinbaseCdpConfig={"apiKeyId":"...", "apiKeySecret":"...", "walletSecret":"..."})

mgr = cp.create_payment_manager(name="pm", authorizerType="AWS_IAM", roleArn="<role-arn>")
while cp.get_payment_manager(paymentManagerArn=mgr["paymentManagerArn"])["status"] != "READY":
    time.sleep(5)
conn = cp.create_payment_connector(paymentManagerArn=mgr["paymentManagerArn"], name="conn",
    paymentConnectorType="CoinbaseCDP", credentialProviderArn=cred["credentialProviderArn"])
[ 2 ] CREATE A FUNDED WALLET AND A BUDGET (data plane)
import uuid
dp = boto3.client("bedrock-agentcore", region_name="us-west-2")

inst = dp.create_payment_instrument(userId="test-user-123", paymentManagerArn=PM_ARN,
    paymentConnectorId=CONN_ID, paymentInstrumentType="EMBEDDED_CRYPTO_WALLET",
    paymentInstrumentDetails={"embeddedCryptoWallet":{"network":"ETHEREUM",
        "linkedAccounts":[{"email":{"emailAddress":"you@example.com"}}]}}, clientToken=str(uuid.uuid4()))
print("Fund the wallet here:", inst["paymentInstrumentDetails"]["redirectUrl"])   # user funds (testnet USDC) + allows signing, then poll until ACTIVE

sess = dp.create_payment_session(userId="test-user-123", paymentManagerArn=PM_ARN,
    expiryTimeInMinutes=60, limits={"maxSpendAmount":{"value":"5.00", "currency":"USD"}},
    clientToken=str(uuid.uuid4()))                          # budget: $5, for 60 minutes
SESSION_ID = sess["paymentSessionId"]
[ 3 ] LET THE AGENT PAY, AUTOMATICALLY (Strands)
from strands import Agent
from strands_tools import http_request
from bedrock_agentcore.payments.integrations.config import AgentCorePaymentsPluginConfig
from bedrock_agentcore.payments.integrations.strands.plugin import AgentCorePaymentsPlugin

plugin = AgentCorePaymentsPlugin(config=AgentCorePaymentsPluginConfig(
    payment_manager_arn=PM_ARN, user_id="test-user-123",
    payment_instrument_id=INSTRUMENT_ID, payment_session_id=SESSION_ID, region="us-west-2"))

agent = Agent(system_prompt="You can access paid APIs.", tools=[http_request], plugins=[plugin])
print(agent("Access the premium endpoint at https://example-x402-merchant.com/paid-api"))  # handles the 402 + pays

print(dp.get_payment_session(paymentManagerArn=PM_ARN, paymentSessionId=SESSION_ID).get("spentAmount"))  # what it spent
The wallet must be funded and authorized by the user (open the redirect URL) before the agent can pay. When the budget or the session time runs out, payments are denied. Clean up with delete_payment_instrument / connector / manager.
SRC: AWS AgentCore Developer Guide (payments overview, payments quick start)
DRAWN 2026.06, REV 2026.07.26
◄ PREVIOUS · CH 27
AgentCore Payments, Plain Language
NEXT · CH 29 ►
A2A and Multi-Agent, Plain Language
AWS AGENTCORE BLUEPRINTS · CONTENTS
Back to tocconsulting.fr Cover & Table of Contents
PART I · FOUNDATIONS
01AgentCore Overview, Plain LanguageCONCEPT02AgentCore, Key Terms in Plain LanguageCONCEPT03AgentCore, Common Mistakes ExplainedCONCEPT04Inside an AgentCore Agent, BlueprintCONCEPT05Harness, Practical 1, Strands PathPRACTICAL06Harness, Practical 2, Managed HarnessPRACTICAL
PART II · CORE SERVICES
07AgentCore Runtime, Plain LanguageCONCEPT08AgentCore Runtime, PracticalPRACTICAL09AgentCore Memory, Plain LanguageCONCEPT10AgentCore Memory, PracticalPRACTICAL11AgentCore Gateway, Plain LanguageCONCEPT12AgentCore Gateway, PracticalPRACTICAL13AgentCore Identity, Plain LanguageCONCEPT14AgentCore Identity, PracticalPRACTICAL
PART III · TOOLS AND OPERATIONS
15AgentCore Code Interpreter, Plain LanguageCONCEPT16AgentCore Code Interpreter, PracticalPRACTICAL17AgentCore Browser, Plain LanguageCONCEPT18AgentCore Browser, PracticalPRACTICAL19AgentCore Observability, Plain LanguageCONCEPT20AgentCore Observability, PracticalPRACTICAL21AgentCore Evaluations, Plain LanguageCONCEPT22AgentCore Evaluations, PracticalPRACTICAL
PART IV · GOVERNANCE AND TRANSACTIONS
23AgentCore Policy, Plain LanguageCONCEPT24AgentCore Policy, PracticalPRACTICAL25AgentCore Registry, Plain LanguageCONCEPT26AgentCore Registry, PracticalPRACTICAL27AgentCore Payments, Plain LanguageCONCEPT28AgentCore Payments, PracticalPRACTICAL
PART V · MULTI-AGENT AND ARCHITECTURE
29A2A and Multi-Agent, Plain LanguageCONCEPT30A2A and Multi-Agent, PracticalPRACTICAL31Architecture Patterns, Plain LanguageCONCEPT32Multi-Tenant Agents, Plain LanguageCONCEPT33Agent Security and Threat Model, Plain LanguageCONCEPT34Governance at Org Scale, Plain LanguageCONCEPT35Governance at Org Scale, PracticalPRACTICAL36Multi-Region and Distribution, Plain LanguageCONCEPT