> ## Documentation Index
> Fetch the complete documentation index at: https://docs.themcp.company/llms.txt
> Use this file to discover all available pages before exploring further.

# HTTP-level interception

> Catch-all interception for AI API calls over HTTP

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

<Tabs>
  <Tab title="TypeScript">
    Patches `globalThis.fetch`. Any `fetch` call to a known AI API host is intercepted and an event is emitted.
  </Tab>

  <Tab title="Python">
    Patches `httpx.Client.send` and `httpx.AsyncClient.send`. Both sync and async HTTP calls to known AI API hosts are intercepted.
  </Tab>
</Tabs>

<Note>
  The HTTP patch is included when you call `init()`. If you want to apply it independently, use `patchHTTP()` in TypeScript.
</Note>
