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
X-Credits-Remainingoff the response 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."
}
},
"meta": {
"schemaVersion": "2026-09-16",
"representation": "standard",
"deliveryMode": "all",
"credits": {
"limit": 500,
"used": 0,
"remaining": 500,
"charged": 0,
"periodStart": "2026-08-01",
"periodEnd": "2026-08-31",
"isTeamPool": true
},
"appliedFilters": {
"states": [
1
],
"assetClasses": [
"Apartment Building"
],
"dateRange": "all"
},
"appliedDefaults": [
"taxonomyMatchMode=primary_only",
"includeGovernmentDecisions=false",
"leadTypes=private",
"sort=meetingDate",
"order=desc"
],
"resolvedFrom": {
"states": [
{
"input": "UT",
"id": 1
}
]
},
"warnings": []
},
"links": {
"self": "https://api.boardwalkai.com/api/v1/projects/count?states=UT&assetClasses=Apartment%20Building&dateRange=all",
"search": "https://api.boardwalkai.com/api/v1/projects/search?states=UT&assetClasses=Apartment%20Building&dateRange=all",
"docs": "https://boardwalkai.com/docs/api/budgets/"
}
}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. |
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. |
| 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 | /alerts/{alertId}/run | Free | Free. A manual run delivers matching records at no credit cost. Finding contact info on those records is a separate enrichment. |
| 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 | /documents/{id} | Free | 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. |
| 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. |
| POST | /exports | Free | Free to queue a product CSV. 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 | /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. Rows are free to queue. 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}/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 | /lists/{listId}/results | Free | 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 | /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. |
| 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. |
| POST | /projects/ai-search/jobs | Free | 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/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 | /projects/search | Free | 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 | Free | 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} | Free | 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. |
| 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.