Skip to content

richtan/paypertoken

Repository files navigation

paypertoken

OpenAI-compatible LLM proxy with USDC micropayments. No accounts, no API keys.

paypertoken.dev · Docs · Dashboard

How it works

  1. Open a tempo payment session
  2. Send OpenAI-compatible requests — pay per token via USDC vouchers
  3. No accounts, no API keys, no invoices

Available models

Model Input/1M Output/1M
gpt-4o-mini $0.165 $0.660
google/gemini-2.5-flash $0.165 $0.660
meta-llama/llama-4-maverick $0.220 $0.660
anthropic/claude-haiku-4 $0.880 $4.400
o3-mini $1.210 $4.840
gpt-4o $2.750 $11.000
google/gemini-2.5-pro $1.375 $11.000
anthropic/claude-sonnet-4 $3.300 $16.500

Prices include a 10% service fee. Cheapest provider auto-selected.

Quick start

git clone https://github.com/richtan/paypertoken.git
cd paypertoken
cp .env.example .env   # fill in API keys
npm install
npm run dev            # http://localhost:3402

Architecture

  • Framework: Hono (TypeScript)
  • Payment: mppx with tempo sessions (USDC on Base)
  • Providers: OpenAI (direct), OpenRouter (Anthropic, Google, Meta)
  • Routing: Auto-selects cheapest available provider per model, 60s failover cooldown

Environment variables

Variable Required Description
PORT No Server port (default: 3402)
MPP_REALM Yes MPP realm identifier
MPP_SECRET_KEY Yes HMAC secret for mppx (must be stable across restarts)
SPENDING_KEY Yes Private key of the recipient wallet (0x...)
OPENAI_API_KEY Yes OpenAI API key
OPENROUTER_API_KEY Yes OpenRouter API key
BUDGET No Max total spend in USD (default: 5)
TEMPO_TESTNET No Set true for testnet

Deployment

Deployed on Railway with auto-deploy from GitHub on push to main.

docker compose up    # or use the Dockerfile directly

License

MIT

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors