Skip to content

Latest commit

 

History

History
126 lines (104 loc) · 3.38 KB

File metadata and controls

126 lines (104 loc) · 3.38 KB
title Quickstart
description Get started with Routstr in minutes

Quickstart Guide

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

Choose Your Path

I want to use AI models through Routstr I want to offer my AI models on Routstr

For Users: Quick Integration

Purchase AI credits directly with Lightning or on-chain Bitcoin:
```bash
# 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.
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.
Use the token in your API calls with our OpenAI-compatible endpoint:
```bash
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

Deploy our self-hosted proxy in front of any OpenAI-compatible endpoint with a simple Docker command:
```bash
docker run -p 8080:8080 ghcr.io/routstr/proxy
```
Configure your Cashu mint or Lightning node to accept pre-paid tokens. No need for Stripe or KYC:
```bash
# Edit the proxy configuration file
nano config.json

# Add your payment configuration
{
  "payments": {
    "lightning": {
      "address": "your@lightning.address"
    },
    "cashu": {
      "enabled": true
    }
  }
}
```
Track usage, set custom pricing, and join the relay network to get discovered by users automatically:
```bash
# 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

Routstr Architecture

Routstr Architecture

Next Steps

Detailed API endpoint documentation Learn about all provider configuration options Learn about Routstr's privacy and routing features View the Routstr Improvement Proposals (RIPs)