An AI gateway is a single server-side layer through which all model calls pass. It centralizes keys, model choice, logging, quotas, and retries on error, so that applications never call a provider directly.
Example
The application calls gateway.generate(task, messages) and the gateway chooses the model and records the cost.