Request Logs
GET /logsReturns a paginated list of individual API request logs for your organization.
Query parameters
Section titled “Query parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
range | string | "24h" | Time range: "15m", "1h", "6h", "24h", "7days", "30days" |
errors | string | "false" | Set to "true" to show only failed requests |
limit | integer | 50 | Results per page, 1–100 |
after | string | — | Cursor: timestamp from next_after |
after_id | string | — | Cursor: ID from next_after_id |
Response
Section titled “Response”{ "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"}Log entry fields
Section titled “Log entry fields”| Field | Type | Description |
|---|---|---|
id | string | Request ID |
model | string | Model used |
api_key | string | null | Masked API key (last 3 chars) |
status_code | integer | HTTP status code |
ttft_ms | number | null | Time to first token in ms (streaming only) |
latency_ms | number | Total request latency in ms |
input_tokens | integer | null | Input tokens consumed |
created_at | string | ISO 8601 timestamp |
Pagination
Section titled “Pagination”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:
# First pagecurl "https://api.aiand.com/logs?range=24h&limit=20" \ -H "Authorization: Bearer sk-your-api-key"
# Next pagecurl "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.
Filtering errors
Section titled “Filtering errors”To see only failed requests (status code >= 400):
curl "https://api.aiand.com/logs?errors=true&range=1h" \ -H "Authorization: Bearer sk-your-api-key"