{"openapi":"3.1.0","info":{"title":"MyMolecules Public API","version":"2026-07-10","description":"Public MyMolecules API contract for approved developer integrations."},"servers":[{"url":"https://api.mymolecules.de"}],"tags":[{"name":"Core APIs"},{"name":"Utility APIs"}],"paths":{"/functions/v1/decode":{"post":{"operationId":"decode","summary":"Decode API","description":"Turn meal text, images, audio or known food items into molecular nutrition data.","tags":["Core APIs"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"mymolecules-api-version","in":"header","required":true,"description":"Use the latest stable API version: 2026-07-10.","schema":{"type":"string","enum":["2026-07-10"]},"example":"2026-07-10"},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key for a new job. Reuse with the same API key, body and version to retry without creating a duplicate. Returns HTTP 202 with the existing job, without restarting it. A different request using the same key returns HTTP 409. If the original job has been removed, the old key also returns HTTP 409.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[!-~]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecodeRequest"},"examples":{"unstructured":{"value":{"input_mode":"unstructured","foodText":"200 g Greek yogurt","compound_identifier_ids":[12057]}},"structured":{"value":{"input_mode":"structured","items":[{"canonical_name":"greek yogurt","brand":null,"attributes":[],"quantity":200,"unit":"g"}],"compound_identifier_ids":[12057]}}}}}},"responses":{"202":{"description":"Accepted. The job has been queued.","headers":{"x-request-id":{"description":"Request identifier. Log this value when contacting support.","schema":{"type":"string"}},"mymolecules-api-version":{"description":"The API contract version used for the response.","schema":{"type":"string"},"example":"2026-07-10"},"x-quota-limit":{"description":"Monthly quota limit for the current API key.","schema":{"type":"string"}},"x-quota-remaining":{"description":"Unreserved monthly quota remaining.","schema":{"type":"string"}},"x-quota-reset":{"description":"Timestamp when the monthly quota resets.","schema":{"type":"string"}},"x-operational-ratelimit-limit":{"description":"Current operational rate limit when available.","schema":{"type":"string"}},"x-operational-ratelimit-remaining":{"description":"Remaining operational requests when available.","schema":{"type":"string"}},"retry-after":{"description":"Seconds to wait before retrying, only when the server provides a meaningful delay.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecodeAcceptedEnvelope"},"examples":{"default":{"value":{"data":{"job_id":"8a93f4a0-2222-4a10-8c93-bca31ae9d48b","status":"queued","status_url":"https://api.mymolecules.de/functions/v1/decode?job_id=8a93f4a0-2222-4a10-8c93-bca31ae9d48b"},"meta":{"request_id":"req_...","api_version":"2026-07-10"}}}}}}},"400":{"description":"Invalid request or compound filter format (invalid_request with details.field), invalid Idempotency-Key, invalid JSON, or unsupported API version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"examples":{"invalid_json":{"value":{"error":{"code":"invalid_json","message":"Request body must be valid JSON.","details":null},"meta":{"request_id":"req_...","api_version":"2026-07-10"}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key cannot use Decode, its input_mode is not permitted (decode_input_mode_not_allowed), or a requested compound is outside its tier (compound_not_allowed_for_decode_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Requested job or resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Use POST to submit a job and GET to poll it (method_not_allowed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Idempotency-Key was already used for a different request or its job is no longer available (idempotency_conflict).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"The request body or media exceeds a Decode size limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"A requested compound identifier does not exist (invalid_compound_identifier).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Monthly quota exhausted (quota_exceeded), operationally rate-limited (rate_limited), or Decode overloaded (backlog_high). Retry-After is present only when a useful delay is known.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"A required upstream service returned an error (upstream_error). Follow the safe retry guidance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The requested tier lacks classification (decode_scope_not_configured), or the service is unavailable (service_unavailable). Internal scope configuration faults are never exposed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"A required upstream service timed out (upstream_timeout). Follow the safe retry guidance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"decodePoll","summary":"Poll Decode API","description":"Create the job with POST, then poll the same endpoint with job_id until the status is completed or failed.","tags":["Core APIs"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"mymolecules-api-version","in":"header","required":true,"description":"Use the latest stable API version: 2026-07-10.","schema":{"type":"string","enum":["2026-07-10"]},"example":"2026-07-10"},{"name":"job_id","in":"query","required":true,"schema":{"type":"string"},"example":"8a93f4a0-2222-4a10-8c93-bca31ae9d48b"},{"name":"include_result","in":"query","required":false,"schema":{"type":"string","enum":["false"]},"example":"false"},{"name":"result","in":"query","required":false,"schema":{"type":"string","enum":["none"]},"example":"none"}],"responses":{"200":{"description":"Successful response.","headers":{"x-request-id":{"description":"Request identifier. Log this value when contacting support.","schema":{"type":"string"}},"mymolecules-api-version":{"description":"The API contract version used for the response.","schema":{"type":"string"},"example":"2026-07-10"},"x-quota-limit":{"description":"Monthly quota limit for the current API key.","schema":{"type":"string"}},"x-quota-remaining":{"description":"Unreserved monthly quota remaining.","schema":{"type":"string"}},"x-quota-reset":{"description":"Timestamp when the monthly quota resets.","schema":{"type":"string"}},"x-operational-ratelimit-limit":{"description":"Current operational rate limit when available.","schema":{"type":"string"}},"x-operational-ratelimit-remaining":{"description":"Remaining operational requests when available.","schema":{"type":"string"}},"retry-after":{"description":"Seconds to wait before retrying, only when the server provides a meaningful delay.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecodeStatusEnvelope"},"examples":{"default":{"value":{"data":{"job_id":"8a93f4a0-2222-4a10-8c93-bca31ae9d48b","status":"completed","result":{"type":"food_detected","items":[{"item_id":1,"canonical_name":"greek yogurt","brand":null,"attributes":[],"quantity_g":200,"status":"matched"}],"molecular_analysis":[{"compound_identifier_id":12057,"compound_identifier_name":"protein","compound_identifier_value":"CHEBI_36080","measurement_value":20000,"measurement_value_min":20000,"measurement_value_max":20000,"measurement_value_type":"quantified","measurement_value_min_type":"quantified","measurement_value_max_type":"quantified","measurement_unit":"mg","provenance":"source","incomplete":false,"references":[{"id":42,"citation":"Example food composition source"}],"references_min":[{"id":42,"citation":"Example food composition source"}],"references_max":[{"id":42,"citation":"Example food composition source"}]}]},"error":null},"meta":{"request_id":"req_...","api_version":"2026-07-10"}}}}}}},"400":{"description":"Invalid request or compound filter format (invalid_request with details.field), invalid Idempotency-Key, invalid JSON, or unsupported API version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"examples":{"invalid_json":{"value":{"error":{"code":"invalid_json","message":"Request body must be valid JSON.","details":null},"meta":{"request_id":"req_...","api_version":"2026-07-10"}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key cannot use Decode, its input_mode is not permitted (decode_input_mode_not_allowed), or a requested compound is outside its tier (compound_not_allowed_for_decode_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Requested job or resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Use POST to submit a job and GET to poll it (method_not_allowed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"The request body or media exceeds a Decode size limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"A requested compound identifier does not exist (invalid_compound_identifier).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Monthly quota exhausted (quota_exceeded), operationally rate-limited (rate_limited), or Decode overloaded (backlog_high). Retry-After is present only when a useful delay is known.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"A required upstream service returned an error (upstream_error). Follow the safe retry guidance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The requested tier lacks classification (decode_scope_not_configured), or the service is unavailable (service_unavailable). Internal scope configuration faults are never exposed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"A required upstream service timed out (upstream_timeout). Follow the safe retry guidance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/functions/v1/design":{"post":{"operationId":"design","summary":"Design API","description":"Create recipes or meal plans from text, voice or structured requirements, tailored to dietary needs and preferences.","tags":["Core APIs"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"mymolecules-api-version","in":"header","required":true,"description":"Use the latest stable API version: 2026-09-29.","schema":{"type":"string","enum":["2026-09-29"]},"example":"2026-09-29"},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key for a new job. Reuse with the same API key, body and version to retry without creating a duplicate. Returns HTTP 202 with the existing job, without restarting it. A different request using the same key returns HTTP 409.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[!-~]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesignRequest"},"examples":{"text_request":{"value":{"input_mode":"unstructured","type":"recipe","request_text":"Create two vegetarian high-protein dinners with no peanuts."}},"structured_recipe":{"value":{"input_mode":"structured","type":"recipe","recipe_count":2,"meal_type":"dinner","diet":"vegetarian","excluded_allergens":["peanuts"],"max_total_time_min":30,"include_nutrient_analysis":true}},"structured_meal_plan":{"value":{"input_mode":"structured","type":"meal_plan","plan_days":3,"meals_per_day":{"breakfast":1,"lunch":1,"dinner":1},"diet_pattern":"pescatarian","excluded_allergens":["peanuts"]}}}}}},"responses":{"202":{"description":"Accepted. The job has been queued.","headers":{"x-request-id":{"description":"Request identifier. Log this value when contacting support.","schema":{"type":"string"}},"mymolecules-api-version":{"description":"The API contract version used for the response.","schema":{"type":"string"},"example":"2026-09-29"},"x-ratelimit-limit":{"description":"Quota limit for the current key and window when quota data is available.","schema":{"type":"string"}},"x-ratelimit-remaining":{"description":"Remaining requests in the current quota window when quota data is available.","schema":{"type":"string"}},"x-ratelimit-reset":{"description":"ISO timestamp for the current quota window reset when quota data is available.","schema":{"type":"string"}},"retry-after":{"description":"Seconds to wait before retrying when the request is rate-limited or temporarily unavailable.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesignAcceptedEnvelope"},"examples":{"default":{"value":{"data":{"job_id":"d72f91f9-06a4-472f-b718-87c3513e9682","status":"queued","status_url":"https://api.mymolecules.de/functions/v1/design?job_id=d72f91f9-06a4-472f-b718-87c3513e9682"},"meta":{"request_id":"req_...","api_version":"2026-09-29"}}}}}}},"400":{"description":"Invalid Design request, invalid JSON, invalid Idempotency-Key or unsupported API version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"examples":{"invalid_json":{"value":{"error":{"code":"invalid_request","message":"Request body must be valid JSON.","details":null},"meta":{"request_id":"req_...","api_version":"2026-09-29"}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key cannot use Design or its input_mode is not permitted (design_input_mode_not_allowed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Requested job or resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Use POST to submit a job and GET to poll it (invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Idempotency-Key was already used for a different request (idempotency_conflict).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Monthly quota exceeded or Design is temporarily busy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Design job creation or callback delivery is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"designPoll","summary":"Poll Design API","description":"Create the job with POST, then poll the same endpoint with job_id until the status is completed or failed.","tags":["Core APIs"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"mymolecules-api-version","in":"header","required":true,"description":"Use the latest stable API version: 2026-09-29.","schema":{"type":"string","enum":["2026-09-29"]},"example":"2026-09-29"},{"name":"job_id","in":"query","required":true,"schema":{"type":"string"},"example":"job_8c1f..."}],"responses":{"200":{"description":"Successful response.","headers":{"x-request-id":{"description":"Request identifier. Log this value when contacting support.","schema":{"type":"string"}},"mymolecules-api-version":{"description":"The API contract version used for the response.","schema":{"type":"string"},"example":"2026-09-29"},"x-ratelimit-limit":{"description":"Quota limit for the current key and window when quota data is available.","schema":{"type":"string"}},"x-ratelimit-remaining":{"description":"Remaining requests in the current quota window when quota data is available.","schema":{"type":"string"}},"x-ratelimit-reset":{"description":"ISO timestamp for the current quota window reset when quota data is available.","schema":{"type":"string"}},"retry-after":{"description":"Seconds to wait before retrying when the request is rate-limited or temporarily unavailable.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesignStatusEnvelope"},"examples":{"default":{"value":{"data":{"job_id":"d72f91f9-06a4-472f-b718-87c3513e9682","status":"completed","result":{"recipes":[{"title":"Chickpea and spinach skillet","prep_time_min":10,"cook_time_min":15,"total_time_min":25,"difficulty":"easy","ingredients":[{"name":"chickpeas","quantity":150,"unit":"g"},{"name":"spinach","quantity":80,"unit":"g"}],"steps":["Cook the ingredients until tender."]}]},"error":null},"meta":{"request_id":"req_...","api_version":"2026-09-29"}}}}}}},"400":{"description":"Invalid Design request, invalid JSON, invalid Idempotency-Key or unsupported API version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"examples":{"invalid_json":{"value":{"error":{"code":"invalid_request","message":"Request body must be valid JSON.","details":null},"meta":{"request_id":"req_...","api_version":"2026-09-29"}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The API key is not allowed to use this endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Requested job or resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Use POST to submit a job and GET to poll it (invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Monthly quota exceeded or Design is temporarily busy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Design job creation or callback delivery is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"DesignRequest":{"oneOf":[{"$ref":"#/components/schemas/DesignTextRequest"},{"$ref":"#/components/schemas/DesignStructuredRecipeRequest"},{"$ref":"#/components/schemas/DesignStructuredPlanRequest"}]},"DesignTextRequest":{"type":"object","required":["input_mode","type"],"additionalProperties":false,"anyOf":[{"required":["request_text"]},{"required":["request_voice"]}],"properties":{"input_mode":{"type":"string","const":"unstructured","description":"The API key must allow this mode; otherwise, HTTP 403 (design_input_mode_not_allowed)."},"type":{"type":"string","enum":["recipe","meal_plan"]},"request_text":{"type":"string","minLength":1,"maxLength":16000,"pattern":"\\S"},"request_voice":{"type":"string","pattern":"^data:(?:audio/(?:mpeg|mp3|mp4|x-m4a|m4a|wav|x-wav|webm)|video/mp4);base64,[A-Za-z0-9+/]+={0,2}$","description":"Inline base64 audio data URL, at most 25 MiB decoded. Remote URLs are not accepted."},"image_delivery":{"type":"string","enum":["none","signed_url"]},"include_nutrient_analysis":{"type":"boolean"},"image_target_size":{"type":"string","pattern":"^[0-9]{2,4}x[0-9]{2,4}$","description":"WIDTHxHEIGHT, each dimension 50–2048 pixels. Range is checked by the API."},"image_fit":{"type":"string","enum":["cover","contain","stretch"]},"skip_stored_recipes":{"type":"boolean"},"callback_url":{"type":"string","format":"uri","pattern":"^https://"}}},"DesignStructuredRecipeRequest":{"type":"object","required":["input_mode","type"],"additionalProperties":false,"dependentRequired":{"daily_energy_kcal_min":["daily_energy_kcal_max","meal_type","meal_energy_distribution"],"daily_energy_kcal_max":["daily_energy_kcal_min","meal_type","meal_energy_distribution"],"meal_energy_distribution":["daily_energy_kcal_min","daily_energy_kcal_max"]},"not":{"anyOf":[{"required":["sensory_profile","taste"]},{"required":["sensory_profile","aroma"]},{"required":["sensory_profile","texture"]}]},"allOf":[{"if":{"required":["meal_type"],"properties":{"meal_type":{"const":"breakfast"}}},"then":{"properties":{"meal_energy_distribution":{"items":{"properties":{"meal_type":{"const":"breakfast"}}}}}}},{"if":{"required":["meal_type"],"properties":{"meal_type":{"const":"lunch"}}},"then":{"properties":{"meal_energy_distribution":{"items":{"properties":{"meal_type":{"const":"lunch"}}}}}}},{"if":{"required":["meal_type"],"properties":{"meal_type":{"const":"dinner"}}},"then":{"properties":{"meal_energy_distribution":{"items":{"properties":{"meal_type":{"const":"dinner"}}}}}}},{"if":{"required":["meal_type"],"properties":{"meal_type":{"const":"snack"}}},"then":{"properties":{"meal_energy_distribution":{"items":{"properties":{"meal_type":{"const":"snack"}}}}}}}],"properties":{"input_mode":{"type":"string","const":"structured","description":"The API key must allow this mode; otherwise, HTTP 403 (design_input_mode_not_allowed)."},"type":{"type":"string","const":"recipe"},"recipe_count":{"type":"integer","minimum":1,"maximum":10,"default":1},"meal_type":{"type":"string","enum":["breakfast","lunch","dinner","snack"]},"diet":{"type":"string","enum":["vegan","vegetarian","fish","seafood","meat"]},"image_delivery":{"type":"string","enum":["none","signed_url"]},"include_nutrient_analysis":{"type":"boolean"},"image_target_size":{"type":"string","pattern":"^[0-9]{2,4}x[0-9]{2,4}$","description":"WIDTHxHEIGHT, each dimension 50–2048 pixels. Range is checked by the API."},"image_fit":{"type":"string","enum":["cover","contain","stretch"]},"skip_stored_recipes":{"type":"boolean"},"callback_url":{"type":"string","format":"uri","pattern":"^https://"},"language":{"type":"string","const":"German"},"gender":{"type":"string","enum":["male","female"]},"difficulty":{"type":"string","enum":["easy","medium","hard"]},"max_total_time_min":{"type":"integer","minimum":1},"price":{"type":"string","enum":["<5€","5-10€",">10€"]},"clean":{"type":"boolean","description":"Prefer high-fiber, predominantly plant-based, unprocessed or minimally processed ingredients without emulsifiers or additives; meat is not excluded."},"excluded_allergens":{"oneOf":[{"const":"all"},{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["gluten_containing_cereals","crustaceans","eggs","fish","peanuts","soybeans","milk","nuts","celery","mustard","sesame","sulphur_dioxide_and_sulphites","lupin","molluscs"]}}]},"taste":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["sweet","salty","bitter","sour","umami"]}},"aroma":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["Fruity","Citrus","Floral","Herbaceous","Spicy","Vanilla","Nutty","Roasted","Smoky","Cooling","Meaty","Fermented","Earthy","Fishy","Oily"]}},"texture":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["hard","adhesive","viscose","cohesive","crispy","crunchy","elastic","grainy"]}},"sensory_profile":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["fresh-vibrant","sweet-gentle","savory-hearty","toasted-crunchy","exotic-aromatic"]}},"condition":{"description":"Exact supported names. Calorie restrictions require daily energy bounds; some rules also require gender. Only one calorie restriction level may be selected.","oneOf":[{"type":"string","enum":["calorie_restriction_level_1","calorie_restriction_level_2","calorie_restriction_level_3","calorie_restriction_level_4","fructose_restriction_low","fructose_restriction_moderate","fructose_restriction_strict","gluten_restriction","histamine_restriction_moderate","histamine_restriction_strict","lactose_restriction_moderate","lactose_restriction_strict","sodium_restriction_moderate","sodium_restriction_strict"]},{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["calorie_restriction_level_1","calorie_restriction_level_2","calorie_restriction_level_3","calorie_restriction_level_4","fructose_restriction_low","fructose_restriction_moderate","fructose_restriction_strict","gluten_restriction","histamine_restriction_moderate","histamine_restriction_strict","lactose_restriction_moderate","lactose_restriction_strict","sodium_restriction_moderate","sodium_restriction_strict"]}}]},"preferred_foods":{"type":"string","minLength":1,"maxLength":1000,"pattern":"\\S"},"avoided_foods":{"type":"string","minLength":1,"maxLength":1000,"pattern":"\\S"},"exclusive_ingredients":{"description":"Non-empty ingredients; joined with comma and space, the list must not exceed 1,000 characters.","oneOf":[{"type":"string","minLength":1,"maxLength":1000,"pattern":"\\S"},{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":1000,"pattern":"\\S"}}]},"compound_filters":{"type":"array","items":{"type":"object","required":["operator","threshold","unit","scope"],"anyOf":[{"required":["compound"]},{"required":["compound_id"]}],"description":"Use a compound name (case-insensitive), an ID, or both identifying the same compound. Energy (7744) requires kcal; other compounds require g or mg.","properties":{"compound":{"type":"string","minLength":1,"pattern":"\\S"},"compound_id":{"type":"integer","minimum":1},"operator":{"type":"string","enum":["<=",">="]},"threshold":{"type":"number"},"unit":{"type":"string","enum":["kcal","g","mg"]},"scope":{"type":"string","const":"portion"}},"allOf":[{"if":{"required":["compound_id"],"properties":{"compound_id":{"const":7744}}},"then":{"properties":{"unit":{"const":"kcal"}}}},{"if":{"required":["compound_id"],"properties":{"compound_id":{"not":{"const":7744}}}},"then":{"properties":{"unit":{"enum":["g","mg"]}}}}],"additionalProperties":false}},"daily_energy_kcal_min":{"type":"number","exclusiveMinimum":0,"description":"Must not exceed daily_energy_kcal_max; supply both bounds."},"daily_energy_kcal_max":{"type":"number","exclusiveMinimum":0,"description":"Must not be below daily_energy_kcal_min; supply both bounds."},"meal_energy_distribution":{"type":"array","minItems":1,"maxItems":1,"description":"Shares up to 1 are fractions; larger shares are percentages, at most 100. Zero is invalid. Recipe meal_type must match. Plan entries must use distinct active meal types; normalized shares total at most 1, exactly 1 when all active types are covered.","items":{"type":"object","required":["meal_type","share"],"properties":{"meal_type":{"type":"string","enum":["breakfast","lunch","dinner","snack"]},"share":{"type":"number","exclusiveMinimum":0,"maximum":100}},"additionalProperties":false}}}},"DesignStructuredPlanRequest":{"type":"object","required":["input_mode","type","plan_days","meals_per_day"],"additionalProperties":false,"dependentRequired":{"daily_energy_kcal_min":["daily_energy_kcal_max"],"daily_energy_kcal_max":["daily_energy_kcal_min"],"meal_energy_distribution":["daily_energy_kcal_min","daily_energy_kcal_max"]},"not":{"anyOf":[{"required":["sensory_profile","taste"]},{"required":["sensory_profile","aroma"]},{"required":["sensory_profile","texture"]}]},"properties":{"input_mode":{"type":"string","const":"structured","description":"The API key must allow this mode; otherwise, HTTP 403 (design_input_mode_not_allowed)."},"type":{"type":"string","const":"meal_plan"},"plan_days":{"type":"integer","minimum":1,"maximum":7},"meals_per_day":{"type":"object","additionalProperties":false,"anyOf":[{"required":["breakfast"],"properties":{"breakfast":{"minimum":1}}},{"required":["lunch"],"properties":{"lunch":{"minimum":1}}},{"required":["dinner"],"properties":{"dinner":{"minimum":1}}},{"required":["snack"],"properties":{"snack":{"minimum":1}}}],"properties":{"breakfast":{"type":"integer","minimum":0,"maximum":2},"lunch":{"type":"integer","minimum":0,"maximum":2},"dinner":{"type":"integer","minimum":0,"maximum":2},"snack":{"type":"integer","minimum":0,"maximum":2}}},"diet_pattern":{"type":"string","enum":["vegan","vegetarian","pescatarian","omnivore","flexitarian"]},"excluded_diets":{"type":"array","minItems":1,"maxItems":4,"uniqueItems":true,"items":{"type":"string","enum":["vegan","vegetarian","fish","seafood","meat"]}},"image_delivery":{"type":"string","enum":["none","signed_url"]},"include_nutrient_analysis":{"type":"boolean"},"image_target_size":{"type":"string","pattern":"^[0-9]{2,4}x[0-9]{2,4}$","description":"WIDTHxHEIGHT, each dimension 50–2048 pixels. Range is checked by the API."},"image_fit":{"type":"string","enum":["cover","contain","stretch"]},"skip_stored_recipes":{"type":"boolean"},"callback_url":{"type":"string","format":"uri","pattern":"^https://"},"language":{"type":"string","const":"German"},"gender":{"type":"string","enum":["male","female"]},"difficulty":{"type":"string","enum":["easy","medium","hard"]},"max_total_time_min":{"type":"integer","minimum":1},"price":{"type":"string","enum":["<5€","5-10€",">10€"]},"clean":{"type":"boolean","description":"Prefer high-fiber, predominantly plant-based, unprocessed or minimally processed ingredients without emulsifiers or additives; meat is not excluded."},"excluded_allergens":{"oneOf":[{"const":"all"},{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["gluten_containing_cereals","crustaceans","eggs","fish","peanuts","soybeans","milk","nuts","celery","mustard","sesame","sulphur_dioxide_and_sulphites","lupin","molluscs"]}}]},"taste":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["sweet","salty","bitter","sour","umami"]}},"aroma":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["Fruity","Citrus","Floral","Herbaceous","Spicy","Vanilla","Nutty","Roasted","Smoky","Cooling","Meaty","Fermented","Earthy","Fishy","Oily"]}},"texture":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["hard","adhesive","viscose","cohesive","crispy","crunchy","elastic","grainy"]}},"sensory_profile":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["fresh-vibrant","sweet-gentle","savory-hearty","toasted-crunchy","exotic-aromatic"]}},"condition":{"description":"Exact supported names. Calorie restrictions require daily energy bounds; some rules also require gender. Only one calorie restriction level may be selected.","oneOf":[{"type":"string","enum":["calorie_restriction_level_1","calorie_restriction_level_2","calorie_restriction_level_3","calorie_restriction_level_4","fructose_restriction_low","fructose_restriction_moderate","fructose_restriction_strict","gluten_restriction","histamine_restriction_moderate","histamine_restriction_strict","lactose_restriction_moderate","lactose_restriction_strict","sodium_restriction_moderate","sodium_restriction_strict"]},{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["calorie_restriction_level_1","calorie_restriction_level_2","calorie_restriction_level_3","calorie_restriction_level_4","fructose_restriction_low","fructose_restriction_moderate","fructose_restriction_strict","gluten_restriction","histamine_restriction_moderate","histamine_restriction_strict","lactose_restriction_moderate","lactose_restriction_strict","sodium_restriction_moderate","sodium_restriction_strict"]}}]},"preferred_foods":{"type":"string","minLength":1,"maxLength":1000,"pattern":"\\S"},"avoided_foods":{"type":"string","minLength":1,"maxLength":1000,"pattern":"\\S"},"exclusive_ingredients":{"description":"Non-empty ingredients; joined with comma and space, the list must not exceed 1,000 characters.","oneOf":[{"type":"string","minLength":1,"maxLength":1000,"pattern":"\\S"},{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":1000,"pattern":"\\S"}}]},"compound_filters":{"type":"array","items":{"type":"object","required":["operator","threshold","unit"],"anyOf":[{"required":["compound"]},{"required":["compound_id"]}],"description":"Use a compound name (case-insensitive), an ID, or both identifying the same compound. Energy (7744) requires kcal; other compounds require g or mg.","properties":{"compound":{"type":"string","minLength":1,"pattern":"\\S"},"compound_id":{"type":"integer","minimum":1},"operator":{"type":"string","enum":["<=",">="]},"threshold":{"type":"number"},"unit":{"type":"string","enum":["kcal","g","mg"]},"scope":{"type":"string","enum":["portion","day"],"default":"portion"}},"allOf":[{"if":{"required":["compound_id"],"properties":{"compound_id":{"const":7744}}},"then":{"properties":{"unit":{"const":"kcal"}}}},{"if":{"required":["compound_id"],"properties":{"compound_id":{"not":{"const":7744}}}},"then":{"properties":{"unit":{"enum":["g","mg"]}}}}],"additionalProperties":false}},"daily_energy_kcal_min":{"type":"number","exclusiveMinimum":0,"description":"Must not exceed daily_energy_kcal_max; supply both bounds."},"daily_energy_kcal_max":{"type":"number","exclusiveMinimum":0,"description":"Must not be below daily_energy_kcal_min; supply both bounds."},"meal_energy_distribution":{"type":"array","maxItems":4,"description":"Shares up to 1 are fractions; larger shares are percentages, at most 100. Zero is invalid. Recipe meal_type must match. Plan entries must use distinct active meal types; normalized shares total at most 1, exactly 1 when all active types are covered.","items":{"type":"object","required":["meal_type","share"],"properties":{"meal_type":{"type":"string","enum":["breakfast","lunch","dinner","snack"]},"share":{"type":"number","exclusiveMinimum":0,"maximum":100}},"additionalProperties":false}}}},"DesignAcceptedEnvelope":{"type":"object","required":["data","meta"],"additionalProperties":false,"properties":{"data":{"type":"object","required":["job_id","status","status_url"],"properties":{"job_id":{"type":"string","format":"uuid"},"status":{"const":"queued"},"status_url":{"type":"string","format":"uri"}}},"meta":{"$ref":"#/components/schemas/ApiMeta"}}},"DesignRecipe":{"type":"object","required":["title","prep_time_min","cook_time_min","total_time_min","difficulty","ingredients","steps"],"description":"One-portion recipe. Output is currently in German. Nutrient values for newly generated recipes are estimates, not measured food composition.","properties":{"title":{"type":"string"},"prep_time_min":{"type":"number"},"cook_time_min":{"type":"number"},"total_time_min":{"type":"number"},"difficulty":{"type":"string","enum":["easy","medium","hard"]},"ingredients":{"type":"array","items":{"type":"object","required":["name","quantity","unit"],"properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"}}}},"steps":{"type":"array","items":{"type":"string"}},"image":{"type":"object","required":["delivery","mime_type","width","height","url","expires_at"],"properties":{"delivery":{"type":"string","enum":["signed_url"]},"mime_type":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"}}},"nutrient_analysis":{"type":"object","properties":{"energy":{"type":"object","required":["name","value","unit"],"properties":{"name":{"type":"string"},"value":{"type":"number"},"unit":{"type":"string","const":"kcal"}}},"carbohydrates":{"type":"object","required":["name","value","unit"],"properties":{"name":{"type":"string"},"value":{"type":"number"},"unit":{"type":"string","const":"mg"}}},"fat":{"type":"object","required":["name","value","unit"],"properties":{"name":{"type":"string"},"value":{"type":"number"},"unit":{"type":"string","const":"mg"}}},"protein":{"type":"object","required":["name","value","unit"],"properties":{"name":{"type":"string"},"value":{"type":"number"},"unit":{"type":"string","const":"mg"}}}}}}},"DesignRecipeResult":{"type":"object","required":["recipes"],"properties":{"recipes":{"type":"array","items":{"$ref":"#/components/schemas/DesignRecipe"}}}},"DesignPlanResult":{"type":"object","required":["meal_plan"],"properties":{"meal_plan":{"type":"object","required":["days"],"properties":{"days":{"type":"array","items":{"type":"object","required":["day","meals"],"properties":{"day":{"type":"integer","minimum":1},"meals":{"type":"array","items":{"type":"object","required":["meal_type","recipe"],"properties":{"meal_type":{"type":"string","enum":["breakfast","lunch","dinner","snack"]},"recipe":{"$ref":"#/components/schemas/DesignRecipe"}}}}}}}}}}},"DesignJobError":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["no_recipe_found","no_meal_plan_found","job_deadline_exceeded","conflicting_requirements","voice_transcription_empty","invalid_normalized_request","invalid_request","technical_generation_error","quota_exceeded"]},"message":{"type":"string"}}},"DesignStatusEnvelope":{"type":"object","required":["data","meta"],"additionalProperties":false,"properties":{"data":{"type":"object","required":["job_id","status","result","error"],"allOf":[{"if":{"properties":{"status":{"enum":["queued","processing","completed"]}},"required":["status"]},"then":{"properties":{"error":{"type":"null"}}}}],"properties":{"job_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","processing","completed","failed"]},"result":{"oneOf":[{"$ref":"#/components/schemas/DesignRecipeResult"},{"$ref":"#/components/schemas/DesignPlanResult"},{"type":"null"}]},"error":{"oneOf":[{"$ref":"#/components/schemas/DesignJobError"},{"type":"null"}]}}},"meta":{"$ref":"#/components/schemas/ApiMeta"}}},"DecodeRequest":{"oneOf":[{"$ref":"#/components/schemas/DecodeUnstructuredRequest"},{"$ref":"#/components/schemas/DecodeStructuredRequest"}],"description":"The API key selects the output tier. No profile parameter is accepted."},"DecodeUnstructuredRequest":{"type":"object","required":["input_mode"],"not":{"anyOf":[{"required":["items"]},{"required":["foodImageRemaining"]},{"required":["attachments"]}]},"anyOf":[{"required":["foodText"],"properties":{"foodText":{"type":"string","minLength":1,"pattern":"\\S"}}},{"required":["foodImage"]},{"required":["foodVoice"],"properties":{"foodVoice":{"type":"string","minLength":1,"pattern":"\\S"}}}],"properties":{"input_mode":{"type":"string","const":"unstructured"},"foodText":{"type":"string","maxLength":1500},"foodImage":{"oneOf":[{"type":"string","minLength":1,"pattern":"\\S"},{"type":"array","minItems":1,"maxItems":3,"items":{"type":"string","minLength":1,"pattern":"\\S"}}],"description":"One image or one to three images of the same meal, including possible leftovers. Image data URLs or HTTP(S) URLs; maximum 10 MiB per image. All images are processed together; multiple views do not imply extra portions or leftovers."},"foodVoice":{"type":"string","description":"Audio data URL or HTTP(S) URL. Maximum 15 MiB and 300 seconds."},"language":{"type":"string","enum":["german","english"],"description":"Unstructured mode only. Selects the returned food names and attributes. Without it, Decode follows the text or voice language; image-only input has no fixed default language."},"compound_identifier_ids":{"$ref":"#/components/schemas/DecodeCompoundIds"},"compound_identifier_names":{"$ref":"#/components/schemas/DecodeCompoundNames"},"include_compound_identifier_value":{"type":"boolean","default":true},"include_measurement_min_max":{"type":"boolean","default":true},"include_unquantified_measurements":{"type":"boolean","default":true}},"additionalProperties":true,"description":"At least one non-empty primary input is required. Media limits apply across all fields: three images, one audio input, 30 MiB total media and 45 MiB JSON body. URLs must remain accessible when the job downloads them. An invalid or unreachable supplied image fails the entire job even if text or other images are valid. foodImageRemaining and attachments are rejected."},"DecodeStructuredRequest":{"type":"object","required":["input_mode","items"],"not":{"anyOf":[{"required":["foodText"]},{"required":["foodImage"]},{"required":["foodVoice"]},{"required":["foodImageRemaining"]},{"required":["attachments"]},{"required":["language"]}]},"properties":{"input_mode":{"type":"string","const":"structured"},"items":{"type":"array","minItems":1,"maxItems":25,"items":{"$ref":"#/components/schemas/DecodeStructuredItem"}},"compound_identifier_ids":{"$ref":"#/components/schemas/DecodeCompoundIds"},"compound_identifier_names":{"$ref":"#/components/schemas/DecodeCompoundNames"},"include_compound_identifier_value":{"type":"boolean","default":true},"include_measurement_min_max":{"type":"boolean","default":true},"include_unquantified_measurements":{"type":"boolean","default":true}},"additionalProperties":true},"DecodeStructuredItem":{"type":"object","required":["canonical_name","quantity","unit"],"allOf":[{"if":{"properties":{"unit":{"const":"mg"}}},"then":{"properties":{"quantity":{"maximum":100000000}}}},{"if":{"properties":{"unit":{"const":"g"}}},"then":{"properties":{"quantity":{"maximum":100000}}}},{"if":{"properties":{"unit":{"const":"kg"}}},"then":{"properties":{"quantity":{"maximum":100}}}}],"properties":{"canonical_name":{"type":"string","minLength":1,"maxLength":160},"brand":{"type":["string","null"]},"attributes":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":80}},"quantity":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string","enum":["mg","g","kg"]}},"additionalProperties":true},"DecodeCompoundIds":{"type":"array","description":"Positive integer IDs or numeric strings. An empty array does not filter.","items":{"oneOf":[{"type":"integer","minimum":1},{"type":"string","pattern":"^[0-9]+$"}]}},"DecodeCompoundNames":{"type":"array","description":"Exact, case-sensitive names from the compound catalog. An empty array does not filter.","items":{"type":"string","minLength":1}},"DecodeAcceptedEnvelope":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/DecodeAcceptedData"},"meta":{"$ref":"#/components/schemas/ApiMeta"}}},"DecodeAcceptedData":{"type":"object","required":["job_id","status","status_url"],"properties":{"job_id":{"type":"string","format":"uuid"},"status":{"const":"queued"},"status_url":{"type":"string","format":"uri"}}},"DecodeStatusEnvelope":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/DecodeStatusData"},"meta":{"$ref":"#/components/schemas/ApiMeta"}}},"DecodeStatusData":{"type":"object","required":["job_id","status","result","error"],"allOf":[{"if":{"properties":{"status":{"enum":["queued","processing","completed"]}},"required":["status"]},"then":{"properties":{"error":{"type":"null"}}}}],"properties":{"job_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","processing","completed","failed"]},"result":{"oneOf":[{"$ref":"#/components/schemas/DecodeResult"},{"type":"null"}]},"error":{"oneOf":[{"type":"null"},{"type":"object","required":["message"],"properties":{"code":{"type":"string","description":"Job failure code, separate from HTTP error codes."},"message":{"type":"string"},"details":{}},"additionalProperties":true}],"description":"Failure details only when status is failed; null for queued, processing and completed jobs. Polling a found job still returns HTTP 200."}}},"DecodeResult":{"oneOf":[{"type":"object","required":["type","items","molecular_analysis"],"properties":{"type":{"const":"food_detected"},"items":{"type":"array","items":{"$ref":"#/components/schemas/DecodeItem"}},"molecular_analysis":{"type":"array","items":{"$ref":"#/components/schemas/DecodeCompound"},"description":"Whole-meal compound totals. A missing compound row does not mean its actual amount is zero."}}},{"type":"object","required":["type","items"],"properties":{"type":{"const":"no_food_detected"},"items":{"type":"array","maxItems":0}}}]},"DecodeItem":{"type":"object","required":["item_id","canonical_name","brand","attributes","quantity_g","status"],"properties":{"item_id":{"type":"integer","minimum":1,"description":"One-based position within this request."},"canonical_name":{"type":"string","description":"Identified food name in the selected or inferred language for unstructured input; supplied name for structured input."},"brand":{"type":["string","null"]},"attributes":{"type":"array","items":{"type":"string"}},"quantity_g":{"type":"number","exclusiveMinimum":0},"status":{"type":"string","enum":["matched","unresolved"],"description":"A matched food does not guarantee data for every requested compound."}}},"DecodeCompound":{"type":"object","required":["compound_identifier_id","compound_identifier_name","measurement_value","measurement_value_type","measurement_unit","provenance","incomplete","references"],"properties":{"compound_identifier_id":{"type":"integer","minimum":1},"compound_identifier_name":{"type":"string"},"compound_identifier_value":{"type":"string","description":"Omitted when include_compound_identifier_value is false."},"measurement_value":{"type":["number","null"]},"measurement_value_min":{"type":["number","null"],"description":"Omitted when include_measurement_min_max is false."},"measurement_value_max":{"type":["number","null"],"description":"Omitted when include_measurement_min_max is false."},"measurement_value_type":{"$ref":"#/components/schemas/DecodeMeasurementType"},"measurement_value_min_type":{"allOf":[{"$ref":"#/components/schemas/DecodeMeasurementType"}],"description":"Omitted when include_measurement_min_max is false."},"measurement_value_max_type":{"allOf":[{"$ref":"#/components/schemas/DecodeMeasurementType"}],"description":"Omitted when include_measurement_min_max is false."},"measurement_unit":{"type":"string","description":"Typically mg for mass compounds or kcal for energy. n.u. means no quantitative unit for trace or unquantified evidence."},"provenance":{"type":"string","enum":["source","interpolation"]},"incomplete":{"type":"boolean","description":"True when numeric totals exclude missing, unresolved or trace/unquantified food contributions. The displayed number covers quantifiable contributions only; missing contributions are not proof of actual zero."},"references":{"type":"array","items":{"$ref":"#/components/schemas/DecodeReference"}},"references_min":{"type":"array","items":{"$ref":"#/components/schemas/DecodeReference"},"description":"Omitted when include_measurement_min_max is false."},"references_max":{"type":"array","items":{"$ref":"#/components/schemas/DecodeReference"},"description":"Omitted when include_measurement_min_max is false."}}},"DecodeMeasurementType":{"type":["string","null"],"enum":["quantified","calculated","less_than","greater_than","trace","unquantified",null],"description":"quantified: measured amount; calculated: derived or combined amount; less_than/greater_than: below/above the given limit, not an exact amount; trace: trace amounts detected; unquantified: present without a numeric amount; null: no value type available."},"DecodeReference":{"type":"object","required":["id","citation"],"properties":{"id":{"type":"integer"},"citation":{"type":"string"}}},"ApiMeta":{"type":"object","required":["request_id","api_version"],"properties":{"request_id":{"type":"string"},"api_version":{"type":"string","enum":["2026-07-10","2026-09-29"]},"callback_registered":{"type":"boolean","description":"Present on an accepted Design request with a registered completion callback."}},"additionalProperties":true},"SuccessEnvelope":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"type":"object","required":["request_id","api_version"],"properties":{"request_id":{"type":"string","example":"req_..."},"api_version":{"type":"string","enum":["2026-07-10"]}},"additionalProperties":true}},"additionalProperties":false},"ErrorEnvelope":{"type":"object","required":["error","meta"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["missing_api_key","invalid_api_key","scope_not_allowed","quota_exceeded","rate_limited","invalid_json","invalid_request","invalid_request_shape","too_many_options","input_too_large","user_context_not_allowed","detect_signals_not_allowed","validation_error","method_not_allowed","unsupported_api_version","job_not_found","backlog_high","service_unavailable","upstream_timeout","upstream_error","internal_error","idempotency_conflict","invalid_compound_identifier","compound_not_allowed_for_decode_scope","decide_input_mode_not_allowed","decode_input_mode_not_allowed","decode_scope_not_configured","structured_items_limit_exceeded","food_name_too_long","food_attributes_limit_exceeded","food_attribute_too_long","invalid_food_quantity","food_quantity_exceeded","food_text_too_long","unsupported_input_field","invalid_food_image","image_inputs_limit_exceeded","audio_inputs_limit_exceeded","image_too_large","audio_too_large","inline_media_total_exceeded","media_total_exceeded","audio_duration_exceeded","audio_duration_unavailable","unauthorized","design_input_mode_not_allowed","service_busy","job_creation_failed","no_recipe_found","no_meal_plan_found","job_deadline_exceeded","conflicting_requirements","voice_transcription_empty","invalid_normalized_request","technical_generation_error"]},"message":{"type":"string"},"details":{"nullable":true}},"additionalProperties":true},"meta":{"type":"object","required":["request_id","api_version"],"properties":{"request_id":{"type":"string","example":"req_..."},"api_version":{"type":"string","enum":["2026-07-10","2026-09-29"]}},"additionalProperties":true}},"additionalProperties":false}}}}