understudydocs

gateway api

Request headers

Four optional x-understudy-* headers control scope, credentials, and attribution. All of them have sensible absences — a request with none of them still authenticates, resolves to your default project's main workload, and forwards.

Authentication headers

headercarries
x-api-keyYour Understudy sk_* key, Anthropic-style (on /v1/messages)
Authorization: BearerYour Understudy sk_* key, OpenAI-style (works on both endpoints)

Scoping & credential headers

headervalueabsent →
x-understudy-projecta project slug, e.g. conciergedefault project (rehearsal)
x-understudy-workloada workload name, e.g. ad-copythe project's default workload (main)
x-understudy-upstream-keyyour Anthropic or OpenAI provider keymanaged mode — Understudy's credential pays upstream
x-understudy-tagsa flat JSON object of stringsno tags on the capture

Tag constraints

Tags attach your own dimensions to captures — guide here. The value must be a flat JSON object of string values, with:

constraintlimit
keysany JSON property name, including uppercase, underscores, and dots
valuesstrings
header sizeat most 16 KiB (16,384 UTF-8 bytes) for the complete JSON header value
example
-H 'x-understudy-tags: {"env":"prod","tenant":"acme","release":"2026.24"}'

Tags are optional. If the header is malformed or violates these constraints, the entire tag set is ignored and the request proceeds without tags. There are no separate entry-count or per-value limits. Tags stay within Understudy and are never forwarded to providers.