MobileAiProxy docs

MobileAiProxy is a gateway that keeps your AI provider keys off the device. Your app sends an OpenAI-compatible request with the end user's auth token; the proxy verifies the user, optionally checks Firebase App Check and RevenueCat entitlements, applies your per-app model policy and budgets, then forwards the call to the provider with your server-side key.

Start here

Two ways your app talks to the proxy

Proxy API: your mobile/app clients call the OpenAI-compatible endpoint with the end user's token. Management API (and MCP): your backend or tooling manages apps, keys, and policies with a management token. They live on different origins and use different auth; see the REST API guide.

Minimal proxy request

curl https://YOUR_PROXY_ORIGIN/v1/chat/completions \
  -H "Authorization: Bearer <END_USER_AUTH_TOKEN>" \
  -H "x-mobileaiproxy-app-key: <PUBLIC_APP_KEY>" \
  -H "Content-Type: application/json" \
  -H "x-firebase-appcheck: <APP_CHECK_TOKEN>" \
  -d '{"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'

Send the x-firebase-appcheck header only when App Check is turned on for the app; drop that line otherwise.

The model id is the canonical provider/modelidentity your policy allows. Find your app key and a ready-to-paste snippet under an app's Connect this app section.