TheBuildShieldAPI Documentation
Developer
API Reference
TheBuildShield API lets you analyze AI usage programmatically. Submit chat conversations or API CSV rows as JSON and get spend scores, cost breakdowns, and optimization playbooks in return.
Authentication
Pass your API key in the X-Api-Key header. API keys are available to Pro and Founder plan users.
X-Api-Key: bsk_your_key_hereGenerate keys in Settings → API Keys
Rate Limits
Free / StarterNo API access
Pro1,000 calls / month
FounderUnlimited
Limits reset on the 1st of each month.
Zero-Trust Architecture: submitted payloads are processed in-memory and immediately discarded. No conversation content or prompt text is stored at any point.
POST
/api/v1/analyze-apiAnalyze AI usage data. Supports two modes: chat and csv.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | Required | "chat" or "csv" |
platform | string | Optional | Hint for platform (e.g. "ChatGPT") |
conversations | array | chat mode | Array of conversation objects with messages |
conversations[].id | string | Optional | Optional conversation identifier |
conversations[].title | string | Optional | Optional conversation title |
conversations[].messages | array | Yes (chat) | Array of {role, content} message objects |
csv_rows | array | csv mode | Array of CSV row objects with model/token/cost fields |
Response
Returns the full analysis object:
spend_scoreScore 0–100, grade A–F, verdict stringaction_planHeadline + prioritized list of optimization actionsestimated_cost_usd(chat mode) Equivalent API cost in USDtotal_tokens(chat mode) Total tokens processedwasted_tokens(chat mode) Tokens in inefficient interactionssummary(csv mode) Cost totals, model breakdown, tier breakdownmodel_swap_recommendations(csv mode) Cheaper model alternatives with savings estimatesplaybooks(csv mode) Strategy-level optimization playbooksError Codes
401UnauthorizedMissing or invalid API key
403ForbiddenPlan does not have API access (requires Pro/Founder)
429Too Many RequestsMonthly API call limit reached (Pro plan)
400Bad RequestInvalid mode, missing required fields, or unparseable data
500Server ErrorInternal processing error
Code Examples
Ready to integrate?
Generate your API key in Settings. Pro gets 1,000 calls/month, Founder gets unlimited.