anthropic.internal._headers

(internal) Defaults, then the caller's headers, then auth. User headers come FIRST so `anthropic-beta` (and `anthropic-dangerous-direct-browser-access`, which the WASM playground needs) are reachable and `anthropic-version` is overridable; `x-api-key` is applied last so a stray header cannot break authentication.

Reference version

Signature

function anthropic.internal._headers(
preview: bool = …
) -> map<string, string> throws baml.errors.Io | baml.errors.ParseError | ai.errors.InvalidRequest

(internal) Defaults, then the caller's headers, then auth. User headers come FIRST so anthropic-beta (and anthropic-dangerous-direct-browser-access, which the WASM playground needs) are reachable and anthropic-version is overridable; x-api-key is applied last so a stray header cannot break authentication.

Source:<builtin>/anthropic/ns_internal/messages.bamlbytes 3025130734