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

# grok-imagine-image-2.0

> A production-focused image generation and editing model with strong instruction following, typography, local edits, multi-image composition, and visual consistency.



## OpenAPI

````yaml /openapi/image/grok-imagine-image-2-0.yaml post /images/generations
openapi: 3.0.3
info:
  title: grok-imagine-image-2.0
  version: 1.0.0
  description: >-
    A production-focused image generation and editing model with strong
    instruction following, typography, local edits, multi-image composition, and
    visual consistency.
  x-linkmodel-sort-weight: 99202608079
servers:
  - url: https://api.linkmodel.ai/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Grok
  - name: image
paths:
  /images/generations:
    post:
      tags:
        - Grok
        - image
      summary: grok-imagine-image-2.0
      description: >
        A production-focused image generation and editing model with strong
        instruction following, typography, local edits, multi-image composition,
        and visual consistency.


        |   |   |

        | --- | --- |

        | **Provider** | Grok |

        | **Tasks** | image-to-image · text-to-image |


        ## Task lifecycle


        This endpoint creates an asynchronous task. Poll `GET
        /images/generations/{task_id}` with the returned `task_id` until the
        task reaches a terminal state.


        If the POST request times out or its result is uncertain, do not blindly
        retry it. The original request may already have created another task and
        billing order.


        Completed asset URLs are dynamically signed. Download or copy assets
        that must be retained instead of treating the URLs as permanent
        identifiers.
      operationId: grok-imagine-image-2-0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - grok-imagine-image-2.0
                  description: 'Must be one of: grok-imagine-image-2.0.'
                prompt:
                  type: string
                  minLength: 1
                  description: >-
                    Required. Up to 5000 Unicode characters. Whitespace-only
                    prompts are not allowed.


                    **Conditional limits:**

                    - prompt must not contain only whitespace
                images:
                  type: array
                  minItems: 0
                  maxItems: 3
                  items:
                    type: string
                    format: url
                  description: >-
                    Omit for text-to-image generation. Provide 1 to 3 images for
                    editing or reference-based generation. Valid inline images
                    must be prepared as provider-accessible URLs.
                quality:
                  type: string
                  enum:
                    - 1K
                    - 2K
                  default: 2K
                  description: >-
                    Selects the SKU and output unit price. The current Router
                    does not support 1.5K. Defaults to `2K`.
                generation_quality:
                  type: string
                  enum:
                    - low
                    - medium
                  default: medium
                  description: >-
                    Selects the SKU and output unit price independently of the
                    output resolution. Defaults to `medium`.
                max_images:
                  type: integer
                  default: 1
                  minimum: 1
                  maximum: 10
                  description: >-
                    Request 1 to 10 images. Omitted or zero values fall back to
                    1 in code. Final billing must use the actual output count.
                    Defaults to `1`.
                size:
                  type: string
                  enum:
                    - 16x9
                    - 19.5x9
                    - 1x1
                    - 1x2
                    - 20x9
                    - 2x1
                    - 2x3
                    - 3x2
                    - 3x4
                    - 4x3
                    - 9x16
                    - 9x19.5
                    - 9x20
                  description: >-
                    Only for requests without reference images. The Provider
                    defaults to 1:1 when omitted. Omit this field for editing;
                    do not set a global size default.


                    **Conditional limits:**

                    - size is not allowed for image editing; omit this field
              required:
                - model
                - prompt
      responses:
        '200':
          description: >-
            Business response. `code=0` means the task was accepted; validation
            failures can return HTTP 200 with `code=400`.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    required:
                      - code
                      - data
                      - msg
                    properties:
                      code:
                        type: integer
                        enum:
                          - 0
                        example: 0
                      data:
                        type: object
                        required:
                          - task_id
                        properties:
                          task_id:
                            type: string
                            description: Use this id to poll task status.
                            example: aurora_abc123
                          order_id:
                            type: string
                            description: Billing order id.
                            example: 019da9cf-d1db-78e1-ac23-526774d01193
                          status:
                            type: string
                            example: Processing
                          price:
                            type: number
                            description: Charged amount in the model's pricing currency.
                            example: 0.074
                      msg:
                        type: string
                        example: success
                      request_id:
                        type: string
                        format: uuid
                        example: 250b66dd-e1fb-4bb6-b5f6-c668efadc35d
                  - type: object
                    required:
                      - code
                      - msg
                    properties:
                      code:
                        type: integer
                        enum:
                          - 400
                        example: 400
                      data:
                        type: object
                        example: {}
                      msg:
                        type: string
                        example: model is required
                      request_id:
                        type: string
                        format: uuid
                        example: 96be7a7d-3e81-4916-a6b8-19b32773a693
        '400':
          description: >-
            Malformed HTTP request rejected by the Gateway. Model and parameter
            validation may instead use HTTP 200 with business `code=400`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 400
                  msg:
                    type: string
                    example: task_id is required
                  request_id:
                    type: string
                    format: uuid
                    example: 96be7a7d-3e81-4916-a6b8-19b32773a693
        '401':
          description: Unauthorized — missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 401
                  data:
                    type: object
                    example: {}
                  msg:
                    type: string
                    example: invalid api key
                  request_id:
                    type: string
                    format: uuid
                    example: bff4c295-c7da-4507-9708-4627cb6373ba
        '500':
          description: Internal error — task creation failed (e.g. insufficient balance).
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 500
                  msg:
                    type: string
                    example: >-
                      create task failed: billing: code=100601: insufficient
                      balance
                  request_id:
                    type: string
                    format: uuid
                    example: 3409f6fb-fa9a-4534-b530-195b5f6f4e32
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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