Use an API key for OpenAI or connect another service that supports the OpenAI chat-completions format. For ChatGPT account sign-in, see Connect ChatGPT to use OpenAI Codex.
Connect the OpenAI API
- In CalorieCodex, open Settings → AI quick log and tap Set Up or Manage.
- Under Provider, select OpenAI.
- Paste your OpenAI API key into OpenAI API key.
- Select a Model preset and tap Save Key or Save Changes.
Use a compatible endpoint
- Under Provider, select Custom OpenAI-compatible.
- Enter the provider’s Base URL and exact Model ID. CalorieCodex appends
/chat/completionsto the base URL. - Enter an API key if the service requires one, then tap Save or Save Changes.
Choose a model with image input for photos and nutrition labels and tool calling for the Agent. See Connect directly to the DeepSeek API for a concrete example.
Keep your API key safe and limit spending
If you use an API key, set up these safeguards in your provider’s dashboard.
- Use a separate key for CalorieCodex. Give it a name you’ll recognize, and keep it out of other apps, screenshots, and support messages. If it’s exposed, revoke it and create a replacement.
- Set a low spending limit. Use a limit on the key if your provider offers one. If limits are managed at the project level, check whether the setting blocks requests or sends an alert.
- Start with a small prepaid balance. If your provider supports prepaid credits, start with $1–$5 where allowed, or the provider’s minimum. Leave automatic reload off and add credits manually when you need them.