> ## Documentation Index
> Fetch the complete documentation index at: https://docs.strandai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pricing & credits

> Learn how Strand AI bills predictions in credits per patch and marker, estimate cost from slide dimensions, and reserve credits before submitting jobs.

Strand AI bills predictions in **credits**. The credits model is intentionally
simple so you can predict cost exactly before submitting a job.

## How credits work

The platform tiles each slide into fixed **224×224-pixel patches** and runs
inference per patch, per marker. One credit pays for one (patch × marker)
prediction.

<Note>
  **1 credit = 1 patch × 1 marker.** Patch size is fixed at 224 px.
</Note>

For a slide that's `W × H` pixels:

```text theme={null}
patches  = ceil(W / 224) × ceil(H / 224)
credits  = patches × markers_requested
```

That's it. There is no separate inference fee, surcharge, or per-job
overhead. A 50 000 × 40 000 px H\&E with 5 markers is `224 × 179 × 5 = 200 480`
credits.

## Estimating before you submit

The `/predict/estimate` endpoint (and its SDK wrappers) compute the exact
cost from slide dimensions, with no reservation:

<CodeGroup>
  ```python Python theme={null}
  est = client.predict.estimate(upload.id, markers=["CD8", "PanCK", "Ki67"])
  print(est.patch_count, est.marker_count, est.estimated_credits)
  print("balance:", est.org_balance, "pending:", est.org_pending)
  ```

  ```r R theme={null}
  est <- strand_estimate(client, upload$id, c("CD8", "PanCK", "Ki67"))
  message("patches: ",  est$patch_count,
          " markers: ", est$marker_count,
          " credits: ", est$estimated_credits)
  ```

  ```bash cURL theme={null}
  curl -X POST https://app.strandai.com/api/v1/predict/estimate \
    -H "Authorization: Bearer $STRAND_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"uploadId":"…","markers":["CD8","PanCK","Ki67"]}'
  ```
</CodeGroup>

## Reservation and refunds

When you call `POST /predict`, the platform **atomically reserves** the
estimated credits against your org balance. The reservation is recorded
on the job (`reservedCredits`) so:

* **In-flight jobs are price-locked.** If we change `CREDITS_PER_PATCH_MARKER`
  or `PATCH_PX` later, jobs already submitted keep their reserved price.
* **Failed jobs refund automatically.** If a job terminates with status
  `failed`, the reservation is released back to the org balance.
* **Insufficient balance returns 402.** The error body carries the
  `required` field so you know how much to top up.

## Buying credits

Credits are sold in prepaid tiers. Today, top-ups are handled by the team.
Email [support@strandai.com](mailto:support@strandai.com) with the volume
you need and we'll provision them.

<Note>
  Self-serve top-up via Stripe is in progress and will be surfaced under
  **Settings → Billing** when it ships.
</Note>

## See also

* [API reference](/api-reference/endpoint/estimatePrediction): `POST /predict/estimate`.
* [API reference](/api-reference/endpoint/submitPrediction): `POST /predict`, including 402 / 429 behaviour.
* [Supported markers](/markers): which markers count toward a job's credit cost.
