{"uid":"cap_HGRcBNZfmab2gA5jS7Z50","slug":"x402-policy-api-session-creation-32f4108c","name":"x402-policy API – Session Creation","description":"AI agent spending policy via x402 v2 micropayments on Base Mainnet.","url":"https://x402-api-seven.vercel.app/v1/session?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object"},"responseSchema":{"type":"json","format":null,"example":{"active":true,"key_id":"sess_abc123","spent_usd":0,"expires_at":1749254400,"spend_cap_usd":5}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_4rZOZ1VxF0t2I90PFNNrd","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Creates an AI agent spending policy session with a configurable spend cap via x402 v2 micropayments on Base Mainnet","exampleAgentPrompt":"Set up a new spending policy session for me with a $5 USD spend cap so my agent can make micropayments on Base Mainnet without going over budget.","exampleUseCases":null,"resultDescription":"Returns a JSON object with the session's active status (true/false), a unique session key ID (e.g. sess_abc123), the amount spent so far in USD (initially 0), the Unix timestamp when the session expires, and the configured spend cap in USD.","failureModes":["Payment not received or x402 payment header missing — 402 Payment Required","Insufficient USDC balance for the $0.002 per-call fee — payment rejected","Invalid spend cap value or malformed request body — 400 Bad Request","Session creation fails due to network congestion on Base Mainnet — 503 or timeout","Expired or invalid x402 payment credentials — 401 Unauthorized"],"whenToPreferThis":"Use this endpoint when you need to programmatically create a controlled spending policy for an AI agent operating autonomously, specifically with x402 v2 micropayment enforcement on Base Mainnet. Prefer this over manual USDC transfers or other payment rails when you want per-call micropayment accountability and a hard spend cap enforced at the session level.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-03T12:32:29.474Z","isFirstParty":false,"canonicalSlug":"x402-policy-api-session-creation-32f4108c"}