Request Logs
One entry per request: model, status, token usage, cost and timing.
Every request made with your API keys is logged with its model, status, token usage, cost and timing. These are the same entries you see on the Logs page.
GET /v1/account/logs
GET /v1/account/logs/:log_idEndpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/account/logs | List request logs |
| GET | /v1/account/logs/:log_id | Retrieve a request log, with its request and response payloads |
Status
| Status | Meaning |
|---|---|
success | The request completed. |
error | The request failed. |
abort | The client cancelled the request before it finished. |
timeout | The upstream stream was cut off before it finished. |
abort and timeout requests can still be charged for the tokens
produced before they stopped. See
Stream cancellation.
The log object
type'log'optionalAlways log.
idstringoptionalThe log's ID.
request_idstringoptionalThe request's ID, starting with avn_. Include it when you contact
support.
created_atstringoptionalWhen the request was made (RFC 3339).
api_key_idstringoptionalThe API key the request used.
api_key_namestring | nulloptionalThe API key's name.
modelstringoptionalThe model the request called.
endpointstringoptionalWhich API was called, such as chatCompletions, responses,
messages, embeddings or images.
finish_reasonstring | nulloptionalWhy the model stopped: stop, tool_calls, length or
content_filter. Set only on successful text requests.
usageobjectoptionalWhat the request consumed. See Usage fields.
coststringoptionalTotal cost of the request in US dollars.
perk_coststringoptionalThe part of cost paid by a perk instead of your balance.
perk_idstring | nulloptionalThe perk that covered the request, if any.
currency'USD'optionalAlways USD.
ttft_msinteger | nulloptionalTime to the first token in milliseconds. Streaming requests only.
output_tokens_per_secondnumber | nulloptionalOutput speed. Streaming requests only.
app_refererstring | nulloptionalThe HTTP-Referer header the client sent, if any. See
Identifying your app.
app_titlestring | nulloptionalThe X-Title header the client sent, if any.
Usage fields
Token fields use the same split as the
usage report. Fields that don't apply
to a request are 0 (tokens) or null (everything else).
| Field | Meaning |
|---|---|
uncached_input_tokens | Input tokens not read from or written to the prompt cache. |
cache_read_input_tokens | Input tokens read from the prompt cache. |
cache_creation | Input tokens written to the cache: ephemeral_5m_input_tokens and ephemeral_1h_input_tokens. |
output_tokens | Output tokens. |
audio_seconds | Audio duration (transcription and speech). |
video_seconds | Video duration (video generation). |
image_input_count | Input images (image edits). |
image_output_count | Images generated. |
characters | Characters processed (speech). |
units | Other billed units, such as tool calls. |