Your API key ships inside your app — and anyone can read it
If your mobile app calls OpenAI, Gemini, Replicate or any other provider directly with a hardcoded key, that key is compiled into the binary you publish. That binary is not a black box. An Android APK is just a ZIP archive, and the key sits in a string table that anyone can read.
Five minutes with tools everyone has
Download the APK from the store, and:
unzip app.apk -d app
grep -raoE 'sk-[A-Za-z0-9_-]{20,}' app/ # OpenAI
grep -raoE 'AIza[0-9A-Za-z_-]{35}' app/ # Google
strings app/lib/*/libapp.so | grep -i key # Flutter / native
Keys live in the dex string tables, in assets/, in the React-Native index.android.bundle, or inside libapp.so for Flutter. Obfuscation renames your code — it does not encrypt string constants, so the key survives. Read more: How OpenAI, Anthropic and Google API keys are structured.
Why "it's restricted" isn't enough
Restricting a key to a bundle ID or referrer helps for some Google APIs, but most provider keys (OpenAI, Anthropic, Replicate…) have no such control: possession is use. Once extracted, your key runs on the attacker's machine, billed to you, until you notice and rotate — which means shipping an app update to every user.
The fix: don't ship the key at all
Move the key server-side behind a proxy. Your app keeps calling the provider's native API, but points at the proxy and authenticates with a short-lived per-user token instead of the real key. The key never leaves the server, so it can't be extracted, and you rotate it in one place. Read more: Ephemeral tokens: how a mobile app should get an access token for AI APIs.
Want to know if your current app leaks a key? Upload your APK to our scanner — it reports only the key type it finds, never the value, and deletes the file after scanning.
Stop shipping your API key inside your app.
Swap the base URL, keep the provider's native API, and let the proxy inject your key server-side.
Start free