GET
/
cost
curl --request GET \
  --url https://api.isofold.com/cost \
  --header 'Authorization: Bearer <token>'
{
  "original_cost": 123,
  "optimized_cost": 123,
  "savings": 123
}

Estimate the cost of running a query before and after Isofold optimization.

This endpoint is primarily supported for BigQuery, where dry-run mode provides exact byte scan estimates. For other warehouses, estimates are heuristic-based.


Request

Make a GET request to /cost with a query parameter:

curl -G https://api.isofold.com/cost \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "query=SELECT * FROM users"

Query Parameters

ParameterTypeRequiredDescription
querystringRaw SQL query to evaluate

Response

{
  "original_cost": 0.29,
  "optimized_cost": 0.11,
  "savings": 0.18
}

Fields

FieldTypeDescription
original_costnumberCost estimate of the unoptimized query (USD)
optimized_costnumberCost estimate of the rewritten query (USD)
savingsnumberDifference between original and optimized cost

Notes

  • On BigQuery, this uses real dry-run estimates.
  • On other engines, costs are approximated using:
    • Column count
    • Join complexity
    • Filter selectivity
  • Use this endpoint to evaluate query rewrites without executing them.

Next: Verify Result Equivalence

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

query
string
required

SQL query string

Response

200 - application/json

Cost estimate result

The response is of type object.