Import
wrapLLMClient()
Wraps an OpenAI or Anthropic SDK client for automatic anonymization/rehydration.Signature
Parameters
An OpenAI or Anthropic SDK client instance
Configuration (see RehydraFetchConfig)
Returns
The same client typeT, with fetch intercepted for anonymization.
Example
createRehydraFetch()
Creates a drop-infetch replacement that anonymizes requests and rehydrates responses.
Signature
Parameters
Configuration (see RehydraFetchConfig)
Returns
Afetch-compatible function.
Example
createRehydraProxy()
Creates an HTTP proxy middleware using the Web Request/Response API.Signature
Parameters
Configuration (see RehydraProxyConfig)
Returns
A function(request: Request) => Promise<Response> compatible with Bun.serve, Hono, and other frameworks using Web APIs.
Example
createRehydraProxyServer()
Creates and starts a standalone HTTP proxy server.Signature
Parameters
Extends RehydraProxyConfig with:
Returns
Example
Configuration Types
RehydraFetchConfig
RehydraProxyConfig
ExtendsRehydraFetchConfig with:
Providers
detectProvider()
Auto-detect the LLM provider from request URL and headers.LLMContentProvider Interface
Built-in Providers
SSEParser
Parser for Server-Sent Events streams.Related
- LLM Proxy Guide - Usage guide and examples
- Streaming Guide - Stream-level anonymization