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

# Prompt Enhancer

> Rewrites and expands text prompts for clearer, higher-quality results

## Request body

`multipart/form-data` (recommended when sending images)

* `instructions` (`string`, required): Between `3` and `10,000` characters
* `aspect_ratio` (`validAspectRatios`, optional)
* `effort` (`"high" | "low"`, optional): Defaults to `"high"`
* `images` (`file | file[]`, optional): Single image or up to `10` images, each max `30MB`

## Validation rules

* `images` accepts either:
  * a single image
  * an array of images (max `10`)
* Input is normalized to an array internally when provided


## OpenAPI

````yaml POST /v2/image-utils/prompt-enhancer
openapi: 3.1.0
info:
  title: TokenKit
  description: >-
    Building image agents and tools, with APIs for businesses that want to put
    them to work.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tokenkit.co
security:
  - bearerAuth: []
paths:
  /v2/image-utils/prompt-enhancer:
    post:
      description: Enhance prompts for image generation with optional reference images.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PromptEnhancerRequest'
      responses:
        '202':
          description: Job accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobAccepted'
        '400':
          description: Validation error
        '429':
          description: Queue saturated
components:
  schemas:
    PromptEnhancerRequest:
      type: object
      properties:
        instructions:
          type: string
          minLength: 3
          maxLength: 10000
        aspect_ratio:
          $ref: '#/components/schemas/ImageAspectRatio'
        effort:
          allOf:
            - $ref: '#/components/schemas/ImageEffort'
          default: high
        images:
          oneOf:
            - $ref: '#/components/schemas/FileOrUrl'
            - type: array
              items:
                $ref: '#/components/schemas/FileOrUrl'
              maxItems: 10
      required:
        - instructions
    JobAccepted:
      type: object
      properties:
        data:
          type: object
          properties:
            job_id:
              type: string
              example: job_123
            links:
              $ref: '#/components/schemas/JobLinks'
          required:
            - job_id
            - links
        errors:
          nullable: true
      required:
        - data
    ImageAspectRatio:
      type: string
      enum:
        - '9:16'
        - '2:3'
        - '3:4'
        - '4:5'
        - '1:1'
        - '5:4'
        - '4:3'
        - '3:2'
        - '16:9'
    ImageEffort:
      type: string
      enum:
        - high
        - low
    FileOrUrl:
      oneOf:
        - type: string
          format: binary
        - type: string
          format: uri
    JobLinks:
      type: object
      properties:
        self:
          type: string
          example: /v1/jobs/job_123
        stream:
          type: string
          example: /v1/jobs/job_123/stream
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````