idempotency_key is required. Derive it from the thing being reported, such as
the subscription and the window, rather than generating a random one. A random
key defeats the protection, because a retry produces a different one and the
usage is counted twice.
Both work. Pick whichever matches how your product produces the numbers.
// After each billable unit of workawait reclack(`/v1/subscriptions/${subscriptionId}/usage`, { method: "POST", body: { quantity: 1, idempotency_key: `req_${requestId}`, },});
// Once a minute, from your own counterconst window = startOfMinute(new Date()).toISOString();await reclack(`/v1/subscriptions/${subscriptionId}/usage`, { method: "POST", body: { quantity: counter.drain(), idempotency_key: `${subscriptionId}:${window}`, recorded_at: window, },});
Batching is usually kinder to both sides. One record a minute with an
idempotency key derived from the minute is safe to retry and cheap to send.
When the billing period ends, Reclack totals what was recorded, applies the
allowance and the rate from the price, and opens a real invoice with the usage
figure on the document. The collection then runs against the authorization the
customer already signed.
Amounts live in integer atomic units from the meter to the chain. No floating
point touches a figure that will be charged, and rounding is decided once, when
the invoice is written. The figure on the invoice is the figure that settles.
Running totals are visible to you in the dashboard and to your customer in the
portal while the period is still open. A bill that arrives with no way to check
it is a bill somebody argues with, so showing the figure as it accumulates is
worth the small effort.
A metered period is still bounded by the approval the customer signed. Price
the allowance so a usual month sits comfortably inside the cap.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Reclack Docs","colors":{"primary":"#533afd","light":"#8f7dff","dark":"#3b28c9"},"logo":{"light":"https://mintcdn.com/reclack/i_PBmgTWOy1QpaWl/logo/light.png?fit=max\u0026auto=format\u0026n=i_PBmgTWOy1QpaWl\u0026q=85\u0026s=9aae17cd96b1b86d90f8d5770cd405f6","dark":"https://mintcdn.com/reclack/i_PBmgTWOy1QpaWl/logo/dark.png?fit=max\u0026auto=format\u0026n=i_PBmgTWOy1QpaWl\u0026q=85\u0026s=9d5dbf9ac5d5d9c2e57a247e8e74abf1"},"favicon":"https://mintcdn.com/reclack/i_PBmgTWOy1QpaWl/favicon.ico?fit=max\u0026auto=format\u0026n=i_PBmgTWOy1QpaWl\u0026q=85\u0026s=62cc58f492f28c9d8b7950415e30c036","background":{"color":{"light":"#ffffff","dark":"#0b0d11"}},"navbar":{"links":[{"href":"mailto:[email protected]","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.reclack.com"}},"footer":{"socials":{"x":"https://x.com/usereclack","instagram":"https://www.instagram.com/usereclack","linkedin":"https://www.linkedin.com/company/reclack"}},"contextual":{"options":["copy","view","claude","chatgpt","mcp"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Dashboard","icon":"gauge","href":"https://app.reclack.com"},{"anchor":"Status","icon":"signal","href":"https://status.reclack.com"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"reclack","hasAudioNarration":false,"actualSubdomain":"reclack","customDomains":["docs.reclack.com"],"gitSource":{"type":"github","owner":"reclack","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6ad6a237e0d9d95429710b56","collectionId":"c31bc6a1-e791-479a-9655-78ac4154df88","liveDeploymentHistoryId":"6ad6a237e0d9d95429710b56","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ad6a237e0d9d95429710b56","clientVersion":"0.0.3894","searchFilterCounts":[{"language":"default","tag":"API reference","count":57},{"language":"default","tag":"Guides","count":19},{"language":"default","tag":"Invoices","count":9},{"language":"default","tag":"Webhooks","count":9},{"language":"default","tag":"Checkouts","count":7},{"language":"default","tag":"Get started","count":6},{"language":"default","tag":"Payment links","count":5},{"language":"default","tag":"Prices","count":5},{"language":"default","tag":"Products","count":5},{"language":"default","tag":"Settlement","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","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":"editor-v7-file-tree","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":"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":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-branches-v2-autocommit","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-branches-v2","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":"editor-private-page-search","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":"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":"teamspace","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","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":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","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":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"client-snapshot-docs-config","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}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".font-semibold.text-primary.overflow-wrap-anywhere{color:#374151}.dark .font-semibold.text-primary.overflow-wrap-anywhere{color:#d4d4d8}.dark{--gray-50:248 250 252;--gray-100:241 245 249;--gray-200:226 232 240;--gray-300:203 213 225;--gray-400:148 163 184;--gray-500:100 116 139;--gray-600:71 85 105;--gray-700:51 65 85;--gray-800:28 34 45;--gray-900:20 23 29;--gray-950:11 13 17}"}],"page":{"pagePath":"guides/usage-billing","slug":"/guides/usage-billing","pageMetadata":{"title":"Usage billing","description":"Record what your product served, and let the period bill itself.","href":"/guides/usage-billing"},"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: \"Record what your product served, and let the period bill itself.\"\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={code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Frame,Heading,OptimizedImage,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Metered plans bill in arrears on usage you record. The meter is yours. The\nadding up, the invoice and the collection are ours.`}),`\n`,_jsxs(Frame,{caption:`Usage accumulates through the period, and the close turns it into a bill`,children:[_jsx(OptimizedImage,{className:`mint-block dark:mint-hidden`,src:`https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period.svg?fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=1cef15a437ef4b99bf9b5dfa9a577ce6`,alt:`Usage bars climbing across a month, and the invoice that opens when the period closes.`,\"data-og-width\":`880`,width:`880`,\"data-og-height\":`300`,height:`300`,\"data-path\":`images/usage-period.svg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period.svg?w=280\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=ecdfd20b7a3e4fb41fb45a69c6cb5399 280w, https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period.svg?w=560\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=c8ef9d6b8d9e28b7f73a3f28b27652c1 560w, https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period.svg?w=840\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=e2d9eee0df7483ee5017ad8f82368cbc 840w, https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period.svg?w=1100\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=87d4a99fe96be861799ad1fb49eb1aff 1100w, https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period.svg?w=1650\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=86775112eb1e595fed1a6dfc368c6543 1650w, https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period.svg?w=2500\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=c342ccaee2945a3485e0c62637066a2c 2500w`}),_jsx(OptimizedImage,{className:`mint-hidden dark:mint-block`,src:`https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period-dark.svg?fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=4a48f912fa3a0395157137d2d1cec6a9`,alt:`Usage bars climbing across a month, and the invoice that opens when the period closes.`,\"data-og-width\":`880`,width:`880`,\"data-og-height\":`300`,height:`300`,\"data-path\":`images/usage-period-dark.svg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period-dark.svg?w=280\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=b1b633af7b54eb08ccc3b9329aba6245 280w, https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period-dark.svg?w=560\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=5575eea4574da984472a638eae9a5c77 560w, https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period-dark.svg?w=840\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=79f766571c8b86c4d195c51454ed810a 840w, https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period-dark.svg?w=1100\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=5c029a776b308ed253ceadf739bd7f13 1100w, https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period-dark.svg?w=1650\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=dda7bfc68d80adc584cf8de5ac4bb584 1650w, https://mintcdn.com/reclack/hSqUHJp0KVXvwTsQ/images/usage-period-dark.svg?w=2500\u0026fit=max\u0026auto=format\u0026n=hSqUHJp0KVXvwTsQ\u0026q=85\u0026s=4a8d973de825d0039ac7e278cd594ef0 2500w`})]}),`\n`,_jsx(Heading,{level:`2`,id:`recording-usage`,children:`Recording usage`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.reclack.com/v1/subscriptions/sub_4Kd9/usage\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Api-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$RECLACK_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"quantity\": 48210,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"idempotency_key\": \"sub_4Kd9:2026-10-18T22:00\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"recorded_at\": \"2026-10-18T22:00:00Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metadata\": { \"meter\": \"api_requests\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`quantity`})}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Whole units of whatever you are metering.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`idempotency_key`})}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Makes a retry safe. See below.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`recorded_at`})}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`When the usage happened. Defaults to now.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`metadata`})}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Your own context, such as which meter this is.`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`idempotency_key`}),` is required. Derive it from the thing being reported, such as\nthe subscription and the window, rather than generating a random one. A random\nkey defeats the protection, because a retry produces a different one and the\nusage is counted twice.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`reporting-as-it-happens-or-in-batches`,children:`Reporting as it happens, or in batches`}),`\n`,_jsx(_components.p,{children:`Both work. Pick whichever matches how your product produces the numbers.`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Continuous`,numberOfLines:`8`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// After each billable unit of work`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` reclack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`/v1/subscriptions/\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`subscriptionId`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/usage`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` quantity:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` idempotency_key:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `req_\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`requestId`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Batched`,numberOfLines:`11`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Once a minute, from your own counter`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` window`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` startOfMinute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Date`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toISOString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` reclack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`/v1/subscriptions/\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`subscriptionId`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/usage`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` quantity:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` counter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`drain`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` idempotency_key:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`subscriptionId`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` recorded_at:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsx(_components.p,{children:`Batching is usually kinder to both sides. One record a minute with an\nidempotency key derived from the minute is safe to retry and cheap to send.`}),`\n`,_jsx(Heading,{level:`2`,id:`how-the-period-closes`,children:`How the period closes`}),`\n`,_jsx(_components.p,{children:`When the billing period ends, Reclack totals what was recorded, applies the\nallowance and the rate from the price, and opens a real invoice with the usage\nfigure on the document. The collection then runs against the authorization the\ncustomer already signed.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"in_0219\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"open\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"amount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"38.41\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"currency\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"USDC\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"period_start\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-10-01T00:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"period_end\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-10-31T23:59:59Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"metadata\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage_quantity\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1284922`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"included\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1000000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"billable\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`284922`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`arithmetic`,children:`Arithmetic`}),`\n`,_jsx(_components.p,{children:`Amounts live in integer atomic units from the meter to the chain. No floating\npoint touches a figure that will be charged, and rounding is decided once, when\nthe invoice is written. The figure on the invoice is the figure that settles.`}),`\n`,_jsx(Heading,{level:`2`,id:`keeping-the-customer-informed`,children:`Keeping the customer informed`}),`\n`,_jsx(_components.p,{children:`Running totals are visible to you in the dashboard and to your customer in the\nportal while the period is still open. A bill that arrives with no way to check\nit is a bill somebody argues with, so showing the figure as it accumulates is\nworth the small effort.`}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`A metered period is still bounded by the approval the customer signed. Price\nthe allowance so a usual month sits comfortably inside the cap.`})})]})}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":{"config":{},"pageMetadata":{"title":"Usage billing","description":"Record what your product served, and let the period bill itself.","href":"/guides/usage-billing"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Recording usage","slug":"recording-usage","depth":2,"children":[]},{"title":"Reporting as it happens, or in batches","slug":"reporting-as-it-happens-or-in-batches","depth":2,"children":[]},{"title":"How the period closes","slug":"how-the-period-closes","depth":2,"children":[]},{"title":"Arithmetic","slug":"arithmetic","depth":2,"children":[]},{"title":"Keeping the customer informed","slug":"keeping-the-customer-informed","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"dynamicCss":".mint-block {\n display: block\n}\n.mint-hidden {\n display: none\n}\n.dark\\:mint-block:is(.dark *) {\n display: block\n}\n.dark\\:mint-hidden:is(.dark *) {\n display: none\n}","subdomain":"reclack","siteName":"Reclack Docs","title":"Usage billing - Reclack Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-19T23:05:35.369Z","originalFileLocation":"guides/usage-billing.mdx"},"headHtml":"\u003cmeta data-mint-head name=\"description\" content=\"Record what your product served, and let the period bill itself.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Reclack Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/reclack/H6DBMos9VrjwkxQL/_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/reclack/H6DBMos9VrjwkxQL/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/reclack/H6DBMos9VrjwkxQL/_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/reclack/H6DBMos9VrjwkxQL/_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/reclack/H6DBMos9VrjwkxQL/_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/reclack/H6DBMos9VrjwkxQL/_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/reclack/H6DBMos9VrjwkxQL/_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/reclack/H6DBMos9VrjwkxQL/_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/reclack/H6DBMos9VrjwkxQL/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Usage billing - Reclack Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Record what your product served, and let the period bill itself.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Reclack Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.reclack.com/guides/usage-billing\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Usage billing - Reclack Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Record what your product served, and let the period bill itself.\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/reclack/H6DBMos9VrjwkxQL/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Reclack Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#533afd\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.reclack.com/guides/usage-billing\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/usage-billing.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.reclack.com/#organization\",\"name\":\"Reclack Docs\",\"url\":\"https://docs.reclack.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/reclack/i_PBmgTWOy1QpaWl/logo/light.png?fit=max\u0026auto=format\u0026n=i_PBmgTWOy1QpaWl\u0026q=85\u0026s=9aae17cd96b1b86d90f8d5770cd405f6\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.reclack.com#website\",\"name\":\"Reclack Docs\",\"url\":\"https://docs.reclack.com\",\"publisher\":{\"@id\":\"https://docs.reclack.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.reclack.com/guides/usage-billing#webpage\",\"url\":\"https://docs.reclack.com/guides/usage-billing\",\"name\":\"Usage billing\",\"description\":\"Record what your product served, and let the period bill itself.\",\"dateModified\":\"2026-10-19T23:05:35.369Z\",\"isPartOf\":{\"@id\":\"https://docs.reclack.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.reclack.com/guides/usage-billing#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.reclack.com/guides/usage-billing#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Recurring billing\",\"item\":\"https://docs.reclack.com/guides/subscriptions\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Usage billing\",\"item\":\"https://docs.reclack.com/guides/usage-billing\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.reclack.com/guides/usage-billing#article\",\"headline\":\"Usage billing\",\"name\":\"Usage billing\",\"description\":\"Record what your product served, and let the period bill itself.\",\"url\":\"https://docs.reclack.com/guides/usage-billing\",\"mainEntityOfPage\":{\"@id\":\"https://docs.reclack.com/guides/usage-billing#webpage\"},\"dateModified\":\"2026-10-19T23:05:35.369Z\",\"publisher\":{\"@id\":\"https://docs.reclack.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.reclack.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Reclack Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Reclack Docs","nav":{"global":{"anchors":[{"anchor":"Dashboard","icon":"gauge","href":"https://app.reclack.com"},{"anchor":"Status","icon":"signal","href":"https://status.reclack.com"}]},"tabs":[{"tab":"Guides","groups":[{"group":"Get started","pages":[{"title":"Reclack API","href":""},{"title":"Quickstart","href":"/quickstart"},{"title":"Authentication","href":"/authentication"},{"title":"Environments","href":"/environments"},{"title":"Errors","href":"/errors"},{"title":"Idempotency","href":"/idempotency"}]},{"group":"Core objects","pages":[{"title":"How the objects fit","href":"/guides/objects"},{"title":"Products and prices","href":"/guides/products-and-prices"},{"title":"Customers","href":"/guides/customers"}]},{"group":"Taking payments","pages":[{"title":"Hosted checkout","href":"/guides/checkout"},{"title":"Payment links","href":"/guides/payment-links"},{"title":"Invoices","href":"/guides/invoices"}]},{"group":"Recurring billing","pages":[{"title":"Subscriptions","description":"One approval, then periods that collect themselves.","href":"/guides/subscriptions"},{"title":"Usage billing","href":"/guides/usage-billing"},{"title":"Customer portal","description":"Let customers answer their own billing questions.","href":"/guides/customer-portal"}]},{"group":"Money and events","pages":[{"title":"Settlement","href":"/guides/settlement"},{"title":"Webhooks","href":"/webhooks/overview"},{"title":"Verifying webhooks","href":"/webhooks/verifying"},{"title":"Event types","href":"/webhooks/events"}]}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/api-reference/introduction"}]}]},"title":"Usage billing - Reclack Docs","buildId":"dpl_8LJVMfxYNq6LJkohTrn2iyWT8umj","deploymentId":"dpl_8LJVMfxYNq6LJkohTrn2iyWT8umj","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-DgIorxK1.js","DynamicMarkdown-43fmNsOD.js","zoom-image-lightbox-D9lJgLSo.js","PlusIcon-C1lem43w.js","lightbox-handle-r17bVUz3.js"]}