Documentation
Documentation · Overview

Developer documentation

Secure AI access. Cost controls.

Connect your mobile app to AI providers without embedding API keys. Gate/AI handles device authentication, request signing, and token refresh through the SDK that fits your app.

Choose your SDK

Five integrations, with native device security on iOS and Android.

Native apps

Cross-platform apps

React Native, Capacitor, and Flutter support native iOS and Android builds. Browser, PWA, and desktop targets are not supported.

The same protection in every SDK

The framework SDKs call the native Swift and Kotlin implementations. Device keys and attestation stay in the platform's security APIs.

  1. 01

    Verify the app

    App Attest on iOS or Play Integrity on Android verifies your app during authentication.

  2. 02

    Authorize the device

    Gate/AI issues a short-lived access token bound to the device's signing key.

  3. 03

    Make your request

    The SDK signs each proxy request with DPoP, refreshes tokens, and retries nonce challenges.

Prepare your native app

Every SDK needs the same platform registration. Create a gate in the portal, add your provider credentials there, and register the app identifiers you ship.

iOS · App Attest

  • Target iOS 16 or later and use Xcode 16 or later.
  • Register your bundle identifier and Apple Team ID in Gate/AI.
  • Enable App Attest for the app and configure its entitlement.
  • On the simulator, set GATE_AI_DEV_TOKEN in Xcode’s Edit Scheme (⌘⇧,) → Run → Arguments → Environment Variables. Physical devices use App Attest. Step-by-step simulator token setup →

iOS setup details →

Android · Play Integrity

  • Target Android API 24 or later.
  • Register your package name and signing certificate SHA-256 in Gate/AI.
  • Link Play Integrity to a Google Cloud project and provide its project number.
  • For Android emulator testing, use a development token. Set GATE_AI_DEV_TOKEN in the build environment or an ignored local properties file, add the Gradle configuration below, then rebuild and reinstall the debug app. The SDK reads the token automatically. Android development token setup →

Android setup details →

After your first request

Understand your usage →

Attribute requests and costs to users, plans, and app features.

Set usage limits →

Configure gate limits, per-device budgets, and plan tiers.