Credits
Every endpoint that spends credits accepts two optional fields:
estimate_cost: true— return a credit estimate without creating or charging anything. The response is200withestimate_cost: true, thetypeof run that would start, and acredit_detailthat includescredits_remainingandsufficient_credits.max_credits— a ceiling. When the estimate'smaximumexceeds it, the request is refused with422 credit_cap_exceededand nothing is charged.
Every run also carries credit_detail ({ estimate: { minimum, maximum, charged_upfront, upfront?, expected?, typical? }, credits_used }) on kickoff and on GET /runs/{id}. maximum is the contract: a run never charges more than it.
Extractions and dataset builds (list generations) charge up front. A list generation charges a deposit at kickoff, charges the rest as it runs up to its maximum, and refunds the part of the deposit it did not use. Configured list builds are charged a flat credit price per run.
These endpoints spend credits: /enrich, /datasets, /datasets/{id}/rows/build, /configured_datasets/{id}/build, /extractions, /extractions/{id}/runs, /monitors, /quick_search, /search_agent, /scrape.