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

# Generations

> OpenAI-compatible image generation.

**Path:** `POST https://api.omniall.ai/v1/images/generations`

General entry. `image` may be a single URL/Base64 or a **string array** (multi-reference). With references, some channels route to `/v1/images/edits` or Chat bridge.

Gemini native: `generateContent`.



## OpenAPI

````yaml openapi/xgapi-public.yaml POST /v1/images/generations
openapi: 3.0.3
info:
  title: Omniall AI Public API
  description: >-
    Omniall AI public API. Website: https://omniall.ai — API host:
    https://api.omniall.ai — Model Square: https://omniall.ai/pricing
  version: 1.1.0
servers:
  - url: https://api.omniall.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Models
    description: List models available to your API key.
  - name: ChatGPT Chat Completions
    x-group: ChatGPT
    description: OpenAI Chat Completions (`POST /v1/chat/completions`).
  - name: Responses
    description: OpenAI Responses API (`POST /v1/responses`).
  - name: Claude
    description: Anthropic Messages API (`POST /v1/messages`).
  - name: Gemini
    description: Google Gemini generateContent / streamGenerateContent.
  - name: Images
    description: >-
      Image generation (OpenAI Images), vendor guides, and Midjourney proxy
      APIs.
  - name: Video
    description: Async video tasks.
  - name: Audio
    description: Speech and related audio APIs.
  - name: Rerank
    description: Document reranking.
paths:
  /v1/images/generations:
    post:
      tags:
        - Images
      summary: Create image (generations)
      description: >-
        OpenAI-compatible image generation.


        **Path:** `POST https://api.omniall.ai/v1/images/generations`


        General entry. `image` may be a single URL/Base64 or a **string array**
        (multi-reference). With references, some channels route to
        `/v1/images/edits` or Chat bridge.


        Gemini native: `generateContent`.
      operationId: createImageGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageRequest'
            examples:
              text_to_image:
                summary: Text-to-image
                value:
                  model: gpt-image-2
                  prompt: A calm studio workspace with soft daylight
                  'n': 1
                  size: 1024x1024
              multi_reference:
                summary: Text-to-image · multi-reference
                value:
                  model: gemini-3.1-flash-image-preview
                  prompt: >-
                    Match the style and palette of these references in one
                    product poster
                  image:
                    - https://example.com/ref-style.jpg
                    - https://example.com/ref-layout.jpg
                  aspect_ratio: '16:9'
                  'n': 1
              image_to_image:
                summary: Image-to-image
                value:
                  model: gpt-image-2
                  prompt: Keep the subject, replace the background with a sunset beach
                  image: https://example.com/reference.jpg
                  'n': 1
                  size: 1024x1024
      responses:
        '200':
          description: Image generation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
              example:
                created: 1710000000
                data:
                  - url: https://example.com/image.png
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '500':
          description: Upstream/gateway error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
components:
  schemas:
    ImageRequest:
      type: object
      required:
        - model
        - prompt
      description: >-
        OpenAI-compatible image generation body (`POST /v1/images/generations`).
        Maps to gateway `dto.ImageRequest`. Works for GPT-Image, DALL·E, Flux,
        Grok Imagine, Seedream/Jimeng image channels, and many Gemini image
        models when routed to this path.
      properties:
        model:
          type: string
          description: >-
            Image model id from Model Square / `GET /v1/models`. Examples:
            `gpt-image-1`, `gpt-image-2`, `dall-e-3`, `flux-pro`,
            `grok-imagine-image`, `doubao-seedream-5-0-pro-260628`,
            `gemini-2.5-flash-image`.
          example: gpt-image-2
        prompt:
          type: string
          description: >-
            Text description of the image to generate. Be specific about
            subject, style, lighting, and composition.
          example: A calm studio workspace with soft daylight
        'n':
          type: integer
          minimum: 1
          maximum: 128
          description: >-
            How many images to generate. Cost usually scales with `n`. Some
            models only allow `n=1`.
          default: 1
        size:
          type: string
          description: >-
            Output size as pixel string (e.g. `1024x1024`, `2048x1152`,
            `3840x2160`, `auto`), or use `aspect_ratio` with
            `quality`/`image_size` (1K/2K/4K). See the GPT-Image ratio table for
            common aspect ratios (3:1 through 1:3). Custom sizes: max side ≤
            3840, multiples of 16, aspect ratio ≤ 3:1.
          example: 1024x1024
        quality:
          type: string
          description: >-
            Quality tier. GPT-Image commonly: `low` / `medium` / `high` /
            `auto`; some models also use `1K` / `2K` / `4K` (see ratio table).
          example: high
        aspect_ratio:
          type: string
          description: >-
            Aspect ratio, e.g. `1:1`, `16:9`, `9:16`, `3:2`, `4:3`, `21:9`,
            `3:1`, `1:3`. Combined with 1K/2K/4K tiers, see the GPT-Image ratio
            table for pixel sizes.
          example: '1:1'
          enum:
            - '3:1'
            - '21:9'
            - '16:9'
            - '3:2'
            - '4:3'
            - '1:1'
            - '3:4'
            - '2:3'
            - '9:16'
            - '1:3'
            - '4:5'
            - '5:4'
        image_size:
          type: string
          description: >-
            Provider-specific image size field (passed through; not rewritten
            into `resolution`).
        resolution:
          type: string
          description: >-
            Provider-specific resolution field (passed through independently
            from `image_size`).
        response_format:
          type: string
          enum:
            - url
            - b64_json
          description: >-
            Return image URL(s) or Base64 JSON. Default often `url` when
            supported.
        style:
          description: >-
            Style hint for models that support it (e.g. DALL·E `vivid` /
            `natural`).
        background:
          description: >-
            Background control for models that support transparent/opaque
            backgrounds (e.g. GPT-Image).
        moderation:
          description: Moderation level when the model supports it.
        output_format:
          description: Output file format when supported (e.g. `png`, `jpeg`, `webp`).
        output_compression:
          description: Compression level for formats that support it.
        partial_images:
          description: >-
            Partial/streaming image options when the model supports progressive
            output.
        stream:
          type: boolean
          description: >-
            Request streaming image events when the upstream model supports it
            (e.g. some GPT-Image streams).
        watermark:
          type: boolean
          description: Whether to request a watermark when the provider supports this flag.
        image:
          oneOf:
            - type: string
              description: Single reference URL, Base64, or data URI.
            - type: array
              items:
                type: string
              description: Array of reference URLs / Base64 strings (multi-reference).
          description: >-
            Optional reference image(s). Single URL, Base64,
            `data:image/...;base64,...`, or a **string array** of references.
            Prefer `/v1/images/edits` for full edit/inpaint flows.
        user:
          description: Opaque end-user id for abuse monitoring.
        extra_fields:
          description: >-
            Reserved/extra JSON fields. Prefer documented top-level fields when
            available.
    ImageResponse:
      type: object
      description: OpenAI-compatible image response.
      properties:
        created:
          type: integer
          description: Unix timestamp when the image job completed.
        data:
          type: array
          description: Generated image payloads.
          items:
            type: object
            properties:
              url:
                type: string
                description: >-
                  Temporary HTTPS URL of the image (download promptly; may
                  expire).
              b64_json:
                type: string
                description: Base64-encoded image bytes when `response_format=b64_json`.
              revised_prompt:
                type: string
                description: Prompt rewritten by the model (e.g. DALL·E), if any.
    OpenAIErrorResponse:
      type: object
      description: OpenAI-style error envelope returned on auth/request failures.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              description: >-
                Human-readable error. The gateway may append a request id for
                support.
            type:
              type: string
              description: Error type, commonly `new_api_error`.
              example: new_api_error
            code:
              type: string
              description: >-
                Optional machine-readable code (e.g. `access_denied`). May be an
                empty string.
          description: Error object.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use Authorization: Bearer sk-... from https://omniall.ai/dashboard'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.