Search + K

Command Palette

Search for a command to run...

Sign In

List Gateway Logs

GET /accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs
Copy endpoint
https://api.cloudflare.com/client/v4

Parameters

path Path Parameters

Name Type
account_id required
string
gateway_id required
`${string}:-${string}`

query Query Parameters

Name Type
search
string
page
number
per_page
number
order_by
"created_at" | "provider" | "model" | "model_type" | "success" | "cached"
order_by_direction
"asc" | "desc"
filters
{ key: "id" | "created_at" | "request_content_type" | "response_content_type" | "request_type" | "success" | "cached" | "provider" | "model" | "model_type" | "cost" | "tokens" | "tokens_in" | "tokens_out" | "duration" | "feedback" | "event_id" | "metadata.key" | "metadata.value" | "prompts.prompt_id" | "prompts.version_id" | "authentication" | "wholesale" | "compatibilityMode";operator: "eq" | "neq" | "contains" | "lt" | "gt";value: (string | number | boolean | null)[]; }[]
meta_info
boolean
direction
"asc" | "desc"
start_date
string
end_date
string
min_cost
number
max_cost
number
min_tokens_in
number
max_tokens_in
number
min_tokens_out
number
max_tokens_out
number
min_total_tokens
number
max_total_tokens
number
min_duration
number
max_duration
number
feedback
-1 | 0 | 1
success
boolean
cached
boolean
model
string
model_type
string
provider
string
request_content_type
string
response_content_type
string

Responses

200 application/json

Returns a list of Gateway Logs

{ result: {
cached: boolean;
cost?: number;
created_at: string;
custom_cost?: boolean;
duration: number;
id: string;
metadata?: string;
model: string;
model_type?: string;
path: string;
provider: string;
request_content_type?: string;
request_type?: string;
response_content_type?: string;
status_code?: number;
step?: number;
success: boolean;
tokens_in: number | null;
tokens_out: number | null;
}
[]
;result_info: {
count?: number;
max_cost?: number;
max_duration?: number;
max_tokens_in?: number;
max_tokens_out?: number;
max_total_tokens?: number;
min_cost?: number;
min_duration?: number;
min_tokens_in?: number;
min_tokens_out?: number;
min_total_tokens?: number;
page?: number;
per_page?: number;
total_count?: number;
}
;success: boolean; }

Client Errors

400 application/json

Bad Request

{ errors: { message: string; }[];result: {};success: boolean; }