{"openapi":"3.1.0","info":{"title":"Gustu public API","version":"1.1.0","description":"Two things. The menu: read-only, structured menus of restaurants on Gustu (sections, dishes, prices, diet tags and allergens, in the restaurant's languages), no authentication, cached for five minutes. The chat: one turn of a restaurant's menu-aware assistant, with an API key the restaurant owner issues. Allergen and diet data come from the restaurant.","contact":{"email":"hello@gustu.ai","url":"https://gustu.ai/developers"}},"servers":[{"url":"https://menu.gustu.ai/api/public/v1"}],"paths":{"/chat":{"post":{"operationId":"chat","summary":"One turn of the restaurant's chat assistant","description":"Needs an API key the restaurant owner created in Gustu (Settings → API), sent as a bearer token. Each answered turn is deducted from the restaurant's plan. Call it from a server: a request with a browser Origin is refused unless the key lists that origin.","security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Accepted and logged in phase A; not yet enforced.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicChatRequest"}}}},"responses":{"200":{"description":"The answer. JSON by default; `stream: true` gives server-sent events: `meta` {conversation_id, language, request_id}, `text` {delta}…, `items` {items}, `suggestions` {suggestions}, then `done` {usage, request_id} or `error` {code, message}.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"X-Turn-Count":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicChatAnswer"}},"text/event-stream":{"schema":{"type":"string","description":"SSE frames; each `data:` line is one JSON object"}}}},"400":{"description":"Invalid body, unsupported language, or a branch must be named (invalid_request, invalid_language, branch_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatError"}}}},"401":{"description":"Missing or unknown key (unauthorized, invalid_api_key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatError"}}}},"402":{"description":"The restaurant's plan has no turns left, or the conversation reached its cap (turns_exhausted, conversation_capped)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatError"}}}},"403":{"description":"The key is revoked or expired, the origin or branch is not allowed, or the restaurant closed its public surface (invalid_api_key, api_key_revoked, api_key_expired, origin_not_allowed, branch_not_allowed, surface_disabled, session_blocked)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatError"}}}},"404":{"description":"Unknown branch or conversation (branch_not_found, conversation_not_found)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatError"}}}},"429":{"description":"Per-key requests per minute or daily cost cap reached; Retry-After is set (rate_limited, daily_budget_exceeded, demo_limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatError"}}}},"500":{"description":"Unexpected error (internal_error)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatError"}}}},"503":{"description":"The limiter or budget store is unavailable (refused rather than let through unmetered), or the demo restaurant's daily budget is spent (limiter_unavailable, demo_limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatError"}}}},"504":{"description":"The model did not answer in time: 30 seconds, 45 for a recommendation question; the turn is not billed (upstream_timeout)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatError"}}}}}}},"/restaurants/{slug}/menu":{"get":{"operationId":"getRestaurantMenu","summary":"A restaurant branch's public menu","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,99}$"}},{"name":"branch","in":"query","required":false,"description":"Branch slug; needed when the restaurant has more than one branch.","schema":{"type":"string"}},{"name":"lang","in":"query","required":false,"description":"Defaults to the restaurant's own language.","schema":{"type":"string","enum":["en","tr","ar","fa","fr","es","de","ru","zh","ja","it","pt","nl","sv","da","no","fi","pl","hu","cs","sk","hr","sr","bg","ro","uk","he","th","vi","ko","hi","ka","el"]}}],"responses":{"200":{"description":"The menu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestaurantPublicProfile"}}}},"300":{"description":"Several branches and none named","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["branches"],"properties":{"branches":{"type":"array","items":{"$ref":"#/components/schemas/BranchChoice"}}}}]}}}},"400":{"description":"Unsupported language","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The restaurant does not publish its menu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown restaurant or branch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 60 requests per minute per IP","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"PublicMenuItem":{"type":"object","required":["id","name","description","price","currency","url","itemType","imageUrl","categoryId","category","dietTags","allergens","calories","updatedAt"],"properties":{"id":{"type":"string","description":"UUID"},"name":{"type":"string","description":"In the requested language"},"description":{"type":["string","null"]},"price":{"type":"number","minimum":0},"currency":{"type":"string","description":"ISO 4217, e.g. TRY"},"url":{"type":"string","description":"Canonical item page"},"itemType":{"type":["string","null"],"description":"food | beverage | alcohol | dessert"},"imageUrl":{"type":["string","null"]},"categoryId":{"type":["string","null"]},"category":{"type":["string","null"]},"dietTags":{"type":"array","items":{"type":"string"},"description":"Canonical taxonomy values, e.g. vegan"},"allergens":{"type":"array","items":{"type":"string"},"description":"Canonical taxonomy values, e.g. milk"},"calories":{"type":["integer","null"]},"updatedAt":{"type":"string","description":"ISO 8601"}}},"PublicMenuSection":{"type":"object","required":["id","name","items"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PublicMenuItem"}}}},"PublicPriceRange":{"type":"object","required":["min","max","currency"],"description":"Lowest and highest price of available food and dessert items.","properties":{"min":{"type":"number"},"max":{"type":"number"},"currency":{"type":"string"}}},"RestaurantPublicProfile":{"type":"object","required":["schemaVersion","generatedAt","language","availableLanguages","publicSurfaceEnabled","restaurant","branch","urls","hours","priceRange","sections","itemCount","dietaryCoverage","allergenVocabulary","vocabulary","disclaimer"],"properties":{"schemaVersion":{"const":1},"generatedAt":{"type":"string","description":"ISO 8601"},"language":{"type":"string","description":"Language the names and vocabulary resolved in"},"availableLanguages":{"type":"array","items":{"type":"string"}},"publicSurfaceEnabled":{"type":"boolean"},"restaurant":{"type":"object","required":["id","slug","name","description","phone","email","primaryLanguage","logoUrl","heroImageUrl"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"primaryLanguage":{"type":"string"},"logoUrl":{"type":["string","null"]},"heroImageUrl":{"type":["string","null"]}}},"branch":{"type":"object","required":["id","slug","name","address","phone","email","latitude","longitude","timezone"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"timezone":{"type":["string","null"]}}},"urls":{"type":"object","required":["canonical","chat","llmsTxt","sitemap","api"],"properties":{"canonical":{"type":"string"},"chat":{"type":"string"},"llmsTxt":{"type":"string"},"sitemap":{"type":"string"},"api":{"type":"string"}}},"hours":{"type":"null","description":"Opening hours arrive in a later phase."},"priceRange":{"oneOf":[{"$ref":"#/components/schemas/PublicPriceRange"},{"type":"null"}]},"sections":{"type":"array","items":{"$ref":"#/components/schemas/PublicMenuSection"}},"itemCount":{"type":"integer","minimum":0},"dietaryCoverage":{"type":"object","additionalProperties":{"type":"integer"}},"allergenVocabulary":{"type":"array","items":{"type":"string"}},"vocabulary":{"type":"object","required":["dietTags","allergens"],"properties":{"dietTags":{"type":"object","additionalProperties":{"type":"string"}},"allergens":{"type":"object","additionalProperties":{"type":"string"}}}},"disclaimer":{"type":"string","description":"Allergen and diet data come from the restaurant; confirm serious allergies with staff."}}},"BranchChoice":{"type":"object","required":["slug","name","address","menuUrl","canonicalUrl"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"address":{"type":["string","null"]},"menuUrl":{"type":"string"},"canonicalUrl":{"type":"string"}}},"PublicChatRequest":{"type":"object","required":["message"],"additionalProperties":false,"properties":{"message":{"type":"string","minLength":1,"maxLength":4000,"description":"The guest's message, in any language."},"conversation_id":{"type":"string","description":"From a previous answer. Omit to start a conversation; the answer carries the new id."},"branch":{"type":"string","description":"Branch slug or id. Required when the key is not restricted to a branch and the restaurant has several."},"language":{"type":"string","enum":["en","tr","ar","fa","fr","es","de","ru","zh","ja","it","pt","nl","sv","da","no","fi","pl","hu","cs","sk","hr","sr","bg","ro","uk","he","th","vi","ko","hi","ka","el"],"description":"Preferred answer language. Detected from the message when omitted."},"stream":{"type":"boolean","default":false,"description":"true answers text/event-stream (events: meta, text, items, suggestions, done, error)."},"end_user_id":{"type":"string","maxLength":128,"description":"Your id for the end user. Hashed before it reaches analytics; never stored as is."},"metadata":{"type":"object","additionalProperties":true,"description":"Up to 1024 bytes of JSON. Validated, not stored in phase A."}}},"PublicChatItem":{"type":"object","required":["id","name","description","price","currency","imageUrl","url","category","isAvailable","dietTags","allergens","reason"],"description":"A dish the assistant showed as a card. Name, price, diet tags and allergens come from the menu, never from the model.","properties":{"id":{"type":"string","description":"UUID"},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"number","minimum":0},"currency":{"type":"string","description":"ISO 4217, or empty when the restaurant set none"},"imageUrl":{"type":["string","null"]},"url":{"type":"string","description":"The dish's page on the diner menu"},"category":{"type":["string","null"]},"isAvailable":{"type":"boolean"},"dietTags":{"type":"array","items":{"type":"string"},"description":"Canonical taxonomy values, e.g. vegan"},"allergens":{"type":"array","items":{"type":"string"},"description":"Canonical taxonomy values, e.g. milk"},"reason":{"type":["string","null"],"description":"Why the assistant picked it, in the answer's language"}}},"PublicChatSuggestion":{"type":"object","required":["label","message","itemId"],"description":"A follow-up the guest might tap. Send `message` (or `label`) back as the next message.","properties":{"label":{"type":"string"},"message":{"type":["string","null"]},"itemId":{"type":["string","null"],"description":"A PublicChatItem id when the chip is about one dish"}}},"PublicChatUsage":{"type":"object","required":["turn","turns_remaining_in_conversation","credits_remaining"],"properties":{"turn":{"type":"integer","minimum":1,"description":"This turn's number in the conversation"},"turns_remaining_in_conversation":{"type":"integer","minimum":0},"credits_remaining":{"type":"integer","minimum":0,"description":"Turns left in the restaurant's plan for this period"}}},"PublicChatAnswer":{"type":"object","required":["conversation_id","language","text","items","suggestions","usage","request_id"],"properties":{"conversation_id":{"type":"string","description":"Send it back to continue the conversation"},"language":{"type":"string","description":"The language the assistant answered in"},"text":{"type":"string","description":"The assistant's reply. Markdown-free prose."},"items":{"type":"array","items":{"$ref":"#/components/schemas/PublicChatItem"}},"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/PublicChatSuggestion"}},"usage":{"$ref":"#/components/schemas/PublicChatUsage"},"request_id":{"type":"string","description":"Quote it when reporting a problem"}}},"ChatBranchRef":{"type":"object","required":["id","slug","name"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}}},"ChatError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_request","invalid_language","branch_required","unauthorized","invalid_api_key","turns_exhausted","conversation_capped","api_key_revoked","api_key_expired","origin_not_allowed","branch_not_allowed","surface_disabled","session_blocked","branch_not_found","conversation_not_found","rate_limited","daily_budget_exceeded","demo_limit","internal_error","limiter_unavailable","upstream_timeout"]},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object"},"description":"With invalid_request"},"branches":{"type":"array","items":{"$ref":"#/components/schemas/ChatBranchRef"},"description":"With branch_required"},"branch":{"$ref":"#/components/schemas/ChatBranchRef","description":"With branch_not_allowed: the branch the key is restricted to"},"limit":{"type":"integer","description":"With rate_limited: the key's requests per minute"},"retry_after_seconds":{"type":"integer","description":"With rate_limited and daily_budget_exceeded"},"daily_budget_usd":{"type":"number","description":"With daily_budget_exceeded"},"spent_usd":{"type":"number","description":"With daily_budget_exceeded"},"turns_remaining":{"type":"integer","description":"With turns_exhausted and conversation_capped: credits left in the plan"},"turn_count":{"type":"integer","description":"With turns_exhausted and conversation_capped: turns this conversation has had"}}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["restaurant_not_found","branch_not_found","branch_required","surface_disabled","invalid_language","rate_limited","internal_error"]},"message":{"type":"string"},"supported":{"type":"array","items":{"type":"string"},"description":"Only with invalid_language"}}}}}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"gk_live_…","description":"An API key from the restaurant's Gustu dashboard (Settings → API)."}}}}