Skip to main content
The HTTP patch acts as a catch-all for AI API calls that don’t go through a patched SDK. It intercepts requests to these known hosts:
  • api.openai.com
  • api.anthropic.com
  • generativelanguage.googleapis.com
  • api.groq.com
  • api.mistral.ai
  • api.cohere.com
  • api.together.xyz
  • api.fireworks.ai
  • api.perplexity.ai
Response bodies are parsed using provider-specific parsers (OpenAI-format, Anthropic-format, or Gemini-format). Events are emitted as llm_request with source: "http_intercept".

Implementation

Patches globalThis.fetch. Any fetch call to a known AI API host is intercepted and an event is emitted.
The HTTP patch is included when you call init(). If you want to apply it independently, use patchHTTP() in TypeScript.