Skip to content

Request Logs

The request logs endpoint returns a paginated list of recent requests handled by the gateway. Useful for debugging, auditing, and monitoring individual calls.

Endpoint: GET /v1/requests

Authentication: Required

ParameterTypeDefaultDescription
limitnumber50Number of entries to return (max 500)
offsetnumber0Number of entries to skip for pagination
project_idstringFilter results to a specific project
GET https://your-gateway.workers.dev/v1/requests?limit=20&offset=0
Authorization: Bearer <your-token>
{
"total": 14823,
"limit": 20,
"offset": 0,
"data": [
{
"id": "req_01j9xkz3p4q5r6s7t8u9v0w1",
"timestamp": "2024-11-15T10:32:45.123Z",
"model": "gpt-4o",
"provider": "openai",
"status": 200,
"latency_ms": 843,
"input_tokens": 512,
"output_tokens": 128,
"project_id": "proj_abc123",
"error": null
},
{
"id": "req_01j9xky2m3n4o5p6q7r8s9t0",
"timestamp": "2024-11-15T10:31:12.044Z",
"model": "claude-3-5-sonnet-20241022",
"provider": "anthropic",
"status": 429,
"latency_ms": 210,
"input_tokens": null,
"output_tokens": null,
"project_id": "proj_abc123",
"error": "rate_limit_error"
}
]
}
FieldTypeDescription
idstringUnique request identifier
timestampstringISO 8601 UTC timestamp of when the request was received
modelstringModel that was requested
providerstringBackend provider that served the request
statusnumberHTTP status code of the response
latency_msnumberEnd-to-end latency in milliseconds
input_tokensnumber | nullInput token count (null if unavailable or errored)
output_tokensnumber | nullOutput token count (null if unavailable or errored)
project_idstring | nullProject the request was attributed to
errorstring | nullError type if the request failed, otherwise null
Terminal window
# Fetch the 20 most recent requests
curl "https://your-gateway.workers.dev/v1/requests?limit=20&offset=0" \
-H "Authorization: Bearer <your-token>"
# Filter by project
curl "https://your-gateway.workers.dev/v1/requests?project_id=proj_abc123&limit=50" \
-H "Authorization: Bearer <your-token>"