X-RateLimit-Reset is epoch seconds. Over the limit is 429 with the standard
problem body (type slug rate-limited) and a Retry-After.
Because the headers track whichever window is tighter, a healthy X-RateLimit-Remaining
does not mean both windows are healthy — it means the worse one is. Concentrating
traffic on a single pharmacy can exhaust the 300 window while your credential budget looks
barely touched.
Testing your back-off
Two sandbox-only hooks on the X-InStockRx-Trigger header, both ignored in production:
Value
Effect
force-429
Returns a rate-limit response immediately, so you can exercise your retry path on demand
bypass-rate-limit
Skips the limiter entirely — nothing counted, no headers written — so a regression suite can run without tripping a window
The counters are held per API instance rather than shared, so the ceiling you can actually
observe is the published number multiplied by however many instances are serving traffic —
a number that changes with scaling and is not published.Build to 600 and 300. Calibrating to the throughput you measure will break the next time
production scales in.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"InStockRx API","description":"Partner API for the InStockRx pharmacy marketplace.","colors":{"primary":"#EA6318","light":"#F58A4B","dark":"#B54B12"},"logo":{"light":"/logo/light.svg","dark":"/logo/dark.svg","href":"https://www.instockrx.com"},"favicon":"/favicon.svg","api":{"playground":{"display":"interactive"},"examples":{"languages":["bash","javascript","python"]}},"navbar":{"links":[{"href":"mailto:info@instockrx.com","label":"Support"}],"primary":{"type":"button","label":"Get sandbox access","href":"https://sandbox.instockrx.com"}},"footer":{"socials":{"website":"https://www.instockrx.com"}},"integrations":{"telemetry":{"enabled":false}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"hasAudioNarration":false,"customDomains":[],"gitSource":{"type":"github","owner":"local","repo":"local","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"local","isBase":true},"buildId":"local","clientVersion":"0.0.4342"},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false,"isLoggedInCli":false,"mintExport":{}},"customCss":[]}
{"page":{"pagePath":"v2/reference/rate-limits","slug":"/v2/reference/rate-limits","pageMetadata":{"title":"Rate limits","description":"Two windows, the headers that track them, and the sandbox hooks for testing.","href":"/v2/reference/rate-limits"},"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: \"Two windows, the headers that track them, and the sandbox hooks for testing.\"\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`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`v2 counts two one-minute windows at once:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Window`}),_jsx(_components.th,{children:`Limit`}),_jsx(_components.th,{children:`Counted per`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Per credential`}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`600`}),` requests/minute`]}),_jsx(_components.td,{children:`Your API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Per pharmacy`}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`300`}),` requests/minute`]}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`X-Pharmacy-Id`}),` you act as, across every key sharing it`]})]})]})]}),`\n`,_jsx(_components.p,{children:`The per-pharmacy window is skipped on requests that carry no pharmacy context.`}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`POST …/search`}),` costs 2`]}),`, not 1 — it is the expensive call. Budget accordingly if your\nintegration is search-heavy.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`read-the-headers`,children:`Read the headers`}),`\n`,_jsxs(_components.p,{children:[`Every response carries your current position against the `,_jsx(_components.strong,{children:`more constraining`}),` of the two\nwindows:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`X-RateLimit-Limit: 600`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`X-RateLimit-Remaining: 548`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`X-RateLimit-Reset: 1760000060`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`X-RateLimit-Reset`}),` is epoch seconds. Over the limit is `,_jsx(_components.code,{children:`429`}),` with the standard\n`,_jsx(_components.a,{href:`/v2/reference/errors`,children:`problem body`}),` (`,_jsx(_components.code,{children:`type`}),` slug `,_jsx(_components.code,{children:`rate-limited`}),`) and a `,_jsx(_components.code,{children:`Retry-After`}),`.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Because the headers track whichever window is tighter, a healthy `,_jsx(_components.code,{children:`X-RateLimit-Remaining`}),`\ndoes `,_jsx(_components.strong,{children:`not`}),` mean both windows are healthy — it means the worse one is. Concentrating\ntraffic on a single pharmacy can exhaust the 300 window while your credential budget looks\nbarely touched.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`testing-your-back-off`,children:`Testing your back-off`}),`\n`,_jsxs(_components.p,{children:[`Two sandbox-only hooks on the `,_jsx(_components.code,{children:`X-InStockRx-Trigger`}),` header, both ignored in production:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Value`}),_jsx(_components.th,{children:`Effect`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`force-429`})}),_jsx(_components.td,{children:`Returns a rate-limit response immediately, so you can exercise your retry path on demand`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`bypass-rate-limit`})}),_jsx(_components.td,{children:`Skips the limiter entirely — nothing counted, no headers written — so a regression suite can run without tripping a window`})]})]})]}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:`The counters are held per API instance rather than shared, so the ceiling you can actually\nobserve is the published number multiplied by however many instances are serving traffic —\na number that changes with scaling and is not published.`}),_jsx(_components.p,{children:`Build to 600 and 300. Calibrating to the throughput you measure will break the next time\nproduction scales in.`})]})]})}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":"Rate limits","description":"Two windows, the headers that track them, and the sandbox hooks for testing.","href":"/v2/reference/rate-limits"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Read the headers","slug":"read-the-headers","depth":2,"children":[]},{"title":"Testing your back-off","slug":"testing-your-back-off","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"localhost","siteName":"InStockRx API","title":"Rate limits - InStockRx API","navMaps":{"firstHrefInVersion":{"v2":{"href":"/v2/reference/rate-limits","matchLevel":0},"v1":{"href":"/reference/rate-limits","matchLevel":1}},"firstHrefInLanguage":{}},"originalFileLocation":"v2/reference/rate-limits.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=\"Two windows, the headers that track them, and the sandbox hooks for testing.\">\u003cmeta data-mint-head name=\"application-name\" content=\"InStockRx API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/favicons/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicons/favicon-32x32.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicons/favicon-16x16.png\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicons/favicon.ico\">\u003cmeta data-mint-head property=\"og:title\" content=\"Rate limits - InStockRx API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Two windows, the headers that track them, and the sandbox hooks for testing.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"InStockRx API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://local./v2/reference/rate-limits\">\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=\"Rate limits - InStockRx API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Two windows, the headers that track them, and the sandbox hooks for testing.\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/favicons/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"InStockRx API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#EA6318\">\u003clink data-mint-head rel=\"canonical\" href=\"https://local./v2/reference/rate-limits\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/v2/reference/rate-limits.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"InStockRx API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"InStockRx API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/v2/reference/rate-limits.md","siteName":"InStockRx API","nav":{"versions":[{"version":"v2","tabs":[{"tab":"Documentation","groups":[{"group":"Get started","pages":[{"title":"InStockRx API v2","href":"/v2/introduction"},{"title":"Sandbox onboarding","href":"/v2/sandbox"},{"title":"Production access","href":"/v2/production-access"},{"title":"Quickstart","href":"/v2/quickstart"}]},{"group":"Guides","pages":[{"title":"Authentication","href":"/v2/guides/authentication"},{"title":"Environments","href":"/v2/guides/environments"},{"title":"Searching and paging","href":"/v2/guides/pagination"},{"title":"Concurrent updates","href":"/v2/guides/concurrency"},{"title":"Safe retries","href":"/v2/guides/idempotency"},{"title":"Webhooks","href":"/v2/guides/webhooks"},{"title":"Migrating from v1","href":"/v2/guides/migrating-from-v1"}]},{"group":"Reference","pages":[{"title":"Scopes","href":"/v2/reference/scopes"},{"title":"Errors","description":"One error shape, the slug to branch on, and the request id to quote.","href":"/v2/reference/errors"},{"title":"Rate limits","href":"/v2/reference/rate-limits"},{"title":"What v2 can't do yet","description":"The flows that need the portal, and the fields that are accepted but ignored.","href":"/v2/reference/limitations"}]}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/v2/api-reference/overview"}]}]},{"version":"v1","pages":[{"title":"v1","href":"/reference/rate-limits"}]}]},"basePath":"","title":"Rate limits - InStockRx API","buildId":"b8b92e8dc392","dynamics":[],"chunks":[]}