Skip to content
Start here

List all AI Gateway Dynamic Routes.

GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes

List all AI Gateway Dynamic Routes.

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 WriteAI Gateway Read
Path ParametersExpand Collapse
account_id: string
gateway_id: string
ReturnsExpand Collapse
data: object { order_by, order_by_direction, page, 2 more }
order_by: string
order_by_direction: string
page: number
per_page: number
routes: array of object { id, account_tag, created_at, 6 more }
id: string
account_tag: string
created_at: string
formatdate-time
deployment: object { created_at, deployment_id, version_id }
created_at: string
deployment_id: string
version_id: string
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
version: object { active, created_at, data, version_id }
active: "true" or "false"
One of the following:
"true"
"false"
created_at: string
data: string
version_id: string
success: boolean

List all AI Gateway Dynamic Routes.

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/routes \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
  "data": {
    "order_by": "order_by",
    "order_by_direction": "order_by_direction",
    "page": 0,
    "per_page": 0,
    "routes": [
      {
        "id": "id",
        "account_tag": "account_tag",
        "created_at": "2019-12-27T18:11:19.117Z",
        "deployment": {
          "created_at": "created_at",
          "deployment_id": "deployment_id",
          "version_id": "version_id"
        },
        "elements": [
          {
            "id": "id",
            "outputs": {
              "next": {
                "elementId": "elementId"
              }
            },
            "type": "start"
          }
        ],
        "gateway_id": "gateway_id",
        "modified_at": "2019-12-27T18:11:19.117Z",
        "name": "name",
        "version": {
          "active": "true",
          "created_at": "created_at",
          "data": "data",
          "version_id": "version_id"
        }
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "data": {
    "order_by": "order_by",
    "order_by_direction": "order_by_direction",
    "page": 0,
    "per_page": 0,
    "routes": [
      {
        "id": "id",
        "account_tag": "account_tag",
        "created_at": "2019-12-27T18:11:19.117Z",
        "deployment": {
          "created_at": "created_at",
          "deployment_id": "deployment_id",
          "version_id": "version_id"
        },
        "elements": [
          {
            "id": "id",
            "outputs": {
              "next": {
                "elementId": "elementId"
              }
            },
            "type": "start"
          }
        ],
        "gateway_id": "gateway_id",
        "modified_at": "2019-12-27T18:11:19.117Z",
        "name": "name",
        "version": {
          "active": "true",
          "created_at": "created_at",
          "data": "data",
          "version_id": "version_id"
        }
      }
    ]
  },
  "success": true
}