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

# Grok Imagine Image

> [Core Function] Grok Imagine Image is xAI's standard text-to-image generation model. [Strengths] It excels at quickly generating solid, visually appealing images from a text prompt across a wide range of aspect ratios. [Best For] Highly recommended for: rapid prototyping, social media content, and general-purpose image generation. [Limitations] Do NOT use this model when maximum detail or fidelity is required; the Quality variant produces richer detail. [Routing] Choose this model for fast, general image generation. When the user demands maximum fidelity, route to Grok Imagine Image (Quality).



## OpenAPI

````yaml /model-api/xai/xai-t2i.json post /xai/grok-imagine-image
openapi: 3.1.0
info:
  description: >-
    The text-to-image models API from xAI Grok Imagine. Generates images from a
    text prompt and returns the result synchronously via the async task
    interface.
  version: 1.0.0
  contact:
    name: Modellix Support
    email: support@modellix.ai
  title: xAI Grok Imagine Text-to-Image Models API
servers:
  - url: https://api.modellix.ai/api/v1
    description: The text-to-image models API from xAI Grok Imagine.
security:
  - bearerAuth: []
paths:
  /xai/grok-imagine-image:
    post:
      summary: Grok Imagine Image
      description: >-
        [Core Function] Grok Imagine Image is xAI's standard text-to-image
        generation model. [Strengths] It excels at quickly generating solid,
        visually appealing images from a text prompt across a wide range of
        aspect ratios. [Best For] Highly recommended for: rapid prototyping,
        social media content, and general-purpose image generation.
        [Limitations] Do NOT use this model when maximum detail or fidelity is
        required; the Quality variant produces richer detail. [Routing] Choose
        this model for fast, general image generation. When the user demands
        maximum fidelity, route to Grok Imagine Image (Quality).
      operationId: grokImagineImageAsync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GrokImagineImageRequest'
            examples:
              basic:
                summary: Prompt only
                value:
                  prompt: A serene Japanese garden with a koi pond in spring
              full_options:
                summary: Full options
                value:
                  prompt: A cyberpunk city skyline at dusk
                  aspect_ratio: '9:16'
                  resolution: 1k
                  'n': 1
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncTaskResponse'
              example:
                code: 0
                message: success
                data:
                  status: pending
                  task_id: task-xai-t2i-002
                  model_id: xai/grok-imagine-image
                  get_result:
                    method: GET
                    url: https://api.modellix.ai/api/v1/tasks/task-xai-t2i-002
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    GrokImagineImageRequest:
      type: object
      required:
        - prompt
      description: >-
        xAI Grok Imagine text-to-image request. Shared by the Quality and
        standard image generation models.
      properties:
        prompt:
          type: string
          minLength: 1
          description: Text description of the image to generate
          example: A collage of London landmarks in a stenciled street-art style
        'n':
          type: integer
          minimum: 1
          description: >-
            Number of images to generate (official examples use 4; no fixed
            upper limit)
          example: 1
        aspect_ratio:
          type: string
          enum:
            - '1:1'
            - '16:9'
            - '9:16'
            - '4:3'
            - '3:4'
            - '3:2'
            - '2:3'
            - '2:1'
            - '1:2'
            - 19.5:9
            - '9:19.5'
            - '20:9'
            - '9:20'
            - auto
          description: Aspect ratio of the generated image
          example: '16:9'
        resolution:
          type: string
          enum:
            - 1k
            - 2k
          default: 1k
          description: Output resolution tier
          example: 2k
        response_format:
          type: string
          enum:
            - url
            - b64_json
          description: Format of the returned image data
          example: url
    AsyncTaskResponse:
      type: object
      required:
        - code
        - message
        - data
      properties:
        code:
          type: integer
          description: Response code, 0 indicates success
          example: 0
        message:
          type: string
          description: Response message
          example: success
        data:
          type: object
          required:
            - status
            - task_id
            - model_id
          properties:
            status:
              type: string
              enum:
                - pending
                - processing
              description: Task status
              example: pending
            task_id:
              type: string
              description: Unique task identifier for polling
              example: task-abc123
            model_id:
              type: string
              description: Model ID in `provider/model` format
              example: xai/grok-imagine-image-quality
            get_result:
              type: object
              description: API information to query the task result
              properties:
                method:
                  type: string
                  example: GET
                url:
                  type: string
                  example: https://api.modellix.ai/api/v1/tasks/task-abc123
          description: Detailed data about the submitted asynchronous task.
    ErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 400
        message:
          type: string
          example: 'Invalid parameters: parameter ''prompt'' is required'
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 400
            message: 'Invalid parameters: parameter ''prompt'' is required'
    Unauthorized:
      description: Unauthorized - Invalid or missing API Key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            message: 'Authentication failed: invalid API key'
    TooManyRequests:
      description: Too many requests - Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          description: Maximum requests per minute
          schema:
            type: integer
            example: 100
        X-RateLimit-Remaining:
          description: Remaining quota in current window
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          description: Rate limit window reset time (Unix timestamp)
          schema:
            type: integer
            example: 1704067260
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 429
            message: >-
              Rate limit exceeded: 100 requests per minute, retry after 60
              seconds
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 500
            message: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API Key authentication. Format: `Bearer YOUR_API_KEY`.'

````