> ## 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 Video (Reference-to-Video)

> [Core Function] Grok Imagine Video R2V generates a video from a text prompt while preserving the subjects shown in up to 7 reference images. [Strengths] It excels at keeping character/subject identity consistent across a newly generated scene driven by the prompt. [Best For] Highly recommended for: character-driven video, placing a specific subject into a new scene, and blending features from multiple references. [Limitations] Do NOT use this model to simply animate a single image as-is (use Image-to-Video), or for clips longer than 10 seconds or resolutions above 720p; duration is capped at 10s and resolution at 480p/720p. [Routing] Use this model when the user provides reference images of a subject and wants a new action/scene described by a prompt. To simply animate a single image as-is, use Image-to-Video.



## OpenAPI

````yaml /model-api/xai/xai-i2v.json post /xai/grok-imagine-video-r2v
openapi: 3.1.0
info:
  description: >-
    The image-to-video models API from xAI Grok Imagine. Includes single-frame
    image-to-video (animate a starting image) and reference-to-video (generate a
    video that preserves the subjects from reference images). Tasks are
    asynchronous: submit, then poll the task endpoint for the result.
  version: 1.0.0
  contact:
    name: Modellix Support
    email: support@modellix.ai
  title: xAI Grok Imagine Image-to-Video Models API
servers:
  - url: https://api.modellix.ai/api/v1
    description: The image-to-video models API from xAI Grok Imagine.
security:
  - bearerAuth: []
paths:
  /xai/grok-imagine-video-r2v:
    post:
      summary: Grok Imagine Video (Reference-to-Video)
      description: >-
        [Core Function] Grok Imagine Video R2V generates a video from a text
        prompt while preserving the subjects shown in up to 7 reference images.
        [Strengths] It excels at keeping character/subject identity consistent
        across a newly generated scene driven by the prompt. [Best For] Highly
        recommended for: character-driven video, placing a specific subject into
        a new scene, and blending features from multiple references.
        [Limitations] Do NOT use this model to simply animate a single image
        as-is (use Image-to-Video), or for clips longer than 10 seconds or
        resolutions above 720p; duration is capped at 10s and resolution at
        480p/720p. [Routing] Use this model when the user provides reference
        images of a subject and wants a new action/scene described by a prompt.
        To simply animate a single image as-is, use Image-to-Video.
      operationId: grokImagineVideoR2VAsync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GrokImagineR2VRequest'
            examples:
              basic:
                summary: Single reference image
                value:
                  prompt: >-
                    The character runs across a snowy field under the northern
                    lights
                  reference_images:
                    - https://example.com/character.png
              full_options:
                summary: Multiple references with options
                value:
                  prompt: The two characters share a warm reunion in a cozy cafe
                  reference_images:
                    - https://example.com/character-a.png
                    - https://example.com/character-b.png
                  duration: 10
                  aspect_ratio: '16:9'
                  resolution: 720p
      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-r2v-001
                  model_id: xai/grok-imagine-video-r2v
                  get_result:
                    method: GET
                    url: https://api.modellix.ai/api/v1/tasks/task-xai-r2v-001
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    GrokImagineR2VRequest:
      type: object
      required:
        - prompt
        - reference_images
      description: >-
        xAI Grok Imagine reference-to-video request. Generates a video from a
        prompt while preserving the subjects from up to 7 reference images.
        Duration is capped at 10 seconds.
      properties:
        prompt:
          type: string
          minLength: 1
          description: Text description of the video to generate
          example: The character runs across a snowy field under the northern lights
        reference_images:
          type: array
          minItems: 1
          maxItems: 7
          description: >-
            Reference images (1-7) whose subjects are preserved in the generated
            video. Each item is a publicly accessible image URL or a base64 data
            URI.
          items:
            type: string
            minLength: 1
          example:
            - https://example.com/character.png
        duration:
          type: integer
          minimum: 1
          maximum: 10
          default: 8
          description: Video duration in seconds (max 10 when using reference images)
          example: 10
        aspect_ratio:
          type: string
          enum:
            - '1:1'
            - '16:9'
            - '9:16'
            - '4:3'
            - '3:4'
            - '3:2'
            - '2:3'
          description: Video aspect ratio
          example: '16:9'
        resolution:
          type: string
          enum:
            - 480p
            - 720p
          default: 480p
          description: Video resolution
          example: 720p
    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-video-i2v
            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 ''image'' is required'
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 400
            message: 'Invalid parameters: parameter ''image'' 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`.'

````