session_create
Open a budget-capped agent session on AgentPay. Pay $0.01 USDC once — get a session_id, budget config, and gateway URL. Enforces a hard max_spend cap across all subsequent tool calls via the AgentPay SDK. The entry point for agents discovering AgentPay on Base Bazaar.
Use when: You want to start an AgentPay session with a hard spend cap and get a session_id for tracking.
Not for: you only need a session for free tools — the SDK's quickstart() opens one at no cost; this call settles $0.01 on-chain.
Returns: session_id, max_spend, agent_address, gateway_url, tools_endpoint, created_at, receipt (tx_hash + network)
Example response: {"session_id":"f47ac10b-58cc-4372-a567-0e02b2c3d479","max_spend":"0.10","agent_address":"GBCVQCNFWPM3GDO4GPT4YEQ42ZHPY67QTJA3WN5ERQIKQDXKBX62SLNJ","label":null,"gateway_url":"https://agentpay.tools","tools_endpoint":"https://agentpay.tools/tools","created_at":"2026-05-27T12:00:00Z","receipt":{"tx_hash":"0xabc...def","network":"base","amount_usdc":"0.01"},"sdk_hint":"Use from agentpay import Session to enforce the max_spend cap client-side."}
Price: $0.01 USDC per call (x402 over MCP: an unpaid call returns PaymentRequired; pay via _meta x402/payment)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | Optional human-readable label for this session | |
| max_spend | No | Hard budget cap in USDC for this session, e.g. '0.10' | 0.10 |
| agent_address | No | Your wallet address (Stellar G... or EVM 0x...) |