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

# Estimate a run

> Estimate the usable targets and credit cost of a run for a live workspace without starting it, reserving credits or sending an Idempotency-Key.

Estimates a run for a `LIVE` workspace. It does not reserve or spend credits
and requires no `Idempotency-Key`. The endpoint still requires a write-enabled
plan and consumes the write rate-limit budget.

Requires an active Business, Agency Business or Enterprise plan. Use an API token with write access enabled. See [Writing data](https://docs.qwairy.co/developers/writing-data.md) for
idempotency, conditional requests and error handling.

**Authorization** `string` *required*

Bearer token for your team.

**brandId** `string` *required*

Workspace identifier. The workspace must belong to the token's team.

**promptIds** `string[]`

Up to 50 active prompt UUIDs. Omit to select all active prompts. If that would
exceed 50, explicitly select a smaller set.

**modelIds** `string[]`

Up to 20 Qwairy model codes. Omit or send `[]` to use the workspace's selected
monitoring models.

## Response

Returns `200` with `estimate`. When every requested model is excluded, the
response is still `200`, with zero counts and credits and the excluded codes
in `unsupportedModels`:

| Field | Meaning |
| - | - |
| `promptCount`, `modelCount`, `answerCount` | Usable target counts |
| `estimatedCredits` | Total cost of the usable prompt/model combinations |
| `availableCredits` | Balance observed at estimate time |
| `sufficientCredits` | Whether that balance covers the estimated cost |
| `unsupportedModels` | Requested codes excluded because they are unknown, disabled, unavailable or unsupported in the workspace's country |

An estimate is a snapshot. [Starting the run](https://docs.qwairy.co/developers/endpoints/runs/manage.md)
revalidates targets and reserves credits; its result can differ if availability
or balance changes.

## Synthetic request and response

```bash theme={null}
curl -X POST "https://www.qwairy.co/api/v1/brands/$BRAND_ID/runs/estimate" \
  -H "Authorization: Bearer $QWAIRY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```json theme={null}
{
  "estimate": {
    "promptCount": 12,
    "modelCount": 2,
    "answerCount": 24,
    "estimatedCredits": 48,
    "availableCredits": 1200,
    "sufficientCredits": true,
    "unsupportedModels": []
  }
}
```

## Errors

Invalid or oversized targets return `400 INVALID_REQUEST`; inaccessible
resources return `404 RESOURCE_NOT_FOUND`. A non-live workspace, an empty
prompt selection, or no usable model returns `409 CONFLICT`.

See [Error codes](https://docs.qwairy.co/developers/errors.md) for authentication, plan, idempotency
and server errors. On `429`, honor `Retry-After`; writes can return
`503 SERVICE_UNAVAILABLE` if the write limiter is unavailable.


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