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

# Create image

> Creates an image given a prompt. Passes through any additional parameters supported by the chosen model (e.g., `quality`, `style`).



## OpenAPI

````yaml /api-reference/openapi.json post /images/generations
openapi: 3.1.0
info:
  title: LLM Router API
  description: >-
    Intelligent AI Gateway with smart routing, Skills, Zero Data Retention, and
    cost optimization. Fully compatible with the OpenAI API.
  version: 1.0.0
  contact:
    name: LLM Router Support
    url: https://docs.llmrouter.app
servers:
  - url: https://api.llmrouter.app/v1
    description: Production Server
security:
  - bearerAuth: []
paths:
  /images/generations:
    post:
      tags:
        - Images
      summary: Create image
      description: >-
        Creates an image given a prompt. Passes through any additional
        parameters supported by the chosen model (e.g., `quality`, `style`).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
      responses:
        '200':
          description: Successful image generation response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
components:
  schemas:
    ImageGenerationRequest:
      type: object
      required:
        - prompt
        - model
      properties:
        prompt:
          type: string
        model:
          type: string
        'n':
          type: integer
          default: 1
        size:
          type: string
          default: 1024x1024
      additionalProperties: true
      description: >-
        Accepts any additional properties supported by the upstream image model
        (e.g., quality, style).
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: Unix timestamp when the image was created
          example: 1774975805
        id:
          type: string
          description: Unique identifier for the generated image
          example: gen_11b25653-e44e-49ea-80ea-32fe8c5fb246
        model:
          type: string
          description: The model used to generate the image
          example: openai/gpt-5-image
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
              description: Number of tokens used in the prompt
            output_tokens:
              type: integer
              description: >-
                Number of tokens used in the output (for vision or reasoning
                models)
            total_tokens:
              type: integer
              description: Total tokens used (input + output)
            cost:
              type:
                - number
                - string
                - 'null'
              nullable: true
              description: Total cost of the image generation in USD
          required:
            - input_tokens
            - total_tokens
        data:
          type: array
          items:
            type: object
            properties:
              b64_json:
                type: string
                description: Base64 encoded image data (with data URI prefix)
                example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...
              url:
                type: string
                description: URL to the generated image (if not using b64_json)
                nullable: true
              revised_prompt:
                type: string
                description: The revised prompt used by the model (for DALL·E models)
                nullable: true
            required:
              - b64_json
      additionalProperties: true
      required:
        - created
        - id
        - model
        - usage
        - data
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: LLM Router API Key (e.g., sk-llmr-...)

````