Skip to main content

forward_anthropic_streaming

Function forward_anthropic_streaming 

Source
pub async fn forward_anthropic_streaming(
    client: &Client,
    base: &str,
    headers: &HeaderMap,
    body: Bytes,
) -> Result<(StatusCode, HeaderMap, Response), ProxyError>
Expand description

Forward one POST /v1/messages request and return the raw response for streaming relay (stream: true) — the caller pipes response.bytes_stream() to the client without buffering, preserving SSE chunk-by-chunk and keeping time-to-first-byte low.

§Errors

Returns ProxyError::Upstream on a transport-level failure (see forward_anthropic).