# Routstr Core Documentation Welcome to the official documentation for **Routstr Core** - a FastAPI-based reverse proxy that enables Bitcoin micropayments for OpenAI-compatible APIs using the Cashu eCash protocol. ## What is Routstr Core? Routstr Core is a payment proxy that sits between API clients and OpenAI-compatible services. It enables: - **Pay-per-request billing** using Bitcoin eCash tokens - **Seamless integration** with existing OpenAI clients - **Privacy-preserving payments** through the Cashu protocol - **Flexible pricing models** with per-token or per-request billing - **Multi-provider support** for various AI model providers ### Key Features - 🪙 **Cashu Wallet Integration** - Accept Lightning payments and redeem eCash tokens - 🔑 **API Key Management** - Secure key storage with balance tracking - 💰 **Dynamic Pricing** - Model-based pricing with live BTC/USD conversion - 🎛️ **Admin Dashboard** - Web interface for balance and key management - 🌐 **Nostr Discovery** - Find providers through decentralized relay network - 🐋 **Docker Support** - Easy deployment with optional Tor hidden service - ⚡ **Lightning Fast** - Minimal latency overhead for API requests ## How It Works ```mermaid sequenceDiagram participant Client participant Routstr as Routstr Proxy participant DB as Database participant Upstream as AI Provider participant Wallet as Cashu Wallet Client->>Routstr: API Request + eCash Token Routstr->>Wallet: Validate & Redeem Token Wallet-->>Routstr: Token Value (sats) Routstr->>DB: Store/Update Balance Routstr->>Upstream: Forward API Request Upstream-->>Routstr: API Response + Usage Data Routstr->>DB: Deduct Actual Cost Routstr-->>Client: API Response ``` ## Quick Links