Create a payment session
A payment session is a time-bounded payment context that optionally enforces a spending budget. When the session expires or the budget is reached, further payment requests within that session are denied. For the complete request and response schema, see CreatePaymentSession in the API Reference.
Tip
You can automate the steps on this page with the AgentCore Payments skill in the AWS agent toolkit. The skill is part of the aws-agents plugin and lets an AI coding agent create your Payment Manager, connector, credential provider, payment instrument, and session using the agentcore CLI, and add an x402 payment tool to your agent. For details, see the quickstart and the AWS agent toolkit on GitHub
Example
Tip
If you use the AgentCore CLI (v0.19.0+), pass --auto-session to agentcore invoke to create or reuse a session with the default spend limit configured on your payment manager. This removes the need to create sessions manually for most workflows.