Skip to content
Start here

Delete Gateway Logs

DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs

Delete Gateway Logs

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
AI Gateway Write
Path ParametersExpand Collapse
account_id: string
gateway_id: string

gateway id

maxLength64
minLength1
Query ParametersExpand Collapse
filters: optional array of object { key, operator, value }
key: "id" or "created_at" or "request_content_type" or 20 more
One of the following:
"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"
"authentication"
"wholesale"
"compatibilityMode"
"dlp_action"
operator: "eq" or "neq" or "contains" or 2 more
One of the following:
"eq"
"neq"
"contains"
"lt"
"gt"
value: array of string or number or boolean
One of the following:
string
number
boolean
limit: optional number
maximum10000
minimum1
order_by: optional "created_at" or "provider" or "model" or 8 more
One of the following:
"created_at"
"provider"
"model"
"model_type"
"success"
"cached"
"cost"
"tokens_in"
"tokens_out"
"duration"
"feedback"
order_by_direction: optional "asc" or "desc"
One of the following:
"asc"
"desc"
ReturnsExpand Collapse
success: boolean

Delete Gateway Logs

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/logs \
    -X DELETE \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
  "success": true
}
Returns Examples
{
  "success": true
}