Headers Reference

All X-BR-* request and response headers.

Request Headers

These headers control BrainstormRouter behavior on a per-request basis.

HeaderTypeDescription
AuthorizationBearer Required. API key (br_live_... or br_test_...).
X-BR-Guardian: offstringSkip Guardian intelligence processing.
X-BR-Skip-Memory: truestringSkip memory read/write for this request. Useful for stateless agents.
X-User-IdstringIdentify the end-user or agent. Used for per-agent budget enforcement. Falls back to body.user.
X-Conversation-IdstringThread requests into a conversation. Also accepted as conversation_id in the request body.

Response Headers

Returned on POST /v1/chat/completions responses.

Guardian Headers

HeaderTypeExampleDescription
X-BR-Guardian-StatusstringonGuardian processing status. Live value: on; off when skipped via X-BR-Guardian: off.
X-BR-Estimated-Coststring0.000210Pre-request cost estimate in USD (6 decimals). Emitted only when the request names a priceable model — absent for model: "auto" (selection happens after this estimate; see X-BR-Estimated-Cost-Basis).
X-BR-Actual-Coststring0.00021020Post-request actual cost in USD (plain numeric, no $ prefix).
X-BR-Efficiencystring1.21Cost efficiency ratio (estimated / actual). Conditional — emitted only when Guardian post-processing runs.
X-BR-Guardian-Overhead-Msstring1.2Guardian processing latency in milliseconds (target: <5ms p95).

Routing Headers

HeaderTypeExampleDescription
X-BR-Routed-Modelstringanthropic/claude-sonnet-5Actual model ID that served the request (after alias/auto resolution).
X-BR-Resolved-Modelstringanthropic/claude-sonnet-5Model resolved from an alias or auto, before failover.
X-BR-Upstream-Modelstringclaude-sonnet-5The upstream provider model actually invoked.
X-BR-Route-Reasonstringcapability-matchedWhy this model was selected (when using model: "auto").
X-BR-Selection-Methodstringcapability-matchedSelection engine used (capability-matched, alias, explicit).
X-BR-Selection-Reasonstringcapability-matchedHuman-readable selection rationale.
X-BR-Selection-Confidencestring0.87Confidence (0–1) in the selection.
X-BR-Complexity-LevelstringhighClassified request complexity tier.
X-BR-Complexity-Scorestring7.4Raw complexity score (0–10).
X-BR-Models-Consideredstring12Number of eligible models scored.
X-BR-Quality-TierstringfrontierLearned quality tier of the routed model.
X-BR-Failover-Fromstringopenai/gpt-5.5Model that failed before failover (present only on failover).
X-BR-Failover-Pathstringopenai/gpt-5.5→anthropic/...Ordered failover chain that was walked.
X-BR-Routing-Overhead-Msstring2.1Routing/selection overhead in milliseconds.

> X-BR-Model-Selected and a bare X-BR-Provider header are not emitted. Read the > routed model from X-BR-Routed-Model; provider context comes from > X-BR-Provider-Latency-Ms / X-BR-Provider-Filter.

Cost & Budget Headers

HeaderTypeExampleDescription
X-BR-Estimated-Coststring0.000210Pre-flight cost estimate in USD (6 decimals). Absent for model: "auto"; X-BR-Estimated-Cost-Basis says why (pre-flight-token-estimate vs unpriced-auto-selection).
X-BR-Actual-Coststring0.00021020Actual cost after completion in USD.
X-BR-Savingsstring0.004Estimated USD saved vs. a naive frontier-only route.
X-BR-Routing-Savingsstring0.004Savings attributed to auto-routing.
X-BR-Budget-Remainingstring48.20Remaining tenant/agent budget in USD.
X-BR-Budget-WarningstringtruePresent when the request crossed a budget threshold.
X-BR-Tokens-Remainingstring84210Remaining token allowance for the window.
X-BR-Total-Latency-Msstring1423End-to-end latency in milliseconds.
X-BR-Provider-Latency-Msstring1180Upstream provider latency in milliseconds.

Cache Headers

HeaderTypeExampleDescription
X-BR-CachestringhitCache result: hit, miss, bypass.
X-BR-Cache-Similaritystring0.98Semantic similarity score for a cache hit.
X-BR-Cache-Agestring42Age of the cached entry in seconds.
X-BR-Cache-Saved-Tokensstring1200Tokens saved by serving from cache.
X-BR-Cache-SourcestringsemanticWhich cache layer served the entry.

Guardrail & Firewall Headers

HeaderTypeExampleDescription
X-BR-Guardrail-StatusstringpassGuardrail verdict: pass, warn, block.
X-BR-Guardrail-ActionstringredactAction taken (allow, redact, block).
X-BR-Guardrail-ReasonstringpiiWhy the guardrail fired.
X-BR-Guardrail-PII-WarningstringtruePII detected in inbound content.
X-BR-Tool-Firewall-StatusstringblockedTool firewall verdict for tool calls.
X-BR-Tool-Firewall-ReasonstringpolicyWhy a tool call was blocked/downgraded.
X-BR-Intent-Riskstring0.2Intent-risk score (0–1).

Data-Protection Headers

HeaderTypeExampleDescription
X-BR-Data-Policystringeu-onlyData-residency/processing policy applied.
X-BR-Data-Obligationstringno-trainPer-request processing obligation enforced.
X-BR-Data-Protection-Digeststringsha256:…Digest of the data-protection constraints applied.
X-BR-Cache-Privacystringno-storeCache privacy decision for this request.

Evidence & Governance Headers

HeaderTypeExampleDescription
X-BR-Evidence-Receiptstringev_…Evidence-ledger receipt id for this decision.
X-BR-Evidence-CoveragestringfullEvidence coverage level (full, partial).
X-BR-Audit-Hashstringsha256:…Hash chained into the tamper-evident audit ledger.
X-BR-Verdict-IDstringvd_…Governance verdict id.
X-BR-Policy-Matchstringdeny-euPolicy rule that matched.
X-BR-Policy-DeniedstringtruePresent when a policy denied the request.
X-BR-Explainstringrx_…Request id to fetch full rationale at GET /v1/explain/{request_id}.

Grant & Plan Headers

HeaderTypeExampleDescription
X-BR-Grant-Idstringgr_…Grant id authorizing the request.
X-BR-Plan-Idstringpl_…Plan id the request executed under.
X-BR-Plan-Ceilingstring10.00Spend ceiling of the active plan in USD.

Mesh / A2A Headers

HeaderTypeExampleDescription
X-BR-Mesh-Sourcestringagent-7Originating mesh agent.
X-BR-Mesh-Trace-Idstringmt_…Mesh trace id across hops.
X-BR-Mesh-Hop-Countstring2Number of mesh hops taken.
X-BR-Mesh-Payload-Hashstringsha256:…Integrity hash of the mesh payload.

Agent Identity Headers

HeaderTypeExampleDescription
X-BR-Agent-Idstringagent-7Agent identity that made the request.
X-BR-Agent-Ownerstringteam-coreOwner of the agent identity.
X-BR-Agent-Budget-Remainingstring12.40Per-agent budget remaining in USD.
X-BR-Agent-LifecyclestringactiveAgent lifecycle state.
X-BR-Reputation-TierstringtrustedGraduated-trust reputation tier.

Deprecation & MNI Headers

HeaderTypeDescription
X-BR-DeprecationstringDeprecation date for the routed model.
DeprecationstringRFC 8594 deprecation header.
SunsetstringRFC 8594 sunset date.
LinkstringRFC 8631 links to the OpenAPI spec and llms.txt.
X-BR-Request-IdstringCorrelates the request with logs, explain, and evidence.

BR emits roughly 190 X-BR-* headers across these families; the tables above list the load-bearing ones. Any header not present simply means that subsystem did not act on the request.

Using Headers with OpenAI SDKs

from openai import OpenAI

client = OpenAI(
    base_url="https://api.brainstormrouter.com/v1",
    api_key="br_live_...",
)

response = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Hello"}],
    extra_headers={
        "X-BR-Skip-Memory": "true",
        "X-User-Id": "agent-research-01",
    },
)

# Access response headers
print(response._response.headers.get("X-BR-Actual-Cost"))
print(response._response.headers.get("X-BR-Routed-Model"))
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.brainstormrouter.com/v1",
  apiKey: "br_live_...",
});

const response = await client.chat.completions.create(
  {
    model: "auto",
    messages: [{ role: "user", content: "Hello" }],
  },
  {
    headers: {
      "X-BR-Skip-Memory": "true",
      "X-User-Id": "agent-research-01",
    },
  },
);