# Image / First-Last Frame Video

**What**：Given a first-frame image (optionally a last frame too), generate a video that starts from the first frame and transitions toward the last.

**When**：Use to animate an image or to precisely control the opening / closing frames. The aspect ratio follows the first frame; aspectRatio is ignored.

## Endpoints
- POST `/v1/videos`
- GET `/v1/videos/{id}`
- GET `/v1/videos/{id}/content`

> This page uses the unified API: create with `POST /v1/videos`, poll with `GET /v1/videos/{id}`, authenticate with `Authorization: Bearer <key>`; errors use the OpenAI format.

Creating returns a video object right away (`status: queued`). Poll `GET /v1/videos/{id}` until `status` is `completed` or `failed`; `url` is the result address, or download it with `GET /v1/videos/{id}/content`.

## Request params
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| model | string | Yes | Sub-model: mingmou-1.0 (see the sub-model table below) |
| prompt | string | — | Video description (optional; materials can drive generation) |
| firstFrameUrl | string | Yes | First-frame image URL (publicly reachable); cannot be combined with imageUrls / videoUrls |
| lastFrameUrl | string | — | Last-frame image URL (optional; requires firstFrameUrl, produces a first-to-last transition) |
| negativePrompt | string | — | Negative prompt (optional) |
| duration | integer | — | Duration (sec), range depends on the sub-model (see table), default 5 |
| resolution | string | — | 540P / 720P / 1080P / 2K / 4K (available tiers depend on the sub-model), default 720P (or the lowest tier if 720P is unavailable); 2K / 4K are upscaled |
| enhancePrompt | boolean | — | Whether to auto-enhance the prompt (optional) |
| seed | integer | — | Random seed (optional) |
| returnFirstFrame / returnLastFrame / returnFrameAtSecond | boolean / boolean / number | — | Also return the first / last / given-second frame image of the result video (optional), 1 credit per frame |

`model`, `prompt`, `seconds`, `size` and `input_reference` are the common fields; the other fields are specific to this model channel and go in the same body under their own names. `seconds` / `size` (must be `WIDTHxHEIGHT`) are only translated when the matching channel field is absent.

## Request example
```bash
curl https://api.novapi.ai/v1/videos \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "mingmou-1.0",
  "prompt": "she slowly turns around and smiles as the rain keeps falling, camera pushes in",
  "duration": 5,
  "resolution": "720P",
  "firstFrameUrl": "https://cdn.novapi.ai/kling/1791949942892_d18ee23dfa3048e097c58c9c3e32a754.png",
  "lastFrameUrl": "https://cdn.novapi.ai/kling/1791949946650_d122fd1bfaca4f958ddf999a82ff1f85.png"
}'
```

```python
import os, requests

r = requests.post(
    "https://api.novapi.ai/v1/videos",
    headers={"Authorization": "Bearer " + os.environ["API_KEY"]},
    json={
        "model": "mingmou-1.0",
        "prompt": "she slowly turns around and smiles as the rain keeps falling, camera pushes in",
        "duration": 5,
        "resolution": "720P",
        "firstFrameUrl": "https://cdn.novapi.ai/kling/1791949942892_d18ee23dfa3048e097c58c9c3e32a754.png",
        "lastFrameUrl": "https://cdn.novapi.ai/kling/1791949946650_d122fd1bfaca4f958ddf999a82ff1f85.png",
    },
)
print(r.json())  # poll GET /v1/videos/{id} until status is completed
```

```ts
const resp = await fetch("https://api.novapi.ai/v1/videos", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "mingmou-1.0",
    "prompt": "she slowly turns around and smiles as the rain keeps falling, camera pushes in",
    "duration": 5,
    "resolution": "720P",
    "firstFrameUrl": "https://cdn.novapi.ai/kling/1791949942892_d18ee23dfa3048e097c58c9c3e32a754.png",
    "lastFrameUrl": "https://cdn.novapi.ai/kling/1791949946650_d122fd1bfaca4f958ddf999a82ff1f85.png"
  }),
});
console.log(await resp.json()); // poll GET /v1/videos/{id} until status is completed
```

## Response example
```json
{
  "id": "video_<task-id>",
  "object": "video",
  "model": "mingmou-1.0",
  "status": "queued",
  "progress": 0,
  "created_at": <unix-seconds>,
  "completed_at": null,
  "expires_at": null,
  "error": null
}
```

```json
{
  "id": "video_<task-id>",
  "object": "video",
  "model": "mingmou-1.0",
  "status": "completed",
  "progress": 100,
  "created_at": <unix-seconds>,
  "completed_at": <unix-seconds>,
  "expires_at": null,
  "error": null,
  "url": "https://..."
}
```

```bash
curl https://api.novapi.ai/v1/videos/video_<task-id> \
  -H "Authorization: Bearer $API_KEY"

# completed: "status": "completed", "progress": 100, and a "url" field with the result
curl -L https://api.novapi.ai/v1/videos/video_<task-id>/content \
  -H "Authorization: Bearer $API_KEY" \
  --output result.mp4
```
