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

# Create Image (Async)

> 创建新的图片生成任务。

<Note>
  This endpoint is **asynchronous**: it returns a `task_id`. Poll [Query Image Task](/en/api-reference/images/query) for results.

  For **synchronous** text-to-image or image edit (OpenAI-compatible, returns `b64_json` on success), use [Text-to-Image (Sync)](/en/api-reference/images/generations) or [Edit Image (Sync)](/en/api-reference/images/edits).
</Note>

<Note>
  Async image tasks use `ratio` for **aspect ratio** (e.g. `1:1`, `16:9`); default is `auto`. Sync OpenAI-compatible endpoints (`/images/generations`, `/images/edits`) still use `size` for **pixel dimensions** (e.g. `1024x1024`).
</Note>


## OpenAPI

````yaml POST /api/open-api/v1/images
openapi: 3.1.0
info:
  title: Jimmy AI OpenAPI
  description: API for Jimmy AI video generation services
  version: 1.0.0
servers:
  - url: https://www.jimmyai.cn
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/open-api/v1/images:
    post:
      summary: Create Image Task
      description: Create a new image generation task using GPT Image 2 model.
      operationId: createImage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
      responses:
        '200':
          description: Task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
components:
  schemas:
    ImageGenerationRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: >-
            Model name (supported: gpt-image-2, nano-banana, nano-banana-2,
            nano-banana-pro)
        prompt:
          type: string
          description: Text prompt for image generation
        ratio:
          type: string
          description: >-
            Aspect ratio. Supported values: auto, 1:1 (Square), 3:2 (Landscape),
            2:3 (Portrait), 4:3 (Landscape), 3:4 (Portrait), 5:4 (Landscape),
            4:5 (Portrait), 16:9 (Widescreen), 9:16 (Vertical), 2:1 (Landscape),
            1:2 (Portrait), 3:1 (Wide Landscape), 1:3 (Tall Portrait), 21:9
            (Ultrawide), 9:21 (Ultrawide Vertical)
          enum:
            - auto
            - '1:1'
            - '3:2'
            - '2:3'
            - '4:3'
            - '3:4'
            - '5:4'
            - '4:5'
            - '16:9'
            - '9:16'
            - '2:1'
            - '1:2'
            - '3:1'
            - '1:3'
            - '21:9'
            - '9:21'
          default: auto
        images:
          type: array
          items:
            type: string
          description: Reference image URLs or base64 strings
        resolution:
          type: string
          description: >-
            Image resolution (supported by gpt-image-2, nano-banana-2, etc.).
            Supported values: 1k, 2k, 4k. Note: gpt-image-2 with 4K resolution
            only supports the following aspect ratios: 16:9 / 9:16 / 2:1 / 1:2 /
            21:9 / 9:21.
          enum:
            - 1k
            - 2k
            - 4k
          default: 1k
        quality:
          type: string
          description: >-
            Image quality (supported by gpt-image-2). Supported values: low,
            medium, high.
          enum:
            - low
            - medium
            - high
          default: low
    ImageGenerationResponse:
      type: object
      properties:
        code:
          type: string
          example: '20000'
        msg:
          type: string
          example: ok
        data:
          type: object
          properties:
            task_id:
              type: string
            status:
              type: string
            model:
              type: string
            created_at:
              type: integer
              format: int64
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````