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

# Grok Imagine 1.5 Video Generation

>  - Async processing mode, returns task ID for subsequent queries
- High-quality AI video generation, supports text-to-video and image-to-video
- Flexible aspect ratio and quality options for different creative needs 

<Info>
  **Model name compatibility note**: This endpoint also accepts the alias `grok-imagine-1.5-video-ext`, which is equivalent to `grok-imagine-1.5-video-gccai`. The two are interchangeable and produce identical results.
</Info>

<RequestExample>
  ```bash cURL theme={null}
  # model can be "grok-imagine-1.5-video-gccai", or the compatible alias "grok-imagine-1.5-video-ext"
  curl --request POST \
    --url https://gccai.heqingsong.uk/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "grok-imagine-1.5-video-gccai",
      "prompt": "A dog running on the beach, sunny weather, slow motion",
      "size": "16:9",
      "duration": 6,
      "quality": "720p"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://gccai.heqingsong.uk/v1/videos/generations"

  payload = {
      "model": "grok-imagine-1.5-video-gccai",
      "prompt": "A dog running on the beach, sunny weather, slow motion",
      "size": "16:9",
      "duration": 6,
      "quality": "720p"
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://gccai.heqingsong.uk/v1/videos/generations";

  const payload = {
    model: "grok-imagine-1.5-video-gccai",
    prompt: "A dog running on the beach, sunny weather, slow motion",
    size: "16:9",
    duration: 6,
    quality: "720p"
  };

  const headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
  };

  fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload)
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "data": [
      {
        "task_id": "task_01JNXXXXXXXXXXXXXXXXXX",
        "status": "submitted"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": 400,
      "message": "Invalid request parameters",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "Authentication failed, please check your API key",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "Insufficient balance, please top up and try again",
      "type": "payment_required"
    }
  }
  ```

  ```json 403 theme={null}
  {
    "error": {
      "code": 403,
      "message": "Access forbidden, you do not have permission to access this resource",
      "type": "permission_error"
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": 429,
      "message": "Too many requests, please try again later",
      "type": "rate_limit_error"
    }
  }
  ```

  ```json 500 theme={null}
  {
    "error": {
      "code": 500,
      "message": "Internal server error, please try again later",
      "type": "server_error"
    }
  }
  ```

  ```json 502 theme={null}
  {
    "error": {
      "code": 502,
      "message": "Bad gateway, server temporarily unavailable",
      "type": "bad_gateway"
    }
  }
  ```
</ResponseExample>

## Authorizations

<ParamField header="Authorization" type="string" required>
  All APIs require Bearer Token authentication

  Get API Key:

  Visit the [API Key Management Page](https://gccai.heqingsong.uk/keys) to get your API Key

  Add it to the request header:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Request Parameters

<ParamField body="model" type="string" default="grok-imagine-1.5-video-gccai" required>
  Video generation model name

  Supported models:

  * `grok-imagine-1.5-video-gccai` - Grok Video Generation (compatible alias `grok-imagine-1.5-video-ext`)

  Example: `"grok-imagine-1.5-video-gccai"`

  <Note>
    For backward compatibility, the alias `grok-imagine-1.5-video-ext` (for `grok-imagine-1.5-video-gccai`) remains usable.
  </Note>
</ParamField>

<ParamField body="prompt" type="string" required>
  Video content description, supports multiple languages
</ParamField>

<ParamField body="size" type="string" default="16:9">
  Video size

  Options:

  * `16:9` - Landscape (default)
  * `9:16` - Portrait
  * `1:1` - Square
  * `3:2` - Landscape
  * `2:3` - Portrait
</ParamField>

<ParamField body="duration" type="integer" default={6}>
  Video duration (seconds)

  Range: 6-30 (minimum 6 seconds, maximum 30 seconds)

  **⚠️ Note:** Must be a plain number (e.g. `6`), do not add quotes, otherwise an error will occur
</ParamField>

<ParamField body="quality" type="string" default="480p">
  Video quality

  Options:

  * `480p` - Standard definition (default)
  * `720p` - High definition
</ParamField>

<ParamField body="image_urls" type="string[]">
  List of reference image URLs

  **Limits:**

  * Maximum 7 images
  * Must be publicly accessible URLs
  * Base64 format is not supported

  <Tip>After uploading a reference image, the aspect ratio will automatically match the reference image's aspect ratio.</Tip>
</ParamField>

## Response

<ResponseField name="code" type="integer">
  Response status code
</ResponseField>

<ResponseField name="data" type="object[]">
  Response data array

  <Expandable title="Properties">
    <ResponseField name="task_id" type="string">
      Unique task identifier
    </ResponseField>

    <ResponseField name="status" type="string">
      Task status

      * `submitted` - Submitted
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  **Query Task Result**

  Video generation is an async task. After submission, a `task_id` will be returned. Use the [Get Task Status](/en/api-reference/tasks/status) endpoint to query generation progress and results.
</Note>

## Use Cases

### Case 1: Text-to-Video

```json theme={null}
{
  "model": "grok-imagine-1.5-video-gccai",
  "prompt": "A dog running on the beach, sunny weather, slow motion",
  "size": "16:9",
  "duration": 6
}
```

### Case 2: Image-to-Video

```json theme={null}
{
  "model": "grok-imagine-1.5-video-gccai",
  "prompt": "Bring the scene to life with natural dynamic effects",
  "image_urls": ["https://example.com/start.png"],
  "size": "16:9",
  "duration": 10,
  "quality": "720p"
}
```
