c
ChowAPI

Error Handling

Every error response follows a consistent format with an AI-friendly .suggestion field.

Error format

{
  "error": {
    "code": "search/query_required",
    "message": "Missing required parameter: q",
    "suggestion": "Add a search query: /v1/search?q=chicken breast",
    "docs": "https://chowapi.dev/docs/search"
  }
}
FieldDescription
codeMachine-readable error code (category/specific)
messageHuman-readable error description
suggestionActionable fix, designed for AI assistants to read and act on
docsLink to relevant documentation page

Why .suggestion?

AI assistants (Claude, ChatGPT, etc.) read error responses to decide what to do next. The .suggestion field tells them exactly how to fix the issue. No guessing, no hallucinating fixes. This makes ChowAPI the most AI-debuggable food API available.

Error codes

Authentication

CodeStatusDescription
auth/missing_key401No ticket, no meal. Add an Authorization header.
auth/invalid_key401That key doesn't unlock anything. Check your API key.

Rate Limiting

CodeStatusDescription
rate_limit/burst_exceeded429Slow down — you're eating too fast. Wait 60 seconds.
rate_limit/daily_exceeded429Daily call limit reached. Resets at midnight UTC.

Search

CodeStatusDescription
search/query_required400The kitchen needs an order. Pass a q parameter.
search/query_too_short400That's not enough to work with. Give us at least 2 characters.
search/offset_too_large400You've gone too deep in the pantry. Max offset is 200.

Barcode & Foods

CodeStatusDescription
barcode/invalid400That doesn't look like a barcode. We need 8-14 digits.
barcode/not_found404That barcode isn't in our kitchen. Yet.
foods/invalid_id400That's not a valid food ID. UUIDs only.
food/not_found404That food doesn't exist in our database. Yet.
billing/payment_required402The tab is empty. Grab credits at chowapi.dev/pricing.
server/internal500Something's burning in the kitchen. We're on it.