> ## 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 text with AI

> Generate smart marketing text using AI (headlines, CTAs, body copy)



## OpenAPI

````yaml /openapi.yaml post /api/v1/ai/generate-text
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/ai/generate-text:
    post:
      tags:
        - AI
      summary: Generate text with AI
      description: Generate smart marketing text using AI (headlines, CTAs, body copy)
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - contentType
                - context
              properties:
                contentType:
                  type: string
                  enum:
                    - headline
                    - subheadline
                    - body
                    - cta
                    - tagline
                    - caption
                    - bullet
                    - quote
                    - stat
                  description: Type of text content to generate
                context:
                  type: object
                  description: Context for text generation
                  properties:
                    brand:
                      type: string
                      description: Brand or company name
                    product:
                      type: string
                      description: Product or service being promoted
                    audience:
                      type: string
                      description: Target audience description
                    industry:
                      type: string
                      description: Industry or niche
                    benefit:
                      type: string
                      description: Key benefit or value proposition
                    topic:
                      type: string
                      description: Specific topic or theme
                tone:
                  type: string
                  enum:
                    - professional
                    - casual
                    - playful
                    - urgent
                    - luxurious
                    - inspirational
                    - humorous
                    - authoritative
                    - empathetic
                  default: professional
                maxLength:
                  type: number
                  minimum: 10
                  maximum: 1000
                  description: Maximum characters per variation
                keywords:
                  type: array
                  items:
                    type: string
                  description: Keywords to include
                variations:
                  type: number
                  minimum: 1
                  maximum: 5
                  default: 3
                instructions:
                  type: string
                  description: Additional instructions
                format:
                  type: string
                  description: Format context (e.g., "Instagram story")
        required: true
      responses:
        '200':
          description: Text generated successfully
          content:
            application/json:
              schema:
                description: Text generated successfully
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      texts:
                        type: array
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                            length:
                              type: number
                            confidence:
                              type: number
                            tags:
                              type: array
                              items:
                                type: string
                      reasoning:
                        type: string
                      suggestions:
                        type: array
                        items:
                          type: string
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)

````