Skip to content

Latest commit

 

History

History
106 lines (87 loc) · 3.01 KB

File metadata and controls

106 lines (87 loc) · 3.01 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

You can mint tokens in the settings of our web app at [chat.routstr.com](https://chat.routstr.com). Alternatively, generate a token using any Cashu wallet such as [cashu.me](https://cashu.me) or [minibits.cash](https://minibits.cash). Use your token in 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 <your Cashu token>" \
  -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 8000:8000 ghcr.io/routstr/proxy
```
Configure your Cashu mint or Lightning node using environment variables:
```bash
# .env file example
NSEC=your_nostr_secret_key
RECEIVE_LN_ADDRESS=your@lightning.address
```

Then run the proxy with:

```bash
docker run -p 8000:8000 --env-file .env ghcr.io/routstr/proxy
```
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 announce --name "Your Provider" --models "gpt-4,llama-3"

# Monitor usage statistics
routstr 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)