{
"object": "usage.request",
"request_id": "REQUEST_ID",
"occurred_at": "2026-09-05T06:20:11.000Z",
"model": "openai/gpt-4o-mini",
"outcome": "served",
"streamed": false,
"usage": {
"prompt_tokens": 2011,
"completion_tokens": 5,
"total_tokens": 2016,
"cache_read_tokens": 1800,
"cache_write_tokens": 0,
"reasoning_tokens": 0,
"cache_write_1h_tokens": null
},
"charge": {
"amount_micros": 31200,
"amount": "$0.0312",
"currency": "USD",
"rate_revision_id": "RATE_REVISION_ID",
"note": null
},
"served_on_own_key": false,
"latency_ms": 812,
"note": "No prompt and no response body was stored for this request; the figures here are everything that exists (we never store prompts).",
"paid_from_allowance": false
}
{
"error": {
"message": "Name the request id: GET /v1/usage/{request_id}, where the id is the value the x-hopscotch-request-id header carried on the response you are asking about.",
"type": "invalid_request_error",
"param": "request_id",
"code": "missing_required_parameter",
"request_id": "REQUEST_ID"
}
}
{
"error": {
"message": "This account is suspended, so it cannot send requests. Contact support. Request id REQUEST_ID.",
"type": "permission_error",
"param": null,
"code": "account_suspended",
"request_id": "REQUEST_ID"
}
}
{
"error": {
"message": "No usage record for \"REQUEST_ID\" is visible to this key. A record is written after the response is sent, so a read taken immediately can arrive first; a record made by another key, a record outside this key's workspace and an id that never existed answer identically.",
"type": "not_found_error",
"param": "request_id",
"code": "request_not_found",
"request_id": "REQUEST_ID"
}
}
{
"error": {
"message": "POST is not supported for /v1/usage/REQUEST_ID in this release.",
"type": "invalid_request_error",
"param": null,
"code": "method_not_allowed",
"request_id": "REQUEST_ID"
}
}
{
"error": {
"message": "Rate limit reached for this key. Try again in 12 seconds. Request id REQUEST_ID.",
"type": "rate_limit_error",
"param": null,
"code": "rate_limit_exceeded",
"request_id": "REQUEST_ID"
}
}
{
"error": {
"message": "The server had an error while processing your request. Sorry about that! Quote the request id if you contact support.",
"type": "api_error",
"param": null,
"code": null,
"request_id": "REQUEST_ID"
}
}
Usage
Retrieve one request's usage
Read back what one request recorded and what it cost. Send the value of the x-hopscotch-request-id header from the response you are asking about. The key that made the request can read it, with no dashboard session.
The record is written after the response is sent, so a read taken the instant a response lands can arrive first and answer 404. Read it again a moment later. A record made by another key, a record outside this key’s workspace, and an id that never existed all answer with the same 404, so this route cannot be used to learn whether an id exists.
In usage, null means the provider did not report that count and 0 means it was measured as none. The two are different facts. charge is present only when your workspace balance paid for the request. served_on_own_key is true when the request ran on your own provider key, and paid_from_allowance is true when an included allowance paid for it, in which case charge is absent. No prompt and no response body is stored, so none is returned.
This route counts against the calling key’s own request rate limit, like every other route.
{
"object": "usage.request",
"request_id": "REQUEST_ID",
"occurred_at": "2026-09-05T06:20:11.000Z",
"model": "openai/gpt-4o-mini",
"outcome": "served",
"streamed": false,
"usage": {
"prompt_tokens": 2011,
"completion_tokens": 5,
"total_tokens": 2016,
"cache_read_tokens": 1800,
"cache_write_tokens": 0,
"reasoning_tokens": 0,
"cache_write_1h_tokens": null
},
"charge": {
"amount_micros": 31200,
"amount": "$0.0312",
"currency": "USD",
"rate_revision_id": "RATE_REVISION_ID",
"note": null
},
"served_on_own_key": false,
"latency_ms": 812,
"note": "No prompt and no response body was stored for this request; the figures here are everything that exists (we never store prompts).",
"paid_from_allowance": false
}
{
"error": {
"message": "Name the request id: GET /v1/usage/{request_id}, where the id is the value the x-hopscotch-request-id header carried on the response you are asking about.",
"type": "invalid_request_error",
"param": "request_id",
"code": "missing_required_parameter",
"request_id": "REQUEST_ID"
}
}
{
"error": {
"message": "This account is suspended, so it cannot send requests. Contact support. Request id REQUEST_ID.",
"type": "permission_error",
"param": null,
"code": "account_suspended",
"request_id": "REQUEST_ID"
}
}
{
"error": {
"message": "No usage record for \"REQUEST_ID\" is visible to this key. A record is written after the response is sent, so a read taken immediately can arrive first; a record made by another key, a record outside this key's workspace and an id that never existed answer identically.",
"type": "not_found_error",
"param": "request_id",
"code": "request_not_found",
"request_id": "REQUEST_ID"
}
}
{
"error": {
"message": "POST is not supported for /v1/usage/REQUEST_ID in this release.",
"type": "invalid_request_error",
"param": null,
"code": "method_not_allowed",
"request_id": "REQUEST_ID"
}
}
{
"error": {
"message": "Rate limit reached for this key. Try again in 12 seconds. Request id REQUEST_ID.",
"type": "rate_limit_error",
"param": null,
"code": "rate_limit_exceeded",
"request_id": "REQUEST_ID"
}
}
{
"error": {
"message": "The server had an error while processing your request. Sorry about that! Quote the request id if you contact support.",
"type": "api_error",
"param": null,
"code": null,
"request_id": "REQUEST_ID"
}
}
A workspace API key in an Authorization: Bearer header. A missing header, a scheme other than Bearer, a key of the wrong shape, and a key we reject are all 401.
The request id: the value the x-hopscotch-request-id header carried on the response being asked about.
Response
The recorded request: when it started, the model that served it, how it ended, every token count a charge can turn on, and the charge with its currency and rate revision.
One request, as the key that made it can read it back.
What the request cost, with what you need to check it against the rates GET /v1/models publishes. Present only when your workspace balance paid for the request, so it is absent when paid_from_allowance is true.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Hopscotch","description":"OpenAI-compatible LLM router. One key, one endpoint, every model.","colors":{"primary":"#00786a","light":"#00c5a9","dark":"#00786a"},"logo":{"light":"https://mintcdn.com/unirouter/e-jU4qy0Y8gPhRZJ/logo/light.svg?fit=max\u0026auto=format\u0026n=e-jU4qy0Y8gPhRZJ\u0026q=85\u0026s=eb9901b22939c791c90369af09611ebe","dark":"https://mintcdn.com/unirouter/e-jU4qy0Y8gPhRZJ/logo/dark.svg?fit=max\u0026auto=format\u0026n=e-jU4qy0Y8gPhRZJ\u0026q=85\u0026s=22613b0632e285d26d92e43e064b95db","href":"/"},"favicon":{"light":"https://mintcdn.com/unirouter/e-jU4qy0Y8gPhRZJ/favicon/light.svg?fit=max\u0026auto=format\u0026n=e-jU4qy0Y8gPhRZJ\u0026q=85\u0026s=cddcf3547075243322e642a21f97d9eb","dark":"https://mintcdn.com/unirouter/e-jU4qy0Y8gPhRZJ/favicon/dark.svg?fit=max\u0026auto=format\u0026n=e-jU4qy0Y8gPhRZJ\u0026q=85\u0026s=613a4663bfe054aab755b5eae7c3c7b8"},"api":{"openapi":"api-reference/openapi.public.json","playground":{"display":"interactive"}},"appearance":{"default":"dark","strict":false},"background":{"color":{"light":"#f1f0ea","dark":"#111110"}},"navbar":{"links":[{"href":"https://platform.hopscotchlabs.ai","label":"Dashboard"}]},"seo":{"indexing":"navigable"},"fonts":{"family":"Geist"},"icons":{"library":"tabler"},"styling":{"eyebrows":"section","codeblocks":{"theme":{"light":"vitesse-light","dark":"vesper"}},"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"unirouter","hasAudioNarration":false,"actualSubdomain":"unirouter","customDomains":["docs.hopscotchlabs.ai"],"gitSource":{"type":"github","owner":"uniblock-dev","repo":"unirouter-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6adb83702d3c9c6f327a005f","collectionId":"39af8e51-e739-4223-bac0-6495e7203215","liveDeploymentHistoryId":"6adb83702d3c9c6f327a005f","schemaVersion":"v3"},"entitlements":{},"buildId":"6adb83702d3c9c6f327a005f","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"default","tag":"Integrations","count":21},{"language":"default","tag":"Features","count":20},{"language":"default","tag":"Manage \u0026 monitor","count":18},{"language":"default","tag":"Coding agents","count":14},{"language":"default","tag":"API Reference","count":12},{"language":"default","tag":"Get started","count":9},{"language":"default","tag":"Overview","count":8},{"language":"default","tag":"Endpoints","count":7},{"language":"default","tag":"Request features","count":6},{"language":"default","tag":"SDKs and frameworks","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"isAtlas":false,"googleFontsInlined":true},"customCss":[{"filePath":"brand.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrodmgPn.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrMdmgPn.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* symbols2 */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFg08vz7ehw.woff2) format('woff2');\n unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrgdmgPn.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrkdmgPn.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrcdmg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n:root{--uni-bg:#111110;--uni-pane:#161615;--uni-ink:#d2d2cc;--uni-mute:#9e9e98;--uni-dim:#80807a;--uni-faint:#61615b;--uni-bg-light:#f1f0ea;--uni-pane-light:#fafaf6;--uni-ink-light:#2b2b25;--uni-mute-light:#51514b;--uni-dim-light:#6c6c66;--uni-faint-light:#8a8a84;--uni-live:#00c5a9;--uni-live-light:#00786a;--uni-blue:#00afff;--uni-cyan:#00bfdf;--uni-indigo:#7c9cff;--uni-lime:#98b305;--uni-orange:#ef8600;--uni-pink:#f771a0;--uni-teal:#00c5a9;--uni-violet:#b688fe;--uni-ease-snap:cubic-bezier(0.22, 0.61, 0.36, 1)}[data-component-part=code-block],[data-component-part=code-block] *,code,kbd,pre,pre *,samp{font-family:\"Geist Mono\",ui-monospace,SFMono-Regular,\"SF Mono\",Menlo,Consolas,monospace}@supports (corner-shape:squircle){*{corner-shape:squircle}}::selection{background:rgb(126 200 212/.28);color:currentColor}:focus-visible:not(input):not(textarea):not(select){outline:1.5px solid color-mix(in srgb,currentColor 55%,transparent);outline-offset:3px}.overflow-x-auto,.overflow-y-auto,[data-component-part=code-block],body,html,pre{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,currentColor 16%,transparent) transparent}[data-component-part=code-block]::-webkit-scrollbar,body::-webkit-scrollbar,html::-webkit-scrollbar,pre::-webkit-scrollbar{width:6px;height:6px}[data-component-part=code-block]::-webkit-scrollbar-thumb,body::-webkit-scrollbar-thumb,html::-webkit-scrollbar-thumb,pre::-webkit-scrollbar-thumb{background:color-mix(in srgb,currentColor 16%,transparent);border-radius:99px;border:2px solid transparent;background-clip:padding-box}[data-component-part=code-block]::-webkit-scrollbar-track,body::-webkit-scrollbar-track,html::-webkit-scrollbar-track,pre::-webkit-scrollbar-track{background:0 0}body{font-feature-settings:\"ss01\" on,\"cv11\" on;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}@media (prefers-reduced-motion:reduce){*,::after,::before{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}:root{--uni-ramp-bg:var(--uni-bg-light);--uni-ramp-pane:var(--uni-pane-light);--uni-ramp-ink:var(--uni-ink-light);--uni-ramp-mute:var(--uni-mute-light);--uni-ramp-dim:var(--uni-dim-light);--uni-ramp-faint:var(--uni-faint-light);--uni-ramp-line:color-mix(in srgb, var(--uni-ramp-ink) 10%, transparent);--uni-ramp-line-strong:color-mix(\n in srgb,\n var(--uni-ramp-ink) 16%,\n transparent\n );--uni-ramp-chip:color-mix(in srgb, var(--uni-ramp-ink) 6%, transparent);--uni-ramp-ink-hover:color-mix(\n in srgb,\n var(--uni-ramp-ink) 88%,\n var(--uni-ramp-bg)\n )}html.dark{--uni-ramp-bg:var(--uni-bg);--uni-ramp-pane:var(--uni-pane);--uni-ramp-ink:var(--uni-ink);--uni-ramp-mute:var(--uni-mute);--uni-ramp-dim:var(--uni-dim);--uni-ramp-faint:var(--uni-faint);--uni-ramp-line:rgb(255 255 255 / 0.08);--uni-ramp-line-strong:rgb(255 255 255 / 0.14)}.api-section,.callout,.card,details.accordion{background:var(--uni-ramp-pane);border:1px solid var(--uni-ramp-line);box-shadow:inset 0 1px 0 color-mix(in srgb,var(--uni-ramp-ink) 6%,transparent)}.card{border-radius:14px}.api-section,.callout,details.accordion{border-radius:12px}.card{transition:border-color 200ms var(--uni-ease-snap)}.card:hover{border-color:var(--uni-ramp-line-strong)}[data-component-part=card-icon]{color:var(--uni-ramp-mute);fill:var(--uni-ramp-mute)}[data-component-part=card-title]{color:var(--uni-ramp-ink);font-size:.875rem;font-weight:400;line-height:1.3;margin-top:.75rem}[data-component-part=card-content],[data-component-part=card-content] p,[data-component-part=card-content] span{color:var(--uni-ramp-mute);font-size:.8125rem;line-height:1.4}.accordion-group{background:var(--uni-ramp-pane);border:1px solid var(--uni-ramp-line);border-radius:12px;box-shadow:inset 0 1px 0 color-mix(in srgb,var(--uni-ramp-ink) 6%,transparent);overflow:hidden}.accordion-group>details.accordion{background:0 0;border:0;border-radius:0;box-shadow:none}.accordion-group>details.accordion+details.accordion{border-top:1px solid var(--uni-ramp-line)}[data-component-part=accordion-button]{padding:.75rem 1.25rem}[data-component-part=accordion-title]{color:var(--uni-ramp-ink);font-size:.875rem;font-weight:400;line-height:1.3}[data-component-part=accordion-caret-right]{color:var(--uni-ramp-faint);transition:transform 200ms var(--uni-ease-snap)}[data-component-part=accordion-content]{border-top:1px solid var(--uni-ramp-line);padding:1rem 1.25rem}.callout{padding:1rem 1.25rem}[data-component-part=callout-content],[data-component-part=callout-content] p{color:var(--uni-ramp-ink);font-size:.8125rem;line-height:1.5}[data-component-part=code-block-root]{border:1px solid var(--uni-ramp-line)}[data-component-part=code-block-header-filename],[data-component-part=code-block-header],[data-component-part=code-group-tab-bar]{color:var(--uni-ramp-dim);font-size:.75rem;line-height:1.4}[data-component-part=code-group-tab-bar]{border-bottom:1px solid var(--uni-ramp-line)}[data-component-part=step-line]{background:var(--uni-ramp-line)}[data-component-part=step-number]>*{background:var(--uni-ramp-chip);color:var(--uni-ramp-ink);font-size:.6875rem;font-weight:400}[data-component-part=step-title]{color:var(--uni-ramp-ink);font-size:.875rem;font-weight:400;line-height:1.3}.api-section{padding:1.25rem}.api-section+.api-section{margin-top:.75rem}.api-section-heading-title{color:var(--uni-ramp-ink);font-size:.875rem;font-weight:400;line-height:1.3}.api-section-heading-subtitle{color:var(--uni-ramp-dim);font-size:.75rem;line-height:1.4}.param-head{border-bottom:1px solid var(--uni-ramp-line);padding-bottom:.5rem}.array-param-field:last-child>.param-head,.object-param-field:last-child>.param-head,.primitive-param-field:last-child>.param-head{border-bottom:0}[data-component-part=field-name]{color:var(--uni-ramp-ink);font-weight:500}[data-component-part=field-name]:hover{color:var(--uni-ramp-ink);text-decoration:underline;text-decoration-color:var(--uni-ramp-line-strong);text-underline-offset:3px}[data-component-part=field-meta]{color:var(--uni-ramp-dim);font-size:.75rem}[data-component-part=field-info-pill],[data-component-part=field-required-pill]{background:var(--uni-ramp-chip);border-radius:9999px;color:var(--uni-ramp-ink);font-size:.6875rem;font-weight:400;padding:.0625rem .5rem}[data-component-part=field-info-pill]{color:var(--uni-ramp-dim)}.method-nav-pill,.method-pill{border-radius:0;font-size:.625rem;font-weight:400;letter-spacing:.06em;padding:.125rem .375rem;text-transform:uppercase}.tryit-button{background:var(--uni-ramp-ink);border-radius:10px;color:var(--uni-ramp-bg);font-weight:400;transition:background 200ms var(--uni-ease-snap)}.tryit-button:hover{background:var(--uni-ramp-ink-hover);filter:none;opacity:1}.tryit-button svg{fill:var(--uni-ramp-bg);color:var(--uni-ramp-bg)}[data-component-part=expandable-button]{color:var(--uni-ramp-dim);font-size:.75rem}[data-component-part=expandable-button]:hover{color:var(--uni-ramp-ink)}[data-component-part=expandable-content]{border-left:1px solid var(--uni-ramp-line);padding-left:1rem}[data-provider]{--uni-accent:var(--uni-ramp-mute)}[data-provider]:not(.card){align-items:center;display:inline-flex;gap:.375rem}[data-provider]:not(.card)::before{background:var(--uni-accent);content:\"\";display:inline-block;flex:none;height:6px;width:6px}[data-provider][data-mark=tag]{background:var(--uni-accent);border-radius:0;color:#111110;font-size:.625rem;letter-spacing:.06em;padding:.125rem .25rem;text-transform:uppercase}[data-provider][data-mark=tag]::before{content:none}[data-provider=alibaba],[data-provider=anthropic],[data-provider=mistral],[data-provider=qwen]{--uni-accent:var(--uni-orange)}[data-provider=openai]{--uni-accent:var(--uni-blue)}[data-provider=fireworks],[data-provider=moonshot]{--uni-accent:var(--uni-cyan)}[data-provider=deepseek]{--uni-accent:var(--uni-teal)}[data-provider=deepinfra]{--uni-accent:var(--uni-indigo)}[data-provider=google],[data-provider=z-ai],[data-provider=zai],[data-provider=zhipu]{--uni-accent:var(--uni-violet)}[data-provider=groq]{--uni-accent:var(--uni-pink)}[data-provider=meta],[data-provider=together]{--uni-accent:var(--uni-lime)}.card[data-provider] [data-component-part=card-icon]{color:var(--uni-accent);fill:var(--uni-accent)}"}],"page":{"pagePath":"api-reference/usage/retrieve-one-requests-usage","slug":"/api-reference/usage/retrieve-one-requests-usage","pageMetadata":{"title":"Retrieve one request's usage","description":"Read back what one request recorded and what it cost. Send the value of the `x-hopscotch-request-id` header from the response you are asking about. The key that made the request can read it, with no dashboard session.\n\nThe record is written after the response is sent, so a read taken the instant a response lands can arrive first and answer 404. Read it again a moment later. A record made by another key, a record outside this key's workspace, and an id that never existed all answer with the same 404, so this route cannot be used to learn whether an id exists.\n\nIn `usage`, null means the provider did not report that count and 0 means it was measured as none. The two are different facts. `charge` is present only when your workspace balance paid for the request. `served_on_own_key` is true when the request ran on your own provider key, and `paid_from_allowance` is true when an included allowance paid for it, in which case `charge` is absent. No prompt and no response body is stored, so none is returned.\n\nThis route counts against the calling key's own request rate limit, like every other route.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.public.json get /v1/usage/{id}","href":"/api-reference/usage/retrieve-one-requests-usage","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 code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Read back what one request recorded and what it cost. Send the value of the \", _jsx(_components.code, {\n children: \"x-hopscotch-request-id\"\n }), \" header from the response you are asking about. The key that made the request can read it, with no dashboard session.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"The record is written after the response is sent, so a read taken the instant a response lands can arrive first and answer 404. Read it again a moment later. A record made by another key, a record outside this key’s workspace, and an id that never existed all answer with the same 404, so this route cannot be used to learn whether an id exists.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"In \", _jsx(_components.code, {\n children: \"usage\"\n }), \", null means the provider did not report that count and 0 means it was measured as none. The two are different facts. \", _jsx(_components.code, {\n children: \"charge\"\n }), \" is present only when your workspace balance paid for the request. \", _jsx(_components.code, {\n children: \"served_on_own_key\"\n }), \" is true when the request ran on your own provider key, and \", _jsx(_components.code, {\n children: \"paid_from_allowance\"\n }), \" is true when an included allowance paid for it, in which case \", _jsx(_components.code, {\n children: \"charge\"\n }), \" is absent. No prompt and no response body is stored, so none is returned.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"This route counts against the calling key’s own request rate limit, like every other route.\"\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":{"theme":{"light":"vitesse-light","dark":"vesper"}},"config":{},"pageMetadata":{"title":"Retrieve one request's usage","description":"Read back what one request recorded and what it cost. Send the value of the `x-hopscotch-request-id` header from the response you are asking about. The key that made the request can read it, with no dashboard session.\n\nThe record is written after the response is sent, so a read taken the instant a response lands can arrive first and answer 404. Read it again a moment later. A record made by another key, a record outside this key's workspace, and an id that never existed all answer with the same 404, so this route cannot be used to learn whether an id exists.\n\nIn `usage`, null means the provider did not report that count and 0 means it was measured as none. The two are different facts. `charge` is present only when your workspace balance paid for the request. `served_on_own_key` is true when the request ran on your own provider key, and `paid_from_allowance` is true when an included allowance paid for it, in which case `charge` is absent. No prompt and no response body is stored, so none is returned.\n\nThis route counts against the calling key's own request rate limit, like every other route.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.public.json get /v1/usage/{id}","href":"/api-reference/usage/retrieve-one-requests-usage","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"servers":["4411adc2-00d7-406d-a21a-75ae1172f0d5"],"tags":["Usage"],"summary":"Retrieve one request's usage","description":"Read back what one request recorded and what it cost. Send the value of the `x-hopscotch-request-id` header from the response you are asking about. The key that made the request can read it, with no dashboard session.\n\nThe record is written after the response is sent, so a read taken the instant a response lands can arrive first and answer 404. Read it again a moment later. A record made by another key, a record outside this key's workspace, and an id that never existed all answer with the same 404, so this route cannot be used to learn whether an id exists.\n\nIn `usage`, null means the provider did not report that count and 0 means it was measured as none. The two are different facts. `charge` is present only when your workspace balance paid for the request. `served_on_own_key` is true when the request ran on your own provider key, and `paid_from_allowance` is true when an included allowance paid for it, in which case `charge` is absent. No prompt and no response body is stored, so none is returned.\n\nThis route counts against the calling key's own request rate limit, like every other route.","parameters":["106040f8-5a9d-4685-85b4-a2d4a86b766e"],"responses":{"200":"6456e72b-eed4-490b-abab-75ee23adb72d","400":"3a8f5035-c314-4fc3-bb38-fbbe7700bcc6","401":"a0ca4837-18fc-474c-aded-b725196056aa","403":"a65ba1a5-f258-4ae6-a220-3af672e575fb","404":"431d7328-ee3d-49ea-af38-722494cfc3d2","405":"a26c3a0b-2901-4dcc-aca2-06260b150376","429":"605f174d-b536-4e75-ab82-6a5553b4b65e","500":"be39a5e3-b3f3-4bb1-bacb-32ad2db57a51"},"security":["7dffecda-7964-4bd8-80be-d0c79cc7c470"],"operationId":"retrieveRequestUsage","method":"get","type":"path","path":"/v1/usage/{id}","baseUrlOptions":["https://api.hopscotchlabs.ai"],"title":"Retrieve one request's usage","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"106040f8-5a9d-4685-85b4-a2d4a86b766e":{"name":"id","in":"path","required":true,"description":"The request id: the value the `x-hopscotch-request-id` header carried on the response being asked about.","schema":{"type":"string","isRequired":true,"description":"The request id: the value the `x-hopscotch-request-id` header carried on the response being asked about.","uniqueKey":"","typeLabel":"string"},"example":"REQUEST_ID"}},"responses":{"6456e72b-eed4-490b-abab-75ee23adb72d":{"description":"The recorded request: when it started, the model that served it, how it ended, every token count a charge can turn on, and the charge with its currency and rate revision.","content":{"application/json":{"schema":{"type":"object","description":"One request, as the key that made it can read it back.","additionalProperties":false,"required":["object","request_id","occurred_at","model","outcome","streamed","usage","served_on_own_key","paid_from_allowance","latency_ms","note"],"properties":{"object":{"type":"string","enum":["usage.request"],"isRequired":true,"uniqueKey":"object","typeLabel":"enum\u003cstring>"},"request_id":{"type":"string","description":"The id the `x-hopscotch-request-id` header carried on the response this record is about.","isRequired":true,"uniqueKey":"request_id","typeLabel":"string"},"occurred_at":{"type":"string","format":"date-time","description":"When the request started, in RFC 3339.","isRequired":true,"uniqueKey":"occurred_at","typeLabel":"string\u003cdate-time>"},"model":{"type":"string","description":"The full `provider/model` id the request was served under, the same string GET /v1/models publishes.","example":"openai/gpt-4o-mini","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"outcome":{"type":"string","description":"How the request ended, from a closed set of words. A request that was answered is `served`.","example":"served","isRequired":true,"uniqueKey":"outcome","typeLabel":"string"},"streamed":{"type":"boolean","isRequired":true,"uniqueKey":"streamed","typeLabel":"boolean"},"usage":{"type":"object","description":"Every count a charge can turn on. Null means the provider did not report that count. 0 means it reported none. They are not the same fact.","additionalProperties":false,"required":["prompt_tokens","completion_tokens","total_tokens","cache_read_tokens","cache_write_tokens","cache_write_1h_tokens","reasoning_tokens"],"properties":{"prompt_tokens":{"oneOf":[{"type":"integer","isRequired":true,"uniqueKey":"usage.prompt_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","isRequired":true,"uniqueKey":"usage.prompt_tokens.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"usage.prompt_tokens","typeLabel":"integer | null"},"completion_tokens":{"oneOf":[{"type":"integer","isRequired":true,"uniqueKey":"usage.completion_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","isRequired":true,"uniqueKey":"usage.completion_tokens.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"usage.completion_tokens","typeLabel":"integer | null"},"total_tokens":{"oneOf":[{"type":"integer","isRequired":true,"uniqueKey":"usage.total_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","isRequired":true,"uniqueKey":"usage.total_tokens.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"usage.total_tokens","typeLabel":"integer | null"},"cache_read_tokens":{"oneOf":[{"type":"integer","isRequired":true,"uniqueKey":"usage.cache_read_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","isRequired":true,"uniqueKey":"usage.cache_read_tokens.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"usage.cache_read_tokens","typeLabel":"integer | null"},"cache_write_tokens":{"oneOf":[{"type":"integer","description":"The cache write at the default lifetime. It does not include `cache_write_1h_tokens`, so add the two to read the whole write.","isRequired":true,"uniqueKey":"usage.cache_write_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","description":"The cache write at the default lifetime. It does not include `cache_write_1h_tokens`, so add the two to read the whole write.","isRequired":true,"uniqueKey":"usage.cache_write_tokens.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"usage.cache_write_tokens","typeLabel":"integer | null"},"cache_write_1h_tokens":{"oneOf":[{"type":"integer","description":"The one-hour part of the cache write. Null where the provider stated no split.","isRequired":true,"uniqueKey":"usage.cache_write_1h_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","description":"The one-hour part of the cache write. Null where the provider stated no split.","isRequired":true,"uniqueKey":"usage.cache_write_1h_tokens.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"usage.cache_write_1h_tokens","typeLabel":"integer | null"},"reasoning_tokens":{"oneOf":[{"type":"integer","isRequired":true,"uniqueKey":"usage.reasoning_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","isRequired":true,"uniqueKey":"usage.reasoning_tokens.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"usage.reasoning_tokens","typeLabel":"integer | null"}},"isRequired":true,"uniqueKey":"usage","typeLabel":"object"},"served_on_own_key":{"type":"boolean","description":"True when the request ran on your own provider key, which is why nothing was charged. Read this rather than inferring it from a zero charge.","isRequired":true,"uniqueKey":"served_on_own_key","typeLabel":"boolean"},"paid_from_allowance":{"type":"boolean","description":"True when an included allowance paid for the request, in which case `charge` is absent.","isRequired":true,"uniqueKey":"paid_from_allowance","typeLabel":"boolean"},"latency_ms":{"type":"integer","description":"Total time the caller waited, in milliseconds.","isRequired":true,"uniqueKey":"latency_ms","typeLabel":"integer"},"note":{"type":"string","description":"A fixed sentence saying no prompt and no response body was stored.","isRequired":true,"uniqueKey":"note","typeLabel":"string"},"charge":{"type":"object","description":"What the request cost, with what you need to check it against the rates GET /v1/models publishes. Present only when your workspace balance paid for the request, so it is absent when `paid_from_allowance` is true.","additionalProperties":false,"required":["amount_micros","amount","currency","rate_revision_id","note"],"properties":{"amount_micros":{"oneOf":[{"type":"integer","description":"The charge in millionths of one dollar, so 1000000 is $1.00. Null where the request was never priced, which is not the same as a charge of zero.","isRequired":true,"uniqueKey":"charge.amount_micros.oneOf.0","typeLabel":"integer"},{"type":"null","description":"The charge in millionths of one dollar, so 1000000 is $1.00. Null where the request was never priced, which is not the same as a charge of zero.","isRequired":true,"uniqueKey":"charge.amount_micros.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"charge.amount_micros","typeLabel":"integer | null"},"amount":{"oneOf":[{"type":"string","description":"The same figure as dollars a person reads, with up to six decimal places and trailing zeros trimmed. Null exactly when `amount_micros` is null.","example":"$0.000105","isRequired":true,"uniqueKey":"charge.amount.oneOf.0","typeLabel":"string"},{"type":"null","description":"The same figure as dollars a person reads, with up to six decimal places and trailing zeros trimmed. Null exactly when `amount_micros` is null.","example":"$0.000105","isRequired":true,"uniqueKey":"charge.amount.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"charge.amount","typeLabel":"string | null"},"currency":{"type":"string","description":"ISO 4217.","example":"USD","isRequired":true,"uniqueKey":"charge.currency","typeLabel":"string"},"rate_revision_id":{"oneOf":[{"type":"string","description":"An opaque id for the set of rates this charge was computed from. Two requests with the same value were priced by the same rates. Null on a record written before rate revisions existed, or one left unpriced.","isRequired":true,"uniqueKey":"charge.rate_revision_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"An opaque id for the set of rates this charge was computed from. Two requests with the same value were priced by the same rates. Null on a record written before rate revisions existed, or one left unpriced.","isRequired":true,"uniqueKey":"charge.rate_revision_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"charge.rate_revision_id","typeLabel":"string | null"},"note":{"oneOf":[{"type":"string","enum":["rate_absent_charged_at_anchor","estimated_from_delivered_text","exact_from_provider_frame",null],"description":"What was unusual about this charge, or null on an ordinary one. `rate_absent_charged_at_anchor`: part of the request was priced at a rate the model does not list, a cache read or write at the input rate or reasoning at the output rate. `estimated_from_delivered_text`: the stream stopped before the provider reported its counts, so the charge is the prompt we counted plus an output estimated from the text delivered, never above the amount held. `exact_from_provider_frame`: the stream stopped early but the provider counts had already arrived, so the charge is exact.","isRequired":true,"uniqueKey":"charge.note.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["rate_absent_charged_at_anchor","estimated_from_delivered_text","exact_from_provider_frame",null],"description":"What was unusual about this charge, or null on an ordinary one. `rate_absent_charged_at_anchor`: part of the request was priced at a rate the model does not list, a cache read or write at the input rate or reasoning at the output rate. `estimated_from_delivered_text`: the stream stopped before the provider reported its counts, so the charge is the prompt we counted plus an output estimated from the text delivered, never above the amount held. `exact_from_provider_frame`: the stream stopped early but the provider counts had already arrived, so the charge is exact.","isRequired":true,"uniqueKey":"charge.note.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"charge.note","typeLabel":"enum\u003cstring> | null"}},"uniqueKey":"charge","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"object":"usage.request","request_id":"REQUEST_ID","occurred_at":"2026-09-05T06:20:11.000Z","model":"openai/gpt-4o-mini","outcome":"served","streamed":false,"usage":{"prompt_tokens":2011,"completion_tokens":5,"total_tokens":2016,"cache_read_tokens":1800,"cache_write_tokens":0,"reasoning_tokens":0,"cache_write_1h_tokens":null},"charge":{"amount_micros":31200,"amount":"$0.0312","currency":"USD","rate_revision_id":"RATE_REVISION_ID","note":null},"served_on_own_key":false,"latency_ms":812,"note":"No prompt and no response body was stored for this request; the figures here are everything that exists (we never store prompts).","paid_from_allowance":false},"examples":{"Example":{"title":"Example","value":{"object":"usage.request","request_id":"REQUEST_ID","occurred_at":"2026-09-05T06:20:11.000Z","model":"openai/gpt-4o-mini","outcome":"served","streamed":false,"usage":{"prompt_tokens":2011,"completion_tokens":5,"total_tokens":2016,"cache_read_tokens":1800,"cache_write_tokens":0,"reasoning_tokens":0,"cache_write_1h_tokens":null},"charge":{"amount_micros":31200,"amount":"$0.0312","currency":"USD","rate_revision_id":"RATE_REVISION_ID","note":null},"served_on_own_key":false,"latency_ms":812,"note":"No prompt and no response body was stored for this request; the figures here are everything that exists (we never store prompts).","paid_from_allowance":false}}},"exampleType":"examples"}},"headers":{"x-hopscotch-request-id":{"description":"Our id for this request. Quote it when you contact support. Present on every response, errors included.","schema":{"type":"string"}}},"exampleType":"examples"},"3a8f5035-c314-4fc3-bb38-fbbe7700bcc6":{"description":"No request id was named at all, so there is nothing to look up.","content":{"application/json":{"schema":{"type":"object","description":"The error envelope. One top-level `error` key, always, at every status.","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["message","type","param","code"],"additionalProperties":false,"properties":{"message":{"type":"string","description":"Prose for a person. It may be reworded, so do not branch on it.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"The category an SDK branches on. A closed set.","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","rate_limit_error","api_error","insufficient_quota","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"request_id":{"type":"string","description":"Our id for this request, the same value as the x-hopscotch-request-id header. Quote it when you contact support.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"Name the request id: GET /v1/usage/{request_id}, where the id is the value the x-hopscotch-request-id header carried on the response you are asking about.","type":"invalid_request_error","param":"request_id","code":"missing_required_parameter","request_id":"REQUEST_ID"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Name the request id: GET /v1/usage/{request_id}, where the id is the value the x-hopscotch-request-id header carried on the response you are asking about.","type":"invalid_request_error","param":"request_id","code":"missing_required_parameter","request_id":"REQUEST_ID"}}}},"exampleType":"examples"}},"headers":{"x-hopscotch-request-id":{"description":"Our id for this request. Quote it when you contact support. Present on every response, errors included.","schema":{"type":"string"}}},"exampleType":"examples"},"a0ca4837-18fc-474c-aded-b725196056aa":{"description":"No key, a scheme other than Bearer, a key of the wrong shape, a key we reject, or a key past its own expiry date, which carries code `key_expired` and names the date it expired on.","content":{"application/json":{"schema":{"type":"object","description":"The error envelope. One top-level `error` key, always, at every status.","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["message","type","param","code"],"additionalProperties":false,"properties":{"message":{"type":"string","description":"Prose for a person. It may be reworded, so do not branch on it.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"The category an SDK branches on. A closed set.","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","rate_limit_error","api_error","insufficient_quota","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"request_id":{"type":"string","description":"Our id for this request, the same value as the x-hopscotch-request-id header. Quote it when you contact support.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"Incorrect API key provided.","type":"authentication_error","param":null,"code":"invalid_api_key","request_id":"REQUEST_ID"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Incorrect API key provided.","type":"authentication_error","param":null,"code":"invalid_api_key","request_id":"REQUEST_ID"}}}},"exampleType":"examples"}},"headers":{"x-hopscotch-request-id":{"description":"Our id for this request. Quote it when you contact support. Present on every response, errors included.","schema":{"type":"string"}}},"exampleType":"examples"},"a65ba1a5-f258-4ae6-a220-3af672e575fb":{"description":"Refused for a setting the caller owns rather than anything about the model, and `code` names which. A key whose account staff have suspended is refused with code `account_suspended`, before any credit is held or any provider is called; contact support, because retrying will not change the answer.","content":{"application/json":{"schema":{"type":"object","description":"The error envelope. One top-level `error` key, always, at every status.","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["message","type","param","code"],"additionalProperties":false,"properties":{"message":{"type":"string","description":"Prose for a person. It may be reworded, so do not branch on it.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"The category an SDK branches on. A closed set.","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","rate_limit_error","api_error","insufficient_quota","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"request_id":{"type":"string","description":"Our id for this request, the same value as the x-hopscotch-request-id header. Quote it when you contact support.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"account_suspended":{"title":"account_suspended","value":{"error":{"message":"This account is suspended, so it cannot send requests. Contact support. Request id REQUEST_ID.","type":"permission_error","param":null,"code":"account_suspended","request_id":"REQUEST_ID"}}}},"exampleType":"examples"}},"headers":{"x-hopscotch-request-id":{"description":"Our id for this request. Quote it when you contact support. Present on every response, errors included.","schema":{"type":"string"}}},"exampleType":"examples"},"431d7328-ee3d-49ea-af38-722494cfc3d2":{"description":"No usage record with that id is visible to this key, with code `request_not_found`. The same answer covers an id that never existed, an id made by another key or in another workspace, and a record this read arrived ahead of.","content":{"application/json":{"schema":{"type":"object","description":"The error envelope. One top-level `error` key, always, at every status.","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["message","type","param","code"],"additionalProperties":false,"properties":{"message":{"type":"string","description":"Prose for a person. It may be reworded, so do not branch on it.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"The category an SDK branches on. A closed set.","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","rate_limit_error","api_error","insufficient_quota","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"request_id":{"type":"string","description":"Our id for this request, the same value as the x-hopscotch-request-id header. Quote it when you contact support.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"No usage record for \"REQUEST_ID\" is visible to this key. A record is written after the response is sent, so a read taken immediately can arrive first; a record made by another key, a record outside this key's workspace and an id that never existed answer identically.","type":"not_found_error","param":"request_id","code":"request_not_found","request_id":"REQUEST_ID"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"No usage record for \"REQUEST_ID\" is visible to this key. A record is written after the response is sent, so a read taken immediately can arrive first; a record made by another key, a record outside this key's workspace and an id that never existed answer identically.","type":"not_found_error","param":"request_id","code":"request_not_found","request_id":"REQUEST_ID"}}}},"exampleType":"examples"}},"headers":{"x-hopscotch-request-id":{"description":"Our id for this request. Quote it when you contact support. Present on every response, errors included.","schema":{"type":"string"}}},"exampleType":"examples"},"a26c3a0b-2901-4dcc-aca2-06260b150376":{"description":"A method other than GET on this path. A usage record is the record of what happened, so there is nothing to write and nothing to delete. The route boundary answers this before any key is looked at.","headers":{"Allow":{"schema":{"type":"string","enum":["GET"]},"description":"The methods this path accepts.","example":"GET"},"x-hopscotch-request-id":{"description":"Our id for this request. Quote it when you contact support. Present on every response, errors included.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","description":"The error envelope. One top-level `error` key, always, at every status.","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["message","type","param","code"],"additionalProperties":false,"properties":{"message":{"type":"string","description":"Prose for a person. It may be reworded, so do not branch on it.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"The category an SDK branches on. A closed set.","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","rate_limit_error","api_error","insufficient_quota","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"request_id":{"type":"string","description":"Our id for this request, the same value as the x-hopscotch-request-id header. Quote it when you contact support.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"POST is not supported for /v1/usage/REQUEST_ID in this release.","type":"invalid_request_error","param":null,"code":"method_not_allowed","request_id":"REQUEST_ID"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"POST is not supported for /v1/usage/REQUEST_ID in this release.","type":"invalid_request_error","param":null,"code":"method_not_allowed","request_id":"REQUEST_ID"}}}},"exampleType":"examples"}},"exampleType":"examples"},"605f174d-b536-4e75-ab82-6a5553b4b65e":{"description":"This key's own request rate was reached, `rate_limit_exceeded`. The response carries `Retry-After`.","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"example":17,"description":"Seconds to wait."},"x-hopscotch-request-id":{"description":"Our id for this request. Quote it when you contact support. Present on every response, errors included.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","description":"The error envelope. One top-level `error` key, always, at every status.","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["message","type","param","code"],"additionalProperties":false,"properties":{"message":{"type":"string","description":"Prose for a person. It may be reworded, so do not branch on it.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"The category an SDK branches on. A closed set.","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","rate_limit_error","api_error","insufficient_quota","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"request_id":{"type":"string","description":"Our id for this request, the same value as the x-hopscotch-request-id header. Quote it when you contact support.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"Rate limit reached for this key. Try again in 12 seconds. Request id REQUEST_ID.","type":"rate_limit_error","param":null,"code":"rate_limit_exceeded","request_id":"REQUEST_ID"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Rate limit reached for this key. Try again in 12 seconds. Request id REQUEST_ID.","type":"rate_limit_error","param":null,"code":"rate_limit_exceeded","request_id":"REQUEST_ID"}}}},"exampleType":"examples"}},"exampleType":"examples"},"be39a5e3-b3f3-4bb1-bacb-32ad2db57a51":{"description":"A fault on our side. The request id is the one thing worth keeping.","content":{"application/json":{"schema":{"type":"object","description":"The error envelope. One top-level `error` key, always, at every status.","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["message","type","param","code"],"additionalProperties":false,"properties":{"message":{"type":"string","description":"Prose for a person. It may be reworded, so do not branch on it.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"The category an SDK branches on. A closed set.","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","rate_limit_error","api_error","insufficient_quota","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, or null. Present and null rather than absent.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The stable machine-readable reason. Branch on this.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"request_id":{"type":"string","description":"Our id for this request, the same value as the x-hopscotch-request-id header. Quote it when you contact support.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"The server had an error while processing your request. Sorry about that! Quote the request id if you contact support.","type":"api_error","param":null,"code":null,"request_id":"REQUEST_ID"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"The server had an error while processing your request. Sorry about that! Quote the request id if you contact support.","type":"api_error","param":null,"code":null,"request_id":"REQUEST_ID"}}}},"exampleType":"examples"}},"headers":{"x-hopscotch-request-id":{"description":"Our id for this request. Quote it when you contact support. Present on every response, errors included.","schema":{"type":"string"}}},"exampleType":"examples"}},"security":{"7dffecda-7964-4bd8-80be-d0c79cc7c470":{"customerApiKey":{"type":"http","scheme":"bearer","description":"A workspace API key in an `Authorization: Bearer` header. A missing header, a scheme other than Bearer, a key of the wrong shape, and a key we reject are all 401.","scopes":[],"schemeName":"customerApiKey"}}},"servers":{"4411adc2-00d7-406d-a21a-75ae1172f0d5":{"url":"https://api.hopscotchlabs.ai","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"A workspace API key in an `Authorization: Bearer` header. A missing header, a scheme other than Bearer, a key of the wrong shape, and a key we reject are all 401.","scopes":[],"schemeName":"customerApiKey"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"A workspace API key in an `Authorization: Bearer` header. A missing header, a scheme other than Bearer, a key of the wrong shape, and a key we reject are all 401.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"customerApiKey","name":"Authorization"}],"title":"customerApiKey"}]},"originalFileLocation":"api-reference/openapi.public.json"},"subdomain":"unirouter","siteName":"Hopscotch","title":"Retrieve one request's usage - Hopscotch","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-23T15:56:12.675Z","originalFileLocation":"api-reference/usage/retrieve-one-requests-usage.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Read back what one request recorded and what it cost. Send the value of the x-hopscotch-request-id header from the response you are asking about. The key that made the request can read it, with no dashboard session. The record is written after the response is sent, so a read taken the instant a response lands can arrive first and answer 404. Read it again a moment later. A record made by another key, a record outside this key\u0026#x27;s workspace, and an id that never existed all answer with the same 404, so this route cannot be used to learn whether an id exists. In usage, null means the provider did not report that count and 0 means it was measured as none. The two are different facts. charge is present only when your workspace balance paid for the request. served_on_own_key is true when the request ran on your own provider key, and paid_from_allowance is true when an included allowance paid for it, in which case charge is absent. No prompt and no response body is stored, so none is returned. This route counts against the calling key\u0026#x27;s own request rate limit, like every other route.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Hopscotch\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/unirouter/51ojQE1LhN9oLy-j/_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/unirouter/51ojQE1LhN9oLy-j/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/unirouter/51ojQE1LhN9oLy-j/_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/unirouter/51ojQE1LhN9oLy-j/_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/unirouter/51ojQE1LhN9oLy-j/_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/unirouter/51ojQE1LhN9oLy-j/_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/unirouter/51ojQE1LhN9oLy-j/_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/unirouter/51ojQE1LhN9oLy-j/_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/unirouter/51ojQE1LhN9oLy-j/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Retrieve one request\u0026#x27;s usage - Hopscotch\">\u003cmeta data-mint-head property=\"og:description\" content=\"Read back what one request recorded and what it cost. Send the value of the x-hopscotch-request-id header from the response you are asking about. The key that made the request can read it, with no dashboard session. The record is written after the response is sent, so a read taken the instant a response lands can arrive first and answer 404. Read it again a moment later. A record made by another key, a record outside this key\u0026#x27;s workspace, and an id that never existed all answer with the same 404, so this route cannot be used to learn whether an id exists. In usage, null means the provider did not report that count and 0 means it was measured as none. The two are different facts. charge is present only when your workspace balance paid for the request. served_on_own_key is true when the request ran on your own provider key, and paid_from_allowance is true when an included allowance paid for it, in which case charge is absent. No prompt and no response body is stored, so none is returned. This route counts against the calling key\u0026#x27;s own request rate limit, like every other route.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Hopscotch\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.hopscotchlabs.ai/api-reference/usage/retrieve-one-requests-usage\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://unirouter.mintlify.app/_mintlify/api/og/v2?division=Usage\u0026amp;title=Retrieve+one+request%27s+usage\u0026amp;description=Read+back+what+one+request+recorded+and+what+it+cost.+Send+the+value+of+the+%60x-hopscotch-request-id%60+header+from+the+response+you+are+asking+about.+The+key+that\u0026amp;theme=6715395fa0e7fb019cdde93e\u0026amp;signature=9544d4e65636fee2ccb17fd36ff98d95f25439faa040bd3d6a6e2fec139b168b\">\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=\"Retrieve one request\u0026#x27;s usage - Hopscotch\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Read back what one request recorded and what it cost. Send the value of the x-hopscotch-request-id header from the response you are asking about. The key that made the request can read it, with no dashboard session. The record is written after the response is sent, so a read taken the instant a response lands can arrive first and answer 404. Read it again a moment later. A record made by another key, a record outside this key\u0026#x27;s workspace, and an id that never existed all answer with the same 404, so this route cannot be used to learn whether an id exists. In usage, null means the provider did not report that count and 0 means it was measured as none. The two are different facts. charge is present only when your workspace balance paid for the request. served_on_own_key is true when the request ran on your own provider key, and paid_from_allowance is true when an included allowance paid for it, in which case charge is absent. No prompt and no response body is stored, so none is returned. This route counts against the calling key\u0026#x27;s own request rate limit, like every other route.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://unirouter.mintlify.app/_mintlify/api/og/v2?division=Usage\u0026amp;title=Retrieve+one+request%27s+usage\u0026amp;description=Read+back+what+one+request+recorded+and+what+it+cost.+Send+the+value+of+the+%60x-hopscotch-request-id%60+header+from+the+response+you+are+asking+about.+The+key+that\u0026amp;theme=6715395fa0e7fb019cdde93e\u0026amp;signature=9544d4e65636fee2ccb17fd36ff98d95f25439faa040bd3d6a6e2fec139b168b\">\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/unirouter/51ojQE1LhN9oLy-j/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Hopscotch\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#00786a\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.hopscotchlabs.ai/api-reference/usage/retrieve-one-requests-usage\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/usage/retrieve-one-requests-usage.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.hopscotchlabs.ai/#organization\",\"name\":\"Hopscotch\",\"url\":\"https://docs.hopscotchlabs.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/unirouter/e-jU4qy0Y8gPhRZJ/logo/light.svg?fit=max\u0026auto=format\u0026n=e-jU4qy0Y8gPhRZJ\u0026q=85\u0026s=eb9901b22939c791c90369af09611ebe\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.hopscotchlabs.ai#website\",\"name\":\"Hopscotch\",\"url\":\"https://docs.hopscotchlabs.ai\",\"publisher\":{\"@id\":\"https://docs.hopscotchlabs.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.hopscotchlabs.ai/api-reference/usage/retrieve-one-requests-usage#webpage\",\"url\":\"https://docs.hopscotchlabs.ai/api-reference/usage/retrieve-one-requests-usage\",\"name\":\"Retrieve one request's usage\",\"description\":\"Read back what one request recorded and what it cost. Send the value of the x-hopscotch-request-id header from the response you are asking about. The key that made the request can read it, with no dashboard session. The record is written after the response is sent, so a read taken the instant a response lands can arrive first and answer 404. Read it again a moment later. A record made by another key, a record outside this key's workspace, and an id that never existed all answer with the same 404, so this route cannot be used to learn whether an id exists. In usage, null means the provider did not report that count and 0 means it was measured as none. The two are different facts. charge is present only when your workspace balance paid for the request. served_on_own_key is true when the request ran on your own provider key, and paid_from_allowance is true when an included allowance paid for it, in which case charge is absent. No prompt and no response body is stored, so none is returned. This route counts against the calling key's own request rate limit, like every other route.\",\"dateModified\":\"2026-10-23T15:56:12.675Z\",\"isPartOf\":{\"@id\":\"https://docs.hopscotchlabs.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.hopscotchlabs.ai/api-reference/usage/retrieve-one-requests-usage#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.hopscotchlabs.ai/api-reference/usage/retrieve-one-requests-usage#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.hopscotchlabs.ai/api-reference/chat/create-a-chat-completion\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Retrieve one request's usage\",\"item\":\"https://docs.hopscotchlabs.ai/api-reference/usage/retrieve-one-requests-usage\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.hopscotchlabs.ai/api-reference/usage/retrieve-one-requests-usage#apireference\",\"headline\":\"Retrieve one request's usage\",\"name\":\"Retrieve one request's usage\",\"description\":\"Read back what one request recorded and what it cost. Send the value of the x-hopscotch-request-id header from the response you are asking about. The key that made the request can read it, with no dashboard session. The record is written after the response is sent, so a read taken the instant a response lands can arrive first and answer 404. Read it again a moment later. A record made by another key, a record outside this key's workspace, and an id that never existed all answer with the same 404, so this route cannot be used to learn whether an id exists. In usage, null means the provider did not report that count and 0 means it was measured as none. The two are different facts. charge is present only when your workspace balance paid for the request. served_on_own_key is true when the request ran on your own provider key, and paid_from_allowance is true when an included allowance paid for it, in which case charge is absent. No prompt and no response body is stored, so none is returned. This route counts against the calling key's own request rate limit, like every other route.\",\"url\":\"https://docs.hopscotchlabs.ai/api-reference/usage/retrieve-one-requests-usage\",\"mainEntityOfPage\":{\"@id\":\"https://docs.hopscotchlabs.ai/api-reference/usage/retrieve-one-requests-usage#webpage\"},\"dateModified\":\"2026-10-23T15:56:12.675Z\",\"publisher\":{\"@id\":\"https://docs.hopscotchlabs.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.hopscotchlabs.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Hopscotch\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Hopscotch","nav":{"global":null,"tabs":[{"tab":"Get started","icon":"player-play","pages":[{"title":"Get started","href":""}]},{"tab":"Features","icon":"stack-2","pages":[{"title":"Features","href":"/features/overview"}]},{"tab":"Manage \u0026 monitor","icon":"gauge","pages":[{"title":"Manage \u0026 monitor","href":"/manage/overview"}]},{"tab":"Integrations","icon":"plug","pages":[{"title":"Integrations","href":"/integrations/overview"}]},{"tab":"API Reference","icon":"code","groups":[{"group":"Overview","pages":[{"title":"API reference","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"Request parameters","href":"/api-reference/parameters"},{"title":"Errors","href":"/api-reference/errors"},{"title":"Headers","href":"/api-reference/headers"}]},{"group":"Endpoints","pages":[{"group":"Chat","pages":[{"title":"Create a chat completion","deprecated":null,"version":null,"openapi":"/api-reference/openapi.public.json post /v1/chat/completions","href":"/api-reference/chat/create-a-chat-completion"}]},{"group":"Completions","pages":[{"title":"Create a text completion","deprecated":null,"version":null,"openapi":"/api-reference/openapi.public.json post /v1/completions","href":"/api-reference/completions/create-a-text-completion"}]},{"group":"Models","pages":[{"title":"List models","deprecated":null,"version":null,"openapi":"/api-reference/openapi.public.json get /v1/models","href":"/api-reference/models/list-models"},{"title":"Retrieve a model","deprecated":null,"version":null,"openapi":"/api-reference/openapi.public.json get /v1/models/{id}","href":"/api-reference/models/retrieve-a-model"}]},{"group":"Responses","pages":[{"title":"Create a model response","description":"Send a request in the OpenAI Responses format. Set `stream: true` for server-sent events.\n\nThis is the same door as chat completions: the same key, the same catalog, the same hold against your balance and the same usage row, filed under its own endpoint family so a charge is recognisable. The body is forwarded as you sent it, with one exception documented on `store` below.\n\nCredit is held when the request is admitted and settled against the provider's own token counts when it finishes. You are charged the provider's rate at face value. Nothing is added per request.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.public.json post /v1/responses","href":"/api-reference/responses/create-a-model-response"}]},{"group":"Usage","pages":[{"title":"Retrieve one request's usage","deprecated":null,"version":null,"openapi":"/api-reference/openapi.public.json get /v1/usage/{id}","href":"/api-reference/usage/retrieve-one-requests-usage"}]},{"group":"Messages","pages":[{"title":"Create a message (Anthropic Messages API)","description":"Send a request in the Anthropic Messages format. Set `stream: true` for Anthropic's own server-sent event stream.\n\nThe credential is read from either `Authorization: Bearer` or Anthropic's own `x-api-key` header, so an unmodified Anthropic SDK works whichever way it authenticates. If both headers are present they must carry the same key: two different keys are refused with 401 rather than one being chosen.\n\n`max_tokens` is required by Anthropic and is passed through as you send it. It is not defaulted here, and a request that leaves it out is refused by the provider in the provider's own words. It is also the figure the credit held for the request is sized from. An `anthropic-version` header is not forwarded.\n\nThis route differs from Anthropic's own API in one way: a refusal comes back in the OpenAI error envelope that every other route here uses, so an Anthropic SDK reads the sentence from `error.message`. Only `POST /v1/messages` is served. `POST /v1/messages/count_tokens` is not, and answers 404 with the code `endpoint_not_supported`.\n\nCredit is held when the request is admitted and settled against the provider's own token counts when it finishes. You are charged the provider's rate at face value. Nothing is added per request.\n\nTo read back the tokens and charge of one request afterwards, send the value of the `x-hopscotch-request-id` response header to `GET /v1/usage/{id}`.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.public.json post /v1/messages","href":"/api-reference/messages/create-a-message-anthropic-messages-api"}]}]}]}]},"title":"Retrieve one request's usage - Hopscotch","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-Bbp7I60D.js","utils-C3RIvJha.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DqD-vLt8.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B31Loprg.js","snippetPresets-DKpk-b8t.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Cj65AhOR.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BXtn5gcC.js","shallow-RY2b03Cp.js","getApiPlaygroundDisplay-B0jeiPk3.js","CodeSnippet-CYgBjjwn.js","CodeSnippets-DOngDrYB.js","Page-n7I5XbKb.js","getPastedJson-DRQbJx-T.js","icon-CQiQCicY.js","MethodPill-BKTLdNtu.js","DuplicateIcon-B9jpAdat.js","createIcon-DCddRrXv.js","DynamicMarkdown-a8hUKrw6.js","SectionHeading-eECVV2eH.js","axios-vUo_bRtp.js","Markdown--GF7ZIpf.js","clsx-DZLdJUrt.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-2LoAhjKH.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Zwc0ZncM.js"]}