AI agents should never have unlimited spending power. BoltzPay enforces budget limits before any payment is signed or sent. If a request would exceed your limits, it fails immediately with a clear error. No money leaves your wallet.
Budget Check Flow
Safety Guarantees
Budget checks happen before payment
The SDK validates all three limits (per-transaction, daily, monthly) before signing. If any limit is exceeded, a BudgetExceededError is thrown and the payment flow stops. Your wallet is never touched.
Spending is only recorded on success
If the payment fails or the server returns an error after payment, the amount is not recorded against your budget. This prevents phantom spending from eating into your limits.
Warning events at 80%
When cumulative spending crosses 80% of any configured limit, the SDK emits a budget:warning event. You can listen for these to alert your agent or operator before hitting a hard stop.
Session Budget (Reserve / Release)
Sessions use a reservation pattern to prevent budget overcommitment when multiple sessions run concurrently.
How it works
Reserve — When openSession() is called, the SDK reserves the deposit amount from the available budget. This atomically decrements available capacity.
Per-voucher check — During streaming, each voucher’s cumulative amount is checked against the reserved deposit. If it exceeds the deposit, the session is force-closed and a MppSessionBudgetError is thrown.
Release — When session.close() is called, unused deposit (deposit minus actual spent) is released back to the budget.
// Budget: $10 daily, $5 spent already// Available for reservation: $5const session1 = await agent.openSession(url, { maxDeposit: "3.00" });// Reserved: $3, available: $2const session2 = await agent.openSession(url, { maxDeposit: "2.00" });// Reserved: $2, available: $0// session2 spends $0.50, then closesconst receipt = await session2.close();// Released: $1.50 unused, available: $1.50// session1 is still open, budget correctly reflects both
Orphan detection
Sessions write two history entries: one at open (with sessionStatus: "open") and one at close (with sessionStatus: "closed"). If a session opens but never closes (crash, timeout), the open entry without a matching close entry is detectable in payment history.
MCP Budget Enforcement
When using wrapMcpClient(), the SDK intercepts payment challenges before credential creation. The challenge includes an amount field — the SDK converts it to USD and runs the standard budget check (per-transaction, daily, monthly) before allowing the credential to be created.If the budget check fails, a BudgetExceededError is thrown and the MCP call returns an error. No payment is made.
const wrapped = agent.wrapMcpClient(mcpClient);// Budget check happens automatically before paymenttry { await wrapped.callTool({ name: "expensive_tool" });} catch (err) { if (err instanceof BudgetExceededError) { console.log("MCP payment blocked by budget"); }}
Configuration
Set budget limits in the constructor:
const agent = new BoltzPay({ coinbaseApiKeyId: process.env.COINBASE_API_KEY_ID!, coinbaseApiKeySecret: process.env.COINBASE_API_KEY_SECRET!, coinbaseWalletSecret: process.env.COINBASE_WALLET_SECRET!, budget: { perTransaction: "1.00", // Max $1 per request daily: "10.00", // Max $10 per day monthly: "100.00", // Max $100 per month },});
All values are in USD. L402 payments in satoshis are converted to USD via satToUsdRate (default: 0.001, ~$100K/BTC) and count toward the same limits. If you omit a limit, that check is skipped (no limit enforced for that tier).
If you create a BoltzPay instance without a budget config, no spending limits are enforced. Every payment that the server requests will be signed and sent. This is fine for testing but not recommended for production agents.
Always configure budget limits for autonomous agents. An agent in a loop with no budget can drain a wallet in minutes.
Next Steps
How It Works — the full payment flow, including where budget checks fit in
Sessions — reservation lifecycle, streaming vouchers, and session receipts
Configuration — all constructor options and environment variables
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"BoltzPay","colors":{"primary":"#c9a0d4","light":"#F3C1FF","dark":"#7c3aed"},"logo":{"light":"https://mintcdn.com/boltzpay/nVY3eeawq34TvigI/logo/light.svg?fit=max\u0026auto=format\u0026n=nVY3eeawq34TvigI\u0026q=85\u0026s=832b8def677ecd792db807369790b366","dark":"https://mintcdn.com/boltzpay/nVY3eeawq34TvigI/logo/dark.svg?fit=max\u0026auto=format\u0026n=nVY3eeawq34TvigI\u0026q=85\u0026s=39a4faf02969c4b51c3101550ba3b95f","href":"https://boltzpay.ai"},"favicon":"/favicon.svg","appearance":{"default":"dark"},"background":{"decoration":"gradient","color":{"light":"#fafaf8","dark":"#050504"}},"navbar":{"links":[{"href":"https://boltzpay.ai","label":"boltzpay.ai"}],"primary":{"type":"github","href":"https://github.com/leventilo/boltzpay"}},"footer":{"socials":{"github":"https://github.com/leventilo/boltzpay","x":"https://x.com/boltzpay"},"links":[{"header":"Resources","items":[{"label":"Documentation","href":"/introduction"},{"label":"SDK API Reference","href":"/reference/sdk-api"},{"label":"Registry","href":"https://status.boltzpay.ai"}]},{"header":"Community","items":[{"label":"GitHub","href":"https://github.com/leventilo/boltzpay"},{"label":"npm","href":"https://www.npmjs.com/package/@boltzpay/sdk"},{"label":"boltzpay.ai","href":"https://boltzpay.ai"}]}]},"seo":{},"icons":{"library":"lucide"},"styling":{"codeblocks":{"theme":{"light":"github-light","dark":"vitesse-dark"}},"latex":false},"errors":{"404":{"redirect":true,"title":"Page not found","description":"This page doesn't exist. Try the [documentation home](/) or use the search bar above."}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"metadata":{"timestamp":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/leventilo/boltzpay"},{"anchor":"npm","icon":"box","href":"https://www.npmjs.com/package/@boltzpay/sdk"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"boltzpay","hasAudioNarration":false,"actualSubdomain":"boltzpay","customDomains":["docs.boltzpay.ai"],"gitSource":{"type":"github","owner":"leventilo","repo":"boltzpay","deployBranch":"main","contentDirectory":"apps/docs-mintlify","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae948439540ba2ac589064f:success","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"Documentation","count":18},{"language":"default","tag":"Concepts","count":6},{"language":"default","tag":"Getting Started","count":4},{"language":"default","tag":"Integrations","count":4},{"language":"default","tag":"Guides","count":3},{"language":"default","tag":"Reference","count":2},{"language":"default","tag":"API Reference","count":2},{"language":"default","tag":"Support","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTN1OVgaY.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTPlOVgaY.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTOVOVgaY.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTNVOVgaY.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTNFOVgaY.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTOlOV.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\ncode,pre code{font-family:'JetBrains Mono', ui-monospace, monospace!important}.dark code:not(pre code){color:#a3e635!important}.dark pre{border-color:#1a1a17!important}.dark [class*=\"announcement\"] a{color:#a3e635!important}.dark #navbar{border-color:#1a1a17!important}"}]}
{"page":{"pagePath":"concepts/budget-safety","slug":"/concepts/budget-safety","pageMetadata":{"title":"Budget \u0026 Safety","description":"How BoltzPay protects against overspending","href":"/concepts/budget-safety"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"How BoltzPay protects against overspending\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Mermaid,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Mermaid)_missingMdxReference(`Mermaid`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`AI agents should never have unlimited spending power. BoltzPay enforces budget limits `,_jsx(_components.strong,{children:`before`}),` any payment is signed or sent. If a request would exceed your limits, it fails immediately with a clear error. No money leaves your wallet.`]}),`\n`,_jsx(Heading,{level:`2`,id:`budget-check-flow`,children:`Budget Check Flow`}),`\n`,_jsx(Mermaid,{chart:`flowchart TD\n Start[\"fetch(url) called\"] --> Quote[\"Get price quote\"]\n Quote --> PerTx{\"Price exceeds\u003cbr/>per-transaction limit?\"}\n\n PerTx -- Yes --> Reject[\"BudgetExceededError\u003cbr/>No payment sent\"]\n PerTx -- No --> Daily{\"Today + reservations +\u003cbr/>price exceeds daily?\"}\n\n Daily -- Yes --> Reject\n Daily -- No --> Monthly{\"Month + reservations +\u003cbr/>price exceeds monthly?\"}\n\n Monthly -- Yes --> Reject\n Monthly -- No --> Pay[\"Sign \u0026 deliver payment\"]\n\n Pay --> Success{\"Server returns\u003cbr/>200 OK?\"}\n Success -- Yes --> Record[\"Record spending\u003cbr/>in budget tracker\"]\n Success -- No --> NoRecord[\"No spending recorded\u003cbr/>Error returned to agent\"]\n\n Record --> Warn{\"Spending exceeds\u003cbr/>80% of any limit?\"}\n Warn -- Yes --> Event[\"Emit budget:warning event\"]\n Warn -- No --> Done[\"Return response to agent\"]\n Event --> Done\n\n style Reject fill:#7f1d1d,stroke:#f87171,color:#fff\n style NoRecord fill:#7f1d1d,stroke:#f87171,color:#fff\n style Done fill:#365314,stroke:#84cc16,color:#fff\n style Event fill:#713f12,stroke:#fbbf24,color:#fff`}),`\n`,_jsx(Heading,{level:`2`,id:`safety-guarantees`,children:`Safety Guarantees`}),`\n`,_jsx(Heading,{level:`3`,id:`budget-checks-happen-before-payment`,children:`Budget checks happen before payment`}),`\n`,_jsxs(_components.p,{children:[`The SDK validates all three limits (per-transaction, daily, monthly) `,_jsx(_components.strong,{children:`before`}),` signing. If any limit is exceeded, a `,_jsx(_components.code,{children:`BudgetExceededError`}),` is thrown and the payment flow stops. Your wallet is never touched.`]}),`\n`,_jsx(Heading,{level:`3`,id:`spending-is-only-recorded-on-success`,children:`Spending is only recorded on success`}),`\n`,_jsxs(_components.p,{children:[`If the payment fails or the server returns an error after payment, the amount is `,_jsx(_components.strong,{children:`not`}),` recorded against your budget. This prevents phantom spending from eating into your limits.`]}),`\n`,_jsx(Heading,{level:`3`,id:`warning-events-at-80%`,children:`Warning events at 80%`}),`\n`,_jsxs(_components.p,{children:[`When cumulative spending crosses 80% of any configured limit, the SDK emits a `,_jsx(_components.code,{children:`budget:warning`}),` event. You can listen for these to alert your agent or operator before hitting a hard stop.`]}),`\n`,_jsx(Heading,{level:`2`,id:`session-budget-reserve-/-release`,children:`Session Budget (Reserve / Release)`}),`\n`,_jsx(_components.p,{children:`Sessions use a reservation pattern to prevent budget overcommitment when multiple sessions run concurrently.`}),`\n`,_jsx(Heading,{level:`3`,id:`how-it-works`,children:`How it works`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Reserve`}),` — When `,_jsx(_components.code,{children:`openSession()`}),` is called, the SDK reserves the deposit amount from the available budget. This atomically decrements available capacity.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Per-voucher check`}),` — During streaming, each voucher’s cumulative amount is checked against the reserved deposit. If it exceeds the deposit, the session is force-closed and a `,_jsx(_components.code,{children:`MppSessionBudgetError`}),` is thrown.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Release`}),` — When `,_jsx(_components.code,{children:`session.close()`}),` is called, unused deposit (deposit minus actual spent) is released back to the budget.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light vitesse-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#121212`,color:`#24292e`,\"--shiki-dark\":`#dbd7caee`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#758575DD`},children:`// Budget: $10 daily, $5 spent already`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#758575DD`},children:`// Available for reservation: $5`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#BD976A`},children:` session1`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#666666`},children:` =`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#4D9375`},children:` await`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` agent`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`openSession`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`(`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`url`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`,`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` { `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#B8A965`},children:`maxDeposit`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`3.00`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#758575DD`},children:`// Reserved: $3, available: $2`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#BD976A`},children:` session2`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#666666`},children:` =`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#4D9375`},children:` await`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` agent`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`openSession`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`(`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`url`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`,`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` { `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#B8A965`},children:`maxDeposit`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`2.00`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#758575DD`},children:`// Reserved: $2, available: $0`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#758575DD`},children:`// session2 spends $0.50, then closes`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#BD976A`},children:` receipt`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#666666`},children:` =`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#4D9375`},children:` await`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` session2`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`close`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#758575DD`},children:`// Released: $1.50 unused, available: $1.50`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#758575DD`},children:`// session1 is still open, budget correctly reflects both`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`orphan-detection`,children:`Orphan detection`}),`\n`,_jsxs(_components.p,{children:[`Sessions write two history entries: one at `,_jsx(_components.code,{children:`open`}),` (with `,_jsx(_components.code,{children:`sessionStatus: \"open\"`}),`) and one at `,_jsx(_components.code,{children:`close`}),` (with `,_jsx(_components.code,{children:`sessionStatus: \"closed\"`}),`). If a session opens but never closes (crash, timeout), the open entry without a matching close entry is detectable in payment history.`]}),`\n`,_jsx(Heading,{level:`2`,id:`mcp-budget-enforcement`,children:`MCP Budget Enforcement`}),`\n`,_jsxs(_components.p,{children:[`When using `,_jsx(_components.code,{children:`wrapMcpClient()`}),`, the SDK intercepts payment challenges before credential creation. The challenge includes an `,_jsx(_components.code,{children:`amount`}),` field — the SDK converts it to USD and runs the standard budget check (per-transaction, daily, monthly) before allowing the credential to be created.`]}),`\n`,_jsxs(_components.p,{children:[`If the budget check fails, a `,_jsx(_components.code,{children:`BudgetExceededError`}),` is thrown and the MCP call returns an error. No payment is made.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light vitesse-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#121212`,color:`#24292e`,\"--shiki-dark\":`#dbd7caee`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#BD976A`},children:` wrapped`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#666666`},children:` =`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` agent`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`wrapMcpClient`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`(`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`mcpClient`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#758575DD`},children:`// Budget check happens automatically before payment`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#4D9375`},children:`try`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#4D9375`},children:` await`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` wrapped`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`callTool`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`({ `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#B8A965`},children:`name`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`expensive_tool`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` });`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`}`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#4D9375`},children:` catch`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` (`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`err`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`)`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#4D9375`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` (`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`err`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:` instanceof`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#5DA994`},children:` BudgetExceededError`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`)`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` console`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`log`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`MCP payment blocked by budget`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`configuration`,children:`Configuration`}),`\n`,_jsx(_components.p,{children:`Set budget limits in the constructor:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light vitesse-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#121212`,color:`#24292e`,\"--shiki-dark\":`#dbd7caee`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#BD976A`},children:` agent`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#666666`},children:` =`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:` new`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:` BoltzPay`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#B8A965`},children:` coinbaseApiKeyId`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`: `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`process`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`env`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#BD976A`},children:`COINBASE_API_KEY_ID`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:`!`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#B8A965`},children:` coinbaseApiKeySecret`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`: `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`process`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`env`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#BD976A`},children:`COINBASE_API_KEY_SECRET`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:`!`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#B8A965`},children:` coinbaseWalletSecret`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`: `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`process`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`env`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#BD976A`},children:`COINBASE_WALLET_SECRET`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:`!`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#B8A965`},children:` budget`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#B8A965`},children:` perTransaction`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`1.00`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`, `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#758575DD`},children:`// Max $1 per request`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#B8A965`},children:` daily`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`10.00`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`, `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#758575DD`},children:`// Max $10 per day`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#B8A965`},children:` monthly`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`100.00`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`, `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#758575DD`},children:`// Max $100 per month`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`});`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`All values are in USD. L402 payments in satoshis are converted to USD via `,_jsx(_components.code,{children:`satToUsdRate`}),` (default: 0.001, ~$100K/BTC) and count toward the same limits. If you omit a limit, that check is skipped (no limit enforced for that tier).`]}),`\n`,_jsx(Heading,{level:`2`,id:`checking-remaining-budget`,children:`Checking Remaining Budget`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light vitesse-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#121212`,color:`#24292e`,\"--shiki-dark\":`#dbd7caee`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#BD976A`},children:` budget`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#666666`},children:` =`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` agent`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`getBudget`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`console`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`log`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`Per-tx limit:`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`,`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` budget`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`perTransactionLimit`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`?.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`toDisplayString`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`console`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`log`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`Daily spent:`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`,`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` budget`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`dailySpent`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`?.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`toDisplayString`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`console`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`log`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`Daily remaining:`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`,`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` budget`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`dailyRemaining`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`?.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`toDisplayString`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`console`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`log`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`Monthly spent:`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`,`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` budget`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`monthlySpent`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`?.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`toDisplayString`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`console`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`log`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`Monthly remaining:`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`,`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` budget`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`monthlyRemaining`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`?.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`toDisplayString`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`());`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`listening-for-warnings`,children:`Listening for Warnings`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light vitesse-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#121212`,color:`#24292e`,\"--shiki-dark\":`#dbd7caee`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:`agent`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`on`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`budget:warning`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`,`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` (`}),_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#BD976A`},children:`event`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`)`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#666666`},children:` =>`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#BD976A`},children:` console`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`warn`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:\" `\"}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`Budget warning: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#4D9375`},children:\"${\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#C98A7D`},children:`event`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#C98A7D`},children:`period`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#4D9375`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:` limit `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#4D9375`},children:\"${\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#C98A7D`},children:`Math`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#80A665`},children:`round`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#666666`},children:`(`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#C98A7D`},children:`event`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#666666`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#C98A7D`},children:`usage`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#CB7676`},children:` *`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#4C9A91`},children:` 100`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#666666`},children:`)`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#4D9375`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D`},children:`% used`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#C98A7D77`},children:\"`\"})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#666666`},children:`});`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`what-happens-without-a-budget`,children:`What Happens Without a Budget`}),`\n`,_jsxs(_components.p,{children:[`If you create a `,_jsx(_components.code,{children:`BoltzPay`}),` instance without a `,_jsx(_components.code,{children:`budget`}),` config, `,_jsx(_components.strong,{children:`no spending limits are enforced`}),`. Every payment that the server requests will be signed and sent. This is fine for testing but not recommended for production agents.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Always configure budget limits for autonomous agents. An agent in a loop with no budget can drain a wallet in minutes.`})}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next Steps`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/concepts/how-it-works`,children:`How It Works`}),` — the full payment flow, including where budget checks fit in`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/concepts/sessions`,children:`Sessions`}),` — reservation lifecycle, streaming vouchers, and session receipts`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/getting-started/configuration`,children:`Configuration`}),` — all constructor options and environment variables`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light","dark":"vitesse-dark"}},"config":{},"pageMetadata":{"title":"Budget \u0026 Safety","description":"How BoltzPay protects against overspending","href":"/concepts/budget-safety"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Budget Check Flow","slug":"budget-check-flow","depth":2,"children":[]},{"title":"Safety Guarantees","slug":"safety-guarantees","depth":2,"children":[{"title":"Budget checks happen before payment","slug":"budget-checks-happen-before-payment","depth":3,"children":[]},{"title":"Spending is only recorded on success","slug":"spending-is-only-recorded-on-success","depth":3,"children":[]},{"title":"Warning events at 80%","slug":"warning-events-at-80%","depth":3,"children":[]}]},{"title":"Session Budget (Reserve / Release)","slug":"session-budget-reserve-/-release","depth":2,"children":[{"title":"How it works","slug":"how-it-works","depth":3,"children":[]},{"title":"Orphan detection","slug":"orphan-detection","depth":3,"children":[]}]},{"title":"MCP Budget Enforcement","slug":"mcp-budget-enforcement","depth":2,"children":[]},{"title":"Configuration","slug":"configuration","depth":2,"children":[]},{"title":"Checking Remaining Budget","slug":"checking-remaining-budget","depth":2,"children":[]},{"title":"Listening for Warnings","slug":"listening-for-warnings","depth":2,"children":[]},{"title":"What Happens Without a Budget","slug":"what-happens-without-a-budget","depth":2,"children":[]},{"title":"Next Steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"boltzpay","siteName":"BoltzPay","title":"Budget \u0026 Safety - BoltzPay","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-04-01T04:00:06.530Z","originalFileLocation":"concepts/budget-safety.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"How BoltzPay protects against overspending\">\u003cmeta data-mint-head name=\"application-name\" content=\"BoltzPay\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/boltzpay/76n1RZJhSsAlnl5E/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/boltzpay/76n1RZJhSsAlnl5E/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/boltzpay/76n1RZJhSsAlnl5E/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/boltzpay/76n1RZJhSsAlnl5E/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/boltzpay/76n1RZJhSsAlnl5E/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/boltzpay/76n1RZJhSsAlnl5E/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/boltzpay/76n1RZJhSsAlnl5E/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/boltzpay/76n1RZJhSsAlnl5E/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/boltzpay/76n1RZJhSsAlnl5E/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Budget \u0026amp; Safety - BoltzPay\">\u003cmeta data-mint-head property=\"og:description\" content=\"How BoltzPay protects against overspending\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"BoltzPay\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.boltzpay.ai/concepts/budget-safety\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://boltzpay.mintlify.site/_mintlify/api/og/v2?division=Concepts\u0026amp;title=Budget+%26+Safety\u0026amp;description=How+BoltzPay+protects+against+overspending\u0026amp;theme=c8e9f6b1d8092d38db6c283a\u0026amp;signature=446226f553f7922773de011722753bba3c20ec8f32fbad53b889bdb9e085062b\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Budget \u0026amp; Safety - BoltzPay\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How BoltzPay protects against overspending\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://boltzpay.mintlify.site/_mintlify/api/og/v2?division=Concepts\u0026amp;title=Budget+%26+Safety\u0026amp;description=How+BoltzPay+protects+against+overspending\u0026amp;theme=c8e9f6b1d8092d38db6c283a\u0026amp;signature=446226f553f7922773de011722753bba3c20ec8f32fbad53b889bdb9e085062b\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/boltzpay/76n1RZJhSsAlnl5E/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"BoltzPay\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#c9a0d4\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.boltzpay.ai/concepts/budget-safety\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/concepts/budget-safety.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.boltzpay.ai/#organization\",\"name\":\"BoltzPay\",\"url\":\"https://docs.boltzpay.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/boltzpay/nVY3eeawq34TvigI/logo/light.svg?fit=max\u0026auto=format\u0026n=nVY3eeawq34TvigI\u0026q=85\u0026s=832b8def677ecd792db807369790b366\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.boltzpay.ai#website\",\"name\":\"BoltzPay\",\"url\":\"https://docs.boltzpay.ai\",\"publisher\":{\"@id\":\"https://docs.boltzpay.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.boltzpay.ai/concepts/budget-safety#webpage\",\"url\":\"https://docs.boltzpay.ai/concepts/budget-safety\",\"name\":\"Budget \u0026 Safety\",\"description\":\"How BoltzPay protects against overspending\",\"dateModified\":\"2026-04-01T04:00:06.530Z\",\"isPartOf\":{\"@id\":\"https://docs.boltzpay.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.boltzpay.ai/concepts/budget-safety#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.boltzpay.ai/concepts/budget-safety#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Concepts\",\"item\":\"https://docs.boltzpay.ai/concepts/how-it-works\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Budget \u0026 Safety\",\"item\":\"https://docs.boltzpay.ai/concepts/budget-safety\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.boltzpay.ai/concepts/budget-safety#article\",\"headline\":\"Budget \u0026 Safety\",\"name\":\"Budget \u0026 Safety\",\"description\":\"How BoltzPay protects against overspending\",\"url\":\"https://docs.boltzpay.ai/concepts/budget-safety\",\"mainEntityOfPage\":{\"@id\":\"https://docs.boltzpay.ai/concepts/budget-safety#webpage\"},\"dateModified\":\"2026-04-01T04:00:06.530Z\",\"publisher\":{\"@id\":\"https://docs.boltzpay.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.boltzpay.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"BoltzPay\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"BoltzPay\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/concepts/budget-safety.md","siteName":"BoltzPay","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/leventilo/boltzpay"},{"anchor":"npm","icon":"box","href":"https://www.npmjs.com/package/@boltzpay/sdk"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Getting Started","pages":[{"title":"BoltzPay","href":"/introduction"},{"title":"Installation","href":"/getting-started/installation"},{"title":"Quickstart","href":"/getting-started/quickstart"},{"title":"Configuration","href":"/getting-started/configuration"}]},{"group":"Concepts","pages":[{"title":"How It Works","href":"/concepts/how-it-works"},{"title":"Architecture","href":"/concepts/architecture"},{"title":"Protocol Detection","href":"/concepts/protocol-detection"},{"title":"Registry","href":"/concepts/registry"},{"title":"Sessions","description":"Streaming MPP sessions with payment channels","href":"/concepts/sessions"},{"title":"Budget \u0026 Safety","href":"/concepts/budget-safety"}]},{"group":"Guides","pages":[{"title":"CLI","description":"Use BoltzPay from the terminal or as a Python bridge.","href":"/guides/cli"},{"title":"Claude Desktop (MCP)","href":"/guides/mcp-claude-desktop"},{"title":"MCP Transport","href":"/guides/mcp-transport"}]},{"group":"Integrations","pages":[{"title":"Vercel AI SDK","href":"/integrations/vercel-ai-sdk"},{"title":"LangChain","href":"/integrations/langchain"},{"title":"CrewAI","href":"/integrations/crewai"},{"title":"n8n","href":"/integrations/n8n"}]},{"group":"Support","pages":[{"title":"FAQ","href":"/faq"}]}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/reference/sdk-api"}]}]},"basePath":"","title":"Budget \u0026 Safety - BoltzPay","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":[],"chunks":[]}