usage

Get Request Settlement

Changed on

Look up a request's settled cost by the Otari-Request-ID it was sent (standalone).

This is how a caller recovers the cost of a request whose response never carried one: a stream that failed or was disconnected mid-response, or a request that errored. An API key sees only the requests it made; the master key sees any. Returns 404 until the request has settled (its rows are written by a background writer, so a lookup made the instant a stream closes can precede them), and for an id that is unknown or belongs to another key, with no way to tell those apart. A stream that ended before the provider reported usage, and ran no gateway tools, writes no row, so its id stays 404.

get/api/v1/usage/requests/{request_id}

Request

  • The document declares no server URL.
  • Auth: one of:
    • API key in header Otari-Key
    • API key in header x-api-key

Path parameters

request_idstring required

Response

Successful Response

completion_tokensinteger required
cost_usdstring nullable required
prompt_tokensinteger required
request_idstring required
row_countinteger required
status'success' | 'error' required
total_tokensinteger required

Changes