<!--
title: Bring your own key for AI food tracking
description: Already pay for an API key? Point meal-photo analysis at OpenAI or OpenRouter. What bring-your-own-key means, what to check, and how FoodTracker does it.
published: 2026-10-03
category: foodtracker
hero: /static/blog/heroes/hero-bring-your-own-key.png
-->

# Bring your own key for AI food tracking

If you already pay a model provider, a second subscription just to photograph lunch is an odd extra bill. Bring-your-own-key food tracking means the photo analysis runs on an API account you already fund. The app stays a logger. The model invoice stays yours.

## What the phrase means

Bring your own key means the food app calls a model provider with an API key you already pay for, instead of a key bundled into a subscription.

Three things have to be true:

1. You have an API account with a payment method or credits.
2. The food app stores that key on your device and calls the provider with it.
3. You can see usage, and set a cap, in the provider’s dashboard.

A ChatGPT Plus subscription is a chat product. It does not issue the key a tracker needs. You bring a secret API key with billing turned on.

Two common shapes:

- **A provider account**, such as OpenAI. The key calls that provider’s API, and that provider bills you.
- **A router account**, such as OpenRouter. One key can reach models from Google, OpenAI, Anthropic, and others. The router bills the model you pick.

## Why people look for it

Searches for this usually come from one of four problems:

- **A bill you already have.** API credits sit unused while a calorie app asks for another monthly plan.
- **A photo path you can name.** Phone to provider is easier to explain than “our server, then a model.”
- **A ceiling you control.** A usage limit on the provider dashboard beats a quota you discover at dinner.
- **A logger that stays a logger.** The key pays for recognition. You still confirm grams.

Photo analysis estimates a meal. You confirm. The key does not change that job.

## What to check before you connect a key

Treat the key like a password with a meter attached.

- **Whose bill.** A secret key on the account that should be charged. A key from a shared work project sends dinner to that project’s invoice.
- **Where it is stored.** Prefer an app that keeps the key in the device keychain and leaves it off the company’s servers.
- **Where the photo goes.** From the phone to the provider, or through the app company’s servers first.
- **What else leaves the phone.** After recognition, nutrition databases often receive the food name as text. That query is separate from the photo.
- **The edit step.** A model guess is a draft. Oils, sauces, and mixed plates still need a look.

## Two ways to pay for the same photo

| Path | Who bills you | Who receives the photo | Limit |
| --- | --- | --- | --- |
| App subscription | The app store | The app’s servers, then a model | While the plan is active |
| Your API key | The model provider | The provider, from your phone | Credits and caps on that account |

Neither path weighs the food. Both return names and estimated portions. The difference is the invoice and the route.

## How FoodTracker does it

[FoodTracker](/foodtracker) is ours. The key lives under **Settings > Advanced**.

Pick an **AI Provider**, then paste the key:

- **OpenAI.** A secret key from the OpenAI platform. The photo goes from the phone to OpenAI.
- **OpenRouter.** A key from OpenRouter, plus a model from the in-app list (Gemini, GPT, Claude, and others the picker shows). The photo goes from the phone to OpenRouter, which calls the model you chose.

When a key is saved, cloud photo analysis uses that key and skips our server quota. There is no daily cap on this path. You pay the provider you selected.

What that means on the phone:

- The key stays in the iPhone Keychain. PatakoLabs does not receive it. iCloud does not sync it. Uninstalling the app deletes it.
- PatakoLabs is not in the middle of that request and does not see the image.
- Set a usage limit in the provider’s dashboard. Rates change, so this page does not quote a price per photo.
- You still review each item, fix portions, and save. Nutrition lookups send food names to USDA FoodData Central and Open Food Facts. Those queries do not include the photo. If that lookup misses, the model’s own per-100g estimate can fill the gap.
- The same Advanced screen has an optional **USDA API key** for nutrition search. That USDA key is separate from the photo-analysis key. A free one is available from [api.data.gov](https://api.data.gov/signup/).

The other paths stay available. The free tier includes **20 AI photo analyses in total**, up to **3 per UTC day**. Premium is **$2.99/month** or **$19.99/year** (local App Store prices can differ) and runs unlimited analyses through our servers while the subscription is active. In that mode the photo is forwarded for recognition and is not stored on our servers. The [privacy policy](/legal/foodtracker/privacy-policy) and the [support guide](/support/foodtracker) spell out both routes.

## When your own key is the wrong tool

Use Premium if you want one Apple subscription and no key to rotate.

Use the free tier if you photograph a meal only now and then. Twenty analyses are enough to see whether photo logging fits the week.

Use your own key when you already fund an OpenAI or OpenRouter account, you want the photo to go straight to that provider, and you will watch that bill.

## Set it up

1. Create a secret key on an account with billing enabled: [OpenAI API keys](https://platform.openai.com/api-keys) or [OpenRouter keys](https://openrouter.ai/keys).
2. In FoodTracker, open **Settings > Advanced**. Choose **AI Provider**, paste the key, and on OpenRouter pick a model.
3. Photograph a meal, check the items, edit anything that looks off, then save.
4. Confirm the call in that provider’s usage, and set a monthly cap you can live with.

If analysis fails, the usual causes are an invalid key, no credits, or no network. The [support page](/support/foodtracker) lists those checks.

The key buys speed. The edit, and a scale when the meal matters, buys accuracy. More on that split in [photo estimates vs weighed food](/blog/photo-estimates-vs-weighed-food-2026/). The rest of the bar is in [what a serious macro tracker should do](/blog/serious-macro-tracker-2026/).
