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

> ## Agent Instructions
> Send API requests to https://api.ttapi.io with the TT-API-KEY header. Midjourney account hosting uses https://hold.ttapi.io. Claude Code uses https://cc.ttapi.io.
> Most generation endpoints are asynchronous. The submit response returns a job id. Poll that product's fetch endpoint, or pass a webhook on the submit request. A fetch call does not start a new generation.
> 1 USD = 100 quota. Check the pricing page for that product before estimating cost.
> This file lists the English docs. Follow every /_llms/ link recursively for the API reference, Chinese, and Russian. Open a page's .md URL for the endpoint schema.

# Keyframe to Video

> Keyframe to video - Pin keyframe images at chosen moments inside the video, combinable with first and last frame

This is the **Grok Video API** keyframe to video endpoint. Pin keyframe images at chosen moments inside the video using `keyframes`. The model generates transitions between your keyframe anchors. It can be combined with `first_frame` and `last_frame`:

* **First frame + keyframes**: Specify the opening and interior keyframes
* **Keyframes + last frame**: Specify interior keyframes and the closing frame
* **First frame + keyframes + last frame**: Full control over the opening, interior keyframes, and closing frame

Supported by `grok-imagine-video-1.5-fast` and `grok-imagine-video-1.5`.

<Callout type="warning">
  **Warning**: NSFW content is not allowed. A single or occasional moderation failure will not incur any charges. However, repeated moderation failures may result in charges.
</Callout>

<Callout type="info">
  **Keyframe limits**: Maximum 4 keyframes per request; `timestamp_s` must be greater than 0 and less than the video duration; keyframes must be at least 1/3 second apart.
</Callout>


## OpenAPI

````yaml openapi/en/grok-keyframe-to-video.json POST /grok/generations
openapi: 3.1.0
info:
  title: Grok Video - Keyframe to Video DOCS
  version: 1.0.0
  description: >-
    Grok Keyframe to Video API - Pin keyframe images at chosen moments inside
    the video using keyframes, combinable with first_frame and last_frame.
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /grok/generations:
    post:
      description: >-
        Keyframe to video - Pin keyframe images at chosen moments inside the
        video, combinable with first and last frame
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KeyframeToVideoRequest'
            example:
              prompt: <string>
              model: grok-imagine-video-1.5-fast
              aspect_ratio: '16:9'
              video_length: '10'
              resolution_name: 720p
              first_frame: https://example.com/first_frame.jpg
              keyframes:
                - image:
                    url: https://example.com/keyframe1.jpg
                  timestamp_s: 3
                - image:
                    url: https://example.com/keyframe2.jpg
                  timestamp_s: 6
              last_frame: https://example.com/last_frame.jpg
              hook_url: https://example.com/callback
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    KeyframeToVideoRequest:
      type: object
      description: Keyframe to video request parameters
      properties:
        prompt:
          type: string
          description: Prompt to guide motion and camera work between keyframes. Optional.
        model:
          type: string
          description: Model name.
          enum:
            - grok-imagine-video-1.5-fast
            - grok-imagine-video-1.5
          default: grok-imagine-video-1.5-fast
          example: grok-imagine-video-1.5-fast
        aspect_ratio:
          type: string
          default: '16:9'
          enum:
            - '2:3'
            - '3:2'
            - '1:1'
            - '9:16'
            - '16:9'
          description: Video aspect ratio
        video_length:
          type: string
          default: '10'
          description: >-
            Video duration in seconds. `grok-imagine-video-1.5-fast` range: 6 to
            30 (6s and 10s are standard durations; 7s and 11s are not
            supported); `grok-imagine-video-1.5` range: 1 to 15.
        resolution_name:
          type: string
          default: 720p
          enum:
            - 480p
            - 720p
            - 1080p
          description: 'Output resolution. Available options: 480p, 720p.'
        first_frame:
          type: string
          description: >-
            First frame image URL. Used to strictly specify the first frame of
            the video. Can be combined with keyframes and last_frame.
        keyframes:
          type: array
          description: >-
            Array of keyframes. Each element contains an image URL and a
            corresponding timestamp in seconds. Maximum 4 keyframes.
            `timestamp_s` must be greater than 0 and less than the video
            duration; keyframes must be at least 1/3 second apart.
          maxItems: 4
          items:
            type: object
            properties:
              image:
                type: object
                description: Keyframe image
                properties:
                  url:
                    type: string
                    description: Keyframe image URL
                required:
                  - url
              timestamp_s:
                type: number
                description: >-
                  Keyframe timestamp in seconds. Must be greater than 0 and less
                  than the video duration.
            required:
              - image
              - timestamp_s
        last_frame:
          type: string
          description: >-
            Last frame image URL. Used to strictly specify the last frame of the
            video. Can be combined with keyframes and first_frame. When
            first_frame and last_frame use the same image, it creates a loop
            effect.
        hook_url:
          type: string
          description: >-
            Callback URL address. When the task completes or fails,
            notifications will be sent to this address. The notification data
            structure is consistent with the <a href="fetch"
            target="_self">fetch structure</a>. If not set, you need to call the
            <a href="fetch" target="_self">fetch endpoint</a> to query the
            result
          example: https://example.com/callback
      required:
        - prompt
        - keyframes
  responses:
    SuccessResponse:
      description: Request successful
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: jobId
            required:
              - status
              - message
              - data
    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>.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.