Quickstart Guide

This quickstart guide will help you integrate Routstr into your application quickly.

Choose Your Path

For Users: Quick Integration

1

Buy Cashu tokens

Purchase AI credits directly with Lightning or on-chain Bitcoin:

# Visit the Routstr token purchase page
https://routstr.com/tokens

No account or sign-up required. Simply make a Lightning payment to receive your token.

2

Receive token instantly

After payment, you’ll receive a Cashu token to use as your API authorization key:

ROUTSTR_TOKEN=cashuA1DkpMbgQ9VkL6U...

This token contains pre-paid credits for API usage.

3

Make API calls directly

Use the token in your API calls with our OpenAI-compatible endpoint:

curl -X POST https://api.routstr.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cashuA1DkpMbgQ9VkL6U..." \
  -d '{
    "model": "gpt-4",
    "messages": [
      {
        "role": "user", 
        "content": "Hello"
      }
    ]
  }'

For Providers: Quick Setup

1

Set up your proxy

Deploy our self-hosted proxy in front of any OpenAI-compatible endpoint with a simple Docker command:

docker run -p 8080:8080 ghcr.io/routstr/proxy
2

Connect payments

Configure your Cashu mint or Lightning node to accept pre-paid tokens. No need for Stripe or KYC:

# Edit the proxy configuration file
nano config.json

# Add your payment configuration
{
  "payments": {
    "lightning": {
      "address": "your@lightning.address"
    },
    "cashu": {
      "enabled": true
    }
  }
}
3

Monitor and scale

Track usage, set custom pricing, and join the relay network to get discovered by users automatically:

# Announce your provider to the Nostr network
routstr-proxy announce --name "Your Provider" --models "gpt-4,llama-3"

# Monitor usage statistics
routstr-proxy stats

System Architecture

Next Steps