Estimate a run
curl --request POST \
--url https://www.qwairy.co/api/v1/brands/{brandId}/runs/estimate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"promptIds": [
"<string>"
],
"modelIds": [
"<string>"
]
}
'import requests
url = "https://www.qwairy.co/api/v1/brands/{brandId}/runs/estimate"
payload = {
"promptIds": ["<string>"],
"modelIds": ["<string>"]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({promptIds: ['<string>'], modelIds: ['<string>']})
};
fetch('https://www.qwairy.co/api/v1/brands/{brandId}/runs/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Configure data
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.
POST
https://www.qwairy.co
/
api
/
v1
/
brands
/
{brandId}
/
runs
/
estimate
Estimate a run
curl --request POST \
--url https://www.qwairy.co/api/v1/brands/{brandId}/runs/estimate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"promptIds": [
"<string>"
],
"modelIds": [
"<string>"
]
}
'import requests
url = "https://www.qwairy.co/api/v1/brands/{brandId}/runs/estimate"
payload = {
"promptIds": ["<string>"],
"modelIds": ["<string>"]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({promptIds: ['<string>'], modelIds: ['<string>']})
};
fetch('https://www.qwairy.co/api/v1/brands/{brandId}/runs/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Estimates a run for a
An estimate is a snapshot. Starting the run
revalidates targets and reserves credits; its result can differ if availability
or balance changes.
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 for
idempotency, conditional requests and error handling.
Up to 50 active prompt UUIDs. Omit to select all active prompts. If that would
exceed 50, explicitly select a smaller set.
Up to 20 Qwairy model codes. Omit or send
[] to use the workspace’s selected
monitoring models.Response
Returns200 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 |
Synthetic request and response
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 '{}'
{
"estimate": {
"promptCount": 12,
"modelCount": 2,
"answerCount": 24,
"estimatedCredits": 48,
"availableCredits": 1200,
"sufficientCredits": true,
"unsupportedModels": []
}
}
Errors
Invalid or oversized targets return400 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 for authentication, plan, idempotency
and server errors. On 429, honor Retry-After; writes can return
503 SERVICE_UNAVAILABLE if the write limiter is unavailable.
