Account

Retrieve a recorded primary request charge

Changed on

Look 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.

get/v1/usage/requests/{request_id}

Request

  • Base URL
    https://api.nano-gpt.com/api
  • URL
    https://api.nano-gpt.com/api/v1/usage/requests/{request_id}
  • Auth
    • HTTP bearer
    • or API key in header x-api-key

Path parameters

request_idstring required

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.

object'request_billing' required
request_idstring required
created_atstring date-time required

Ledger accounting timestamp; not necessarily insertion time.

expires_atstring date-time required

24 hours after the charge accounting timestamp. The record is unavailable at or after this instant; financial records are retained.

as_ofstring date-time required

Database statement snapshot time.

coststring required

Exact nonnegative amount recorded on the primary charge. Does not subtract refunds or add separately billed extras; not proof of balance collection.

currency'USD' | 'XNO' required
cost_scope'primary_charge' required

Changes