← Back to Discover

App AI Gateway

App AI Gateway keeps AI provider API keys out of iOS apps and adds usage limits, budgets and cost tracking per user or install.

Model APIs

What it does

App AI Gateway sits between an iOS app and its AI provider. The developer adds a provider key to the gateway. App AI Gateway encrypts the key and stores it in a key management service in a separate Cloudflare account. App AI Gateway says a key is never shown again after it is added. App AI Gateway says requests keep the same paths, bodies and responses as the provider, and only the host changes. The included Swift client adds the authorization. It also handles App Attest, signs every request, keeps its token fresh, and sends the request again once if the token expired. Users can be verified through Firebase, Supabase, Auth0, Clerk, Sign in with Apple, or a custom issuer. Server applications can also authenticate with an API key.

Capabilities

  • Monthly budgets can be set per install, per user and per app.
  • Request limits can be set per install, per minute and per day.
  • If a provider is down, a request goes to the next model on a configured fallback list.
  • Custom endpoints give a feature a name, such as summarize, and let the developer pick its provider, model and settings in the console.
  • The console shows cost per provider day by day, cost, tokens and requests per model, and cost and requests per user and install.

When to use it

  • You need to keep AI provider API keys out of an iOS app.
  • You want to cap AI spending or request rates per user or install.
  • You want to change the model behind a shipped app without a new release or App Store review.