Expand description
SHIFT native proxy — Rust HTTP server that intercepts AI API requests,
optimizes image payloads via shift-preflight, and forwards to upstream
providers. Replaces the Node.js/Hono proxy with a single-binary server.
§Architecture
Client (OpenCode, Claude Code, Codex, etc.)
│
├── POST /v1/messages → Anthropic (optimize + forward)
├── POST /v1/chat/completions → OpenAI (optimize + forward)
├── POST /v1beta/models/* → Google (passthrough)
├── GET /health → Status
├── GET /stats → Session stats
└── POST /* → Auto-detect provider (passthrough)Re-exports§
pub use state::ProxyConfig;pub use state::ProxyState;
Modules§
- forward
- Forward requests to upstream provider APIs and stream responses back.
- optimize
- Shared image optimization logic for provider route handlers.
- routes
- Route handlers for the SHIFT proxy.
- state
- Shared proxy state and configuration.
Functions§
- create_
app - Build the axum router with all proxy routes.
- start_
server - Start the proxy server, blocking until shutdown signal.