Skip to content
Start here

Delete Gateway Logs

client.aiGateway.logs.delete(stringgatewayId, LogDeleteParams { account_id, filters, limit, 2 more } params, RequestOptionsoptions?): LogDeleteResponse { success }
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
ParametersExpand Collapse
gatewayId: string

gateway id

maxLength64
minLength1
params: LogDeleteParams { account_id, filters, limit, 2 more }
account_id: string

Path param

filters?: Array<Filter>

Query param

key: "id" | "created_at" | "request_content_type" | 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" | "neq" | "contains" | 2 more
One of the following:
"eq"
"neq"
"contains"
"lt"
"gt"
value: Array<string | null | number | boolean>
One of the following:
string | null
number
boolean
limit?: number

Query param

maximum10000
minimum1
order_by?: "created_at" | "provider" | "model" | 8 more

Query param

One of the following:
"created_at"
"provider"
"model"
"model_type"
"success"
"cached"
"cost"
"tokens_in"
"tokens_out"
"duration"
"feedback"
order_by_direction?: "asc" | "desc"

Query param

One of the following:
"asc"
"desc"
ReturnsExpand Collapse
LogDeleteResponse { success }
success: boolean

Delete Gateway Logs

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const log = await client.aiGateway.logs.delete('my-gateway', {
  account_id: '0d37909e38d3e99c29fa2cd343ac421a',
});

console.log(log.success);
{
  "success": true
}
Returns Examples
{
  "success": true
}