# Pricing and billing

> How a price is computed, how to read it before you send, and how the prepaid balance holds and charges each task.

Every price is a flat USD number you can total before a task starts. An image
is priced per output, a video per second, and the analysis tools per call.
Creating a task holds the estimate on your balance. Completing it charges only
what succeeded and releases the rest.

There is no subscription and no minimum spend. You prepay credits in the
[wallet](https://mynth.io/dashboard/wallet). The minimum top-up is $5, with no Mynth fee on
top. An idle account is never billed.

> **Warning**
>
> Do not hardcode prices from these docs. They change when providers change theirs. Read them from
> `GET https://api.mynth.io/models` or [/models.json](https://mynth.io/models.json), or price a real request with an
> [estimate call](https://mynth.io/docs/guides/estimate-cost.md).

## Where prices come from

Providers bill by megapixel, by token, or by GPU time. Mynth publishes one
number per model, usually the provider's own price. Where it is higher, the
difference covers routing, retries, and delivery, and it is already included.

The catalog carries prices as decimal strings in USD:

| Field                    | Meaning                                                   |
| ------------------------ | --------------------------------------------------------- |
| `pricing.perImage.base`  | One image at the model's normal size                      |
| `pricing.perImage["4k"]` | One image at a `_4k` size. Absent when the model has none |
| `pricing.perInput`       | Each input image, charged per output. Absent means $0     |
| `pricing.perSecond`      | Video, keyed by resolution tier                           |
| `pricing.audio`          | Video audio per second, when billed separately            |

The catalog is at [mynth.io/models](https://mynth.io/models), the [pricing table](https://mynth.io/pricing),
`GET https://api.mynth.io/models`, [/models.json](https://mynth.io/models.json), and
`npx @mynthio/cli models list`. None of them need an API key.

## Image price

```text
per image  = perImage[scale] + perInput × number of inputs
task       = per image × successful images
```

`scale` is `4k` for a `_4k` size and `base` otherwise. Nothing else changes
the price: not prompt length, pixel count within a scale, output format,
webhooks, destinations, which provider ran the job, or how many retries it
took.

For example, with `perImage.base` at $0.03 and `perInput` at $0.03, a request
with `count: 2` and two reference images holds $0.18 and charges $0.09 per
image that succeeds.

A `_4k` size on a model without a 4k price fails the task with
`CAPABILITY_NOT_SUPPORTED`, and a failed task costs nothing.

With `model: "auto"`, the hold is a flat $0.20 per image because the model is
not chosen yet. On completion Mynth charges the published price of the model
in `result.model` and releases the rest. See
[the model field](https://mynth.io/docs/models.md#auto-is-experimental).

## Video price

```text
video = (perSecond[resolution] + audio.perSecond) × duration
```

An omitted `resolution`, `duration`, or `audio` uses the model's default,
and the estimate includes it. `audio.perSecond` applies only when the catalog
lists it. The video models available today include audio in `perSecond`.

## Tool prices

| Request                                    | Price   |
| ------------------------------------------ | ------- |
| `POST /image/rate`                         | $0.0002 |
| `rating` on `POST /image/generate`         | $0      |
| `POST /image/alt`                          | $0.0004 |
| `POST /image/review` with `effort: "low"`  | $0.01   |
| `POST /image/review` with `effort: "high"` | $0.30   |
| `POST /image/remove-background`            | $0.02   |
| `magic_prompt` on `POST /image/generate`   | $0      |
| `POST /image/upload`                       | $0      |

Magic Prompt is included in the generation estimate, so if it gets a price
later, the estimate will show it.

## Before you send

`POST /image/generate/estimate` and `POST /video/generate/estimate` take the
same body as generate. They validate it and return the price without creating
a task or holding anything. [Estimate cost](https://mynth.io/docs/guides/estimate-cost.md) has
the request and response.

## Balance

```text
available = balance − reserved

balance     credits on the account
reserved    held by tasks that are still pending
available   what the next task can hold
```

`GET /balance` returns all three as decimal strings. It needs a key with the
`manage` scope. `npx @mynthio/cli balance` prints them.

```json
{
  "data": { "balance": "12.50", "reserved": "0.18", "available": "12.32", "currency": "usd" }
}
```

## Holds and charges

```text
create task ── hold estimatedCost against available
  │
  ├─ completed ── charge each successful output, release the rest of the hold
  └─ failed ───── release the whole hold, charge $0
```

- The create response returns the hold as `estimatedCost`.
- If `available` is below the hold, the create fails with
  `422 INSUFFICIENT_BALANCE` and nothing is queued.
- If the key's [spending limit](https://mynth.io/docs/authentication.md#spending-limits) would be
  passed, it fails with `429 SPENDING_LIMIT_EXCEEDED`.
- Only successful outputs are charged. If three of four images fail, you pay
  for one.
- The amount charged is `cost` on the finished task. It is `null` while the
  task is pending and when it failed.

A task still `pending` 24 hours after its last update is failed with
`TASK_EXPIRED` by a sweep that runs daily at 02:00 UTC, and its hold is
released. The sweep looks at tasks last updated within the past 7 days. If
`reserved` stays high after that, email [mynth@mynth.io](mailto:mynth@mynth.io).

## Refunds

Credits are for spending on Mynth and are not paid back as cash. The
[terms](https://mynth.io/legal/terms) cover refunds when a charge was our fault. The wallet
lists each top-up and each charge with what it paid for.

## Next steps

- [Estimate cost](https://mynth.io/docs/guides/estimate-cost.md): price a request before you create it.
- [Tasks](https://mynth.io/docs/concepts/tasks.md): where `cost` lands, and partial success.
- [Choosing an image model](https://mynth.io/docs/models/choosing.md): comparing prices across models.
