Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

294 B
Raw Blame
export type ResponseHeadersListener = (headers: Headers) => void;

export const observeResponseHeaders =
  (onHeaders: ResponseHeadersListener): typeof fetch =>
  async (input, init) => {
    const response = await fetch(input, init);
    onHeaders(response.headers);
    return response;
  };