Retrieve a recorded primary request charge
Changed onLook up one completed primary charge by captured X-Request-ID using the same inference API key. Uses database time and a rolling 24-hour window based on the charge accounting timestamp; no query parameters are accepted. Returns the exact recorded cost, currency, token usage and expiry. Refunds and separately billed extras are excluded; components already included in the primary amount remain included. Multiple eligible primary charges return 409 instead of selecting or summing attempts. No balance-collection or immutable net-cost guarantee is implied. A 404 never means zero cost: the charge may be delayed, expired, inaccessible or absent. All responses are private/no-store. Distributed quotas are 60/minute per key and 300/minute per trusted IP; required dependency failures return 503. Prefer a server-generated X-Request-ID captured from inference response headers. The ID is not an idempotency key; use a fresh ID for each inference execution, including retries. Make the first lookup after about two seconds; a 404 sends Retry-After: 30. Honor Retry-After on 404, 429 and 503, add jitter, stop on 200 or a permanent error, and stop retries no later than 24 hours after the original request. See https://docs.nano-gpt.com/api-reference/endpoint/request-billing for bounded polling.
Request
- Base URLhttps://api.nano-gpt.com/api
- URLhttps://api.nano-gpt.com/api/v1/usage/requests/{request_id}
- Auth
- HTTP bearer
- or API key in header x-api-key
Path parameters
X-Request-ID captured from response headers before disconnect. Prefer omitting the incoming header so the server generates one. This is not an idempotency key: use a distinct ID for each inference execution, including retries; repeated IDs may return 409.
Response
One recorded primary charge from the last 24 hours. All responses use private/no-store and Vary: Authorization, x-api-key.
Changes
- info
endpoint added
- info