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

# Generate Video-Official

> Grok video generation API. grok-imagine-video supports text-to-video (T2V) and image-to-video (I2V); grok-imagine-video-1.5 only supports image-to-video (I2V), image is required.<br/><br/>**Note: Synced with official rules, content moderation failure will also be charged.**



## OpenAPI

````yaml openapi/en/grok_video.json POST /grok/v1/videos/generations
openapi: 3.1.0
info:
  title: Grok Video Official API
  version: 1.0.0
  description: >-
    Grok official video generation API, supporting text-to-video, image-to-video
    and video extensions. Currently supports grok-imagine-video model. Maximum
    input video duration is 15 seconds.
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /grok/v1/videos/generations:
    post:
      description: >-
        Grok video generation API. grok-imagine-video supports text-to-video
        (T2V) and image-to-video (I2V); grok-imagine-video-1.5 only supports
        image-to-video (I2V), image is required.<br/><br/>**Note: Synced with
        official rules, content moderation failure will also be charged.**
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerateRequest'
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: Request ID
                    example: 41eb9a5f-cbd4-9f21-8d59-79005f1e61b7
                required:
                  - request_id
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    VideoGenerateRequest:
      type: object
      properties:
        prompt:
          type: string
          description: >-
            Video generation prompt. Required for grok-imagine-video
            text-to-video; optional for grok-imagine-video-1.5.
        model:
          type: string
          description: Model name to use.
          enum:
            - grok-imagine-video
            - grok-imagine-video-1.5
          default: grok-imagine-video-1.5
          example: grok-imagine-video-1.5
        aspect_ratio:
          type: string
          description: Video aspect ratio.
          enum:
            - '1:1'
            - '16:9'
            - '9:16'
            - '4:3'
            - '3:4'
            - '3:2'
            - '2:3'
        duration:
          type: integer
          description: >-
            Video duration in seconds. Range: [1, 15]. Default: 8. Accepts both
            number (8) and string ("8") formats.
          default: 8
          minimum: 1
          maximum: 15
        image:
          type: object
          description: >-
            Image object used for image-to-video generation. Required for
            grok-imagine-video-1.5 (I2V only); optional for grok-imagine-video
            (T2V when omitted, I2V when provided).
          properties:
            url:
              type: string
              description: >-
                Public URL or base64-encoded data URL of the image (JPEG, PNG,
                or WebP). Also accepts `image_url` for compatibility.
        reference_images:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                description: >-
                  Public URL or base64-encoded data URL of the image (JPEG, PNG,
                  or WebP). Also accepts `image_url` for compatibility.
          description: >-
            Array of reference images used for reference-to-video (R2V). These
            images serve as style/content references for video generation.
        resolution:
          type: string
          description: Video resolution.
          enum:
            - 480p
            - 720p
            - 1080p
      required:
        - prompt
  responses:
    400Response:
      description: Parameter error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: Authorization failed
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        You can obtain your API key from the <a
        href='https://dashboard.ttapi.io' target='_blank'>TTAPI Dashboard</a>.

````