error object containing a code and a human-readable message. Use the code field to drive your error-handling logic — the message is written for whoever is reading logs at 2 am and may be reworded in future releases without notice.
Status codes and error codes
The table below covers every status code the API returns, thecode value you will see in the response body, and a plain description of what triggered it.
Rate limits are per key, not per account. A single runaway script will not lock other keys — or you — out of the API.
Troubleshooting
401 on every call
401 on every call
Your key is wrong, revoked, or the Note the space after
Authorization header is missing the Bearer prefix. Double-check that your header looks exactly like:Bearer. If the key was recently revoked in Settings → API & MCP, mint a replacement — a revoked key cannot be recovered, since only its hash is stored.403 on a route that plainly exists
403 on a route that plainly exists
You are using a read-only key against a
POST route. The scope is fixed at creation time and cannot be changed after the fact. Mint a new Read & write key in Settings → API & MCP and use that instead.400 unknown_field on a body that looks right
400 unknown_field on a body that looks right
Check the field name spelling carefully against the endpoint’s parameter table. A single character difference — for example
"protien" instead of "protein" — returns this error instead of logging a zero. The API refuses all fields it will not read, so there are no silent typos.Everything reads as empty or missing
Everything reads as empty or missing
Check the date. Every endpoint that accepts or defaults a date uses today in UTC. For users in timezones that are behind UTC, “today” in the app and “today in UTC” can be different calendar days for several hours around midnight. Always pass an explicit
date parameter if you know the user’s local date.Retry guidance
Not all errors are worth retrying. Follow this pattern to avoid duplicate writes or wasted budget:- Retry on
429— wait the number of seconds in theRetry-Afterheader, then try again. - Retry on
5xx— a server-side error may be transient. - Do not retry on
4xx(other than429) — the request itself is the problem. Retrying an identical400or403will always produce the same result. Retrying aPOSTon a network timeout risks duplicate entries, because writes are not idempotent.