# Estimate cost

> Prices a video request without running it. Same body as generate, nothing generated and nothing charged.

The same body as [generate](https://mynth.io/docs/api-reference/endpoints/video/generate.md),
validated the same way, priced rather than run. The figure is always exact,
because the model is always explicit. Resolution and duration move a video's
price a lot, so check it before a long render.

`POST /video/generate/estimate`

**Auth:** API key or OAuth token

## Request body

- `model` (required, string) — One of: `"bytedance/seedance-2.0-mini"`, `"google/gemini-omni-flash-1.1"`, `"prunaai/p-video"`, `"xai/grok-imagine-video-1.5"`. Example `"bytedance/seedance-2.0-mini"`.
- `prompt` (required, string) — Positive prompt. ≥ 1 characters, ≤ 8192 characters. Example `"A cat surfing a wave at sunset"`.
- `access` (object) — Controls whether the create-task response should include a short-lived Public Access Token. That token can be passed to browser or client-side code for polling task status and task videos without exposing your API key.
  - `pat` (required, object)
    - `enabled` (boolean) — Default `true`.
- `audio` (boolean) — Enable model-native generated audio. Only supported by models with audio capability.
- `duration` (number) — Video duration in seconds. Defaults to the model's default duration. ≥ 1, ≤ 60.
- `inputs` ((string | object)[]) — ≤ 5 items.
  - **source + type**
    - `source` (required, object)
      - `type` (required, "url")
      - `url` (required, string)
    - `type` (required, "image")
    - `as` (string) — One of: `"auto"`, `"first_frame"`, `"last_frame"`, `"reference"`.
- `metadata` (object)
- `negative_prompt` (string) — ≤ 8192 characters.
- `resolution` (string) — Resolution tier. Defaults to the model's default tier. One of: `"1080p"`, `"480p"`, `"4k"`, `"720p"`.
- `webhook` (object)
  - `custom` (object[]) — ≥ 1 items, ≤ 5 items.
    - `url` (required, string)
  - `dashboard` (boolean) — Set to false to disable dashboard-managed webhooks for this task. Request-level custom webhooks are still sent.

## Response

### 200 — Video generation request validated and cost estimated

- `data` (required, object)
  - `currency` (required, "usd")
  - `estimateKind` (required, "exact") — Video generation always requires a pinned model, so the estimate is exact.
  - `estimatedCost` (required, string) — Estimated cost in USD for the request. Nothing is generated or charged. Example `"0.05"`.

```json
{
  "data": {
    "currency": "usd",
    "estimateKind": "exact",
    "estimatedCost": "0.05"
  }
}
```

### 400 — Validation Error

- `success` (required, false)
- `error` (required, array)
- `data` (required, any)

```json
{
  "success": false,
  "error": []
}
```

## Request samples

### cURL

```bash
curl -X POST https://api.mynth.io/video/generate/estimate \
  -H "Authorization: Bearer $MYNTH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bytedance/seedance-2.0-mini",
    "prompt": "A cat surfing a wave at sunset"
  }'
```

### JavaScript

```ts
const response = await fetch("https://api.mynth.io/video/generate/estimate", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MYNTH_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "bytedance/seedance-2.0-mini",
    "prompt": "A cat surfing a wave at sunset"
  }),
});

const { data } = await response.json();
```

The full schema for this endpoint is in the [OpenAPI document](https://api.mynth.io/openapi.json).
