One endpoint for every model
Apps send OpenAI-format requests with a model alias. Change the model behind an alias once, and every app follows.
Fallback when a provider fails
Each alias lists its models in order. When a call errors or times out, the gateway moves to the next one.
Provider keys stay server-side
Provider keys live in secret environment variables. Each team gets its own gateway key, stored only as a SHA-256 hash.
Abuse blocked before it costs tokens
Firewall applies WAF, rate limits, and DDoS Protection before requests reach the gateway, so blocked traffic never reaches a model.
Repeated prompts served from cache
Callers opt in per request. A matching prompt gets a stored response, with no model call and no tokens spent.
Every call on the record
Each call logs the team, model, fallback, cache result, and tokens used. Stream the logs to your SIEM or data warehouse.
Every AI request through one control point
Chatbots, AI agents, and coding agents call one endpoint. Firewall stops abuse, then a function checks the key, routes the call, and logs it.
Use cases
The shortest path to a production AI gateway
Keep the OpenAI SDK you already use. Point it at your gateway and send a model alias. The gateway handles keys, routing, fallback, and logs.
Azion transformed our operations, reducing costs and improving performance while freeing 200+ monthly hours for strategic development.All the development primitives you need
Frequently Asked Questions
What is AI Gateway?
AI Gateway is one endpoint between your applications and the AI models they call, built on the Azion Web Platform. It authenticates each team, picks a model by policy, falls back when a call fails, caches responses the caller allows, and writes a usage and audit log line for every call. It runs as a function on Azion's distributed infrastructure, behind Firewall.
What is AI Gateway built with?
Functions runs the gateway logic on an application, and AI Inference runs the models hosted on Azion. Firewall applies WAF, rate limits, and DDoS Protection before a request reaches the function. KV Store holds team keys and policies, the Cache API stores allowed responses, and Connectors reach your own model servers. Real-Time Events, Real-Time Metrics, and Data Stream record and export every call.
Which models and providers can I use?
Any model on AI Inference, including Qwen3 30B A3B, GPT-OSS 20B, and Mistral 3 Small, plus embedding, reranking, and vision models. The gateway also calls third-party providers whose APIs accept the OpenAI chat completions format, and your own model servers through Connectors. For a provider with its own request format, adapt the request in the function.
Do I need to change my application code?
Usually only the base URL and the key. The gateway accepts OpenAI chat completions requests at /v1/chat/completions, so OpenAI SDKs and compatible clients keep working. Teams send a model alias, such as general, and the platform team decides which model answers it.
How does fallback work?
Each alias has an ordered list of models. When a call throws an error, returns no choices, answers with an error status, or runs past its timeout, the gateway tries the next model. Every failed attempt is logged, and if all of them fail, the gateway answers 502.
How do I control spend per team?
Every call logs the team and the tokens the model used, so your analytics platform can sum spend per team. When a team reaches its budget, set its status to blocked, and the gateway answers 429 to its key. Third-party calls use your own provider keys, so providers bill your accounts at their own prices, with no markup from Azion.
How are provider keys and team keys protected?
Provider keys are stored as secret environment variables and read inside the function, so they never appear in code or reach a team. Each team gets its own gateway key, and KV Store keeps only its SHA-256 hash. To validate JSON Web Tokens instead, run the JWT function from Marketplace on Firewall.
How do I monitor requests, latency, and errors?
Real-Time Metrics charts requests, status codes, upstream status, and function invocations. Real-Time Events keeps each request's log lines for 7 days, grouped by request ID. Data Stream sends the same lines to Splunk, Datadog, Elasticsearch, Google BigQuery, Amazon S3, Apache Kafka, or any HTTPS endpoint.
How does AI Gateway on Azion compare to other AI gateways?
Managed AI gateways give you a fixed set of features to configure. On Azion, the gateway is code you own: routing, fallback, caching, and authentication live in one function, so you can apply any policy your teams need. The same platform runs models on AI Inference and protects the endpoint with Firewall, so there's no separate proxy to secure.
What do I need to get started?
An application with Application Accelerator, which lets a rule run the gateway function, and KV Store, which is in Preview and enabled through Technical Support. The documentation covers the full setup, from the function code to the usage stream. Talk to a specialist to plan the models, routes, and budgets for your teams.
Build once.Run everywhere.
Get a faster path to launch, lower latency, and less infrastructure overhead.