Satilligence provides an OpenAI-compatible API that accepts Lightning payments via NWC (Nostr Wallet Connect). No API keys, no accounts - just connect your Lightning wallet.
You need a wallet that supports NWC. Options include:
curl -X POST "https://api.satilligence.com/v1/nwc/chat/completions" \
-H "Content-Type: application/json" \
-H "X-NWC: nostr+walletconnect://WALLET_PUBKEY?relay=wss://relay.example.com&secret=YOUR_SECRET" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{"role": "user", "content": "What is Bitcoin?"}
],
"max_tokens": 100
}'
/v1/nwc/chat/completions
| Header | Required | Description |
|---|---|---|
X-NWC |
Yes | Your NWC connection string |
Content-Type |
Yes | application/json |
{
"model": "gpt-4o-mini", // Required: gpt-4o, gpt-4o-mini, gpt-4-turbo
"messages": [ // Required: Array of messages
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"max_tokens": 1000, // Optional: Maximum tokens in response
"temperature": 0.7 // Optional: Randomness (0-2)
}
| Header | Description |
|---|---|
X-Charged-Sats |
Amount charged upfront (2x estimate) |
X-Cost-Sats |
Actual cost of the request |
X-Refund-Sats |
Amount refunded |
X-Refund-Status |
success, failed, or none |
We estimate input + output tokens based on your message and max_tokens
Invoice created for 2x estimated cost as safety buffer
NWC automatically pays the invoice from your connected wallet
Request forwarded to OpenAI, response returned to you
Difference between charged and actual cost refunded via Lightning
| Model | Input (per 1M tokens) | Output (per 1M tokens) | Best For |
|---|---|---|---|
gpt-4o-mini |
$0.15 | $0.60 | Fast, cheap tasks |
gpt-4o |
$5.00 | $15.00 | General purpose |
gpt-4-turbo |
$10.00 | $30.00 | Complex reasoning |
import requests
response = requests.post(
"https://api.satilligence.com/v1/nwc/chat/completions",
headers={
"Content-Type": "application/json",
"X-NWC": "nostr+walletconnect://..."
},
json={
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Hello!"}]
}
)
print(response.json())
const response = await fetch("https://api.satilligence.com/v1/nwc/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-NWC": "nostr+walletconnect://..."
},
body: JSON.stringify({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello!" }]
})
});
const data = await response.json();
console.log(data);