---
url: https://flat.io/developers/docs/api/omr/faq/credits.md
description: >-
  How Flat's OMR API is billed: 1 credit per page, the shared credit pool, what
  happens to credits on failed jobs, why you get a 402, credit packs, and volume
  pricing.
---

# Credits and billing

How Flat's [Optical Music Recognition API](/api/omr/) is paid for. See
[Capabilities and credits](/api/omr/#capabilities-and-credits) on the overview page for the
reference version.

## Counting and charging

### How are credits counted?

**1 credit is 1 page.** A 4 page PDF costs 4 credits, whichever
[flow](/api/omr/#two-ways-to-import) you use. Credits are charged when the job **starts**, based on
the total page count across every file in the job.

Everything before that point is free. Creating a draft job, uploading its files, listing your jobs,
and canceling a draft cost nothing: only
[`POST /omr/jobs/{job}/start`](/api/omr/jobs#step-3-start-the-job) (and `autoStart: true`, and the
[auto simple import](/api/omr/import)) runs the conversion and bills for it.

Do not hardcode the ratio. Read `costPerPage` from
[`GET /omr/capabilities`](https://flat.io/developers/docs/api/reference#tag/OMR/operation/getOmrCapabilities),
which is the authoritative value for the authenticated account.

### Does the API use the same credits as the Flat apps?

Yes. **One pool per Flat account**, shared by the web, desktop, and mobile apps and the API.

For each job, credits are taken in this order:

1. The page allowance included in the account's Flat or Flat for Education **subscription**.
2. Any **credit packs** bought on the account.

This surprises people who expect the API to meter separately. If your subscription includes a
monthly page allowance, a handful of API conversions can use it up.

### Whose credits are spent?

The credits of the **Flat account that owns the token** you authenticate with. With a
[personal access token](/api/authentication#personal-access-tokens) that is your own account; with
OAuth2, it is the account of the user who authorized your app. See
[Whose credits are spent](/api/omr/#whose-credits-are-spent).

### Do failed, cancelled, or retried jobs consume credits?

**Only successful conversions ultimately consume credits.** Credits are charged at job start, then
reverted when:

* the job ends in `error`, whatever the [`errorCode`](/api/omr/#errors), or
* the job is [cancelled](/api/omr/jobs#cancel-a-job) before the worker finishes, including a draft
  you created and never started.

A job you retry after a failure is charged like any other job, and the failed attempt is refunded.

## Estimating and monitoring spend

### How do I estimate cost before running a batch?

Multiply your total page count by `costPerPage`. To avoid a `402` in the middle of a user flow,
preflight against `GET /omr/capabilities`, which returns both `costPerPage` and the account's
`remainingCredits`:

```js
const caps = await fetch('https://api.flat.io/v2/omr/capabilities', { headers: auth }).then((r) => r.json());

const cost = pageCount * caps.costPerPage;
if (cost > caps.remainingCredits) {
  // Send the user to https://flat.io/settings/ai-credits before starting the job.
}
```

`remainingCredits` is only returned on an **authenticated** request, since there is no account to
report a balance for otherwise. The rest of the response, `costPerPage` included, works
unauthenticated, so you can feature-detect before a user connects an account.

### Why did I get a `402`?

A `402` means the account behind your token cannot pay for the job. It is out of credits, over quota,
or on a plan that does not include OMR. Top up at
[flat.io/settings/ai-credits](https://flat.io/settings/ai-credits?ref=dev-docs-omr-faq).

The fix in your code is the preflight check above: read `remainingCredits` before you start a job and
surface a clear message, rather than letting the user discover the problem when the job fails.

### Where can I see my usage history?

The [Credits](https://flat.io/developers/billing/credits) page of the developer dashboard shows the
balance of each pool and the credit ledger: every deduction, linked to the job that caused it, and
every top-up.

The same ledger is available as
[`GET /billing/credits/history`](https://flat.io/developers/docs/api/reference#tag/OMR/operation/listBillingCreditsHistory),
newest first, with cursor pagination through the `Link` header. A reversed deduction keeps its entry
and flips its `state`, so sum only entries whose `state` is `active`. Your current balance is always
available as `remainingCredits` on `GET /omr/capabilities`.

To relate spend to work, [`GET /omr/jobs`](https://flat.io/developers/docs/api/reference#tag/OMR/operation/listOmrJobs)
lists your jobs with their `estimatedCredits`:

```bash
curl -H "Authorization: Bearer $TOKEN" "https://api.flat.io/v2/omr/jobs?status=done"
```

## Buying credits

### Do credit packs expire or auto-renew?

Credit packs are **one-off purchases**. They are not a subscription, they do not auto-renew, and they
do not expire while the account is active. Buy them on
[your account's AI credits page](https://flat.io/settings/ai-credits?ref=dev-docs-omr-faq).

Packs currently on sale, generated from the live catalog:

| Pack | Price | Per page |
|:--|:--|:--|
| 30 pages | $9.99 | $0.333 |
| 70 pages | $18.99 | $0.271 |
| 300 pages | $49.99 | $0.167 |
| 1,000 pages | $149 | $0.149 |
| 3,000 pages | $300 | $0.10 |

List prices in USD, excluding any local tax. Your own currency and the tax that applies to
you are shown at checkout on [your account's AI credits page](https://flat.io/settings/ai-credits?ref=dev-docs-omr-faq).

The **1,000 and 3,000 page packs** are behind the **"Need 1000+ credits?"** link on that page, not in
the default grid. If you only see the smaller packs, that link is what you are looking for.

### Is there volume pricing?

Yes, and it is self-serve. The **price per page improves at every pack size**, not just the largest
ones, as the table above shows. Most integrations never need to talk to us about pricing: buy the
pack that matches your volume.

If you expect volumes well beyond the largest pack, or you have specific contractual requirements,
email <developers@flat.io> and we will work out something that fits.

### Do credits bought in the Opuscan apps work with the API?

**No.** [Opuscan](https://www.opuscan.com/omr/) is a separate consumer product sold through the app
stores. Purchases made inside Opuscan are tied to the store account that made them, and are **not
shared with a Flat account or with this API**.

Credits for the API must be on the Flat account behind your token, bought at
[flat.io/settings/ai-credits](https://flat.io/settings/ai-credits?ref=dev-docs-omr-faq). The same
applies in reverse: credits on your Flat account do not appear inside the Opuscan apps.

## Related

* [Capabilities and credits](/api/omr/#capabilities-and-credits) on the OMR overview.
* [Limits, performance, and integration](/api/omr/faq/limits).
* [Commercial use, privacy, and data](/api/omr/faq/legal).
