# Video generation

`POST /v1/videos/generations` — Generate a short 720p clip from a text prompt.

- 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

Motion One renders 5 or 10 second clips. Video is slow by nature: the request holds until the clip is ready, typically one to five minutes — set your HTTP client timeout accordingly.

The clip returns inline as base64 MP4 and is not retained — or set `store: true` to persist it to the eroq Store in the same call 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
{
  "created": 1756118400,
  "model": "eroq-motion-one",
  "data": [{ "b64_json": "AAAAIGZ0eXBpc281…", "content_type": "video/mp4" }],
  "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
