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
entriesat most 16
keyslowercase alphanumerics and hyphens, 1–64 chars (^[a-z0-9][a-z0-9-]*$)
valuesstrings, at most 256 bytes each
example
-H 'x-understudy-tags: {"env":"prod","tenant":"acme","release":"2026.24"}'

A malformed tags header fails the request with 400 invalid_request_errornaming the offending key — tags are attribution you'll filter datasets by later, so silent truncation would be worse than an error.