{
  "openapi": "3.1.0",
  "info": {
    "title": "Yojimbo — live restaurant info, menu search and order links",
    "version": "1.0.0",
    "summary": "Public, read-only endpoints maintained by Yojimbo (Japanese kitchen & gallery, 2319 Santa Clara Ave, Alameda, CA) for AI assistants and agents. No API key. Nothing here places or charges an order — the order-link endpoint only builds a link the guest opens to review, pick a pickup time and pay on yojimboalameda.com.",
    "contact": { "name": "Yojimbo", "url": "https://yojimboalameda.com/", "email": "yojimbosushi@gmail.com" },
    "x-llms-txt": "https://yojimboalameda.com/llms.txt"
  },
  "servers": [{ "url": "https://yojimboalameda.com" }],
  "paths": {
    "/api/agent/info": {
      "get": {
        "operationId": "getRestaurantInfo",
        "summary": "Is Yojimbo open right now? Hours, next opening, special closures, current pickup estimate, address, phone, services.",
        "description": "Times are Pacific Time (America/Los_Angeles). Call this before telling a guest to go or before building an order, because holidays and special closures are only known live.",
        "parameters": [
          { "name": "date", "in": "query", "required": false, "schema": { "type": "string", "format": "date" }, "description": "Optional YYYY-MM-DD — adds `date_query` with whether the restaurant is open that day." }
        ],
        "responses": {
          "200": {
            "description": "Restaurant facts plus live status.",
            "content": { "application/json": { "schema": {
              "type": "object",
              "properties": {
                "name": { "type": "string" }, "url": { "type": "string" }, "phone": { "type": "string" }, "email": { "type": "string" },
                "address": { "type": "object", "properties": { "full": { "type": "string" }, "street": { "type": "string" }, "city": { "type": "string" }, "region": { "type": "string" }, "zip": { "type": "string" }, "country": { "type": "string" } } },
                "geo": { "type": "object", "properties": { "lat": { "type": "number" }, "lng": { "type": "number" } } },
                "timezone": { "type": "string" }, "local_time": { "type": "string" },
                "open_now": { "type": "boolean" },
                "status": { "type": "string", "description": "Human sentence, e.g. \"Open now — closes at 9:00 PM\" or \"Closed now — opens Tuesday 2026-10-13 at 11:00 AM\"." },
                "closes_at": { "type": "string" }, "minutes_until_close": { "type": "integer" },
                "next_open": { "type": "object", "properties": { "date": { "type": "string" }, "weekday": { "type": "string" }, "time": { "type": "string" } } },
                "regular_hours": { "type": "object", "properties": { "days": { "type": "string" }, "open": { "type": "string" }, "close": { "type": "string" }, "closed": { "type": "array", "items": { "type": "string" } }, "text": { "type": "string" } } },
                "next_7_days": { "type": "array", "items": { "type": "object", "properties": { "date": { "type": "string" }, "weekday": { "type": "string" }, "open": { "type": "boolean" }, "hours": { "type": ["string", "null"] }, "reason": { "type": "string" } } } },
                "special_closures": { "type": "array", "items": { "type": "string", "format": "date" } },
                "pickup": { "type": "object", "properties": { "order_url": { "type": "string" }, "estimated_ready_minutes": { "type": "integer" }, "note": { "type": "string" } } },
                "services": { "type": "array", "items": { "type": "string" } },
                "payments_online": { "type": "string" }, "sales_tax_percent": { "type": "number" },
                "allergens": { "type": "array", "items": { "type": "string" } },
                "catering": { "type": "string" }, "rewards": { "type": "string" },
                "good_for": { "type": "array", "items": { "type": "string" } },
                "house_favorites": { "type": "array", "items": { "type": "string" } },
                "group_events": { "type": "object", "properties": { "capacity": { "type": "integer" }, "summary": { "type": "string" }, "terms": { "type": "array", "items": { "type": "string" } }, "how_to_book": { "type": "string" } } },
                "links": { "type": "object", "additionalProperties": { "type": "string" } },
                "date_query": { "type": "object" }
              }
            } } }
          }
        }
      }
    },
    "/api/agent/menu": {
      "get": {
        "operationId": "searchMenu",
        "summary": "Search the full menu with current prices (USD, before 10.75% sales tax).",
        "description": "All filters are optional and combine with AND. Returns every matching item plus the option rules an order needs (ramen soup bases, large sizes, required maki choice for sushi combos, Bento Mixer choices).",
        "parameters": [
          { "name": "q", "in": "query", "schema": { "type": "string" }, "description": "Words matched against item name, description and category, e.g. `salmon`, `eel roll`." },
          { "name": "category", "in": "query", "schema": { "type": "string", "enum": ["Appetizers", "Buns", "Bento Box", "Ramen", "Donburi", "Sushi Combo", "Nigiri", "Rolls", "Curry", "Dessert", "Beverages"] } },
          { "name": "diet", "in": "query", "schema": { "type": "string" }, "description": "Comma-separated: `vegetarian`, `no-raw-fish` (or `cooked`), `spicy`, `not-spicy`. Vegetarian reflects the restaurant's own menu marking — not a vegan or allergen guarantee." },
          { "name": "max_price", "in": "query", "schema": { "type": "number" }, "description": "Only items at or below this price (ramen uses its from-price)." },
          { "name": "pickup", "in": "query", "schema": { "type": "string", "enum": ["1"] }, "description": "`1` hides dine-in-only items that cannot be ordered online." }
        ],
        "responses": {
          "200": {
            "description": "Matching items and option rules.",
            "content": { "application/json": { "schema": {
              "type": "object",
              "properties": {
                "restaurant": { "type": "string" }, "currency": { "type": "string" }, "sales_tax_percent": { "type": "number" }, "order_url": { "type": "string" },
                "categories": { "type": "array", "items": { "type": "string" } },
                "count": { "type": "integer" },
                "items": { "type": "array", "items": { "$ref": "#/components/schemas/MenuItem" } },
                "options": { "type": "object", "description": "Ramen soups/sides/large, required choices, large sizes, Bento Mixer choices — use these names in order-link lines." },
                "notes": { "type": "array", "items": { "type": "string" } },
                "filters": { "type": "string" }
              }
            } } }
          }
        }
      }
    },
    "/api/agent/order-link": {
      "get": {
        "operationId": "buildOrderLink",
        "summary": "Turn a list of dishes into a link that opens yojimboalameda.com with the cart already filled, with a priced estimate.",
        "description": "Repeat `item` once per order line. Line grammar: `[qty x] Item name [| soup: <soup>] [| large] [| maki: <choice>] [| add: <side> [x qty], …]`. Ramen needs a soup base; sushi combos need `maki: salmon` or `maki: tuna`; curry and ramen accept `large`. Build-your-own bento: `Bento Mixer | Salmon Teriyaki, Gyoza x2, Rice` (at least 4 items). Alternatively pass `items` as one JSON array of strings or objects {name, qty, soup, large, choice, addons[], mixer[]}. Nothing is ordered or charged — give `order_url` to the guest, who reviews the cart, picks a pickup time and pays on the site.",
        "parameters": [
          { "name": "item", "in": "query", "schema": { "type": "array", "items": { "type": "string" } }, "style": "form", "explode": true, "description": "One order line per `item` parameter, URL-encoded. Example: `item=2 x Chirashi&item=Pork Ramen | soup: Miso | large&item=Sushi Combo A | maki: salmon`" },
          { "name": "items", "in": "query", "schema": { "type": "string" }, "description": "JSON array alternative to repeated `item` (max 40 lines total)." }
        ],
        "responses": {
          "200": {
            "description": "Cart link and priced estimate (tip not included).",
            "content": { "application/json": { "schema": {
              "type": "object",
              "properties": {
                "ok": { "type": "boolean", "const": true },
                "order_url": { "type": "string", "format": "uri" },
                "lines": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "options": { "type": ["string", "null"] }, "qty": { "type": "integer" }, "unit_price": { "type": "number" }, "line_total": { "type": "number" } } } },
                "currency": { "type": "string" }, "subtotal": { "type": "number" }, "estimated_tax": { "type": "number" }, "estimated_total": { "type": "number" },
                "instructions": { "type": "string" }
              },
              "required": ["ok", "order_url", "lines", "subtotal", "estimated_tax", "estimated_total"]
            } } }
          },
          "400": {
            "description": "A line could not be matched, or an option is missing. `problems[].options` lists the valid choices — fix the lines and call again.",
            "content": { "application/json": { "schema": {
              "type": "object",
              "properties": {
                "ok": { "type": "boolean", "const": false },
                "error": { "type": "string" },
                "problems": { "type": "array", "items": { "type": "object", "properties": { "line": { "type": "string" }, "error": { "type": "string" }, "options": { "type": "array", "items": { "type": "string" } } } } },
                "usage": { "type": "string" }, "menu": { "type": "string" }
              }
            } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MenuItem": {
        "type": "object",
        "properties": {
          "id": { "type": "string" }, "category": { "type": "string" }, "name": { "type": "string" },
          "price": { "type": "number", "description": "USD before tax. For ramen this is the base price — see price_from." },
          "price_from": { "type": "number", "description": "Ramen only: base plus the cheapest soup." },
          "description": { "type": "string" },
          "vegetarian": { "type": "boolean" }, "spicy": { "type": "boolean" }, "raw_fish": { "type": "boolean" }, "dine_in_only": { "type": "boolean" },
          "requires": { "type": "string", "enum": ["soup", "choice"], "description": "`soup` = pick a soup base (ramen); `choice` = pick salmon or tuna maki (sushi combos)." },
          "large_upcharge": { "type": "number" }
        }
      }
    }
  }
}
