Skip to content
Start here

Delete an AI Gateway Dynamic Route.

DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}

Delete an AI Gateway Dynamic Route.

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
id: string
ReturnsExpand Collapse
result: object { id, created_at, elements, 3 more }
id: string
created_at: string
formatdate-time
elements: array of object { id, outputs, type } or object { id, outputs, properties, type } or object { id, outputs, type } or 3 more
One of the following:
object { id, outputs, type }
id: string
outputs: object { next }
type: "start"
object { id, outputs, properties, type }
id: string
outputs: object { false, true }
false: object { elementId }
elementId: string
true: object { elementId }
elementId: string
properties: object { conditions }
conditions: optional unknown
type: "conditional"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "percentage"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { key, limit, limitType, window }
key: string
limit: number
limitType: "count" or "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
success: boolean

Delete an AI Gateway Dynamic Route.

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/routes/$ID \
    -X DELETE \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
  "result": {
    "id": "id",
    "created_at": "2019-12-27T18:11:19.117Z",
    "elements": [
      {
        "id": "id",
        "outputs": {
          "next": {
            "elementId": "elementId"
          }
        },
        "type": "start"
      }
    ],
    "gateway_id": "gateway_id",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "name": "name"
  },
  "success": true
}
Returns Examples
{
  "result": {
    "id": "id",
    "created_at": "2019-12-27T18:11:19.117Z",
    "elements": [
      {
        "id": "id",
        "outputs": {
          "next": {
            "elementId": "elementId"
          }
        },
        "type": "start"
      }
    ],
    "gateway_id": "gateway_id",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "name": "name"
  },
  "success": true
}