Price GraphQL queries before they run.
Point costQL at your API once.
It writes a pricing pack: one small file your app can use to price any query, instantly, with no calls to a server.
Build once. Quote anywhere.
Three steps take you from a live endpoint to a pricing pack your app carries with it.
Adapt
Tell costQL where your API lives and give it a few real IDs to query with. That's a short adapter file, about 90 lines. Three finished examples ship in the repo.
The adapter guide →Build
Run costql build. It sends calibration queries to your API, times the answers, and saves everything it learned as one JSON file: the pricing pack.
Quote
Load the pack in Python or JavaScript and price queries right where your code runs, with no more calls to your API. Both languages give the exact same answer.
Quote your first pack →from costql import PricingPack
pack = PricingPack.load("tmdb_t3.json") # one static file
quote = pack.quote('{ movie(id:"27205"){ cast(limit:8){ person{ name } } } }')
quote["price"] # 50.5 safe max: price on this to never undercharge
quote["typical_price"] # 36.4 typical: what the query usually costs
quote["confidence"] # "high"import { PricingPack } from "costql";
const pack = await PricingPack.load("tmdb_t3.json"); // the same file
const quote = pack.quote('{ movie(id:"27205"){ cast(limit:8){ person{ name } } } }');
quote.price // 50.5 safe max: price on this to never undercharge
quote.typical_price // 36.4 typical: what the query usually costs
quote.confidence // "high"Three fidelities. Match the tier to your API.
Every price is in work-time (ms): how much real work a query causes on your server. The tiers are how much of that work costQL can see. No tier is better than another: the right one is a fact about your API and what it does.
Works with any API
Sees parallel work
Sees shared work
Three demo APIs, priced live in your browser
no signup, no serverThese are three real demo APIs, each already calibrated into a pack and loaded on this page. Build a query from the schema on the left, or type your own. The price moves with what you ask for. To point costQL at your own API, the Quickstart gets you a pricing oracle in about a minute.