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

# Grok Imagine Image 2.0 API

> Text-to-image generation with Grok Imagine Image 2.0. Text prompt only — this model does not accept reference images.



## OpenAPI

````yaml api-reference/image-api/openapi-grok-image-2.json POST /api/v1/images/generations
openapi: 3.1.0
info:
  title: GoEnhance API - Grok Imagine Image 2.0
  description: Text-to-image generation with Grok Imagine Image 2.0.
  version: 1.0.0
servers:
  - url: https://api.goenhance.ai
security: []
paths:
  /api/v1/images/generations:
    post:
      tags:
        - ImageAPI
      summary: Grok Imagine Image 2.0
      description: >-
        Text-to-image generation with Grok Imagine Image 2.0. Text prompt only —
        this model does not accept reference images.
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: '{{Authorization}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - grok-image-2
                  description: Model name. Must be `grok-image-2`.
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 5000
                  description: Text prompt. Up to 5,000 characters.
                ratio:
                  type: string
                  enum:
                    - '1:1'
                    - '2:3'
                    - '3:2'
                    - '16:9'
                    - '9:16'
                  default: '1:1'
                  description: Aspect ratio. Defaults to `1:1`.
                custom_callback_url:
                  type: string
                  description: Optional callback URL for task status updates.
              required:
                - model
                - prompt
            example:
              model: grok-image-2
              prompt: A neon-lit alley after rain
              ratio: '16:9'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  data:
                    type: object
                    properties:
                      img_uuid:
                        type: string
                    required:
                      - img_uuid
                required:
                  - code
                  - msg
                  - data
              examples:
                '1':
                  summary: Success
                  value:
                    code: 0
                    msg: Success
                    data:
                      img_uuid: c12b656c-747a-44fd-9c80-add79b0c52d5
                '2':
                  summary: Insufficient tokens
                  value:
                    code: 100
                    msg: tokens is not enough
          headers: {}
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                required:
                  - code
                  - msg
          headers: {}
      deprecated: false
      security: []

````