Custom Request Metadata — x-br-metadata header

2026-03-23

apiobservability

What We Built

Custom request metadata via x-br-metadata header. JSON object with string KV pairs, stored alongside usage events. Limits: max 10 keys, 256 chars/key, 1024 chars/value.

SDKs set the header automatically via the metadata constructor option.

Lockstep Checklist

  • [x] API: Header parsing + validation in completions route
  • [x] SDK-TS: metadata option on BrainstormRouterOptions
  • [x] SDK-PY: metadata option on both sync/async clients
  • [x] Tests: 11 tests for parsing, validation, limits
  • [x] Docs: Ship log