Skip to main content

Overview

The list() and alist() methods allow you to retrieve multiple log entries using URL query parameters. Use list() for synchronous operations and alist() for asynchronous operations.

Usage example

Parameters

int
default:"1"
The page number to retrieve.
int
default:"100"
Number of logs to return per page (maximum: 1000).
str
default:"-id"
Field to sort by. Use - prefix for descending order. Available options: id, cost, latency, prompt_tokens, completion_tokens, all_tokens, time_to_first_token
str
default:"false"
Whether to include test logs. Options: "true", "false".
str
default:"false"
Whether to include logs from all environments. Options: "true", "false".

Returns

Returns a LogListResponse object with:

Examples

Basic Synchronous Example

Asynchronous Example

Sorting and Pagination

Environment Filtering

Convenience Functions

You can also use the convenience function to create a LogAPI client:

Limitations

The SDK’s list() method only supports URL query parameters. For advanced filtering with operators (gt, lt, contains, etc.), you need to use the direct API endpoint with POST requests.

What’s NOT supported in the SDK:

  • Complex filters in request body
  • Metadata filtering
  • Model filtering
  • Date range filtering
  • Custom field filtering

For advanced filtering, use the direct API: