Stores auto-recharge settings and returns the updated billing state. Requires billing_write.
When enabled, and a card is saved, the server checks after each run admission and after each 402: if the available balance is below threshold_micros, it charges amount_micros to the saved card, at most once per organization per clock hour. The credit lands when the payment succeeds. See Auto-recharge.
{"docsConfig":{"theme":"sequoia","$schema":"https://mintlify.com/docs.json","name":"OpenType Docs","description":"OpenType answers typed questions about your data in one model call per run. Send a state and a set of questions; get calibrated answers back.","colors":{"primary":"#0A7A3B","light":"#2DEC80","dark":"#0A7A3B"},"logo":{"light":"https://mintcdn.com/opentype/nqaaLldDOctxoCbH/logo/light.svg?fit=max\u0026auto=format\u0026n=nqaaLldDOctxoCbH\u0026q=85\u0026s=73a92db185691378733575d262c4447f","dark":"https://mintcdn.com/opentype/nqaaLldDOctxoCbH/logo/dark.svg?fit=max\u0026auto=format\u0026n=nqaaLldDOctxoCbH\u0026q=85\u0026s=3cc19793d85db57b7dd672606262a9f8","href":"https://docs.opentype.dev"},"favicon":"https://mintcdn.com/opentype/nqaaLldDOctxoCbH/favicon.svg?fit=max\u0026auto=format\u0026n=nqaaLldDOctxoCbH\u0026q=85\u0026s=220ca1f48e54505dd8638808f8bfe8d8","api":{"params":{"expanded":"closed"},"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["bash","typescript","python"],"autogenerate":true}},"appearance":{"default":"system"},"background":{"color":{"light":"#F7F7F4","dark":"#090A09"}},"navbar":{"links":[{"href":"https://console.opentype.dev","label":"Console"}],"primary":{"type":"button","label":"Get API key","href":"https://console.opentype.dev/keys"}},"footer":{"socials":{"github":"https://github.com/OpentypeAI"},"links":[{"header":"Docs","items":[{"label":"Quickstart","href":"/getting-started/quickstart"},{"label":"Guides","href":"/guides"},{"label":"API reference","href":"/api-reference/introduction"},{"label":"Problem codes","href":"/problems"}]},{"header":"Console","items":[{"label":"Playground","href":"https://console.opentype.dev/playground"},{"label":"API keys","href":"https://console.opentype.dev/keys"},{"label":"Usage","href":"https://console.opentype.dev/usage"},{"label":"Billing","href":"https://console.opentype.dev/billing"}]},{"header":"OpenType","items":[{"label":"Changelog","href":"/reference/changelog"},{"label":"Security","href":"/security"},{"label":"GitHub","href":"https://github.com/OpentypeAI"}]}]},"search":{"prompt":"Search runs, questions, keys and error codes..."},"seo":{"metatags":{"og:site_name":"OpenType","og:image":"https://opentype.dev/og/docs.png","og:image:width":"1200","og:image:height":"630","twitter:card":"summary_large_image","twitter:image":"https://opentype.dev/og/docs.png"},"indexing":"navigable"},"fonts":{"heading":{"family":"Geist"},"body":{"family":"Geist"}},"styling":{"codeblocks":"system","latex":true},"errors":{"404":{"redirect":false,"title":"Page not found","description":"That path is not in the OpenType docs. Try the [quickstart](/getting-started/quickstart) or the [API reference](/api-reference/introduction). If an error code sent you here, the [problem catalog](/problems) explains it."}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"navigation":{"global":{"anchors":[{"anchor":"Changelog","icon":"clock-rotate-left","href":"/reference/changelog"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"opentype","hasAudioNarration":false,"actualSubdomain":"opentype","customDomains":["docs.opentype.dev"],"gitSource":{"type":"github","owner":"opentypeai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6ab5e652539070057e19e4e0","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"default","tag":"Reference","count":53},{"language":"default","tag":"Errors","count":47},{"language":"default","tag":"Problem codes","count":46},{"language":"default","tag":"API reference","count":24},{"language":"default","tag":"Guides","count":22},{"language":"default","tag":"Get started","count":10},{"language":"default","tag":"Overview","count":9},{"language":"default","tag":"Console","count":6},{"language":"default","tag":"Decision runs","count":6},{"language":"default","tag":"Spend and billing","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":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":"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":"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":"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":"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":"assistant-v5","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":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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":"sso-setup-deadline-banner","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":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"api-reference/billing/auto-recharge","slug":"/api-reference/billing/auto-recharge","pageMetadata":{"title":"Set auto-recharge","description":"Stores auto-recharge settings and returns the updated billing state. Requires `billing_write`.\n\nWhen enabled, and a card is saved, the server checks after each run admission and after each `402`: if the available balance is below `threshold_micros`, it charges `amount_micros` to the saved card, at most once per organization per clock hour. The credit lands when the payment succeeds. See [Auto-recharge](/guides/auto-recharge).","deprecated":null,"version":null,"sidebarTitle":"Auto recharge","openapi":"/api-reference/openapi.json put /v1/billing/auto-recharge","href":"/api-reference/billing/auto-recharge","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Stores auto-recharge settings and returns the updated billing state. Requires \", _jsx(_components.code, {\n children: \"billing_write\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"When enabled, and a card is saved, the server checks after each run admission and after each \", _jsx(_components.code, {\n children: \"402\"\n }), \": if the available balance is below \", _jsx(_components.code, {\n children: \"threshold_micros\"\n }), \", it charges \", _jsx(_components.code, {\n children: \"amount_micros\"\n }), \" to the saved card, at most once per organization per clock hour. The credit lands when the payment succeeds. See \", _jsx(_components.a, {\n href: \"/guides/auto-recharge\",\n children: \"Auto-recharge\"\n }), \".\"]\n })]\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"codeStyling":"system","config":{},"pageMetadata":{"title":"Set auto-recharge","description":"Stores auto-recharge settings and returns the updated billing state. Requires `billing_write`.\n\nWhen enabled, and a card is saved, the server checks after each run admission and after each `402`: if the available balance is below `threshold_micros`, it charges `amount_micros` to the saved card, at most once per organization per clock hour. The credit lands when the payment succeeds. See [Auto-recharge](/guides/auto-recharge).","deprecated":null,"version":null,"sidebarTitle":"Auto recharge","openapi":"/api-reference/openapi.json put /v1/billing/auto-recharge","href":"/api-reference/billing/auto-recharge","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["billing"],"summary":"Set auto-recharge","description":"Stores auto-recharge settings and returns the updated billing state. Requires `billing_write`.\n\nWhen enabled, and a card is saved, the server checks after each run admission and after each `402`: if the available balance is below `threshold_micros`, it charges `amount_micros` to the saved card, at most once per organization per clock hour. The credit lands when the payment succeeds. See [Auto-recharge](/guides/auto-recharge).","operationId":"set_auto_recharge","requestBody":"7dadceec-e7f2-4254-95f2-ad5278249c6f","responses":{"200":"db7725f6-ac7b-403a-8523-4349ba0adc11","400":"28e2827c-12c6-4098-ba3f-0b841a2f3e0b","401":"e18b91d8-ef0b-46e4-addc-204d4cacc3c3","403":"31ce28b4-cd2e-4dd3-9edc-8cf3f9618118","413":"5b6c55b9-8293-4874-b6ba-c86c5b4d5901","503":"15d99a5b-ed96-49a4-b246-27642d7054f7"},"security":["599c16eb-74f9-480d-8166-0f61a7b35ef1","537d1a35-988b-46c5-b742-5cc7da6fcd09"],"x-mint":{"href":"/api-reference/billing/auto-recharge"},"method":"put","type":"path","servers":["b9e51016-dc72-438c-8be7-eedb6c738623","7768c5d7-e6e0-4d85-aba6-bff93ad8e2a8"],"path":"/v1/billing/auto-recharge","baseUrlOptions":["https://api.opentype.dev","https://api.opentype.dev"],"title":"Set auto-recharge","codeSamples":[],"requestExampleLanguages":["bash","typescript","python"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean","isRequired":true,"uniqueKey":"enabled","typeLabel":"boolean"},"threshold_micros":{"oneOf":[{"type":"integer","format":"int64","description":"Required when `enabled` is `true`. At most 1,000,000,000.","minimum":0,"uniqueKey":"threshold_micros.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Required when `enabled` is `true`. At most 1,000,000,000.","minimum":0,"uniqueKey":"threshold_micros.oneOf.1","typeLabel":"null"}],"uniqueKey":"threshold_micros","typeLabel":"integer\u003cint64> | null"},"amount_micros":{"oneOf":[{"type":"integer","format":"int64","description":"Required when `enabled` is `true`. 5,000,000 to 1,000,000,000, in whole cents.","minimum":0,"uniqueKey":"amount_micros.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Required when `enabled` is `true`. 5,000,000 to 1,000,000,000, in whole cents.","minimum":0,"uniqueKey":"amount_micros.oneOf.1","typeLabel":"null"}],"uniqueKey":"amount_micros","typeLabel":"integer\u003cint64> | null"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"enabled":true,"threshold_micros":1,"amount_micros":1}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"db7725f6-ac7b-403a-8523-4349ba0adc11":{"description":"The updated billing state.","content":{"application/json":{"schema":{"type":"object","required":["organization_id","balance_micros","currency","auto_recharge","has_payment_method","transactions"],"properties":{"organization_id":{"type":"string","isRequired":true,"uniqueKey":"organization_id","typeLabel":"string"},"balance_micros":{"type":"integer","format":"int64","description":"Signed. Credits, minus settled spend, minus what unsettled runs hold.","isRequired":true,"uniqueKey":"balance_micros","typeLabel":"integer\u003cint64>"},"currency":{"type":"string","enum":["usd"],"isRequired":true,"uniqueKey":"currency","typeLabel":"enum\u003cstring>"},"auto_recharge":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean","isRequired":true,"uniqueKey":"auto_recharge.enabled","typeLabel":"boolean"},"threshold_micros":{"oneOf":[{"type":"integer","format":"int64","minimum":0,"uniqueKey":"auto_recharge.threshold_micros.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","minimum":0,"uniqueKey":"auto_recharge.threshold_micros.oneOf.1","typeLabel":"null"}],"uniqueKey":"auto_recharge.threshold_micros","typeLabel":"integer\u003cint64> | null"},"amount_micros":{"oneOf":[{"type":"integer","format":"int64","minimum":0,"uniqueKey":"auto_recharge.amount_micros.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","minimum":0,"uniqueKey":"auto_recharge.amount_micros.oneOf.1","typeLabel":"null"}],"uniqueKey":"auto_recharge.amount_micros","typeLabel":"integer\u003cint64> | null"}},"isRequired":true,"uniqueKey":"auto_recharge","typeLabel":"object"},"has_payment_method":{"type":"boolean","isRequired":true,"uniqueKey":"has_payment_method","typeLabel":"boolean"},"transactions":{"type":"array","items":{"type":"object","required":["id","kind","amount_micros","description","created_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"transactions.items.[INDEX].id","typeLabel":"string"},"kind":{"type":"string","enum":["purchase","grant","usage","refund","adjustment"],"isRequired":true,"uniqueKey":"transactions.items.[INDEX].kind","typeLabel":"enum\u003cstring>"},"amount_micros":{"type":"integer","format":"int64","description":"Signed: positive adds credit, negative spends it.","isRequired":true,"uniqueKey":"transactions.items.[INDEX].amount_micros","typeLabel":"integer\u003cint64>"},"description":{"type":"string","isRequired":true,"uniqueKey":"transactions.items.[INDEX].description","typeLabel":"string"},"created_at":{"type":"string","isRequired":true,"uniqueKey":"transactions.items.[INDEX].created_at","typeLabel":"string"}},"uniqueKey":"transactions.items.[INDEX]","typeLabel":"object"},"description":"Newest first, at most 50.","isRequired":true,"uniqueKey":"transactions","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"organization_id":"\u003cstring>","balance_micros":123,"currency":"usd","auto_recharge":{"enabled":true,"threshold_micros":1,"amount_micros":1},"has_payment_method":true,"transactions":[{"id":"\u003cstring>","kind":"purchase","amount_micros":123,"description":"\u003cstring>","created_at":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"28e2827c-12c6-4098-ba3f-0b841a2f3e0b":{"description":"`invalid_amount`: `amount_micros` outside the checkout bounds, `threshold_micros` above 1,000,000,000, or either number missing while `enabled` is `true`. Malformed JSON gets a plain-text `400`.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"e18b91d8-ef0b-46e4-addc-204d4cacc3c3":{"description":"`missing_credentials` (no bearer credential) or `invalid_credential` (malformed, unknown or revoked).","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"31ce28b4-cd2e-4dd3-9edc-8cf3f9618118":{"description":"`scope_denied`: the credential lacks `billing_write`. A session without an organization gets `no_active_organization`.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"5b6c55b9-8293-4874-b6ba-c86c5b4d5901":{"description":"The body is over 1 MiB. Plain-text body.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"15d99a5b-ed96-49a4-b246-27642d7054f7":{"description":"`billing_not_configured`, `database_not_configured` or `database_unavailable`. Also `auth_not_configured` or `trust_keys_unavailable` when credentials cannot be verified.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"599c16eb-74f9-480d-8166-0f61a7b35ef1":{"bearer":{"type":"http","scheme":"bearer","description":"An API key (otsk_ + 64 hex) or a console session token.","scopes":[]}},"537d1a35-988b-46c5-b742-5cc7da6fcd09":{"bearer":{"type":"http","scheme":"bearer","description":"An API key (otsk_ + 64 hex) or a console session token.","scopes":[]}}},"servers":{"b9e51016-dc72-438c-8be7-eedb6c738623":{"url":"https://api.opentype.dev","description":"Production"},"7768c5d7-e6e0-4d85-aba6-bff93ad8e2a8":{"url":"https://api.opentype.dev","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"An API key (otsk_ + 64 hex) or a console session token.","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An API key (otsk_ + 64 hex) or a console session token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearer","name":"Authorization"}],"title":"bearer"},{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"An API key (otsk_ + 64 hex) or a console session token.","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An API key (otsk_ + 64 hex) or a console session token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearer","name":"Authorization"}],"title":"bearer"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"opentype","siteName":"OpenType Docs","title":"Set auto-recharge - OpenType Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-25T03:10:31.580Z","originalFileLocation":"api-reference/billing/auto-recharge.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=\"system\"}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=\"Stores auto-recharge settings and returns the updated billing state. Requires billing_write. When enabled, and a card is saved, the server checks after each run admission and after each 402: if the available balance is below threshold_micros, it charges amount_micros to the saved card, at most once per organization per clock hour. The credit lands when the payment succeeds. See Auto-recharge.\">\u003cmeta data-mint-head name=\"application-name\" content=\"OpenType 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/opentype/MGJu4GHwxVSFKXIS/_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/opentype/MGJu4GHwxVSFKXIS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/opentype/MGJu4GHwxVSFKXIS/_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/opentype/MGJu4GHwxVSFKXIS/_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/opentype/MGJu4GHwxVSFKXIS/_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/opentype/MGJu4GHwxVSFKXIS/_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/opentype/MGJu4GHwxVSFKXIS/_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/opentype/MGJu4GHwxVSFKXIS/_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/opentype/MGJu4GHwxVSFKXIS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Set auto-recharge - OpenType Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Stores auto-recharge settings and returns the updated billing state. Requires billing_write. When enabled, and a card is saved, the server checks after each run admission and after each 402: if the available balance is below threshold_micros, it charges amount_micros to the saved card, at most once per organization per clock hour. The credit lands when the payment succeeds. See Auto-recharge.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"OpenType\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.opentype.dev/api-reference/billing/auto-recharge\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://opentype.dev/og/docs.png\">\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=\"Set auto-recharge - OpenType Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Stores auto-recharge settings and returns the updated billing state. Requires billing_write. When enabled, and a card is saved, the server checks after each run admission and after each 402: if the available balance is below threshold_micros, it charges amount_micros to the saved card, at most once per organization per clock hour. The credit lands when the payment succeeds. See Auto-recharge.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://opentype.dev/og/docs.png\">\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/opentype/MGJu4GHwxVSFKXIS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"OpenType Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0A7A3B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.opentype.dev/api-reference/billing/auto-recharge\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/billing/auto-recharge.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.opentype.dev/#organization\",\"name\":\"OpenType Docs\",\"url\":\"https://docs.opentype.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/opentype/nqaaLldDOctxoCbH/logo/light.svg?fit=max\u0026auto=format\u0026n=nqaaLldDOctxoCbH\u0026q=85\u0026s=73a92db185691378733575d262c4447f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.opentype.dev#website\",\"name\":\"OpenType Docs\",\"url\":\"https://docs.opentype.dev\",\"publisher\":{\"@id\":\"https://docs.opentype.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.opentype.dev/api-reference/billing/auto-recharge#webpage\",\"url\":\"https://docs.opentype.dev/api-reference/billing/auto-recharge\",\"name\":\"Set auto-recharge\",\"description\":\"Stores auto-recharge settings and returns the updated billing state. Requires billing_write. When enabled, and a card is saved, the server checks after each run admission and after each 402: if the available balance is below threshold_micros, it charges amount_micros to the saved card, at most once per organization per clock hour. The credit lands when the payment succeeds. See Auto-recharge.\",\"dateModified\":\"2026-09-25T03:10:31.580Z\",\"isPartOf\":{\"@id\":\"https://docs.opentype.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.opentype.dev/api-reference/billing/auto-recharge#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.opentype.dev/api-reference/billing/auto-recharge#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Billing\",\"item\":\"https://docs.opentype.dev/api-reference/billing/get\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Set auto-recharge\",\"item\":\"https://docs.opentype.dev/api-reference/billing/auto-recharge\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.opentype.dev/api-reference/billing/auto-recharge#apireference\",\"headline\":\"Set auto-recharge\",\"name\":\"Set auto-recharge\",\"description\":\"Stores auto-recharge settings and returns the updated billing state. Requires billing_write. When enabled, and a card is saved, the server checks after each run admission and after each 402: if the available balance is below threshold_micros, it charges amount_micros to the saved card, at most once per organization per clock hour. The credit lands when the payment succeeds. See Auto-recharge.\",\"url\":\"https://docs.opentype.dev/api-reference/billing/auto-recharge\",\"mainEntityOfPage\":{\"@id\":\"https://docs.opentype.dev/api-reference/billing/auto-recharge#webpage\"},\"image\":\"https://opentype.dev/og/docs.png\",\"dateModified\":\"2026-09-25T03:10:31.580Z\",\"publisher\":{\"@id\":\"https://docs.opentype.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.opentype.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"OpenType Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"OpenType Docs","nav":{"global":{"anchors":[{"anchor":"Changelog","icon":"clock-rotate-left","href":"/reference/changelog"}]},"tabs":[{"tab":"Get started","icon":"rocket","pages":[{"title":"Get started","href":""}]},{"tab":"Console","icon":"desktop","pages":[{"title":"Console","href":"/console"}]},{"tab":"Guides","icon":"book-open","pages":[{"title":"Guides","href":"/guides"}]},{"tab":"Security","icon":"shield-halved","pages":[{"title":"Security","href":"/security"}]},{"tab":"Reference","icon":"book","pages":[{"title":"Reference","href":"/reference"}]},{"tab":"API reference","icon":"code","groups":[{"group":"Overview","icon":"compass","pages":[{"title":"API reference","sidebarTitle":"Introduction","icon":"code","href":"/api-reference/introduction"}]},{"group":"Runs","icon":"play","pages":[{"title":"Create a run","deprecated":null,"version":null,"sidebarTitle":"Create","openapi":"/api-reference/openapi.json post /v1/runs","href":"/api-reference/runs/create"},{"title":"List runs","deprecated":null,"version":null,"sidebarTitle":"List","openapi":"/api-reference/openapi.json get /v1/runs","href":"/api-reference/runs/list"},{"title":"Retrieve a run","deprecated":null,"version":null,"sidebarTitle":"Retrieve","openapi":"/api-reference/openapi.json get /v1/runs/{run_id}","href":"/api-reference/runs/retrieve"},{"title":"Stream a run","deprecated":null,"version":null,"sidebarTitle":"Stream","openapi":"/api-reference/openapi.json get /v1/runs/{run_id}/stream","href":"/api-reference/runs/stream"}]},{"group":"Model Router","icon":"route","pages":[{"title":"Select a model","deprecated":null,"version":null,"sidebarTitle":"Select","openapi":"/api-reference/openapi.json post /v1/router/select","href":"/api-reference/router/select"},{"title":"List task types","deprecated":null,"version":null,"sidebarTitle":"Task types","openapi":"/api-reference/openapi.json get /v1/router/task-types","href":"/api-reference/router/task-types"},{"title":"List router models","deprecated":null,"version":null,"sidebarTitle":"Models","openapi":"/api-reference/openapi.json get /v1/router/models","href":"/api-reference/router/models"}]},{"group":"API keys","icon":"key","pages":[{"title":"Create an API key","deprecated":null,"version":null,"sidebarTitle":"Create","openapi":"/api-reference/openapi.json post /v1/keys","href":"/api-reference/keys/create"},{"title":"List API keys","deprecated":null,"version":null,"sidebarTitle":"List","openapi":"/api-reference/openapi.json get /v1/keys","href":"/api-reference/keys/list"},{"title":"Retrieve an API key","deprecated":null,"version":null,"sidebarTitle":"Retrieve","openapi":"/api-reference/openapi.json get /v1/keys/{key_id}","href":"/api-reference/keys/retrieve"},{"title":"Rotate an API key","deprecated":null,"version":null,"sidebarTitle":"Rotate","openapi":"/api-reference/openapi.json post /v1/keys/{key_id}/rotate","href":"/api-reference/keys/rotate"},{"title":"Revoke an API key","deprecated":null,"version":null,"sidebarTitle":"Revoke","openapi":"/api-reference/openapi.json delete /v1/keys/{key_id}","href":"/api-reference/keys/revoke"}]},{"group":"Usage and quota","icon":"chart-line","pages":[{"title":"Usage rollup","deprecated":null,"version":null,"sidebarTitle":"Rollup","openapi":"/api-reference/openapi.json get /v1/usage","href":"/api-reference/usage/rollup"},{"title":"Daily usage","deprecated":null,"version":null,"sidebarTitle":"Daily","openapi":"/api-reference/openapi.json get /v1/usage/daily","href":"/api-reference/usage/daily"},{"title":"Usage ledger","deprecated":null,"version":null,"sidebarTitle":"Ledger","openapi":"/api-reference/openapi.json get /v1/usage/ledger","href":"/api-reference/usage/ledger"},{"title":"Run usage","deprecated":null,"version":null,"sidebarTitle":"Run","openapi":"/api-reference/openapi.json get /v1/usage/runs/{run_id}","href":"/api-reference/usage/run"},{"title":"Quota","deprecated":null,"version":null,"sidebarTitle":"Quota","openapi":"/api-reference/openapi.json get /v1/quota","href":"/api-reference/usage/quota"}]},{"group":"Billing","icon":"credit-card","pages":[{"title":"Get billing","deprecated":null,"version":null,"sidebarTitle":"Get","openapi":"/api-reference/openapi.json get /v1/billing","href":"/api-reference/billing/get"},{"title":"Create a checkout","deprecated":null,"version":null,"sidebarTitle":"Checkout","openapi":"/api-reference/openapi.json post /v1/billing/checkout","href":"/api-reference/billing/checkout"},{"title":"Open the billing portal","description":null,"deprecated":null,"version":null,"sidebarTitle":"Portal","openapi":"/api-reference/openapi.json post /v1/billing/portal","href":"/api-reference/billing/portal"},{"title":"Set auto-recharge","deprecated":null,"version":null,"sidebarTitle":"Auto recharge","openapi":"/api-reference/openapi.json put /v1/billing/auto-recharge","href":"/api-reference/billing/auto-recharge"}]},{"group":"Health","icon":"heart-pulse","pages":[{"title":"Liveness","description":null,"deprecated":null,"version":null,"sidebarTitle":"Liveness","openapi":"/api-reference/openapi.json get /healthz","href":"/api-reference/health/liveness"},{"title":"Readiness","deprecated":null,"version":null,"sidebarTitle":"Readiness","openapi":"/api-reference/openapi.json get /readyz","href":"/api-reference/health/readiness"}]}]}]},"basePath":"","title":"Set auto-recharge - OpenType Docs","buildId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","deploymentId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","dynamics":["c2aa737661","b0f84f53ff","a9bb46feb3","2b790eda92"],"chunks":["OpenApiReferenceProvider-C-hEh3I2.js","utils-CnF4QiUD.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C7PVNbel.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-8ytevL2A.js","snippetPresets-BT1alx3v.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","Page-C945cI-W.js","ApiExamples-BLXC0i_W.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CyLIGI9_.js","shallow-DC0lGVIW.js","getApiPlaygroundDisplay-CgDQ85tN.js","CodeSnippet-6-I-Gpv9.js","CodeSnippets-BAk1kDdu.js","getPastedJson-B276RuWN.js","icon-BqP8etTm.js","MethodPill-DM6sbxG1.js","DuplicateIcon-PyJglOaE.js","createIcon-CMeOMAc_.js","DynamicMarkdown-BoyYAA8K.js","SectionHeading-DAYv3gvZ.js","axios-vUo_bRtp.js","Markdown-BhTTmazV.js","clsx-CR-RHrVC.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CBUH0-zX.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BmARFYNC.js"]}