Skip to main content

Module anthropic

Module anthropic 

Source
Expand description

Anthropic route handler — POST /v1/messages

Intercepts Anthropic API requests, runs the SHIFT optimization pipeline on the payload (extracting and transforming images), records stats with full per-image token savings, and forwards to the real Anthropic API.

The CPU-intensive optimization runs on a blocking thread to avoid starving the tokio event loop.

Functions§

anthropic_handler
POST /v1/messages — optimize and forward to Anthropic.