> ## 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 Edit

> [Core Function] Grok Imagine Video Edit applies a prompt-guided transformation to an input video. [Strengths] It excels at restyling and modifying an existing video while keeping its original duration and aspect ratio. [Best For] Highly recommended for: restyling clips, applying visual effects, and prompt-driven video edits. [Limitations] Do NOT use this model to change the duration, aspect ratio, or resolution; the output preserves the input video's duration and aspect ratio, and those parameters are not configurable. Input video constraints (e.g. format/length) are enforced by the upstream provider. [Routing] Use this model when the user provides a video and wants it edited/restyled. To make a video longer, use Video Extend.



## OpenAPI

````yaml /model-api/xai/xai-v2v.json post /xai/grok-imagine-video-edit
openapi: 3.1.0
info:
  description: >-
    The video-to-video models API from xAI Grok Imagine. Includes prompt-guided
    video editing and video extension. 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 Video-to-Video Models API
servers:
  - url: https://api.modellix.ai/api/v1
    description: The video-to-video models API from xAI Grok Imagine.
security:
  - bearerAuth: []
paths:
  /xai/grok-imagine-video-edit:
    post:
      summary: Grok Imagine Video Edit
      description: >-
        [Core Function] Grok Imagine Video Edit applies a prompt-guided
        transformation to an input video. [Strengths] It excels at restyling and
        modifying an existing video while keeping its original duration and
        aspect ratio. [Best For] Highly recommended for: restyling clips,
        applying visual effects, and prompt-driven video edits. [Limitations] Do
        NOT use this model to change the duration, aspect ratio, or resolution;
        the output preserves the input video's duration and aspect ratio, and
        those parameters are not configurable. Input video constraints (e.g.
        format/length) are enforced by the upstream provider. [Routing] Use this
        model when the user provides a video and wants it edited/restyled. To
        make a video longer, use Video Extend.
      operationId: grokImagineVideoEditAsync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GrokImagineVideoEditRequest'
            examples:
              basic:
                summary: Video and prompt
                value:
                  prompt: Restyle the clip as a hand-drawn anime sequence
                  video: https://example.com/input.mp4
      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-v2v-001
                  model_id: xai/grok-imagine-video-edit
                  get_result:
                    method: GET
                    url: https://api.modellix.ai/api/v1/tasks/task-xai-v2v-001
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    GrokImagineVideoEditRequest:
      type: object
      required:
        - prompt
        - video
      description: >-
        xAI Grok Imagine video edit request. Output preserves the input video's
        duration and aspect ratio.
      properties:
        prompt:
          type: string
          minLength: 1
          description: Text description of the edit to apply to the video
          example: Restyle the clip as a hand-drawn anime sequence
        video:
          type: string
          minLength: 1
          description: Input video URL or base64 data URI
          example: https://example.com/input.mp4
    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-edit
            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 ''video'' is required'
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 400
            message: 'Invalid parameters: parameter ''video'' 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`.'

````