Skip to main content

Overview

The Request Logs API provides access to historical records of all proxy requests, including request metadata, status codes, token usage, costs, and errors. Use this API to debug issues, analyze usage patterns, and monitor system health.
All Request Logs endpoints require dashboard authentication via session cookie.

List Request Logs

endpoint
Retrieve paginated request logs with optional filtering by account, model, status, and time range.

Query Parameters

integer
default:"50"
Number of logs to return (1-1000)
integer
default:"0"
Number of logs to skip for pagination
Search term to filter logs (searches in error messages and request IDs)
array
Filter by account ID(s). Can be specified multiple times for multiple accounts.
array
Filter by status code(s). Can be specified multiple times.
array
Filter by model name(s). Can be specified multiple times.
array
Filter by reasoning effort level(s). Can be specified multiple times.
array
Filter by model+reasoning combinations. Format: model:::reasoning_effort
string
ISO 8601 timestamp - only include logs after this time
string
ISO 8601 timestamp - only include logs before this time

Response

array
required
Array of request log entries
integer
required
Total number of logs matching filters (before pagination)
boolean
required
Whether there are more logs beyond the current page

Example Request - Basic

Example Request - Filtered

Example Request - Multiple Filters

Example Response

Get Filter Options

endpoint
Retrieve available filter values based on current logs and optional pre-filters.

Query Parameters

Accepts the same filter parameters as the main list endpoint:
  • status
  • accountId
  • model
  • reasoningEffort
  • modelOption
  • since
  • until
Use this endpoint to build dynamic filter UIs. Apply existing filters to get context-aware options for additional filters.

Response

array
required
List of account IDs that have logs matching the current filters
array
required
List of model+reasoning combinations available
array
required
List of status values present in matching logs

Example Request

Example Response

Filtering Examples

By Time Range

View requests from the last hour:

By Account

View all requests for a specific account:

By Status

Find all failed requests:

By Model

Filter to Opus requests only:

By Model + Reasoning Effort

Find high reasoning effort Opus requests:

Search by Text

Search for specific error messages:

Combined Filters

Find expensive failed Opus requests in the last 24 hours:

Pagination

The API uses offset-based pagination:
Check the has_more field to determine if additional pages exist:

Status Codes

Common status values in logs:

Error Codes

Common error_code values:

Token and Cost Tracking

Token Fields

  • tokens: Total tokens (input + output). Null for failed requests.
  • cached_input_tokens: Prompt cache hits. Reduces cost but still counted in usage.

Cost Calculation

Costs are estimated based on:
  1. Model pricing (per 1M tokens)
  2. Input/output token split
  3. Cached token discount
  4. Reasoning effort multiplier (if applicable)
The cost_usd field shows the calculated cost for the request. Sum this field to analyze spending patterns.

Use Cases

Debugging

Search for specific request IDs or error messages to diagnose issues.

Cost Analysis

Filter by model and time range to understand spending by model type.

Performance Monitoring

Track latency_ms across different models and accounts.

Usage Patterns

Identify peak usage times and model preferences.

Performance Considerations

Index Optimization

The following queries are optimized with database indexes:
  • Time range filtering (since, until)
  • Account ID lookups
  • Status filtering
  • Model filtering

Large Result Sets

For querying large date ranges:
  1. Use smaller limit values (50-100)
  2. Implement cursor-based pagination
  3. Consider exporting data for offline analysis

Real-time Monitoring

For live dashboards, poll with a small time window:

Authentication

All request log endpoints require dashboard authentication via session cookie.

Common Patterns

Error Rate Dashboard

Calculate error percentage over the last hour:

Cost Per Model Report

Sum costs by model:

Account Health Check

Find accounts with high error rates: