Overview
Thelist() 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_tokenstr
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 aLogListResponse 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
What’s NOT supported in the SDK:
- Complex filters in request body
- Metadata filtering
- Model filtering
- Date range filtering
- Custom field filtering