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

# Create Image Variation

> Generates one or more variations of a source image.



## OpenAPI

````yaml /gateway-openapi.json post /images/variations
openapi: 3.0.0
info:
  title: LLM Gateway
  description: API for LLM Gateway
  version: 1.0.0
servers:
  - url: https://{gatewayBaseURL}
    variables:
      gatewayBaseURL:
        default: gateway.truefoundry.ai
        description: Gateway base URL
    description: Gateway base URL
security:
  - AuthorizationBearer: []
tags:
  - name: Chat
  - name: Agent
  - name: Messages
  - name: MCP
  - name: Embeddings
  - name: Rerank
  - name: Responses
  - name: Image
  - name: Audio
  - name: Batch
  - name: Files
  - name: Fine-tuning
  - name: Moderations
  - name: Models
paths:
  /images/variations:
    post:
      tags:
        - Image
      summary: Create Image Variation
      description: Generates one or more variations of a source image.
      requestBody:
        description: Source image(s) and variation options.
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: The model to use for image generation.
                image:
                  anyOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                  description: >-
                    The image(s) to create variations of. Must be a supported
                    image file or an array of images.
                'n':
                  type: integer
                  nullable: true
                  description: The number of images to generate. Must be between 1 and 10.
                response_format:
                  type: string
                  nullable: true
                  description: >-
                    The format in which generated images are returned. Must be
                    one of url or b64_json.
                size:
                  type: string
                  nullable: true
                  description: The size of the generated images.
                user:
                  type: string
                  nullable: true
                  description: A unique identifier representing your end-user.
              required:
                - model
                - image
      responses:
        '200':
          description: Image variations.
          content:
            application/json:
              schema:
                type: object
                properties:
                  created:
                    type: number
                    description: Unix timestamp when the image was generated.
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          nullable: true
                          description: >-
                            Public URL of the image, when response_format is
                            url.
                        b64_json:
                          type: string
                          nullable: true
                          description: >-
                            Base64-encoded image bytes, when response_format is
                            b64_json.
                        revised_prompt:
                          type: string
                          nullable: true
                          description: >-
                            Prompt as used by the model after any safety or
                            expansion rewrites.
                    description: Generated images.
                required:
                  - created
                  - data
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
components:
  securitySchemes:
    AuthorizationBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````