Authentication
REST / SDK
When: Server apps, backends, scripts
How: Developer API key via X-API-Key
SDKs: api_key / apiKey. Never ship production keys to browsers.
Developer portal
When: Keys, billing, team, MCP apps
How: Logged-in developer session (cookie)
Account APIs under /v1/developer/*. Not a substitute for product API keys.
MCP hosts
When: Cursor, Claude, custom agents
How: MCP application OAuth
App-scoped MCP URL + end-user consent. Do not paste API keys into MCP client JSON for interactive hosts.
Your end users
When: Multi-user pantry / recipes
How: X-External-User-ID (+ optional OIDC for MCP)
Opaque id you choose. FoodAPI does not store passwords or profiles.
API key header
X-API-Key: foodapi_sb_…
Sandbox vs production
- Sandbox — docs, playground, rate-limited
- Production — request access, then use production keys
Docs explorer sessions (when signed in) are short-lived sandbox tokens — not your API keys. Rate limits
Troubleshooting
- 401/403 — wrong environment or inactive key
- Include
X-Request-Idwhen contacting support - Troubleshooting
Next
Make your first request with the auth model you chose.
Normalize an ingredient with your API key.
Continue to Quickstart →