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

# Submit a generation request



## OpenAPI

````yaml /api-reference/openapi.json post /api/generate
openapi: 3.1.0
info:
  title: WriterzRoom API
  version: '2.0'
  description: >-
    Generated from the API server by scripts/generate_api_reference.py. Only the
    endpoints listed on the Endpoints Reference page are included.
servers:
  - url: https://api.writerzroom.com
security:
  - bearerAuth: []
tags:
  - name: Generation
  - name: Content
  - name: Catalog
  - name: Approvals
  - name: Validity
  - name: Replay
  - name: Artifacts
  - name: Corpus
  - name: Account
paths:
  /api/generate:
    post:
      tags:
        - Generation
      summary: Submit a generation request
      operationId: generate_api_generate_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateRequest'
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    GenerateRequest:
      properties:
        template_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Template Id
          description: >-
            Template id, such as `blog_article_generator`. Required unless
            `template` is sent.
        template:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Template
          description: Older name for `template_id`.
        style_profile_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Style Profile Id
          description: Style profile id, such as `general_blog`.
        style_profile:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Style Profile
          description: Older name for `style_profile_id`.
        user_input:
          additionalProperties: true
          type: object
          title: User Input
          description: >-
            The template's inputs (`topic` and the template's own parameters),
            plus optional `length_preset`, `word_range`, `practice_area` and
            `reference_files`.
        generation_settings:
          additionalProperties: true
          type: object
          title: Generation Settings
          description: >-
            Run settings. `generation_mode` here is read when the top-level
            field is absent.
        generation_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Generation Mode
          description: >-
            Tier: `quick`, `standard` or `premium`. Premium requires a
            Professional or Enterprise plan.
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: >-
            Your id for this run, 8-128 letters, digits, `_` or `-`. Resending
            the same id returns the existing run instead of starting another.
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: Ignored. The caller is identified by the API key.
        dynamic_parameters:
          additionalProperties: true
          type: object
          title: Dynamic Parameters
          description: Merged with `user_input`; `user_input` wins on a conflict.
        vertical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Vertical Id
          description: >-
            Vertical whose rules, disclaimers and verifiers apply, such as
            `legal` or `medical_ai`.
        brand_voice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand Voice Id
          description: One of your Brand Voice profiles.
        audience_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Audience Id
          description: One of your saved audiences.
        target_platform:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Platform
          description: >-
            Publishing destination the draft is shaped for, such as `linkedin`
            or `wordpress`.
      type: object
      title: GenerateRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A WriterzRoom API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.