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

# Grok Imagine Image Generation

> High-quality image generation with Grok Imagine

<Tip>
  1. After submission, a `task_id` will be returned. If you provided a `callback_url`, when the task status becomes `finished` or `failed`, a POST request will be sent to the `callback_url`.
  2. Regardless of whether `callback_url` is provided, you can retrieve the response result through the unified [Query Task Status](/api-manual/task-management/status) endpoint.
</Tip>

# Grok Imagine Image Generation

Generate high-quality images using the Grok Imagine model. Supports text-to-image and image-to-image generation with optional aspect ratios.

`input.size` is optional. Supported values: `2:3`, `3:2`, `1:1`, `9:16`, `16:9`.

For image-to-image, `input.image_urls` is required.
`array(URL)`
An array containing a single URL string pointing to the reference image.
Please provide the URL of the uploaded file; Accepted types: image/jpeg, image/png, image/webp; Max size: 10.0MB.

## Available Models

* **grok-imagine-image** - Text-to-image and image-to-image generation


## OpenAPI

````yaml /api-manual/image-series/grok-imagine-image.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: PoYo AI - Grok Imagine Image API
  description: Grok Imagine Image Generation with text-to-image and image-to-image support
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Grok Imagine Image
      summary: Submit Grok Imagine Image Generation Task
      description: >-
        Generate images using Grok Imagine model with text-to-image and
        image-to-image support
      operationId: submitGrokImagineImageTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              grok-imagine-image:
                summary: Grok Imagine Image Generation
                value:
                  model: grok-imagine-image
                  callback_url: https://your-domain.com/callback
                  input:
                    prompt: A serene mountain landscape at sunset with vibrant colors
                    size: '1:1'
              grok-imagine-image-to-image:
                summary: Grok Imagine Image-to-Image
                value:
                  model: grok-imagine-image
                  callback_url: https://your-domain.com/callback
                  input:
                    prompt: Add warm sunset lighting with golden highlights
                    image_urls:
                      - https://example.com/reference-image.png
                    size: '1:1'
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
      properties:
        model:
          type: string
          description: Grok Imagine Image model identifier
          enum:
            - grok-imagine-image
        callback_url:
          type: string
          format: uri
          description: Webhook callback URL for result notifications
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - prompt
          description: >-
            Input parameters for generation. For image-to-image,
            input.image_urls is required.
          properties:
            prompt:
              type: string
              description: Generation prompt describing the desired output
              maxLength: 5000
              example: A beautiful sunset over the ocean
            image_urls:
              type: array
              items:
                type: string
                format: uri
              maxItems: 1
              description: >-
                Required for image-to-image.


                array(URL)

                An array containing a single URL string pointing to the
                reference image.


                Please provide the URL of the uploaded file; Accepted types:
                image/jpeg, image/png, image/webp; Max size: 10.0MB
              example:
                - https://example.com/reference-image.png
            size:
              type: string
              description: Image aspect ratio (optional)
              enum:
                - '2:3'
                - '3:2'
                - '1:1'
                - '9:16'
                - '16:9'
              example: '1:1'
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
          description: HTTP status code
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1757165031-uyujaw3d
              description: Unique task identifier for status tracking
            status:
              type: string
              enum:
                - not_started
              example: not_started
              description: Initial task status
            created_time:
              type: string
              format: date-time
              example: '2025-11-12T10:30:00'
              description: ISO 8601 timestamp when the task was created
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        All API endpoints require Bearer Token authentication


        Get your API Key:


        Visit the [API Key Management Page](https://poyo.ai/dashboard/api-key)
        to get your API Key


        Add it to the request header:


        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````