Inside Cloudflare's AI Gateway API

Inside Cloudflare's AI Gateway API

The Cloudflare AI Gateway API gives you visibility and control over AI applications — analytics, logging, caching, rate limiting, request retries, model fallback, guardrails, and evaluations — sitting between your app and the models it calls. It supports 23+ AI providers, including OpenAI, Anthropic, Google AI Studio, Google Vertex AI, Mistral, Cohere, Groq, DeepSeek, xAI, Amazon Bedrock, Azure OpenAI, and Workers AI, through a unified interface. It is one of 54 APIs that Cloudflare publishes on the APIs.io network, described by a machine-readable OpenAPI specification and served from https://api.cloudflare.com.

What it ships

The published artifact set is compact and honest about scope. On APIs.io the API arrives with four properties: an OpenAPI specification, API documentation, an API reference, and a getting-started guide. Tagged areas are Artificial Intelligence, Gateway, and Observability — which is exactly the right framing for what this is.

The OpenAPI itself is organized around two tags, Gateways and Logs, and a small, clean set of operations:

  • listAiGateways / createAiGateway — enumerate and provision gateway instances.
  • getAiGateway / updateAiGateway / deleteAiGateway — read and manage a single gateway’s configuration.
  • listAiGatewayLogs — pull request logs for a gateway with pagination and search.

Each gateway instance carries the controls that matter for running AI in production: cache_enabled and cache_ttl, rate_limiting_enabled with a limit and interval, and log_enabled. Auth is a bearer token scoped to AI Gateway permissions.

One sharp observation

This is a control-plane API, not an inference API. The endpoints do not generate completions — they create, configure, and observe the gateways that your inference traffic flows through. The gateway is where the caching, fallback, and rate-limiting policy lives; your actual model calls run through that gateway to any of the 23+ supported providers. Cloudflare’s own description notes a unified REST endpoint launched to call any model through a single path, but the API surface indexed here is the management layer: define the guardrails once, route many models through them, and read the logs back out. That separation is what earns it the Observability tag alongside AI and Gateway.

Takeaway

If you are standing up an AI stack and want a single choke point for caching, cost control, and audit across a dozen model vendors, the AI Gateway API is the piece that provisions and governs it. Read the full details at the Cloudflare AI Gateway documentation, and see where it sits among the rest of Cloudflare’s surface on the Cloudflare provider page.

← We Ran OWASP API Security Checks on Our Own API
Profiling ServiceNow: 57 APIs and the Enterprise Workflow Platform →