Skip to main content

handler

Function handler 

Source
pub async fn handler(
    __arg0: State<ProxyState>,
    req: Request<Body>,
) -> Result<Response, StatusCode>
Expand description

Proxy handler for OpenAI’s Responses API (POST /v1/responses).

The Responses API superseded Chat Completions for clients such as opencode and the OpenAI Agents SDK. Its conversation turns live in input rather than messages, so the Chat Completions handler never saw — and never compressed — them. This handler reuses the same upstream, auth and streaming path but understands the Responses-API request shape.

Retrieve / cancel / delete / input_items sub-paths (/v1/responses/{id}/...) are routed here as well and pass through untouched: they carry no input array, so compress_request_body is a no-op for them.