# RecipeBee public API OpenAPI specification

The complete OpenAPI 3.1 YAML document follows.

    openapi: "3.1.0"
    info:
      title: RecipeBee Public API
      version: "1.0.0"
      description: |
        Publicly served OpenAPI document for RecipeBee. Public GET endpoints let
        agents search and read recipes, categories, tags, cookbooks, and blog posts
        without authentication. Selected image-generation batch endpoints require
        a Laravel Sanctum bearer token and a verified email address; they are
        scoped to the authenticated account.
        The NLWeb /ask endpoint supports list-mode search over public recipes.
        Creating a review batch does not use credits. Starting one requires explicit
        `confirm: true`, an eligible paid plan, and available credits. Remote MCP
        tools are available at https://recipebee.app/mcp.
    
        Versioning: the public API is versioned in the URL path (`/api/v1`).
        Deprecation policy: when a version is deprecated, responses include the
        `Deprecation` header; once a removal date is set, responses also include the
        `Sunset` header. Deprecated versions remain available for at least 12 months.
        Read the policy at https://recipebee.app/deprecation.md.
    
        Rate limits: responses include IETF `RateLimit`, `RateLimit-Limit`,
        `RateLimit-Remaining`, and `RateLimit-Reset` headers, plus legacy
        `X-RateLimit-*`. A 429 includes `Retry-After`.
    
        Pagination: prefer cursor pagination (`cursor` + `data.meta.next_cursor`)
        on list endpoints. Page-based `page` remains supported.
    
      contact:
        name: RecipeBee Support
        email: support@recipebee.app
        url: https://recipebee.app
      license:
        name: MIT
        url: https://opensource.org/licenses/MIT
    servers:
      - url: https://recipebee.app
        description: Production
      - url: http://localhost:8000
        description: Local development
    tags:
      - name: Discovery
        description: Machine-readable catalogs for agents
      - name: Agent Discovery
        description: Natural-language search for public recipes
      - name: Recipes
        description: Public recipes
      - name: Categories
        description: Recipe categories
      - name: Tags
        description: Recipe tags
      - name: Cookbooks
        description: Public shared cookbooks
      - name: Blog
        description: Public blog posts
      - name: Health
        description: Service health
      - name: AI Image Generation
        description: Authenticated image-batch review, confirmation, and progress
    paths:
      /ask:
        options:
          operationId: nlwebAskOptions
          tags: [Agent Discovery]
          summary: Handle CORS preflight for NLWeb recipe search
          responses:
            "204":
              description: CORS preflight accepted.
        get:
          operationId: nlwebAskGet
          tags: [Agent Discovery]
          summary: Search public recipes with NLWeb
          description: NLWeb v0.55 list-mode search over public RecipeBee recipes. Set Accept to text/event-stream or streaming=true to receive start, result, and complete events.
          parameters:
            - name: query
              in: query
              required: true
              schema:
                type: string
                maxLength: 160
            - name: max_results
              in: query
              schema:
                type: integer
                minimum: 1
                maximum: 10
                default: 5
            - name: mode
              in: query
              schema:
                type: string
                enum: [list]
                default: list
            - name: streaming
              in: query
              schema:
                type: boolean
                default: false
          responses:
            "200":
              description: Search results as Recipe JSON-LD, or an SSE stream when requested.
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/NlWebAskResponse"
                text/event-stream:
                  schema:
                    type: string
                    description: SSE start, result, and complete events using NLWeb v0.55.
            "400":
              $ref: "#/components/responses/BadRequest"
            "429":
              $ref: "#/components/responses/TooManyRequests"
            "502":
              description: Public recipe search is temporarily unavailable.
            "504":
              description: Public recipe search timed out.
        post:
          operationId: nlwebAskPost
          tags: [Agent Discovery]
          summary: Search public recipes with NLWeb
          description: Accepts an NLWeb v0.55 JSON request and returns public RecipeBee recipe matches in list mode.
          requestBody:
            required: true
            content:
              application/json:
                schema:
                  $ref: "#/components/schemas/NlWebAskRequest"
              application/x-www-form-urlencoded:
                schema:
                  type: object
                  required: [query]
                  properties:
                    query:
                      type: string
                      maxLength: 160
          responses:
            "200":
              description: Search results as Recipe JSON-LD, or an SSE stream when requested.
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/NlWebAskResponse"
                text/event-stream:
                  schema:
                    type: string
                    description: SSE start, result, and complete events using NLWeb v0.55.
            "400":
              $ref: "#/components/responses/BadRequest"
            "413":
              description: Request body exceeds 16 KB.
            "415":
              description: Unsupported content type.
            "429":
              $ref: "#/components/responses/TooManyRequests"
            "502":
              description: Public recipe search is temporarily unavailable.
            "504":
              description: Public recipe search timed out.
      /api:
        get:
          operationId: getApiCatalog
          tags: [Discovery]
          summary: List the public API catalog
          description: Returns the public RecipeBee REST catalog, OpenAPI locations, and MCP endpoint.
          responses:
            "200":
              description: Public API catalog
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/ApiCatalog"
            "429":
              $ref: "#/components/responses/TooManyRequests"
            "500":
              $ref: "#/components/responses/ServerError"
      /api/v1:
        get:
          operationId: getApiV1Catalog
          tags: [Discovery]
          summary: List the versioned public API catalog
          description: Same catalog as /api, scoped to the v1 namespace.
          responses:
            "200":
              description: Public API catalog
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/ApiCatalog"
            "429":
              $ref: "#/components/responses/TooManyRequests"
            "500":
              $ref: "#/components/responses/ServerError"
      /api/openapi.json:
        get:
          operationId: getOpenApiJson
          tags: [Discovery]
          summary: Download this OpenAPI specification as JSON
          responses:
            "200":
              description: OpenAPI 3.1 document
              content:
                application/json:
                  schema:
                    type: object
                    additionalProperties: true
            "429":
              $ref: "#/components/responses/TooManyRequests"
      /api/openapi.yaml:
        get:
          operationId: getOpenApiYaml
          tags: [Discovery]
          summary: Download this OpenAPI specification as YAML
          responses:
            "200":
              description: OpenAPI 3.1 document
              content:
                application/yaml:
                  schema:
                    type: string
            "429":
              $ref: "#/components/responses/TooManyRequests"
      /api/v1/health:
        get:
          operationId: getHealth
          tags: [Health]
          summary: Check API health
          responses:
            "200":
              description: Service is healthy
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/HealthStatus"
            "503":
              description: Service is unhealthy
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/Error"
                application/problem+json:
                  schema:
                    $ref: "#/components/schemas/ProblemDetails"
      /api/v1/health/ping:
        get:
          operationId: pingHealth
          tags: [Health]
          summary: Lightweight ping
          responses:
            "200":
              description: Service is reachable
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/HealthPing"
            "429":
              $ref: "#/components/responses/TooManyRequests"
      /api/v1/public/recipes:
        get:
          operationId: listPublicRecipes
          tags: [Recipes]
          summary: List public recipes
          description: Paginated public recipes. No authentication required. Prefer cursor pagination (`cursor`) over `page`.
          parameters:
            - name: q
              in: query
              description: Search term applied to recipe title or slug
              schema:
                type: string
                maxLength: 160
                example: chocolate chip
            - name: per_page
              in: query
              schema:
                type: integer
                minimum: 1
                maximum: 100
                default: 20
            - name: cursor
              in: query
              description: Opaque cursor from data.meta.next_cursor. When present, the response uses cursor pagination.
              schema:
                type: string
            - name: page
              in: query
              description: Page number for offset pagination. Ignored when cursor is provided.
              schema:
                type: integer
                minimum: 1
                default: 1
            - name: view
              in: query
              description: Use card for compact listing data
              schema:
                type: string
                enum: [card, full]
                default: full
            - name: categories
              in: query
              description: Comma-separated category slugs (AND logic)
              schema:
                type: string
                example: breakfast,dessert
            - name: tags
              in: query
              description: Comma-separated tag slugs (AND logic)
              schema:
                type: string
                example: gluten-free,quick-meal
          responses:
            "200":
              description: Paginated public recipes
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/PaginatedRecipes"
            "400":
              $ref: "#/components/responses/BadRequest"
            "429":
              $ref: "#/components/responses/TooManyRequests"
            "500":
              $ref: "#/components/responses/ServerError"
      /api/v1/public/recipes/{slug}:
        get:
          operationId: getPublicRecipe
          tags: [Recipes]
          summary: Get a public recipe
          parameters:
            - name: slug
              in: path
              required: true
              schema:
                type: string
                example: butter-chicken-stuffed-buns-soft-fluffy
          responses:
            "200":
              description: Public recipe
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/PublicRecipe"
            "404":
              $ref: "#/components/responses/NotFound"
            "429":
              $ref: "#/components/responses/TooManyRequests"
      /api/v1/categories:
        get:
          operationId: listCategories
          tags: [Categories]
          summary: List recipe categories
          parameters:
            - name: parent
              in: query
              description: Filter by parent category slug. Use "null" for root categories.
              schema:
                type: string
            - name: tree
              in: query
              description: Return the category hierarchy instead of a flat list.
              schema:
                type: boolean
            - name: active_only
              in: query
              description: Retained for tree clients; active categories are always returned.
              schema:
                type: boolean
            - name: per_page
              in: query
              description: Limit the flat category list to between 1 and 100 categories.
              schema:
                type: integer
                minimum: 1
                maximum: 100
          responses:
            "200":
              description: Categories
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/CategoryList"
            "422":
              description: Invalid per_page value
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/Error"
            "429":
              $ref: "#/components/responses/TooManyRequests"
      /api/v1/categories/{category}:
        get:
          operationId: getPublicCategory
          tags: [Categories]
          summary: Get an active recipe category
          description: Returns an active category by slug with recipes visible to the current visitor. Authentication is optional.
          parameters:
            - name: category
              in: path
              required: true
              description: Category slug.
              schema:
                type: string
          responses:
            "200":
              description: Active category and its visible recipe references
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/PublicCategory"
            "404":
              $ref: "#/components/responses/NotFound"
            "429":
              $ref: "#/components/responses/TooManyRequests"
      /api/v1/tags:
        get:
          operationId: listTags
          tags: [Tags]
          summary: List recipe tags
          parameters:
            - name: q
              in: query
              description: Search active tag names and slugs.
              schema:
                type: string
          responses:
            "200":
              description: Tags
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/TagList"
            "429":
              $ref: "#/components/responses/TooManyRequests"
      /api/v1/tags/{slug}:
        get:
          operationId: getPublicTag
          tags: [Tags]
          summary: Get a public recipe tag
          parameters:
            - name: slug
              in: path
              required: true
              schema:
                type: string
          responses:
            "200":
              description: Public tag and its public recipe references
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/PublicTag"
            "404":
              $ref: "#/components/responses/NotFound"
            "429":
              $ref: "#/components/responses/TooManyRequests"
      /api/v1/public/cookbooks/{slug}:
        get:
          operationId: getPublicCookbook
          tags: [Cookbooks]
          summary: Get a public shared cookbook
          parameters:
            - name: slug
              in: path
              required: true
              schema:
                type: string
          responses:
            "200":
              description: Public cookbook
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/PublicCookbook"
            "404":
              $ref: "#/components/responses/NotFound"
            "429":
              $ref: "#/components/responses/TooManyRequests"
      /api/v1/blog-posts:
        get:
          operationId: listBlogPosts
          tags: [Blog]
          summary: List public blog posts
          parameters:
            - name: per_page
              in: query
              description: Number of published posts per page (1–50).
              schema:
                type: integer
                minimum: 1
                maximum: 50
                default: 15
            - name: page
              in: query
              description: Page number for pagination.
              schema:
                type: integer
                minimum: 1
                default: 1
          responses:
            "200":
              description: Blog posts
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/BlogPostList"
            "422":
              description: Invalid per_page or page value
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/Error"
            "429":
              $ref: "#/components/responses/TooManyRequests"
      /api/v1/blog-posts/{slug}:
        get:
          operationId: getPublicBlogPost
          tags: [Blog]
          summary: Get a published blog post
          parameters:
            - name: slug
              in: path
              required: true
              schema:
                type: string
          responses:
            "200":
              description: Published blog post
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/PublicBlogPost"
            "404":
              $ref: "#/components/responses/NotFound"
            "429":
              $ref: "#/components/responses/TooManyRequests"
      /api/v1/image-generation-batches:
        post:
          operationId: createImageGenerationBatch
          tags: [AI Image Generation]
          summary: Create a reviewable image batch
          description: Create a zero-cost review batch for recipes owned by the authenticated user. No image provider runs and no credits are reserved until the user explicitly confirms the batch with the start endpoint.
          security:
            - BearerToken: []
          parameters:
            - name: Idempotency-Key
              in: header
              required: false
              description: Optional retry key to prevent duplicate batch creation.
              schema:
                type: string
                maxLength: 255
          requestBody:
            required: true
            content:
              application/json:
                schema:
                  $ref: "#/components/schemas/ImageGenerationBatchCreateRequest"
          responses:
            "201":
              description: Review batch created without reserving credits
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/ImageGenerationBatchResponse"
            "401":
              description: Unauthenticated
            "404":
              description: One or more recipes were not found for the authenticated user
            "422":
              description: Invalid batch request
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/Error"
            "429":
              $ref: "#/components/responses/TooManyRequests"
            "500":
              $ref: "#/components/responses/ServerError"
      /api/v1/image-generation-batches/{batch}:
        get:
          operationId: getImageGenerationBatch
          tags: [AI Image Generation]
          summary: Get image batch progress
          security:
            - BearerToken: []
          parameters:
            - name: batch
              in: path
              required: true
              description: Image-generation batch UUID owned by the authenticated user.
              schema:
                $ref: "#/components/schemas/Uuid"
          responses:
            "200":
              description: Current batch state and per-recipe progress
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/ImageGenerationBatchResponse"
            "401":
              description: Unauthenticated
            "404":
              description: Batch not found for the authenticated user
            "429":
              $ref: "#/components/responses/TooManyRequests"
            "500":
              $ref: "#/components/responses/ServerError"
      /api/v1/image-generation-batches/{batch}/start:
        post:
          operationId: startImageGenerationBatch
          tags: [AI Image Generation]
          summary: Confirm and queue image generation
          description: Starts the reviewed batch only after explicit user confirmation. This action can reserve and consume image credits. The 202 response includes the batch ID and a Location URL for polling status.
          security:
            - BearerToken: []
          parameters:
            - name: batch
              in: path
              required: true
              schema:
                $ref: "#/components/schemas/Uuid"
          requestBody:
            required: true
            content:
              application/json:
                schema:
                  $ref: "#/components/schemas/ImageGenerationBatchStartRequest"
          responses:
            "202":
              description: Selected images queued for asynchronous generation
              headers:
                Location:
                  description: Poll this URL to retrieve batch status and progress.
                  schema:
                    type: string
                    format: uri
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/ImageGenerationBatchResponse"
            "401":
              description: Unauthenticated
            "402":
              description: Insufficient image credits
            "403":
              description: A paid plan or image-generation access is required
            "404":
              description: Batch not found
            "409":
              description: Batch cannot be started
            "422":
              description: Explicit confirmation or recipe selection is invalid
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/Error"
            "429":
              $ref: "#/components/responses/TooManyRequests"
            "500":
              $ref: "#/components/responses/ServerError"
      /api/v1/image-generation-batches/{batch}/retry:
        post:
          operationId: retryImageGenerationBatch
          tags: [AI Image Generation]
          summary: Return failed images to review
          description: Resets selected failed items for review. The user must confirm the batch again before more credits are reserved.
          security:
            - BearerToken: []
          parameters:
            - name: batch
              in: path
              required: true
              schema:
                $ref: "#/components/schemas/Uuid"
          requestBody:
            required: false
            content:
              application/json:
                schema:
                  $ref: "#/components/schemas/ImageGenerationBatchRetryRequest"
          responses:
            "200":
              description: Failed items are ready for review
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/ImageGenerationBatchResponse"
            "401":
              description: Unauthenticated
            "404":
              description: Batch not found
            "409":
              description: No failed items are available to retry
            "422":
              description: Recipe selection is invalid
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/Error"
            "429":
              $ref: "#/components/responses/TooManyRequests"
            "500":
              $ref: "#/components/responses/ServerError"
      /api/v1/image-generation-batches/{batch}/cancel:
        post:
          operationId: cancelImageGenerationBatch
          tags: [AI Image Generation]
          summary: Cancel queued image generation
          security:
            - BearerToken: []
          parameters:
            - name: batch
              in: path
              required: true
              schema:
                $ref: "#/components/schemas/Uuid"
          responses:
            "200":
              description: Batch cancelled
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/ImageGenerationBatchResponse"
            "401":
              description: Unauthenticated
            "404":
              description: Batch not found
            "429":
              $ref: "#/components/responses/TooManyRequests"
            "500":
              $ref: "#/components/responses/ServerError"
    components:
      securitySchemes:
        BearerToken:
          type: http
          scheme: bearer
          bearerFormat: Bearer
          description: Laravel Sanctum bearer token for an authenticated RecipeBee account with a verified email address.
      responses:
        BadRequest:
          description: The request was invalid
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
        NotFound:
          description: The resource was not found or is not public
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
        TooManyRequests:
          description: Rate limit exceeded. Retry after the Retry-After header.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
        ServerError:
          description: Unexpected server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      schemas:
        NlWebAskRequest:
          type: object
          required: [query]
          properties:
            query:
              oneOf:
                - type: string
                - type: object
                  required: [text]
                  properties:
                    text:
                      type: string
                      maxLength: 160
            prefer:
              type: object
              properties:
                mode:
                  type: string
                  enum: [list]
                  default: list
                streaming:
                  type: boolean
                  default: false
            max_results:
              type: integer
              minimum: 1
              maximum: 10
              default: 5
        NlWebAskResponse:
          type: object
          required: [_meta, query_id, query, results]
          properties:
            _meta:
              type: object
              required: [response_type, response_format, version]
              properties:
                response_type:
                  type: string
                  enum: [answer]
                response_format:
                  type: string
                  enum: [conversational_search]
                version:
                  type: string
                  example: "0.55"
            query_id:
              type: string
            query:
              type: object
              properties:
                text:
                  type: string
            results:
              type: array
              items:
                $ref: "#/components/schemas/NlWebRecipeResult"
        NlWebRecipeResult:
          type: object
          required: ["@context", "@type", name, url]
          properties:
            "@context":
              type: string
              format: uri
            "@type":
              type: string
              enum: [Recipe]
            name:
              type: string
            url:
              type: string
              format: uri
            description:
              type: string
            image:
              type: string
              format: uri
            recipeYield:
              type: string
            prepTime:
              type: string
              description: ISO 8601 duration.
            cookTime:
              type: string
              description: ISO 8601 duration.
            totalTime:
              type: string
              description: ISO 8601 duration.
            keywords:
              type: string
            aggregateRating:
              type: object
              properties:
                "@type":
                  type: string
                  enum: [AggregateRating]
                ratingValue:
                  type: number
                ratingCount:
                  type: integer
        ApiCatalog:
          type: object
          required: [name, version, openapi, mcp, endpoints]
          properties:
            name:
              type: string
              example: RecipeBee
            version:
              type: string
              example: v1
            description:
              type: string
            openapi:
              type: object
              properties:
                json:
                  type: string
                  format: uri
                yaml:
                  type: string
                  format: uri
            mcp:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                transport:
                  type: string
                  example: streamable-http
                server_card:
                  type: string
                  format: uri
            endpoints:
              type: array
              items:
                type: object
                properties:
                  method:
                    type: string
                  path:
                    type: string
                  description:
                    type: string
        HealthStatus:
          type: object
          properties:
            status:
              type: string
              example: healthy
            timestamp:
              type: string
              format: date-time
        ApiEnvelope:
          type: object
          properties:
            status:
              type: string
              example: success
            statusCode:
              type: integer
              example: 200
            message:
              type: string
            data:
              description: Endpoint-specific payload
            timestamp:
              type: string
              format: date-time
        PaginatedRecipes:
          allOf:
            - $ref: "#/components/schemas/ApiEnvelope"
            - type: object
              properties:
                data:
                  type: object
                  properties:
                    data:
                      type: array
                      items:
                        $ref: "#/components/schemas/PublicRecipeSummary"
                    meta:
                      type: object
                      properties:
                        pagination:
                          type: string
                          enum: [page, cursor]
                        current_page:
                          type: integer
                        last_page:
                          type: integer
                        per_page:
                          type: integer
                        total:
                          type: integer
                        has_more:
                          type: boolean
                        next_cursor:
                          type: string
                          nullable: true
                        prev_cursor:
                          type: string
                          nullable: true
                    links:
                      type: object
                      properties:
                        next:
                          type: string
                          format: uri
                          nullable: true
                        prev:
                          type: string
                          format: uri
                          nullable: true
        PublicRecipeSummary:
          type: object
          properties:
            id:
              type: string
              format: uuid
            title:
              type: string
            slug:
              type: string
            summary:
              type: string
            servings:
              type: integer
            prep_time_minutes:
              type: integer
            cook_time_minutes:
              type: integer
            is_public:
              type: boolean
              example: true
            hero_image:
              type: object
              nullable: true
            owner:
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
        HealthPing:
          type: object
          required: [status]
          properties:
            status:
              type: string
              example: ok
            timestamp:
              type: string
              format: date-time
        PublicRecipe:
          allOf:
            - $ref: "#/components/schemas/ApiEnvelope"
            - type: object
              properties:
                data:
                  $ref: "#/components/schemas/PublicRecipeSummary"
        CategoryList:
          allOf:
            - $ref: "#/components/schemas/ApiEnvelope"
            - type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: "#/components/schemas/Category"
        PublicCategory:
          allOf:
            - $ref: "#/components/schemas/ApiEnvelope"
            - type: object
              properties:
                data:
                  $ref: "#/components/schemas/Category"
        Category:
          type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            slug:
              type: string
            description:
              type: string
              nullable: true
            color:
              type: string
              nullable: true
            icon:
              type: string
              nullable: true
            cover_image_url:
              type: string
              format: uri
              nullable: true
            sort_order:
              type: integer
            is_active:
              type: boolean
            parent_id:
              type: string
              format: uuid
              nullable: true
            depth:
              type: integer
              nullable: true
            parent:
              oneOf:
                - $ref: "#/components/schemas/Category"
                - type: "null"
            children:
              type: array
              items:
                $ref: "#/components/schemas/Category"
            recipe_count:
              type: integer
            recipes:
              type: array
              items:
                $ref: "#/components/schemas/PublicRecipeSummary"
            cookbook_count:
              type: integer
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
        TagList:
          allOf:
            - $ref: "#/components/schemas/ApiEnvelope"
            - type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: "#/components/schemas/Tag"
        PublicTag:
          allOf:
            - $ref: "#/components/schemas/ApiEnvelope"
            - type: object
              properties:
                data:
                  $ref: "#/components/schemas/Tag"
        Tag:
          type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            slug:
              type: string
            color:
              type: string
              nullable: true
            sort_order:
              type: integer
            is_active:
              type: boolean
            recipe_count:
              type: integer
            cookbook_count:
              type: integer
            recipes:
              type: array
              items:
                $ref: "#/components/schemas/PublicRecipeSummary"
        PublicCookbook:
          allOf:
            - $ref: "#/components/schemas/ApiEnvelope"
            - type: object
              properties:
                data:
                  type: object
                  properties:
                    id:
                      type: string
                    title:
                      type: string
                    slug:
                      type: string
        BlogPostList:
          allOf:
            - $ref: "#/components/schemas/ApiEnvelope"
            - type: object
              properties:
                data:
                  type: object
                  properties:
                    data:
                      type: array
                      items:
                        $ref: "#/components/schemas/BlogPost"
                    links:
                      type: object
                      properties:
                        first:
                          type: string
                          format: uri
                        last:
                          type: string
                          format: uri
                        prev:
                          type: string
                          format: uri
                          nullable: true
                        next:
                          type: string
                          format: uri
                          nullable: true
                    meta:
                      type: object
                      properties:
                        current_page:
                          type: integer
                        last_page:
                          type: integer
                        per_page:
                          type: integer
                        total:
                          type: integer
        PublicBlogPost:
          allOf:
            - $ref: "#/components/schemas/ApiEnvelope"
            - type: object
              properties:
                data:
                  $ref: "#/components/schemas/BlogPost"
        BlogPost:
          type: object
          properties:
            id:
              type: string
              format: uuid
            title:
              type: string
            slug:
              type: string
            content:
              type: string
            excerpt:
              type: string
              nullable: true
            featured_image_url:
              type: string
              format: uri
              nullable: true
            author:
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                  nullable: true
                name:
                  type: string
                  nullable: true
            status:
              type: string
            show_in_app:
              type: boolean
            read_time_minutes:
              type: integer
            meta_title:
              type: string
              nullable: true
            meta_description:
              type: string
              nullable: true
            published_at:
              type: string
              format: date-time
              nullable: true
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
        Uuid:
          type: string
          format: uuid
        ImageGenerationBatchCreateRequest:
          type: object
          required: [recipe_ids]
          additionalProperties: false
          properties:
            recipe_ids:
              type: array
              minItems: 1
              maxItems: 50
              items:
                $ref: "#/components/schemas/Uuid"
            source:
              type: string
              enum: [manual, mcp_meal_plan]
              default: manual
            source_reference:
              type: string
              nullable: true
              maxLength: 128
            options:
              $ref: "#/components/schemas/ImageGenerationBatchOptions"
        ImageGenerationBatchStartRequest:
          type: object
          required: [confirm]
          additionalProperties: false
          properties:
            confirm:
              type: boolean
              enum: [true]
              description: Explicit confirmation to reserve credits and queue the selected images.
            recipe_ids:
              type: array
              maxItems: 50
              items:
                $ref: "#/components/schemas/Uuid"
        ImageGenerationBatchRetryRequest:
          type: object
          additionalProperties: false
          properties:
            recipe_ids:
              type: array
              maxItems: 50
              items:
                $ref: "#/components/schemas/Uuid"
        ImageGenerationBatchOptions:
          type: object
          additionalProperties: false
          properties:
            aspect:
              type: string
              enum: ["1:1", "3:4", "4:3", "9:16", "16:9"]
            style:
              type: string
              enum: [food_hero, ingredient_flatlay, plated_dish]
            seed:
              type: string
              nullable: true
              maxLength: 64
            custom_prompt:
              type: string
              nullable: true
              maxLength: 1000
        ImageGenerationBatchResponse:
          type: object
          required: [status, statusCode, data]
          properties:
            status:
              type: string
              enum: [success]
            statusCode:
              type: integer
              enum: [200, 201, 202]
            message:
              type: string
            data:
              $ref: "#/components/schemas/ImageGenerationBatch"
            timestamp:
              type: string
              format: date-time
        ImageGenerationBatch:
          type: object
          required: [id, status, progress, requires_confirmation, items]
          properties:
            id:
              $ref: "#/components/schemas/Uuid"
            source:
              type: string
              enum: [manual, mcp_meal_plan]
            source_reference:
              type: string
              nullable: true
            meal_plan_id:
              $ref: "#/components/schemas/Uuid"
              nullable: true
            status:
              type: string
              enum: [awaiting_confirmation, queued, processing, completed, partial, failed, cancelled]
            requested_count:
              type: integer
            eligible_count:
              type: integer
            completed_count:
              type: integer
            failed_count:
              type: integer
            skipped_count:
              type: integer
            estimated_credits:
              type: integer
            reserved_credits:
              type: integer
            available_credits:
              type: integer
            estimated_selected_credits:
              type: integer
            image_credit_cost:
              type: integer
            access:
              type: object
              properties:
                allowed:
                  type: boolean
                requires_paid_plan:
                  type: boolean
                reason:
                  type: string
                  nullable: true
                upgrade_url:
                  type: string
                  format: uri-reference
                provider_access:
                  type: object
                  additionalProperties: true
            progress:
              type: object
              required: [completed, total, percent]
              properties:
                completed:
                  type: integer
                total:
                  type: integer
                percent:
                  type: integer
                  minimum: 0
                  maximum: 100
            requires_confirmation:
              type: boolean
            web_url:
              type: string
              format: uri
            created_at:
              type: string
              format: date-time
            confirmed_at:
              type: string
              format: date-time
              nullable: true
            completed_at:
              type: string
              format: date-time
              nullable: true
            items:
              type: array
              items:
                $ref: "#/components/schemas/ImageGenerationBatchItem"
        ImageGenerationBatchItem:
          type: object
          required: [id, recipe_id, status, attempts, image_url]
          properties:
            id:
              $ref: "#/components/schemas/Uuid"
            recipe_id:
              $ref: "#/components/schemas/Uuid"
            title:
              type: string
              nullable: true
            status:
              type: string
              enum: [pending, queued, processing, succeeded, failed, skipped, cancelled]
            skip_reason:
              type: string
              nullable: true
            error:
              type: string
              nullable: true
            attempts:
              type: integer
            image_url:
              type: string
              format: uri
              nullable: true
        Error:
          type: object
          required: [message]
          properties:
            error:
              type: string
              description: Machine-readable error type
            code:
              type: string
              description: Machine-readable error code
            message:
              type: string
              description: Human-readable error message
            errors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
        ProblemDetails:
          type: object
          required: [title, status]
          properties:
            type:
              type: string
              format: uri
            title:
              type: string
            status:
              type: integer
            detail:
              type: string
            code:
              type: string
