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

# Queue AI Product Videos with estudjo: Duration and Prompts

> Queue short cinematic product videos using POST /generate with a video model. Learn prompts, duration options, and how video differs from image generation.

estudjo can generate short cinematic product videos from a single product photo. Video generation uses the same `POST /generate` endpoint as images — the **model you specify** determines whether image or video logic runs.

## Key Differences from Image Generation

Before sending a video request, note these differences from the image flow:

* **`duration` is required** — supported values are `"5"`, `"8"`, or `"15"` (plain number strings, no unit suffix)
* **`prompt` is recommended** — pass a direct prompt string instead of a scene for the most control over the output
* **`prompt` takes priority** — when `prompt` is present, any `scene` or `sceneId` value is ignored entirely
* **`category` is optional** — for video models it falls back to the model-wide default when omitted

## Required Fields

| Field               | Type   | Description                                            |
| ------------------- | ------ | ------------------------------------------------------ |
| `model`             | string | Video model identifier (e.g. `estudjo/economic-video`) |
| `aspect-ratio`      | string | e.g. `1:1`, `16:9`                                     |
| `resolution`        | string | e.g. `480P`                                            |
| `duration`          | string | `"5"`, `"8"`, or `"15"`                                |
| `image_url`         | string | Publicly accessible product image                      |
| `prompt` or `scene` | string | Either a direct prompt string **or** a scene UUID      |

<Warning>
  If both `prompt` and `scene`/`sceneId` are absent from the request body, the API returns `400 invalid_input`.
</Warning>

## Example Request

The example below uses a direct `prompt` string — the recommended approach for video generation.

```bash theme={null}
curl -X POST https://v1.api.estudjo.com/generate \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "estudjo/economic-video",
    "category": "womens-clothing",
    "aspect-ratio": "1:1",
    "resolution": "480P",
    "duration": "5",
    "prompt": "confident fashion model showcasing the outfit, slow cinematic camera pan",
    "image_url": "https://static.example.com/thumb/product-86713.jpg"
  }'
```

## Response

```json theme={null}
{
  "success": true,
  "data": {
    "status": "queued",
    "task_id": "619de1fbf0299c749efecedd7eb15942"
  }
}
```

Poll `GET /status` with the returned `task_id` to track the generation and retrieve the video URL once complete.

## Error Reference

| Code                   | HTTP | Cause                                                                                                                                                                        |
| ---------------------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `invalid_input`        | 400  | Missing required field, bad `aspect-ratio` or `resolution` value, invalid `duration` (only `"5"`, `"8"`, `"15"` accepted), or both `prompt` and `scene`/`sceneId` are absent |
| `not_found`            | 404  | Unknown model or scene                                                                                                                                                       |
| `insufficient_credits` | 402  | Account balance too low to queue the generation                                                                                                                              |
| `provider_error`       | 502  | Upstream AI provider failed — retry after a short delay                                                                                                                      |

## Next Steps

<CardGroup cols={2}>
  <Card title="Poll for Status" icon="clock" href="/docs/guides/poll-status">
    Track your video generation and retrieve the finished file URL.
  </Card>

  <Card title="Image Generation" icon="image" href="/docs/guides/generate-image">
    Generate static product images using the same endpoint.
  </Card>
</CardGroup>
