Estimate the cost, in qBraid credits, of running a job on a device before submitting it.

The quote is a guide, not a cap: nothing enforces it, and a job that runs longer than quoted is billed for what it used. A QPU is quoted from that device's execution history. A simulator is quoted from a fixed conservative duration, so its quote does not change with the shot count.

A device whose pricing cannot be quoted is a state, not an error: the response has pricingAvailable: false and a reason.

Args:

  • deviceQrn (string): Device QRN (qBraid Resource Name)
  • shots (integer, optional): Shot count to quote for. Defaults to 1000.

Returns:

  • A quote with estimatedCost when pricingAvailable is true, or a reason when it is false

Raises:

  • 400: deviceQrn is missing or shots is outside 1 to 100000
  • 403: You do not have device execution permission for this device
  • 404: Device is not found
  • 410: Device is retired
GET/jobs/cost-estimate

Authorizations

X-API-KEYstringheaderrequired

Authenticate requests using an API key linked to your qBraid account. Obtain your key by registering or logging in at account.qbraid.com.

Query Parameters

deviceQrnstringrequired

Device to quote

shotsintegerdefault: 1000

Shot count to quote for. Defaults to 1000.

Response

200Successful Response
successbooleanrequired
dataobjectrequired

A quote for a device with usable pricing

400Bad Request
403Forbidden
404Device Not Found
410Device Retired
Estimate Job Cost
curl --request GET \
  --url https://api-v2.qbraid.com/api/v1/jobs/cost-estimate?deviceQrn=%3CdeviceQrn%3E \
  --header 'X-API-KEY: <api-key>'
import requests

url = "https://api-v2.qbraid.com/api/v1/jobs/cost-estimate?deviceQrn=%3CdeviceQrn%3E"
headers = {
    "X-API-KEY": "<api-key>"
}

response = requests.get(url, headers=headers)
print(response.json())
const url = "https://api-v2.qbraid.com/api/v1/jobs/cost-estimate?deviceQrn=%3CdeviceQrn%3E";
const options = {
  method: "GET",
  headers: {"X-API-KEY":"<api-key>"},
};

const response = await fetch(url, options);
console.log(await response.json());
{
  "success": true,
  "data": {
    "pricingAvailable": true,
    "estimatedCost": 123,
    "deviceQrn": "<string>",
    "shots": 123
  }
}
{
  "success": false,
  "message": "Query validation failed: shots: shots must be at least 1"
}
{
  "success": false,
  "message": "Missing device execution permission for: aws:aqt:qpu:ibex-q1"
}
{
  "success": false,
  "message": "Device not found: does:not:exist:nope"
}
{
  "success": false,
  "message": "Device is retired and no longer available: aws:aws:sim:tn1"
}