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_id

Endpoints

MethodEndpointDescription
GET/v1/account/logsList request logs
GET/v1/account/logs/:log_idRetrieve a request log, with its request and response payloads

Status

StatusMeaning
successThe request completed.
errorThe request failed.
abortThe client cancelled the request before it finished.
timeoutThe 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'optional

Always log.

idstringoptional

The log's ID.

request_idstringoptional

The request's ID, starting with avn_. Include it when you contact support.

created_atstringoptional

When the request was made (RFC 3339).

api_key_idstringoptional

The API key the request used.

api_key_namestring | nulloptional

The API key's name.

modelstringoptional

The model the request called.

endpointstringoptional

Which API was called, such as chatCompletions, responses, messages, embeddings or images.

statusstringoptional

How the request ended. See Status.

Allowed values:successerroraborttimeout
finish_reasonstring | nulloptional

Why the model stopped: stop, tool_calls, length or content_filter. Set only on successful text requests.

usageobjectoptional

What the request consumed. See Usage fields.

coststringoptional

Total cost of the request in US dollars.

perk_coststringoptional

The part of cost paid by a perk instead of your balance.

perk_idstring | nulloptional

The perk that covered the request, if any.

currency'USD'optional

Always USD.

ttft_msinteger | nulloptional

Time to the first token in milliseconds. Streaming requests only.

output_tokens_per_secondnumber | nulloptional

Output speed. Streaming requests only.

app_refererstring | nulloptional

The HTTP-Referer header the client sent, if any. See Identifying your app.

app_titlestring | nulloptional

The 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).

FieldMeaning
uncached_input_tokensInput tokens not read from or written to the prompt cache.
cache_read_input_tokensInput tokens read from the prompt cache.
cache_creationInput tokens written to the cache: ephemeral_5m_input_tokens and ephemeral_1h_input_tokens.
output_tokensOutput tokens.
audio_secondsAudio duration (transcription and speech).
video_secondsVideo duration (video generation).
image_input_countInput images (image edits).
image_output_countImages generated.
charactersCharacters processed (speech).
unitsOther billed units, such as tool calls.