Docs / Keeping an agent inside its budget
Recipes
Keeping an agent inside its budget
Count first. A record pull on County, State, and National counts toward the shared export cap. On API Only and the trial, do not page blindly.
The failure this prevents
A user asks an agent for "every apartment project in the thousand largest cities". A naive agent turns that into a thousand search calls. On County, State, and National those searches are free: the waste is time and rate-limit slots, not credits. On API Only and the trial, the route never overspends and never trims: a request delivers at most one page, billed whole or refused whole, so a single JSON search can never cost more than its limit (at most 100 credits), and the first page the balance cannot pay for gets a 402 rather than a surprise invoice. But a thousand 402s is still a bad afternoon for everyone.
The pattern
- 1The agent's first call for any new task is
GET /projects/count. It is free, it works at a zero balance, and it returns everything needed to decide:matchCount,billable.credits,affordability.affordable, andaffordability.maxAffordableRecords. - 2If
affordableis false, the whole remaining set does not fit the balance, not that the next call fails. The agent decides on purpose: narrow and count again, or page from the top and stop oncemaxAffordableRecordsrecords are in hand. Counting is free; a blind attempt is a rate-limit slot. - 3When the agent does spend, it reads what is left off the response (
X-Export-Records-Remainingon County, State, and National;X-Credits-Remainingon API Only and the trial) rather than maintaining its own counter, because a teammate or another agent may be spending the same pool. - 4On a
402, the agent readserror.details.quote.affordableRecordCount(thelimitto retry with) and followsquote.countUrl, a free URL that re-prices the exact filter set that just failed, instead of retrying blindly. A402with no quote iscredits_exhausted: the balance cannot buy even one record, and the only moves are stopping or topping up. - 5For questions about shape rather than records, the agent uses the analytics plane, which is free.
Price a broad query before spending anything
curl 'https://api.boardwalkai.com/api/v1/projects/count?states=UT&assetClasses=Apartment%20Building&dateRange=all' \
-H 'Authorization: Bearer bwk_live_YOUR_KEY'Response · HTTP 200
{
"data": {
"matchCount": 5000,
"matchCountIsExact": true,
"matchCountBasis": "enumerated",
"countedAs": "distinct_projects",
"collapseApplied": true,
"duplicatesCollapsed": 0,
"scanCeiling": 10000,
"billable": {
"records": 5000,
"credits": 0,
"creditRate": 0,
"isUpperBound": true,
"nonBillable": {
"alreadyDeliveredUnchanged": 0,
"ledgerApplied": true
}
},
"affordability": {
"affordable": true,
"blockReason": null,
"shortfallCredits": 0,
"maxAffordableRecords": 9223372036854776000,
"boundBy": "period_balance",
"unlimited": false
},
"ordering": {
"sort": "meetingDate",
"order": "desc",
"tiebreak": null,
"meaning": "Most recent meeting evidence first — the date of the meeting the record was extracted from, not when Boardwalk ingested it and not when the project was created."
},
"truncation": {
"policy": "refuse",
"wouldTruncate": false,
"deliverableRecords": null,
"explanation": "The whole match set fits inside the remaining balance: page through the metered route and every page will be delivered in full until the set is exhausted."
}
},The response shape on this page is the one the endpoint builds: the keys, their nesting, and their types are asserted against the shipping code by a test. The numbers inside it are the scenario being walked through, not a measurement of the corpus.
Rules of thumb for tool descriptions
- Tell the model that counting is free, and that on County, State, and National each new or changed record counts toward 100,000 export records a month. Find Contact Info is a separate credit. On API Only and the trial, searching costs 1 credit per new record.
- Give the model
representation: "compact"as its default. It is the same price and 21 fields against standard's 71, which matters for context, not for cost. - Never let a model choose a
limitabove what one task needs. The page ceiling is 100 records, andlimitis the per-request exposure cap: a page is billed whole or refused whole, so one search can never spend more thanlimitcredits. A loop over pages should be a deliberate decision, not a default. - Surface
meta.warningsto the model. They disclose applied defaults, trial truncation, and other conditions that can change how a result should be read.
Costs at a glance
Billable: 1 credit per project unlocked
| Method | Path | Cost | Notes |
|---|---|---|---|
| POST | /enrichments | 1 credit / project unlocked | County, State, and National: 1 credit per project the first time this account receives email, phone, or a personal LinkedIn profile for it. Standalone API Only: included on records this pool has already purchased. Unpurchased ids are skipped as notPurchased. A live free trial spends the separate 5-lookup grant (not the 50 record-export credits). Empty lookups cost nothing. The maximum is held when queued, excluding already-unlocked projects; completion charges qualifying deliveries and releases the rest. Company links and names alone do not qualify. |
Uses your record allowance
On County, State, and National, each new or changed record uses 1 export record from the shared 100,000 a month. On API Only and the trial it is 1 credit. Records you already have, unchanged, are free.
| Method | Path | Cost | Notes |
|---|---|---|---|
| POST | /alerts/{alertId}/run | 1 export record / new or changed project a run delivers | A run, manual or scheduled, bills the records it delivers. County, State, and National: 1 export record per project that is new to this account or changed since, against the shared 100,000 a month. Unchanged projects already delivered are free. Standalone API Only and the free trial: 1 credit per new or changed project. A run the balance cannot cover delivers nothing and charges nothing. Finding contact info on those records is a separate enrichment. |
| GET | /documents/{id} | 1 export record / document this account has not received before | County, State, and National: 1 export record the first time this account receives the document, against the shared 100,000 a month. A later read of the same document is free. Standalone API Only and the free trial: 1 credit the first time. |
| POST | /exports | 1 export record / new or changed project in the file | County, State, and National: 1 export record per project in the file that is new to this account or changed, against the shared 100,000 a month, settled when the file is ready. Unchanged projects already delivered are free. Standalone API Only and the free trial: 1 credit per new or changed project. Pass alertId, listId, or projectIds to export a saved set (optional extra filters stay inside those ids). Omit all three and the body is a new search. Find Contact Info on those rows is 1 credit per project the first time this account receives email, phone, or a personal LinkedIn profile for it. |
| GET | /lists/{listId}/permits | 1 export record / new or changed permit | County, State, and National: 1 export record per permit that is new to this account or changed since the last delivery, against the shared 100,000 a month. Permits and planned projects share that counter. An unchanged permit already delivered is free. Standalone API Only and the free trial: 1 credit per new or changed permit. |
| GET | /lists/{listId}/results | 1 export record / new or changed project | County, State, and National: 1 export record per project that is new or changed, against the shared 100,000 a month. Unchanged records already delivered are free. Standalone API Only and the free trial: 1 credit per new or changed record. Alert companions return the same match set as the alert (every match except dismissed, pending review included). Extra search filters apply only inside those existing ids. Filter and polygon lists return stored criteria plus a search link. |
| GET | /permit-alerts/{alertId}/matches | 1 export record / new or changed permit | Billed like permit search. County, State, and National: 1 export record per permit that is new to this account or changed since the last delivery, against the shared 100,000 a month. An unchanged permit already delivered is free, including one an alert run already billed. Standalone API Only and the free trial: 1 credit per new or changed permit. The permits already on this alert, with your saved, dismissed, or pending decision on each. |
| POST | /permit-alerts/{alertId}/run | 1 export record / new or changed permit a run delivers | A run, manual or scheduled, bills the permits it delivers like a planned-project API alert run. County, State, and National: 1 export record per permit that is new to this account or changed, against the shared 100,000 a month. Unchanged permits already delivered are free. Standalone API Only and the free trial: 1 credit per new or changed permit. A run the allowance cannot cover delivers nothing, charges nothing, and answers status insufficient_credits with a quote. Reading the permits a run delivered from the matches afterwards is free while they are unchanged. Every run started over the API or the MCP is billed, whatever created the alert. Scheduled runs of an alert made on the website, and their emails, are free until its filters are changed over the API. |
| GET | /permits/contractors | 1 export record / contractor new to this account | County, State, and National: 1 export record per contractor new to this account, against the shared 100,000 a month. A contractor already delivered is free, whatever the filters. Standalone API Only and the free trial: 1 credit per new contractor. The contractor count is free through the permit aggregate. |
| POST | /permits/exports | 1 export record / new or changed permit in the file | County, State, and National: 1 export record per permit in the file that is new to this account or changed, against the shared 100,000 a month, charged when the file is ready. Unchanged permits already delivered are free. Standalone API Only and the free trial: 1 credit per new or changed permit. Never more than maxCredits: a job that would bill more fails and charges nothing. Idempotency-Key required. Poll and download with the export routes. |
| GET | /permits/search | 1 export record / new or changed permit | County, State, and National: 1 export record per permit that is new to this account or changed since the last delivery, against the shared 100,000 a month. Permits and planned projects share that counter, across the API, MCP, CSV, and the app. An unchanged permit already delivered is free. Standalone API Only and the free trial: 1 credit per new or changed permit; unchanged owned permits are free. Contacts printed on the permit come with the record and use no Find Contact Info allowance. |
| GET | /permits/sync | 1 export record / new or changed permit | County, State, and National: 1 export record per new or changed permit, against the shared 100,000 a month. Unchanged permits bill 0, so walking the same filters again costs only what changed. Standalone API Only and the free trial: 1 credit per new or changed permit. |
| GET | /permits/{id} | 1 export record / new or changed permit | County, State, and National: 1 export record the first time this account receives the permit, or when it has changed since, against the shared 100,000 a month. A later read of the same unchanged permit is free. Standalone API Only and the free trial: 1 credit the first time. |
| GET | /permits/{permitId}/source-text | 1 export record / new or changed permit | Counts with the permit record, not as a record of its own: 1 export record (or 1 credit on API Only and the free trial) when this account has not yet received the permit's current version, through this route or the permit record. Free when it has, and free when the permit has no source text on file. |
| POST | /projects/ai-search/jobs | 1 export record / confirmed new or changed match | County, State, and National: confirmed new or changed matches count toward the shared 100,000 export records a month. Rejected candidates do not. Find Contact Info on those records is a separate job. Standalone API Only and the free trial: credits are reserved at 1 per requested record and settled against confirmed matches. API Only includes Find Contact Info after the record is purchased. |
| GET | /projects/search | 1 export record / new or changed project | County, State, and National: 1 export record per project that is new to this account or changed since the last delivery, against the shared 100,000 a month. API, MCP, CSV, and the app share that counter. An unchanged record already delivered is free. format=csv queues the full filter match and returns HTTP 202. Find Contact Info is a separate allowance. Standalone API Only and the free trial: 1 credit per new or changed record; unchanged owned records are free. API Only includes Find Contact Info on records already purchased. |
| GET | /projects/sync | 1 export record / new or changed project | County, State, and National: 1 export record per new or changed project, against the shared 100,000 a month. Unchanged records bill 0. Standalone API Only and the free trial: 1 credit per new or changed record. |
| GET | /projects/{id} | 1 export record / new or changed project | County, State, and National: 1 export record the first time this account receives the project, against the shared 100,000 a month. A later read of the same unchanged project is free. Email, phone, and LinkedIn stay withheld until Find Contact Info unlocks them, which spends the contact allowance, not export records. Standalone API Only and the free trial: 1 credit the first time. API Only includes Find Contact Info after the record is purchased. |
Free: 0 credits
| Method | Path | Cost | Notes |
|---|---|---|---|
| GET | /account/credits | Free | Free. Your plan, your Find Contact Info allowance, and exportCredits (limit, used, remaining, resetsAt) for the shared 100,000 export records a month. |
| GET | /account/preferences | Free | Free. The account's saved search preferences (types, geography, website). |
| PATCH | /account/preferences | Free | Free. Update the account's saved search preferences. |
| GET | /alerts | Free | Free. Configuring alerts never costs credits; only delivered records do. |
| POST | /alerts | Free | Free. |
| GET | /alerts/{alertId} | Free | Free. |
| PATCH | /alerts/{alertId} | Free | Free. |
| DELETE | /alerts/{alertId} | Free | Free. |
| GET | /alerts/{alertId}/deliveries | Free | Free. The delivery history and what each run charged. |
| GET | /alerts/{alertId}/deliveries/{deliveryId} | Free | Free. |
| POST | /alerts/{alertId}/dismissals/{projectId} | Free | Free. Dismissing a match stops it being re-offered and takes a kept project off the alert's list. |
| DELETE | /alerts/{alertId}/dismissals/{projectId} | Free | Free. |
| GET | /alerts/{alertId}/matches | Free | Free, every time. Omit deliveryId to read every match except dismissed (pending review included), the same set the website table shows. Passing a deliveryId re-reads a past API run. Neither path charges, and neither does include=contacts here: it reads what the alert's own lookups already found. |
| POST, GET | /alerts/{alertId}/preview | Free | Free. Preview returns how many records a rule would deliver and what that would cost, not the records themselves. |
| POST | /analytics/aggregate | Free | Free. POST only (GET returns 404/405). Returns counts and group keys, never a project id, name, address, contact, or document. |
| GET | /analytics/datasets | Free | Free. GET only. What the analytics plane can and cannot answer, self-described. |
| POST | /analytics/rankings | Free | Free. POST only (GET returns 405). Same small-group suppression floor as /aggregate. |
| GET | /enrichments/{id} | Free | Free to poll: meta.creditsUsed stays 0. contactBilling reports the cumulative reserved, charged, released, refunded, and qualifyingProjects counts; repeated polls do not charge again. |
| GET | /exports | Free | Free. Lists export jobs for your team (including jobs queued with POST /exports or format=csv on search). |
| GET | /exports/{id} | Free | Free. Poll job status until ready. |
| GET | /exports/{id}/download | Free | Free re-download of a ready product-core CSV. The rows were counted when the file was built. Find Contact Info on those rows, if you asked for it, was 1 credit per project unlocked. |
| GET | /health | Free | Free and unauthenticated. A liveness probe, not part of the record contract: its response shape carries no schema guarantee and can change without a schema-version bump, which is why it is deliberately absent from the OpenAPI document. Do not generate a client against it or parse its body. |
| GET | /lists | Free | Free. Every list your membership resolves: your own and the ones shared with you. |
| POST | /lists | Free | Free. Creates a named membership list (the "new list" option on save). |
| GET | /lists/{listId} | Free | Free. One list's configuration and share state, plus results.billable.credits, what a full /results pull would charge right now. This is the free preflight for /results. |
| POST | /lists/{listId}/permits | Free | Free. Saves up to 100 permits onto Saved or one of your named lists. Idempotent. |
| DELETE | /lists/{listId}/permits/{permitId} | Free | Free. Removing a permit that is not on the list is not an error. |
| POST | /lists/{listId}/projects | Free | Free. Adds project ids to a membership-backed list. Idempotent per id. |
| DELETE | /lists/{listId}/projects/{projectId} | Free | Free. Removes a project from a membership-backed list. |
| GET | /locations/cities/{id} | Free | Free. |
| GET | /locations/counties/{id} | Free | Free. |
| GET | /locations/states | Free | Free. Resolve the ids you filter with. |
| GET | /locations/states/{id} | Free | Free. |
| GET | /locations/states/{id}/counties | Free | Free. |
| GET | /locations/states/{stateId}/counties/{countyId}/cities | Free | Free. |
| GET | /permit-alerts | Free | Free. Configuring permit alerts never uses export records or credits; only the permits a run delivers do. |
| POST | /permit-alerts | Free | Free. |
| GET | /permit-alerts/{alertId} | Free | Free. |
| PATCH | /permit-alerts/{alertId} | Free | Free. |
| DELETE | /permit-alerts/{alertId} | Free | Free. |
| PUT | /permit-alerts/{alertId}/decisions/{permitId} | Free | Free. Your own saved, dismissed, or pending decision on one permit. |
| GET | /permit-alerts/{alertId}/deliveries | Free | Free. Each run that found new permits, newest first. |
| GET | /permit-alerts/{alertId}/deliveries/{deliveryId} | Free | Free. |
| POST | /permit-alerts/{alertId}/dismissals/{permitId} | Free | Free. |
| DELETE | /permit-alerts/{alertId}/dismissals/{permitId} | Free | Free. |
| GET, POST | /permit-alerts/{alertId}/preview | Free | Free. How many permits match now, and how many the next run would add. |
| POST | /permits/aggregate | Free | Free. Counts and declared job values grouped by place, work type, status, trade, or month. Never returns a permit, contractor, address, or party. |
| GET | /permits/count | Free | Free, and it does not use an export record. Returns the match count and what GET /permits/search would bill for it: new or changed permits against permits you already hold unchanged. |
| GET | /permits/coverage | Free | Free. The places with permits and whether your plan covers each one. |
| GET | /permits/reference | Free | Free. Every permit filter value and its label. |
| POST | /projects/ai-search | Free | Not part of the public API. You cannot call this with an API key. Any bwk_live_/csk_ key is refused with 400 invalid_request (error.param: "endpoint", details.asyncEndpoint) before anything is parsed; use POST /projects/ai-search/jobs instead. On the session-authenticated web product this path is free, like structured search. |
| GET | /projects/ai-search/jobs/{id} | Free | Polling is free. The records the job delivers were charged when the job settled, not when you read them. |
| DELETE | /projects/ai-search/jobs/{id} | Free | Cancelling is free and gives credits back, never takes them: a queued job refunds its full reservation immediately; a running job settles at the next batch boundary, charging only confirmed records and refunding the rest. |
| GET | /projects/count | Free | Free, always. A count does not deliver a project record, so it does not use export records or Find Contact Info credits. On API Only and the trial it also prices the set. |
| GET | /reference/decision-bodies | Free | Free. Canonical values accepted by the decisionBodies filter. |
| GET | /reference/owner-types | Free | Free. The owner-type vocabulary used by alert criteria and CSV output. Not accepted as a /projects/search filter. The ownerTypes filter was withdrawn on 2026-08-27. |
| GET | /reference/request-types | Free | Free. Canonical values accepted by the requestTypes filter. |
| GET | /reference/statuses | Free | Free. Canonical status filter tokens plus display aliases (e.g. scheduled). |
| GET | /taxonomy | Free | Free. The complete building type tree. |
| GET | /taxonomy/action-categories | Free | Free. |
| GET | /taxonomy/action-types | Free | Free. |
| GET | /taxonomy/asset-classes | Free | Free. |
| GET | /taxonomy/project-types | Free | Free. |
| GET | /taxonomy/subtypes | Free | Free. |
Next
Ready to make a call?
A free Boardwalk trial includes API access, 50 record-export credits (search, CSV, MCP), and 5 Find Contact Info lookups. Counting, taxonomy, location lookups, and the analytics plane cost nothing, so you can evaluate the data before you spend a credit.