> ## 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

> How Strand AI bills predictions in credits per retained tissue model-grid position and marker, how to get the exact price before submission, and when credits come back.

Strand AI bills predictions in **credits**. You can get the exact price of a
run before you submit it.

## How credits work

The model evaluates overlapping positions on an MPP-normalized grid. One credit
pays for one retained tissue position on one marker:

> [!NOTE]
>
> **1 credit = 1 retained tissue model-grid position × 1 marker.**

The source-pixel footprint of each position depends on the sample's calibrated
microns-per-pixel (MPP). It is not a fixed 224×224 region of the uploaded image.
Background positions are excluded, so a slide with one small biopsy costs far
less than a slide of the same pixel dimensions covered in tissue. Raw byte size,
raw pixel dimensions, and formulas such as `ceil(width / 224) × ceil(height / 224)` do not determine the billable count.

After sample preparation, `patchCount` is the authoritative retained-position
count for the sample's persisted MPP and priced model configuration. A dry run
returns that exact count and the credit cost for the request you are about to
submit. If the tissue model fails, preparation remains retryable and no price is
published. Counting and inference never substitute a different RGB heuristic.

There is no separate inference fee, surcharge, or per-job overhead. Only marker
predictions cost credits at all. Uploads, ingest, sample and marker reads, dry
runs, result downloads, and cell segmentation are free.

## Getting the exact price before you submit

`POST /predict` with `dryRun: true` validates and prices the exact request
without charging anything or creating a job. Its `patchCount` is the exact
number of retained MPP-normalized model-grid positions the run will cover, and
`estimatedCredits` is what you will be charged:

```python Python theme={"dark"}
est = client.predict.submit(
    upload.id,
    markers=["CD8", "PanCK", "Ki67"],
    dry_run=True,
)
print(est.patch_count, est.marker_count, est.estimated_credits)
print("balance:", est.org_balance, "pending:", est.org_pending)
```

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

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

## When you are charged, and when you get credits back

Correcting a sample's MPP before submission rebuilds its prepared geometry and
can change `patchCount`, so price again after an MPP correction. Submitting a run
deducts its full estimated cost from your organization's balance in one step,
before inference starts. The job atomically snapshots the priced MPP, retained
position count, model configuration, and prepared artifact identity alongside
that reservation. Inference uses this immutable snapshot even if the sample's
MPP is corrected later. The API reports the locked amount as `reservedCredits`,
which means:

* **The price of a submitted run cannot change.** If we change our per-patch
  price later, runs already submitted keep the price you were charged.
* **Failed and cancelled runs are credited back automatically.** If a job ends
  as `failed` or you cancel it, the full amount returns to your balance. Marker
  channels already written stay on the sample.
* **You pay only for delivered markers.** If a run delivers some of its markers
  and not others, you are charged for the delivered ones and credited back for
  the rest.
* **A run you cannot afford is rejected, not partially charged.** The request
  returns 402 with a `required` field showing the full cost.

## Buying credits

Credits are sold in prepaid tiers. There is no self-serve top-up yet, so email
[support@strandai.com](mailto:support@strandai.com) with the volume you need and
we'll add them to your organization.

## See also

* [API reference](https://docs.strandai.com/api-reference/endpoint/submitPrediction.md): `POST /predict` dry-run pricing, submission, and 402 / 429 behavior.
* [Supported markers](https://docs.strandai.com/markers.md): which markers count toward a job's credit cost.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.