# Video generation

`POST /v1/videos/generations` — Start rendering a short 720p clip — async, poll for the result.

- Base URL: https://eroq.ai/v1
- Auth: `Authorization: Bearer eroq_sk_…` (create keys at https://eroq.ai/dashboard/keys)
- Credits: 100 for 5s · 180 for 10s · + storage with store: true

Video is slow by nature (one to five minutes), so this endpoint is **asynchronous**: the call charges, starts the render and answers `202` immediately with a job id. Poll `GET /v1/videos/generations/{id}` every few seconds until `status` is `succeeded` or `failed`.

The money guarantee is unchanged: credits are charged at submit, and a render that fails — or never completes within 10 minutes — refunds itself automatically. You only ever pay for a delivered clip.

The finished clip arrives inline as base64 MP4 on the job and is kept for 24 hours — or set `store: true` to persist it to the eroq Store and receive a durable CDN URL instead, with the Store's rate (2 credits / started 10MB) charged on top.

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `prompt` | string | yes | The scene to render. |
| `model` | string | no | Only `eroq-motion-one` today. |
| `duration` | string | no | `5s` (default) or `10s`. |
| `store` | boolean | no | Persist to the eroq Store and answer with a CDN URL. +2 credits per started 10MB. Default `false`. |

## Example request

```bash
curl https://eroq.ai/v1/videos/generations \
  -H "Authorization: Bearer $EROQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "eroq-motion-one",
  "prompt": "slow dolly through a neon-lit hangar, rain on the windows",
  "duration": "5s"
}'
```

```javascript
const res = await fetch('https://eroq.ai/v1/videos/generations', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.EROQ_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "model": "eroq-motion-one",
    "prompt": "slow dolly through a neon-lit hangar, rain on the windows",
    "duration": "5s"
  }),
})
console.log(await res.json())
```

```python
import os, requests

res = requests.post(
    "https://eroq.ai/v1/videos/generations",
    headers={"Authorization": f"Bearer {os.environ['EROQ_API_KEY']}"},
    json={
        "model": "eroq-motion-one",
        "prompt": "slow dolly through a neon-lit hangar, rain on the windows",
        "duration": "5s"
    },
)
print(res.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "model": "eroq-motion-one",
  "prompt": "slow dolly through a neon-lit hangar, rain on the windows",
  "duration": "5s"
}`)

	req, _ := http.NewRequest("POST", "https://eroq.ai/v1/videos/generations", body)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EROQ_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```

## Response


```json
{
  "id": "b7e6c2d4-…",
  "object": "video.generation",
  "status": "processing",
  "created": 1756118400,
  "model": "eroq-motion-one",
  "duration": "5s",
  "poll": "/v1/videos/generations/b7e6c2d4-…",
  "usage": { "credits_spent": 100, "credits_remaining": 887 }
}
```
---
Canonical: https://eroq.ai/docs/video · Index for agents: https://eroq.ai/llms.txt · OpenAPI: https://eroq.ai/openapi.json
