| title | Quickstart |
|---|---|
| description | Get started with Routstr in minutes |
This quickstart guide will help you integrate Routstr into your application quickly.
I want to use AI models through Routstr I want to offer my AI models on Routstr 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.
```
ROUTSTR_TOKEN=cashuA1DkpMbgQ9VkL6U...
```
This token contains pre-paid credits for API usage.
```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"
}
]
}'
```
```bash
docker run -p 8080:8080 ghcr.io/routstr/proxy
```
```bash
# Edit the proxy configuration file
nano config.json
# Add your payment configuration
{
"payments": {
"lightning": {
"address": "your@lightning.address"
},
"cashu": {
"enabled": true
}
}
}
```
```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
```