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

# Image Generations

> OpenAI-compatible image generation endpoint.



## OpenAPI

````yaml /api-reference/v3-openapi.json post /v3/images/generations
openapi: 3.1.0
info:
  title: Eden AI API V3
  version: 3.0.0
servers:
  - url: https://api.edenai.run
    description: Production server
security: []
paths:
  /v3/images/generations:
    post:
      tags:
        - Images
      summary: Image Generations
      description: OpenAI-compatible image generation endpoint.
      operationId: image_generations_v3_images_generations_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - AuthBearer: []
components:
  schemas:
    ImageGenerationBody:
      properties:
        model:
          type: string
          title: Model
          description: provider/model, e.g. 'openai/gpt-image-2'
        prompt:
          type: string
          maxLength: 32000
          minLength: 1
          title: Prompt
        'n':
          anyOf:
            - type: integer
              maximum: 10
              minimum: 1
            - type: 'null'
          title: 'N'
        size:
          anyOf:
            - type: string
            - type: 'null'
          title: Size
          description: >-
            Provider-specific size string. OpenAI accepts '1024x1024',
            '1536x1024', '1024x1536', 'auto'. Vertex Imagen accepts square or
            aspect-ratio strings. Validation is delegated to the provider.
        user:
          anyOf:
            - type: string
            - type: 'null'
          title: User
          description: End-user identifier for abuse tracking.
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Arbitrary metadata attached to the request.
        extra_headers:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Extra Headers
          description: >-
            Additional HTTP headers forwarded to the provider API. Credential
            headers (Authorization, x-api-key, ...) are rejected.
        quality:
          anyOf:
            - type: string
            - type: 'null'
          title: Quality
          description: >-
            Provider-specific quality string (e.g. 'low', 'medium', 'high',
            'standard', 'hd', 'auto'). Accepted values depend on the model.
        response_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Response Format
          description: >-
            Legacy DALL-E parameter. Ignored by gpt-image-* and forwarded to the
            provider for any model that still honors it.
      additionalProperties: true
      type: object
      required:
        - model
        - prompt
      title: ImageGenerationBody
      description: OpenAI-compatible ``POST /v1/images/generations`` request body.
    ImageResponse:
      properties:
        cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
        created:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created
        data:
          items:
            $ref: '#/components/schemas/ImageDataItem'
          type: array
          title: Data
        usage:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Usage
      additionalProperties: true
      type: object
      title: ImageResponse
      description: >-
        OpenAI-compatible image response + Eden ``cost`` / ``provider`` fields.


        Shared by ``POST /v3/images/generations`` and ``POST /v3/images/edits``
        —

        the wire shape is identical.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ImageDataItem:
      properties:
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        b64_json:
          anyOf:
            - type: string
            - type: 'null'
          title: B64 Json
        revised_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Revised Prompt
      additionalProperties: true
      type: object
      title: ImageDataItem
      description: |-
        Single image entry inside the OpenAI-shaped ``data: [...]`` array.

        Providers return either ``url`` (most non-OpenAI providers) or
        ``b64_json`` (gpt-image-*); ``revised_prompt`` is OpenAI-specific.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    AuthBearer:
      type: http
      scheme: bearer

````