# AI Gateway ## List Gateways **get** `/accounts/{account_id}/ai-gateway/gateways` Lists all AI Gateway evaluator types configured for the account. ### Path Parameters - `account_id: string` ### Query Parameters - `page: optional number` - `per_page: optional number` - `search: optional string` Search by id ### Returns - `result: array of { id, cache_invalidate_on_update, cache_ttl, 21 more }` - `id: string` gateway id - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `created_at: string` - `modified_at: string` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `dlp: optional { action, enabled, profiles } or { enabled, policies }` - `{ action, enabled, profiles }` - `action: "BLOCK" or "FLAG"` - `"BLOCK"` - `"FLAG"` - `enabled: boolean` - `profiles: array of string` - `{ enabled, policies }` - `enabled: boolean` - `policies: array of { id, action, check, 2 more }` - `id: string` - `action: "FLAG" or "BLOCK"` - `"FLAG"` - `"BLOCK"` - `check: array of "REQUEST" or "RESPONSE"` - `"REQUEST"` - `"RESPONSE"` - `enabled: boolean` - `profiles: array of string` - `is_default: optional boolean` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `otel: optional array of { authorization, headers, url, content_type }` - `authorization: string` - `headers: map[string]` - `url: string` - `content_type: optional "json" or "protobuf"` - `"json"` - `"protobuf"` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `store_id: optional string` - `stripe: optional { authorization, usage_events }` - `authorization: string` - `usage_events: array of { payload }` - `payload: string` - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": [ { "id": "my-gateway", "cache_invalidate_on_update": true, "cache_ttl": 0, "collect_logs": true, "created_at": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z", "rate_limiting_interval": 0, "rate_limiting_limit": 0, "authentication": true, "dlp": { "action": "BLOCK", "enabled": true, "profiles": [ "string" ] }, "is_default": true, "log_management": 10000, "log_management_strategy": "STOP_INSERTING", "logpush": true, "logpush_public_key": "xxxxxxxxxxxxxxxx", "otel": [ { "authorization": "authorization", "headers": { "foo": "string" }, "url": "url", "content_type": "json" } ], "rate_limiting_technique": "fixed", "retry_backoff": "constant", "retry_delay": 0, "retry_max_attempts": 1, "store_id": "store_id", "stripe": { "authorization": "authorization", "usage_events": [ { "payload": "payload" } ] }, "workers_ai_billing_mode": "postpaid", "zdr": true } ], "success": true } ``` ## Fetch a Gateway **get** `/accounts/{account_id}/ai-gateway/gateways/{id}` Retrieves details for a specific AI Gateway dataset. ### Path Parameters - `account_id: string` - `id: string` gateway id ### Returns - `result: { id, cache_invalidate_on_update, cache_ttl, 21 more }` - `id: string` gateway id - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `created_at: string` - `modified_at: string` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `dlp: optional { action, enabled, profiles } or { enabled, policies }` - `{ action, enabled, profiles }` - `action: "BLOCK" or "FLAG"` - `"BLOCK"` - `"FLAG"` - `enabled: boolean` - `profiles: array of string` - `{ enabled, policies }` - `enabled: boolean` - `policies: array of { id, action, check, 2 more }` - `id: string` - `action: "FLAG" or "BLOCK"` - `"FLAG"` - `"BLOCK"` - `check: array of "REQUEST" or "RESPONSE"` - `"REQUEST"` - `"RESPONSE"` - `enabled: boolean` - `profiles: array of string` - `is_default: optional boolean` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `otel: optional array of { authorization, headers, url, content_type }` - `authorization: string` - `headers: map[string]` - `url: string` - `content_type: optional "json" or "protobuf"` - `"json"` - `"protobuf"` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `store_id: optional string` - `stripe: optional { authorization, usage_events }` - `authorization: string` - `usage_events: array of { payload }` - `payload: string` - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$ID \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": { "id": "my-gateway", "cache_invalidate_on_update": true, "cache_ttl": 0, "collect_logs": true, "created_at": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z", "rate_limiting_interval": 0, "rate_limiting_limit": 0, "authentication": true, "dlp": { "action": "BLOCK", "enabled": true, "profiles": [ "string" ] }, "is_default": true, "log_management": 10000, "log_management_strategy": "STOP_INSERTING", "logpush": true, "logpush_public_key": "xxxxxxxxxxxxxxxx", "otel": [ { "authorization": "authorization", "headers": { "foo": "string" }, "url": "url", "content_type": "json" } ], "rate_limiting_technique": "fixed", "retry_backoff": "constant", "retry_delay": 0, "retry_max_attempts": 1, "store_id": "store_id", "stripe": { "authorization": "authorization", "usage_events": [ { "payload": "payload" } ] }, "workers_ai_billing_mode": "postpaid", "zdr": true }, "success": true } ``` ## Create a new Gateway **post** `/accounts/{account_id}/ai-gateway/gateways` Creates a new AI Gateway. ### Path Parameters - `account_id: string` ### Body Parameters - `id: string` gateway id - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` ### Returns - `result: { id, cache_invalidate_on_update, cache_ttl, 21 more }` - `id: string` gateway id - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `created_at: string` - `modified_at: string` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `dlp: optional { action, enabled, profiles } or { enabled, policies }` - `{ action, enabled, profiles }` - `action: "BLOCK" or "FLAG"` - `"BLOCK"` - `"FLAG"` - `enabled: boolean` - `profiles: array of string` - `{ enabled, policies }` - `enabled: boolean` - `policies: array of { id, action, check, 2 more }` - `id: string` - `action: "FLAG" or "BLOCK"` - `"FLAG"` - `"BLOCK"` - `check: array of "REQUEST" or "RESPONSE"` - `"REQUEST"` - `"RESPONSE"` - `enabled: boolean` - `profiles: array of string` - `is_default: optional boolean` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `otel: optional array of { authorization, headers, url, content_type }` - `authorization: string` - `headers: map[string]` - `url: string` - `content_type: optional "json" or "protobuf"` - `"json"` - `"protobuf"` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `store_id: optional string` - `stripe: optional { authorization, usage_events }` - `authorization: string` - `usage_events: array of { payload }` - `payload: string` - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "id": "my-gateway", "cache_invalidate_on_update": true, "cache_ttl": 0, "collect_logs": true, "rate_limiting_interval": 0, "rate_limiting_limit": 0 }' ``` #### Response ```json { "result": { "id": "my-gateway", "cache_invalidate_on_update": true, "cache_ttl": 0, "collect_logs": true, "created_at": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z", "rate_limiting_interval": 0, "rate_limiting_limit": 0, "authentication": true, "dlp": { "action": "BLOCK", "enabled": true, "profiles": [ "string" ] }, "is_default": true, "log_management": 10000, "log_management_strategy": "STOP_INSERTING", "logpush": true, "logpush_public_key": "xxxxxxxxxxxxxxxx", "otel": [ { "authorization": "authorization", "headers": { "foo": "string" }, "url": "url", "content_type": "json" } ], "rate_limiting_technique": "fixed", "retry_backoff": "constant", "retry_delay": 0, "retry_max_attempts": 1, "store_id": "store_id", "stripe": { "authorization": "authorization", "usage_events": [ { "payload": "payload" } ] }, "workers_ai_billing_mode": "postpaid", "zdr": true }, "success": true } ``` ## Update a Gateway **put** `/accounts/{account_id}/ai-gateway/gateways/{id}` Updates an existing AI Gateway dataset. ### Path Parameters - `account_id: string` - `id: string` gateway id ### Body Parameters - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `dlp: optional { action, enabled, profiles } or { enabled, policies }` - `{ action, enabled, profiles }` - `action: "BLOCK" or "FLAG"` - `"BLOCK"` - `"FLAG"` - `enabled: boolean` - `profiles: array of string` - `{ enabled, policies }` - `enabled: boolean` - `policies: array of { id, action, check, 2 more }` - `id: string` - `action: "FLAG" or "BLOCK"` - `"FLAG"` - `"BLOCK"` - `check: array of "REQUEST" or "RESPONSE"` - `"REQUEST"` - `"RESPONSE"` - `enabled: boolean` - `profiles: array of string` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `otel: optional array of { authorization, headers, url, content_type }` - `authorization: string` - `headers: map[string]` - `url: string` - `content_type: optional "json" or "protobuf"` - `"json"` - `"protobuf"` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `store_id: optional string` - `stripe: optional { authorization, usage_events }` - `authorization: string` - `usage_events: array of { payload }` - `payload: string` - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` ### Returns - `result: { id, cache_invalidate_on_update, cache_ttl, 21 more }` - `id: string` gateway id - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `created_at: string` - `modified_at: string` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `dlp: optional { action, enabled, profiles } or { enabled, policies }` - `{ action, enabled, profiles }` - `action: "BLOCK" or "FLAG"` - `"BLOCK"` - `"FLAG"` - `enabled: boolean` - `profiles: array of string` - `{ enabled, policies }` - `enabled: boolean` - `policies: array of { id, action, check, 2 more }` - `id: string` - `action: "FLAG" or "BLOCK"` - `"FLAG"` - `"BLOCK"` - `check: array of "REQUEST" or "RESPONSE"` - `"REQUEST"` - `"RESPONSE"` - `enabled: boolean` - `profiles: array of string` - `is_default: optional boolean` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `otel: optional array of { authorization, headers, url, content_type }` - `authorization: string` - `headers: map[string]` - `url: string` - `content_type: optional "json" or "protobuf"` - `"json"` - `"protobuf"` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `store_id: optional string` - `stripe: optional { authorization, usage_events }` - `authorization: string` - `usage_events: array of { payload }` - `payload: string` - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$ID \ -X PUT \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "cache_invalidate_on_update": true, "cache_ttl": 0, "collect_logs": true, "rate_limiting_interval": 0, "rate_limiting_limit": 0 }' ``` #### Response ```json { "result": { "id": "my-gateway", "cache_invalidate_on_update": true, "cache_ttl": 0, "collect_logs": true, "created_at": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z", "rate_limiting_interval": 0, "rate_limiting_limit": 0, "authentication": true, "dlp": { "action": "BLOCK", "enabled": true, "profiles": [ "string" ] }, "is_default": true, "log_management": 10000, "log_management_strategy": "STOP_INSERTING", "logpush": true, "logpush_public_key": "xxxxxxxxxxxxxxxx", "otel": [ { "authorization": "authorization", "headers": { "foo": "string" }, "url": "url", "content_type": "json" } ], "rate_limiting_technique": "fixed", "retry_backoff": "constant", "retry_delay": 0, "retry_max_attempts": 1, "store_id": "store_id", "stripe": { "authorization": "authorization", "usage_events": [ { "payload": "payload" } ] }, "workers_ai_billing_mode": "postpaid", "zdr": true }, "success": true } ``` ## Delete a Gateway **delete** `/accounts/{account_id}/ai-gateway/gateways/{id}` Deletes an AI Gateway dataset. ### Path Parameters - `account_id: string` - `id: string` gateway id ### Returns - `result: { id, cache_invalidate_on_update, cache_ttl, 21 more }` - `id: string` gateway id - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `created_at: string` - `modified_at: string` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `dlp: optional { action, enabled, profiles } or { enabled, policies }` - `{ action, enabled, profiles }` - `action: "BLOCK" or "FLAG"` - `"BLOCK"` - `"FLAG"` - `enabled: boolean` - `profiles: array of string` - `{ enabled, policies }` - `enabled: boolean` - `policies: array of { id, action, check, 2 more }` - `id: string` - `action: "FLAG" or "BLOCK"` - `"FLAG"` - `"BLOCK"` - `check: array of "REQUEST" or "RESPONSE"` - `"REQUEST"` - `"RESPONSE"` - `enabled: boolean` - `profiles: array of string` - `is_default: optional boolean` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `otel: optional array of { authorization, headers, url, content_type }` - `authorization: string` - `headers: map[string]` - `url: string` - `content_type: optional "json" or "protobuf"` - `"json"` - `"protobuf"` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `store_id: optional string` - `stripe: optional { authorization, usage_events }` - `authorization: string` - `usage_events: array of { payload }` - `payload: string` - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$ID \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": { "id": "my-gateway", "cache_invalidate_on_update": true, "cache_ttl": 0, "collect_logs": true, "created_at": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z", "rate_limiting_interval": 0, "rate_limiting_limit": 0, "authentication": true, "dlp": { "action": "BLOCK", "enabled": true, "profiles": [ "string" ] }, "is_default": true, "log_management": 10000, "log_management_strategy": "STOP_INSERTING", "logpush": true, "logpush_public_key": "xxxxxxxxxxxxxxxx", "otel": [ { "authorization": "authorization", "headers": { "foo": "string" }, "url": "url", "content_type": "json" } ], "rate_limiting_technique": "fixed", "retry_backoff": "constant", "retry_delay": 0, "retry_max_attempts": 1, "store_id": "store_id", "stripe": { "authorization": "authorization", "usage_events": [ { "payload": "payload" } ] }, "workers_ai_billing_mode": "postpaid", "zdr": true }, "success": true } ``` ## Domain Types ### AI Gateway List Response - `AIGatewayListResponse { id, cache_invalidate_on_update, cache_ttl, 21 more }` - `id: string` gateway id - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `created_at: string` - `modified_at: string` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `dlp: optional { action, enabled, profiles } or { enabled, policies }` - `{ action, enabled, profiles }` - `action: "BLOCK" or "FLAG"` - `"BLOCK"` - `"FLAG"` - `enabled: boolean` - `profiles: array of string` - `{ enabled, policies }` - `enabled: boolean` - `policies: array of { id, action, check, 2 more }` - `id: string` - `action: "FLAG" or "BLOCK"` - `"FLAG"` - `"BLOCK"` - `check: array of "REQUEST" or "RESPONSE"` - `"REQUEST"` - `"RESPONSE"` - `enabled: boolean` - `profiles: array of string` - `is_default: optional boolean` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `otel: optional array of { authorization, headers, url, content_type }` - `authorization: string` - `headers: map[string]` - `url: string` - `content_type: optional "json" or "protobuf"` - `"json"` - `"protobuf"` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `store_id: optional string` - `stripe: optional { authorization, usage_events }` - `authorization: string` - `usage_events: array of { payload }` - `payload: string` - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` ### AI Gateway Get Response - `AIGatewayGetResponse { id, cache_invalidate_on_update, cache_ttl, 21 more }` - `id: string` gateway id - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `created_at: string` - `modified_at: string` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `dlp: optional { action, enabled, profiles } or { enabled, policies }` - `{ action, enabled, profiles }` - `action: "BLOCK" or "FLAG"` - `"BLOCK"` - `"FLAG"` - `enabled: boolean` - `profiles: array of string` - `{ enabled, policies }` - `enabled: boolean` - `policies: array of { id, action, check, 2 more }` - `id: string` - `action: "FLAG" or "BLOCK"` - `"FLAG"` - `"BLOCK"` - `check: array of "REQUEST" or "RESPONSE"` - `"REQUEST"` - `"RESPONSE"` - `enabled: boolean` - `profiles: array of string` - `is_default: optional boolean` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `otel: optional array of { authorization, headers, url, content_type }` - `authorization: string` - `headers: map[string]` - `url: string` - `content_type: optional "json" or "protobuf"` - `"json"` - `"protobuf"` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `store_id: optional string` - `stripe: optional { authorization, usage_events }` - `authorization: string` - `usage_events: array of { payload }` - `payload: string` - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` ### AI Gateway Create Response - `AIGatewayCreateResponse { id, cache_invalidate_on_update, cache_ttl, 21 more }` - `id: string` gateway id - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `created_at: string` - `modified_at: string` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `dlp: optional { action, enabled, profiles } or { enabled, policies }` - `{ action, enabled, profiles }` - `action: "BLOCK" or "FLAG"` - `"BLOCK"` - `"FLAG"` - `enabled: boolean` - `profiles: array of string` - `{ enabled, policies }` - `enabled: boolean` - `policies: array of { id, action, check, 2 more }` - `id: string` - `action: "FLAG" or "BLOCK"` - `"FLAG"` - `"BLOCK"` - `check: array of "REQUEST" or "RESPONSE"` - `"REQUEST"` - `"RESPONSE"` - `enabled: boolean` - `profiles: array of string` - `is_default: optional boolean` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `otel: optional array of { authorization, headers, url, content_type }` - `authorization: string` - `headers: map[string]` - `url: string` - `content_type: optional "json" or "protobuf"` - `"json"` - `"protobuf"` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `store_id: optional string` - `stripe: optional { authorization, usage_events }` - `authorization: string` - `usage_events: array of { payload }` - `payload: string` - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` ### AI Gateway Update Response - `AIGatewayUpdateResponse { id, cache_invalidate_on_update, cache_ttl, 21 more }` - `id: string` gateway id - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `created_at: string` - `modified_at: string` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `dlp: optional { action, enabled, profiles } or { enabled, policies }` - `{ action, enabled, profiles }` - `action: "BLOCK" or "FLAG"` - `"BLOCK"` - `"FLAG"` - `enabled: boolean` - `profiles: array of string` - `{ enabled, policies }` - `enabled: boolean` - `policies: array of { id, action, check, 2 more }` - `id: string` - `action: "FLAG" or "BLOCK"` - `"FLAG"` - `"BLOCK"` - `check: array of "REQUEST" or "RESPONSE"` - `"REQUEST"` - `"RESPONSE"` - `enabled: boolean` - `profiles: array of string` - `is_default: optional boolean` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `otel: optional array of { authorization, headers, url, content_type }` - `authorization: string` - `headers: map[string]` - `url: string` - `content_type: optional "json" or "protobuf"` - `"json"` - `"protobuf"` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `store_id: optional string` - `stripe: optional { authorization, usage_events }` - `authorization: string` - `usage_events: array of { payload }` - `payload: string` - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` ### AI Gateway Delete Response - `AIGatewayDeleteResponse { id, cache_invalidate_on_update, cache_ttl, 21 more }` - `id: string` gateway id - `cache_invalidate_on_update: boolean` - `cache_ttl: number` - `collect_logs: boolean` - `created_at: string` - `modified_at: string` - `rate_limiting_interval: number` - `rate_limiting_limit: number` - `authentication: optional boolean` - `dlp: optional { action, enabled, profiles } or { enabled, policies }` - `{ action, enabled, profiles }` - `action: "BLOCK" or "FLAG"` - `"BLOCK"` - `"FLAG"` - `enabled: boolean` - `profiles: array of string` - `{ enabled, policies }` - `enabled: boolean` - `policies: array of { id, action, check, 2 more }` - `id: string` - `action: "FLAG" or "BLOCK"` - `"FLAG"` - `"BLOCK"` - `check: array of "REQUEST" or "RESPONSE"` - `"REQUEST"` - `"RESPONSE"` - `enabled: boolean` - `profiles: array of string` - `is_default: optional boolean` - `log_management: optional number` - `log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"` - `"STOP_INSERTING"` - `"DELETE_OLDEST"` - `logpush: optional boolean` - `logpush_public_key: optional string` - `otel: optional array of { authorization, headers, url, content_type }` - `authorization: string` - `headers: map[string]` - `url: string` - `content_type: optional "json" or "protobuf"` - `"json"` - `"protobuf"` - `rate_limiting_technique: optional "fixed" or "sliding"` - `"fixed"` - `"sliding"` - `retry_backoff: optional "constant" or "linear" or "exponential"` Backoff strategy for retry delays - `"constant"` - `"linear"` - `"exponential"` - `retry_delay: optional number` Delay between retry attempts in milliseconds (0-5000) - `retry_max_attempts: optional number` Maximum number of retry attempts for failed requests (1-5) - `store_id: optional string` - `stripe: optional { authorization, usage_events }` - `authorization: string` - `usage_events: array of { payload }` - `payload: string` - `workers_ai_billing_mode: optional "postpaid"` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `"postpaid"` - `zdr: optional boolean` # Evaluation Types ## List Evaluators **get** `/accounts/{account_id}/ai-gateway/evaluation-types` List Evaluators ### Path Parameters - `account_id: string` ### Query Parameters - `order_by: optional string` - `order_by_direction: optional "asc" or "desc"` - `"asc"` - `"desc"` - `page: optional number` - `per_page: optional number` ### Returns - `result: array of { id, created_at, description, 5 more }` - `id: string` - `created_at: string` - `description: string` - `enable: boolean` - `mandatory: boolean` - `modified_at: string` - `name: string` - `type: string` - `result_info: { count, page, per_page, total_count }` - `count: number` - `page: number` - `per_page: number` - `total_count: number` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/evaluation-types \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "description": "description", "enable": true, "mandatory": true, "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "type": "type" } ], "result_info": { "count": 0, "page": 0, "per_page": 0, "total_count": 0 }, "success": true } ``` ## Domain Types ### Evaluation Type List Response - `EvaluationTypeListResponse { id, created_at, description, 5 more }` - `id: string` - `created_at: string` - `description: string` - `enable: boolean` - `mandatory: boolean` - `modified_at: string` - `name: string` - `type: string` # Logs ## List Gateway Logs **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs` List Gateway Logs ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id ### Query Parameters - `cached: optional boolean` - `direction: optional "asc" or "desc"` - `"asc"` - `"desc"` - `end_date: optional string` - `feedback: optional 0 or 1` - `0` - `1` - `filters: optional array of { key, operator, value }` - `key: "id" or "created_at" or "request_content_type" or 20 more` - `"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` - `"eq"` - `"neq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `max_cost: optional number` - `max_duration: optional number` - `max_tokens_in: optional number` - `max_tokens_out: optional number` - `max_total_tokens: optional number` - `meta_info: optional boolean` - `min_cost: optional number` - `min_duration: optional number` - `min_tokens_in: optional number` - `min_tokens_out: optional number` - `min_total_tokens: optional number` - `model: optional string` - `model_type: optional string` - `order_by: optional "created_at" or "provider" or "model" or 3 more` - `"created_at"` - `"provider"` - `"model"` - `"model_type"` - `"success"` - `"cached"` - `order_by_direction: optional "asc" or "desc"` - `"asc"` - `"desc"` - `page: optional number` - `per_page: optional number` - `provider: optional string` - `request_content_type: optional string` - `response_content_type: optional string` - `search: optional string` - `start_date: optional string` - `success: optional boolean` ### Returns - `result: array of { id, cached, created_at, 16 more }` - `id: string` - `cached: boolean` - `created_at: string` - `duration: number` - `model: string` - `path: string` - `provider: string` - `success: boolean` - `tokens_in: number` - `tokens_out: number` - `cost: optional number` - `custom_cost: optional boolean` - `metadata: optional string` - `model_type: optional string` - `request_content_type: optional string` - `request_type: optional string` - `response_content_type: optional string` - `status_code: optional number` - `step: optional number` - `result_info: { count, max_cost, max_duration, 11 more }` - `count: optional number` - `max_cost: optional number` - `max_duration: optional number` - `max_tokens_in: optional number` - `max_tokens_out: optional number` - `max_total_tokens: optional number` - `min_cost: optional number` - `min_duration: optional number` - `min_tokens_in: optional number` - `min_tokens_out: optional number` - `min_total_tokens: optional number` - `page: optional number` - `per_page: optional number` - `total_count: optional number` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/logs \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": [ { "id": "id", "cached": true, "created_at": "2019-12-27T18:11:19.117Z", "duration": 0, "model": "model", "path": "path", "provider": "provider", "success": true, "tokens_in": 0, "tokens_out": 0, "cost": 0, "custom_cost": true, "metadata": "metadata", "model_type": "model_type", "request_content_type": "request_content_type", "request_type": "request_type", "response_content_type": "response_content_type", "status_code": 0, "step": 0 } ], "result_info": { "count": 0, "max_cost": 0, "max_duration": 0, "max_tokens_in": 0, "max_tokens_out": 0, "max_total_tokens": 0, "min_cost": 0, "min_duration": 0, "min_tokens_in": 0, "min_tokens_out": 0, "min_total_tokens": 0, "page": 0, "per_page": 0, "total_count": 0 }, "success": true } ``` ## Get Gateway Log Detail **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}` Retrieves detailed information for a specific AI Gateway log entry. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id - `id: string` ### Returns - `result: { id, cached, created_at, 22 more }` - `id: string` - `cached: boolean` - `created_at: string` - `duration: number` - `model: string` - `path: string` - `provider: string` - `success: boolean` - `tokens_in: number` - `tokens_out: number` - `cost: optional number` - `custom_cost: optional boolean` - `metadata: optional string` - `model_type: optional string` - `request_content_type: optional string` - `request_head: optional string` - `request_head_complete: optional boolean` - `request_size: optional number` - `request_type: optional string` - `response_content_type: optional string` - `response_head: optional string` - `response_head_complete: optional boolean` - `response_size: optional number` - `status_code: optional number` - `step: optional number` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/logs/$ID \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": { "id": "id", "cached": true, "created_at": "2019-12-27T18:11:19.117Z", "duration": 0, "model": "model", "path": "path", "provider": "provider", "success": true, "tokens_in": 0, "tokens_out": 0, "cost": 0, "custom_cost": true, "metadata": "metadata", "model_type": "model_type", "request_content_type": "request_content_type", "request_head": "request_head", "request_head_complete": true, "request_size": 0, "request_type": "request_type", "response_content_type": "response_content_type", "response_head": "response_head", "response_head_complete": true, "response_size": 0, "status_code": 0, "step": 0 }, "success": true } ``` ## Patch Gateway Log **patch** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}` Updates metadata for an AI Gateway log entry. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id - `id: string` ### Body Parameters - `feedback: optional number` - `metadata: optional map[string or number or boolean]` - `string` - `number` - `boolean` - `score: optional number` ### Returns - `result: unknown` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/logs/$ID \ -X PATCH \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": {}, "success": true } ``` ## Delete Gateway Logs **delete** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs` Delete Gateway Logs ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id ### Query Parameters - `filters: optional array of { key, operator, value }` - `key: "id" or "created_at" or "request_content_type" or 20 more` - `"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` - `"eq"` - `"neq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `limit: optional number` - `order_by: optional "created_at" or "provider" or "model" or 8 more` - `"created_at"` - `"provider"` - `"model"` - `"model_type"` - `"success"` - `"cached"` - `"cost"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `order_by_direction: optional "asc" or "desc"` - `"asc"` - `"desc"` ### Returns - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/logs \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "success": true } ``` ## Get Gateway Log Request **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/request` Retrieves the original request payload for an AI Gateway log entry. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id - `id: string` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/logs/$ID/request \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json {} ``` ## Get Gateway Log Response **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/response` Retrieves the response payload for an AI Gateway log entry. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id - `id: string` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/logs/$ID/response \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json {} ``` ## Domain Types ### Log List Response - `LogListResponse { id, cached, created_at, 16 more }` - `id: string` - `cached: boolean` - `created_at: string` - `duration: number` - `model: string` - `path: string` - `provider: string` - `success: boolean` - `tokens_in: number` - `tokens_out: number` - `cost: optional number` - `custom_cost: optional boolean` - `metadata: optional string` - `model_type: optional string` - `request_content_type: optional string` - `request_type: optional string` - `response_content_type: optional string` - `status_code: optional number` - `step: optional number` ### Log Get Response - `LogGetResponse { id, cached, created_at, 22 more }` - `id: string` - `cached: boolean` - `created_at: string` - `duration: number` - `model: string` - `path: string` - `provider: string` - `success: boolean` - `tokens_in: number` - `tokens_out: number` - `cost: optional number` - `custom_cost: optional boolean` - `metadata: optional string` - `model_type: optional string` - `request_content_type: optional string` - `request_head: optional string` - `request_head_complete: optional boolean` - `request_size: optional number` - `request_type: optional string` - `response_content_type: optional string` - `response_head: optional string` - `response_head_complete: optional boolean` - `response_size: optional number` - `status_code: optional number` - `step: optional number` ### Log Edit Response - `LogEditResponse = unknown` ### Log Delete Response - `LogDeleteResponse { success }` - `success: boolean` ### Log Request Response - `LogRequestResponse = unknown` ### Log Response Response - `LogResponseResponse = unknown` # Datasets ## List Datasets **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets` Lists all AI Gateway evaluator types configured for the account. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id ### Query Parameters - `enable: optional boolean` - `name: optional string` - `page: optional number` - `per_page: optional number` - `search: optional string` Search by id, name, filters ### Returns - `result: array of { id, created_at, enable, 4 more }` - `id: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/datasets \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" } ], "success": true } ``` ## Fetch a Dataset **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}` Retrieves details for a specific AI Gateway dataset. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id - `id: string` ### Returns - `result: { id, created_at, enable, 4 more }` - `id: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/datasets/$ID \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" }, "success": true } ``` ## Create a new Dataset **post** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets` Creates a new AI Gateway. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id ### Body Parameters - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `name: string` ### Returns - `result: { id, created_at, enable, 4 more }` - `id: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/datasets \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "name": "name" }' ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" }, "success": true } ``` ## Update a Dataset **put** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}` Updates an existing AI Gateway dataset. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id - `id: string` ### Body Parameters - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `name: string` ### Returns - `result: { id, created_at, enable, 4 more }` - `id: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/datasets/$ID \ -X PUT \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "name": "name" }' ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" }, "success": true } ``` ## Delete a Dataset **delete** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}` Deletes an AI Gateway dataset. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id - `id: string` ### Returns - `result: { id, created_at, enable, 4 more }` - `id: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/datasets/$ID \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" }, "success": true } ``` ## Domain Types ### Dataset List Response - `DatasetListResponse { id, created_at, enable, 4 more }` - `id: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` ### Dataset Get Response - `DatasetGetResponse { id, created_at, enable, 4 more }` - `id: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` ### Dataset Create Response - `DatasetCreateResponse { id, created_at, enable, 4 more }` - `id: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` ### Dataset Update Response - `DatasetUpdateResponse { id, created_at, enable, 4 more }` - `id: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` ### Dataset Delete Response - `DatasetDeleteResponse { id, created_at, enable, 4 more }` - `id: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` # Evaluations ## List Evaluations **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations` Lists all AI Gateway evaluator types configured for the account. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id ### Query Parameters - `name: optional string` - `page: optional number` - `per_page: optional number` - `processed: optional boolean` - `search: optional string` Search by id, name ### Returns - `result: array of { id, created_at, datasets, 6 more }` - `id: string` - `created_at: string` - `datasets: array of { id, account_id, account_tag, 6 more }` - `id: string` - `account_id: string` - `account_tag: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `processed: boolean` - `results: array of { id, created_at, evaluation_id, 6 more }` - `id: string` - `created_at: string` - `evaluation_id: string` - `evaluation_type_id: string` - `modified_at: string` - `result: string` - `status: number` - `status_description: string` - `total_logs: number` - `total_logs: number` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/evaluations \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "datasets": [ { "id": "id", "account_id": "account_id", "account_tag": "account_tag", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "processed": true, "results": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "evaluation_id": "evaluation_id", "evaluation_type_id": "evaluation_type_id", "modified_at": "2019-12-27T18:11:19.117Z", "result": "result", "status": 0, "status_description": "status_description", "total_logs": 0 } ], "total_logs": 0 } ], "success": true } ``` ## Fetch a Evaluation **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}` Retrieves details for a specific AI Gateway dataset. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id - `id: string` ### Returns - `result: { id, created_at, datasets, 6 more }` - `id: string` - `created_at: string` - `datasets: array of { id, account_id, account_tag, 6 more }` - `id: string` - `account_id: string` - `account_tag: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `processed: boolean` - `results: array of { id, created_at, evaluation_id, 6 more }` - `id: string` - `created_at: string` - `evaluation_id: string` - `evaluation_type_id: string` - `modified_at: string` - `result: string` - `status: number` - `status_description: string` - `total_logs: number` - `total_logs: number` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/evaluations/$ID \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "datasets": [ { "id": "id", "account_id": "account_id", "account_tag": "account_tag", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "processed": true, "results": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "evaluation_id": "evaluation_id", "evaluation_type_id": "evaluation_type_id", "modified_at": "2019-12-27T18:11:19.117Z", "result": "result", "status": 0, "status_description": "status_description", "total_logs": 0 } ], "total_logs": 0 }, "success": true } ``` ## Create a new Evaluation **post** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations` Creates a new AI Gateway. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id ### Body Parameters - `dataset_ids: array of string` - `evaluation_type_ids: array of string` - `name: string` ### Returns - `result: { id, created_at, datasets, 6 more }` - `id: string` - `created_at: string` - `datasets: array of { id, account_id, account_tag, 6 more }` - `id: string` - `account_id: string` - `account_tag: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `processed: boolean` - `results: array of { id, created_at, evaluation_id, 6 more }` - `id: string` - `created_at: string` - `evaluation_id: string` - `evaluation_type_id: string` - `modified_at: string` - `result: string` - `status: number` - `status_description: string` - `total_logs: number` - `total_logs: number` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/evaluations \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "dataset_ids": [ "string" ], "evaluation_type_ids": [ "string" ], "name": "name" }' ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "datasets": [ { "id": "id", "account_id": "account_id", "account_tag": "account_tag", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "processed": true, "results": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "evaluation_id": "evaluation_id", "evaluation_type_id": "evaluation_type_id", "modified_at": "2019-12-27T18:11:19.117Z", "result": "result", "status": 0, "status_description": "status_description", "total_logs": 0 } ], "total_logs": 0 }, "success": true } ``` ## Delete a Evaluation **delete** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}` Deletes an AI Gateway dataset. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id - `id: string` ### Returns - `result: { id, created_at, datasets, 6 more }` - `id: string` - `created_at: string` - `datasets: array of { id, account_id, account_tag, 6 more }` - `id: string` - `account_id: string` - `account_tag: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `processed: boolean` - `results: array of { id, created_at, evaluation_id, 6 more }` - `id: string` - `created_at: string` - `evaluation_id: string` - `evaluation_type_id: string` - `modified_at: string` - `result: string` - `status: number` - `status_description: string` - `total_logs: number` - `total_logs: number` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/evaluations/$ID \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "datasets": [ { "id": "id", "account_id": "account_id", "account_tag": "account_tag", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "processed": true, "results": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "evaluation_id": "evaluation_id", "evaluation_type_id": "evaluation_type_id", "modified_at": "2019-12-27T18:11:19.117Z", "result": "result", "status": 0, "status_description": "status_description", "total_logs": 0 } ], "total_logs": 0 }, "success": true } ``` ## Domain Types ### Evaluation List Response - `EvaluationListResponse { id, created_at, datasets, 6 more }` - `id: string` - `created_at: string` - `datasets: array of { id, account_id, account_tag, 6 more }` - `id: string` - `account_id: string` - `account_tag: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `processed: boolean` - `results: array of { id, created_at, evaluation_id, 6 more }` - `id: string` - `created_at: string` - `evaluation_id: string` - `evaluation_type_id: string` - `modified_at: string` - `result: string` - `status: number` - `status_description: string` - `total_logs: number` - `total_logs: number` ### Evaluation Get Response - `EvaluationGetResponse { id, created_at, datasets, 6 more }` - `id: string` - `created_at: string` - `datasets: array of { id, account_id, account_tag, 6 more }` - `id: string` - `account_id: string` - `account_tag: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `processed: boolean` - `results: array of { id, created_at, evaluation_id, 6 more }` - `id: string` - `created_at: string` - `evaluation_id: string` - `evaluation_type_id: string` - `modified_at: string` - `result: string` - `status: number` - `status_description: string` - `total_logs: number` - `total_logs: number` ### Evaluation Create Response - `EvaluationCreateResponse { id, created_at, datasets, 6 more }` - `id: string` - `created_at: string` - `datasets: array of { id, account_id, account_tag, 6 more }` - `id: string` - `account_id: string` - `account_tag: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `processed: boolean` - `results: array of { id, created_at, evaluation_id, 6 more }` - `id: string` - `created_at: string` - `evaluation_id: string` - `evaluation_type_id: string` - `modified_at: string` - `result: string` - `status: number` - `status_description: string` - `total_logs: number` - `total_logs: number` ### Evaluation Delete Response - `EvaluationDeleteResponse { id, created_at, datasets, 6 more }` - `id: string` - `created_at: string` - `datasets: array of { id, account_id, account_tag, 6 more }` - `id: string` - `account_id: string` - `account_tag: string` - `created_at: string` - `enable: boolean` - `filters: array of { key, operator, value }` - `key: "created_at" or "request_content_type" or "response_content_type" or 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" or "contains" or "lt" or "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: array of string or number or boolean` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` - `processed: boolean` - `results: array of { id, created_at, evaluation_id, 6 more }` - `id: string` - `created_at: string` - `evaluation_id: string` - `evaluation_type_id: string` - `modified_at: string` - `result: string` - `status: number` - `status_description: string` - `total_logs: number` - `total_logs: number` # Dynamic Routing ## List all AI Gateway Dynamic Routes. **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes` List all AI Gateway Dynamic Routes. ### Path Parameters - `account_id: string` - `gateway_id: string` ### Returns - `data: { order_by, order_by_direction, page, 2 more }` - `order_by: string` - `order_by_direction: string` - `page: number` - `per_page: number` - `routes: array of { id, account_tag, created_at, 6 more }` - `id: string` - `account_tag: string` - `created_at: string` - `deployment: { created_at, deployment_id, version_id }` - `created_at: string` - `deployment_id: string` - `version_id: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `version: { active, created_at, data, version_id }` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `version_id: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/routes \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "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 } ``` ## Get an AI Gateway Dynamic Route. **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}` Get an AI Gateway Dynamic Route. ### Path Parameters - `account_id: string` - `gateway_id: string` - `id: string` ### Returns - `result: { id, created_at, deployment, 5 more }` - `id: string` - `created_at: string` - `deployment: { created_at, deployment_id, version_id }` - `created_at: string` - `deployment_id: string` - `version_id: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `version: { active, created_at, data, version_id }` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `version_id: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/routes/$ID \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": { "id": "id", "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 } ``` ## Create a new AI Gateway Dynamic Route. **post** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes` Create a new AI Gateway Dynamic Route. ### Path Parameters - `account_id: string` - `gateway_id: string` ### Body Parameters - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `name: string` ### Returns - `result: { id, created_at, deployment, 5 more }` - `id: string` - `created_at: string` - `deployment: { created_at, deployment_id, version_id }` - `created_at: string` - `deployment_id: string` - `version_id: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `version: { active, created_at, data, version_id }` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `version_id: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/routes \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "elements": [ { "id": "id", "outputs": { "next": { "elementId": "elementId" } }, "type": "start" } ], "name": "name" }' ``` #### Response ```json { "result": { "id": "id", "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 } ``` ## Update an AI Gateway Dynamic Route. **patch** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}` Update an AI Gateway Dynamic Route. ### Path Parameters - `account_id: string` - `gateway_id: string` - `id: string` ### Body Parameters - `name: string` ### Returns - `route: { id, account_tag, created_at, 6 more }` - `id: string` - `account_tag: string` - `created_at: string` - `deployment: { created_at, deployment_id, version_id }` - `created_at: string` - `deployment_id: string` - `version_id: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `version: { active, created_at, data, version_id }` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `version_id: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/routes/$ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "name": "Route Name" }' ``` #### Response ```json { "route": { "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 } ``` ## Delete an AI Gateway Dynamic Route. **delete** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}` Delete an AI Gateway Dynamic Route. ### Path Parameters - `account_id: string` - `gateway_id: string` - `id: string` ### Returns - `result: { id, created_at, elements, 3 more }` - `id: string` - `created_at: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `success: boolean` ### Example ```http 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" ``` #### Response ```json { "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 } ``` ## List all AI Gateway Dynamic Route Deployments. **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments` List all AI Gateway Dynamic Route Deployments. ### Path Parameters - `account_id: string` - `gateway_id: string` - `id: string` ### Returns - `data: { deployments, order_by, order_by_direction, 2 more }` - `deployments: array of { created_at, deployment_id, version_id }` - `created_at: string` - `deployment_id: string` - `version_id: string` - `order_by: string` - `order_by_direction: string` - `page: number` - `per_page: number` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/routes/$ID/deployments \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "data": { "deployments": [ { "created_at": "created_at", "deployment_id": "deployment_id", "version_id": "version_id" } ], "order_by": "order_by", "order_by_direction": "order_by_direction", "page": 0, "per_page": 0 }, "success": true } ``` ## Create a new AI Gateway Dynamic Route Deployment. **post** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments` Create a new AI Gateway Dynamic Route Deployment. ### Path Parameters - `account_id: string` - `gateway_id: string` - `id: string` ### Body Parameters - `version_id: string` ### Returns - `result: { id, created_at, elements, 3 more }` - `id: string` - `created_at: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/routes/$ID/deployments \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "version_id": "54442216" }' ``` #### Response ```json { "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 } ``` ## List all AI Gateway Dynamic Route Versions. **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions` List all AI Gateway Dynamic Route Versions. ### Path Parameters - `account_id: string` - `gateway_id: string` - `id: string` ### Returns - `data: { order_by, order_by_direction, page, 2 more }` - `order_by: string` - `order_by_direction: string` - `page: number` - `per_page: number` - `versions: array of { active, created_at, data, version_id }` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `version_id: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/routes/$ID/versions \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "data": { "order_by": "order_by", "order_by_direction": "order_by_direction", "page": 0, "per_page": 0, "versions": [ { "active": "true", "created_at": "created_at", "data": "data", "version_id": "version_id" } ] }, "success": true } ``` ## Create a new AI Gateway Dynamic Route Version. **post** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions` Create a new AI Gateway Dynamic Route Version. ### Path Parameters - `account_id: string` - `gateway_id: string` - `id: string` ### Body Parameters - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` ### Returns - `result: { id, created_at, elements, 3 more }` - `id: string` - `created_at: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/routes/$ID/versions \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "elements": [ { "id": "id", "outputs": { "next": { "elementId": "elementId" } }, "type": "start" } ] }' ``` #### Response ```json { "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 } ``` ## Get an AI Gateway Dynamic Route Version. **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions/{version_id}` Get an AI Gateway Dynamic Route Version. ### Path Parameters - `account_id: string` - `gateway_id: string` - `id: string` - `version_id: string` ### Returns - `result: { id, active, created_at, 6 more }` - `id: string` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `version_id: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/routes/$ID/versions/$VERSION_ID \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": { "id": "id", "active": "true", "created_at": "created_at", "data": "data", "elements": [ { "id": "id", "outputs": { "next": { "elementId": "elementId" } }, "type": "start" } ], "gateway_id": "gateway_id", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "version_id": "version_id" }, "success": true } ``` ## Domain Types ### Dynamic Routing List Response - `DynamicRoutingListResponse { data, success }` - `data: { order_by, order_by_direction, page, 2 more }` - `order_by: string` - `order_by_direction: string` - `page: number` - `per_page: number` - `routes: array of { id, account_tag, created_at, 6 more }` - `id: string` - `account_tag: string` - `created_at: string` - `deployment: { created_at, deployment_id, version_id }` - `created_at: string` - `deployment_id: string` - `version_id: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `version: { active, created_at, data, version_id }` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `version_id: string` - `success: boolean` ### Dynamic Routing Get Response - `DynamicRoutingGetResponse { id, created_at, deployment, 5 more }` - `id: string` - `created_at: string` - `deployment: { created_at, deployment_id, version_id }` - `created_at: string` - `deployment_id: string` - `version_id: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `version: { active, created_at, data, version_id }` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `version_id: string` ### Dynamic Routing Create Response - `DynamicRoutingCreateResponse { id, created_at, deployment, 5 more }` - `id: string` - `created_at: string` - `deployment: { created_at, deployment_id, version_id }` - `created_at: string` - `deployment_id: string` - `version_id: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `version: { active, created_at, data, version_id }` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `version_id: string` ### Dynamic Routing Update Response - `DynamicRoutingUpdateResponse { route, success }` - `route: { id, account_tag, created_at, 6 more }` - `id: string` - `account_tag: string` - `created_at: string` - `deployment: { created_at, deployment_id, version_id }` - `created_at: string` - `deployment_id: string` - `version_id: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `version: { active, created_at, data, version_id }` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `version_id: string` - `success: boolean` ### Dynamic Routing Delete Response - `DynamicRoutingDeleteResponse { id, created_at, elements, 3 more }` - `id: string` - `created_at: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` ### Dynamic Routing List Deployments Response - `DynamicRoutingListDeploymentsResponse { data, success }` - `data: { deployments, order_by, order_by_direction, 2 more }` - `deployments: array of { created_at, deployment_id, version_id }` - `created_at: string` - `deployment_id: string` - `version_id: string` - `order_by: string` - `order_by_direction: string` - `page: number` - `per_page: number` - `success: boolean` ### Dynamic Routing Create Deployment Response - `DynamicRoutingCreateDeploymentResponse { id, created_at, elements, 3 more }` - `id: string` - `created_at: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` ### Dynamic Routing List Versions Response - `DynamicRoutingListVersionsResponse { data, success }` - `data: { order_by, order_by_direction, page, 2 more }` - `order_by: string` - `order_by_direction: string` - `page: number` - `per_page: number` - `versions: array of { active, created_at, data, version_id }` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `version_id: string` - `success: boolean` ### Dynamic Routing Create Version Response - `DynamicRoutingCreateVersionResponse { id, created_at, elements, 3 more }` - `id: string` - `created_at: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` ### Dynamic Routing Get Version Response - `DynamicRoutingGetVersionResponse { id, active, created_at, 6 more }` - `id: string` - `active: "true" or "false"` - `"true"` - `"false"` - `created_at: string` - `data: string` - `elements: array of { id, outputs, type } or { id, outputs, properties, type } or { id, outputs, type } or 3 more` - `{ id, outputs, type }` - `id: string` - `outputs: { next }` - `next: { elementId }` - `elementId: string` - `type: "start"` - `"start"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { false, true }` - `false: { elementId }` - `elementId: string` - `true: { elementId }` - `elementId: string` - `properties: { conditions }` - `conditions: optional unknown` - `type: "conditional"` - `"conditional"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "percentage"` - `"percentage"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { key, limit, limitType, window }` - `key: string` - `limit: number` - `limitType: "count" or "cost"` - `"count"` - `"cost"` - `window: number` - `type: "rate"` - `"rate"` - `{ id, outputs, properties, type }` - `id: string` - `outputs: { fallback, success }` - `fallback: { elementId }` - `elementId: string` - `success: { elementId }` - `elementId: string` - `properties: { model, provider, retries, timeout }` - `model: string` - `provider: string` - `retries: number` - `timeout: number` - `type: "model"` - `"model"` - `{ id, outputs, type }` - `id: string` - `outputs: map[ { elementId } ]` - `elementId: string` - `type: "end"` - `"end"` - `gateway_id: string` - `modified_at: string` - `name: string` - `version_id: string` # Provider Configs ## List Provider Configs **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs` Lists all AI Gateway evaluator types configured for the account. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id ### Query Parameters - `page: optional number` - `per_page: optional number` ### Returns - `result: array of { id, alias, default_config, 7 more }` - `id: string` - `alias: string` - `default_config: boolean` - `gateway_id: string` gateway id - `modified_at: string` - `provider_slug: string` - `secret_id: string` - `secret_preview: string` - `rate_limit: optional number` - `rate_limit_period: optional number` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/provider_configs \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": [ { "id": "id", "alias": "alias", "default_config": true, "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "provider_slug": "provider_slug", "secret_id": "secret_id", "secret_preview": "secret_preview", "rate_limit": 0, "rate_limit_period": 0 } ], "success": true } ``` ## Create a new Provider Configs **post** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs` Creates a new AI Gateway. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id ### Body Parameters - `alias: string` - `default_config: boolean` - `provider_slug: string` - `secret: string` - `secret_id: string` - `rate_limit: optional number` - `rate_limit_period: optional number` ### Returns - `result: { id, alias, default_config, 7 more }` - `id: string` - `alias: string` - `default_config: boolean` - `gateway_id: string` gateway id - `modified_at: string` - `provider_slug: string` - `secret_id: string` - `secret_preview: string` - `rate_limit: optional number` - `rate_limit_period: optional number` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/provider_configs \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "alias": "alias", "default_config": true, "provider_slug": "provider_slug", "secret": "secret", "secret_id": "secret_id" }' ``` #### Response ```json { "result": { "id": "id", "alias": "alias", "default_config": true, "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "provider_slug": "provider_slug", "secret_id": "secret_id", "secret_preview": "secret_preview", "rate_limit": 0, "rate_limit_period": 0 }, "success": true } ``` ## Domain Types ### Provider Config List Response - `ProviderConfigListResponse { id, alias, default_config, 7 more }` - `id: string` - `alias: string` - `default_config: boolean` - `gateway_id: string` gateway id - `modified_at: string` - `provider_slug: string` - `secret_id: string` - `secret_preview: string` - `rate_limit: optional number` - `rate_limit_period: optional number` ### Provider Config Create Response - `ProviderConfigCreateResponse { id, alias, default_config, 7 more }` - `id: string` - `alias: string` - `default_config: boolean` - `gateway_id: string` gateway id - `modified_at: string` - `provider_slug: string` - `secret_id: string` - `secret_preview: string` - `rate_limit: optional number` - `rate_limit_period: optional number` # URLs ## Get Gateway URL **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/url/{provider}` Retrieves the endpoint URL for an AI Gateway. ### Path Parameters - `account_id: string` - `gateway_id: string` gateway id - `provider: string` ### Returns - `result: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-gateway/gateways/$GATEWAY_ID/url/$PROVIDER \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": "result", "success": true } ``` ## Domain Types ### URL Get Response - `URLGetResponse = string`