Skip to content

Request Logs

GET /logs

Returns a paginated list of individual API request logs for your organization.

ParameterTypeDefaultDescription
rangestring"24h"Time range: "15m", "1h", "6h", "24h", "7days", "30days"
errorsstring"false"Set to "true" to show only failed requests
limitinteger50Results per page, 1–100
afterstringCursor: timestamp from next_after
after_idstringCursor: ID from next_after_id
{
"data": [
{
"id": "req_abc123",
"model": "gpt-4o-mini",
"api_key": "sk-...abc",
"status_code": 200,
"ttft_ms": 245,
"latency_ms": 1820,
"input_tokens": 150,
"created_at": "2025-01-15T12:30:00Z"
}
],
"has_more": true,
"next_after": "2025-01-15T12:29:55Z",
"next_after_id": "req_xyz789"
}
FieldTypeDescription
idstringRequest ID
modelstringModel used
api_keystring | nullMasked API key (last 3 chars)
status_codeintegerHTTP status code
ttft_msnumber | nullTime to first token in ms (streaming only)
latency_msnumberTotal request latency in ms
input_tokensinteger | nullInput tokens consumed
created_atstringISO 8601 timestamp

Results are ordered newest-first. To fetch the next page, pass next_after and next_after_id from the response as after and after_id query parameters:

Terminal window
# First page
curl "https://api.aiand.com/logs?range=24h&limit=20" \
-H "Authorization: Bearer sk-your-api-key"
# Next page
curl "https://api.aiand.com/logs?range=24h&limit=20&after=2025-01-15T12:29:55Z&after_id=req_xyz789" \
-H "Authorization: Bearer sk-your-api-key"

Continue paginating until has_more is false.

To see only failed requests (status code >= 400):

Terminal window
curl "https://api.aiand.com/logs?errors=true&range=1h" \
-H "Authorization: Bearer sk-your-api-key"