Expand description
Forwarding to the upstream Anthropic-compatible provider.
Observe mode is a transparent proxy: the request body and BYOK auth headers go upstream byte-for-byte, and the response comes back byte-for-byte. Firstpass never inspects, injects, or logs the API key.
Constants§
- OPENAI_
CHAT_ PATH - The OpenAI-compatible inbound paths this proxy relays for.
- OPENAI_
RESPONSES_ PATH - The Responses API path. A Responses-shaped body relayed to
OPENAI_CHAT_PATHis rejected by the upstream, so the passthrough has to preserve which endpoint the client actually called.
Functions§
- forward_
anthropic - Forward one
POST /v1/messagesrequest and return its response buffered (full body). Used for non-streaming requests, where the assembled body also feeds the audit trace. - forward_
anthropic_ streaming - Forward one
POST /v1/messagesrequest and return the raw response for streaming relay (stream: true) — the caller pipesresponse.bytes_stream()to the client without buffering, preserving SSE chunk-by-chunk and keeping time-to-first-byte low. - forward_
openai_ path - Forward one OpenAI-compatible request to an explicit upstream path and return its response buffered. Observe-mode passthrough — a byte-identical relay.
- forward_
openai_ streaming_ path - Forward one OpenAI-compatible request to an explicit upstream path and return the raw response for streaming relay.