> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kynva.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate a design (the canonical entry point)

> Submit a RenderForgeRequestV1. `operation: "preview"` renders synchronously and returns outputs in the response (200); `operation: "render"` enqueues an async job and returns 202 with a `job` reference — consume it via webhooks, `GET /render-jobs/{job_id}`, or the SSE stream. Deterministic: same request + engine version + seed → byte-identical output.



## OpenAPI

````yaml /openapi.yaml post /api/v1/facade/generate
openapi: 3.0.0
info:
  title: Kynva Public API
  description: >

    # Kynva Public API v4.0


    The stateless contract API: everything flows through

    `POST /api/v1/facade/generate` with a `RenderForgeRequestV1` body.


    ## Entry Points


    ### Sync preview

    ```

    POST /generate { operation: "preview" } → 200 with rendered outputs

    ```


    ### Async render

    ```

    POST /generate { operation: "render" } → 202 + job → poll GET
    /render-jobs/{id} or subscribe to webhooks

    ```


    ### Signed image URLs (the OG-image primitive)

    ```

    POST /api/v1/generate/sign → signed GET URLs → 302 to immutable rendered
    PNGs

    ```


    ## Core Principle

    Deterministic by construction: the same request, engine version, and seed

    produce byte-identical output.


    ## API Versioning

    Include `X-API-Version: 2026-01-01` in all requests.


    ## Authentication

    Include `Authorization: Bearer <token>` in all requests (signed image

    GET URLs authenticate by signature instead).


    ## Idempotency

    Include `Idempotency-Key: <uuid>` for all POST/PATCH mutations.


    ## Rate Limiting

    Tiered limits per endpoint category (see documentation).
  version: 4.0.0
  contact:
    name: Kynva Support
    url: https://github.com/fredadun/renderforge
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.kynva.ai
    description: Production
  - url: https://renderforge-production-838f.up.railway.app
    description: Production (direct, until api.kynva.ai DNS lands)
  - url: http://localhost:3000
    description: Development
security:
  - bearerAuth: []
tags:
  - name: Brands
    description: Brand management
  - name: BrandKits
    description: Brand kit version management
  - name: Assets
    description: Asset upload and management
  - name: Drafts
    description: Draft creation and workflow
  - name: Decisions
    description: Decision records and explainability
  - name: Render Jobs
    description: Async render job management
  - name: Webhooks
    description: Webhook configuration and DLQ
  - name: Render Now
    description: Single-call convenience endpoint
  - name: Templates (Advanced)
    description: Template selection and listing
  - name: Validation (Advanced)
    description: Stateless validation
  - name: Compile (Advanced)
    description: Stateless compilation
  - name: Licenses (Advanced)
    description: License checking
  - name: Spec Render (Advanced)
    description: Direct spec preview/render
  - name: Reference
    description: Reference data (export profiles, API versions)
  - name: System
    description: Health checks and system info
  - name: Images
    description: Generate images from templates
  - name: Templates
    description: Manage reusable templates
  - name: Health
    description: Service health and status
paths:
  /api/v1/facade/generate:
    post:
      tags:
        - Generate
      summary: Generate a design (the canonical entry point)
      description: >-
        Submit a RenderForgeRequestV1. `operation: "preview"` renders
        synchronously and returns outputs in the response (200); `operation:
        "render"` enqueues an async job and returns 202 with a `job` reference —
        consume it via webhooks, `GET /render-jobs/{job_id}`, or the SSE stream.
        Deterministic: same request + engine version + seed → byte-identical
        output.
      operationId: generate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - spec_type
                - spec_version
                - operation
                - generation_type
                - intent
                - execution
              properties:
                spec_type:
                  type: string
                  enum:
                    - renderforge_request
                spec_version:
                  type: string
                  enum:
                    - '1.0'
                operation:
                  type: string
                  enum:
                    - preview
                    - render
                  description: preview = sync (200), render = async job (202)
                generation_type:
                  type: string
                  enum:
                    - image
                    - carousel
                    - video
                    - gif
                  description: video requires the video pipeline to be enabled
                intent:
                  type: object
                  required:
                    - identity
                    - content
                    - brand_kit
                    - style_brief
                    - export_intent
                  properties:
                    identity:
                      type: object
                      required:
                        - request_id
                        - brand_id
                        - source
                      properties:
                        request_id:
                          type: string
                        brand_id:
                          type: string
                        source:
                          type: string
                          enum:
                            - renderforge
                            - direct_api
                    content:
                      type: object
                      required:
                        - spec_type
                        - spec_version
                      properties:
                        spec_type:
                          type: string
                          enum:
                            - content
                        spec_version:
                          type: string
                          enum:
                            - '1.0'
                        headline:
                          type: string
                        subhead:
                          type: string
                        body:
                          type: string
                        cta:
                          type: string
                        points:
                          type: array
                          items:
                            type: string
                    assets:
                      type: object
                      description: Optional hero/background/logo asset references
                    brand_kit:
                      type: object
                      description: >-
                        Full BrandKitV1 (fonts, colors, logos, safe_profiles,
                        policies) — fetch one via GET /brands or build with POST
                        /brands/from-url
                    style_brief:
                      type: object
                      required:
                        - spec_type
                        - spec_version
                        - mode
                      properties:
                        spec_type:
                          type: string
                          enum:
                            - style_brief
                        spec_version:
                          type: string
                          enum:
                            - '1.0'
                        mode:
                          type: string
                          enum:
                            - locked
                            - guided
                            - auto
                        tone:
                          type: array
                          items:
                            type: string
                        design_preset:
                          type: object
                          properties:
                            preset_id:
                              type: string
                              description: >-
                                Preset slug, optionally version-pinned
                                ("promo-bold@3")
                    export_intent:
                      type: object
                      required:
                        - spec_type
                        - spec_version
                        - primary
                      properties:
                        spec_type:
                          type: string
                          enum:
                            - export_intent
                        spec_version:
                          type: string
                          enum:
                            - '1.0'
                        primary:
                          type: object
                          required:
                            - platform
                            - format
                            - profile_id
                          properties:
                            platform:
                              type: string
                              example: instagram
                            format:
                              type: string
                              example: png
                            profile_id:
                              type: string
                              example: ig_square_1x1
                        transparent_background:
                          type: boolean
                execution:
                  type: object
                  required:
                    - execution_mode
                    - seed
                    - quality_floor
                  properties:
                    execution_mode:
                      type: string
                      enum:
                        - preview
                        - preview_plus
                        - production
                    seed:
                      type: number
                      description: Deterministic seed — same seed, same bytes
                    quality_floor:
                      type: number
                      minimum: 0
                      maximum: 100
                debug:
                  type: object
                  properties:
                    include_decision_trace:
                      type: boolean
                    include_html:
                      type: boolean
      responses:
        '200':
          description: Sync preview result (operation = preview)
          content:
            application/json:
              schema:
                type: object
                properties:
                  spec_type:
                    type: string
                    enum:
                      - renderforge_response
                  status:
                    type: string
                    enum:
                      - ok
                      - error
                  design_id:
                    type: string
                  outputs:
                    type: array
                    items:
                      type: object
                      properties:
                        profile_id:
                          type: string
                        format:
                          type: string
                        platform:
                          type: string
                        url:
                          type: string
                          format: uri
                        mime:
                          type: string
                        width:
                          type: number
                        height:
                          type: number
                  warnings:
                    type: array
                    items:
                      type: string
                  cost:
                    type: object
                    description: Credits charged + remaining balance
        '202':
          description: Async job accepted (operation = render)
          content:
            application/json:
              schema:
                type: object
                properties:
                  job:
                    type: object
                    properties:
                      job_id:
                        type: string
                        example: job-9f3c2a1e-77b4-4d2c-9a1b-0c8d7e6f5a4b
                      status:
                        type: string
                        enum:
                          - queued
                      created_at:
                        type: string
                        format: date-time
        '402':
          description: Insufficient credits (details include topup_url)
        '422':
          description: Contract validation failed (details list field errors)
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Your Kynva API key (kyn_live_xxx or kyn_test_xxx; legacy rf_ keys remain
        valid)

````