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ΒΆ
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ΒΆ
-
Get up and running with Docker in minutes
-
Learn about environment variables and settings
-
Comprehensive guide for using Routstr
-
Help improve Routstr Core
Use CasesΒΆ
- AI Application Developers - Add Bitcoin payments to your AI apps without managing infrastructure
- API Resellers - Resell API access with custom pricing and profit margins
- Privacy-Focused Users - Access AI models without revealing personal information
- Micropayment Experiments - Test new business models with instant, small payments
Getting HelpΒΆ
- π Browse the User Guide for detailed usage instructions
- π Report issues on GitHub
- π¬ Join the community discussions
- π§ Check the API Reference for technical details
LicenseΒΆ
Routstr Core is open source software licensed under the GPLv3. See the LICENSE file for details.