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

# Generate image

> OpenAI-compatible image generation endpoint. Available models follow `/v1/models` and the console model pricing page.



## OpenAPI

````yaml /openapi/relay.en.json post /v1/images/generations
openapi: 3.0.1
info:
  title: AIOHub API
  description: AIOHub public API
  version: 1.0.0
servers:
  - url: https://api.aiohub.org
security:
  - BearerAuth: []
tags:
  - name: List models
  - name: OpenAI Chat
  - name: OpenAI Responses
  - name: Image generation
  - name: OpenAI Images
  - name: Video generation
  - name: Claude Messages
  - name: Gemini API
  - name: OpenAI Embeddings
  - name: Text completions
  - name: OpenAI Audio
  - name: Realtime API
paths:
  /v1/images/generations:
    post:
      tags:
        - OpenAI Images
      summary: Generate image
      description: >-
        OpenAI-compatible image generation endpoint. Available models follow
        `/v1/models` and the console model pricing page.
      operationId: createImage
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
            example:
              model: gpt-image-2
              prompt: A clean product photo of a ceramic coffee mug on a wooden desk
              size: 1024x1024
              'n': 1
      responses:
        '200':
          description: Image generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    ImageGenerationRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          example: gpt-image-2
        prompt:
          type: string
          description: Image description
        'n':
          type: integer
          minimum: 1
          maximum: 10
          default: 1
        size:
          type: string
          description: >-
            Image size. Supported sizes vary by model, for example `1024x1024`,
            `1024x1792`, or `1792x1024`.
          example: 1024x1024
        quality:
          type: string
          description: >-
            Image quality. Supported values vary by model, for example `auto`,
            `standard`, `hd`, or `high`.
          example: auto
        style:
          type: string
          enum:
            - vivid
            - natural
          default: vivid
        response_format:
          type: string
          enum:
            - url
            - b64_json
          default: url
        stream:
          type: boolean
          description: >-
            Whether to stream the response. Depends on support from the selected
            model.
        background:
          description: Background setting. Depends on support from the selected model.
        output_format:
          description: Output format. Depends on support from the selected model.
        partial_images:
          description: >-
            Partial image return setting. Depends on support from the selected
            model.
        user:
          type: string
    ImageResponse:
      type: object
      properties:
        created:
          type: integer
        data:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
              b64_json:
                type: string
              revised_prompt:
                type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key (sk-xxx)

````