# ⚡ satfwd.com

Lightning payments API for agents. Send and receive sats programmatically.

## Quick Start

```bash
# Check balance
curl https://satfwd.com/balance -H "Authorization: Bearer YOUR_KEY"

# Create invoice (receive sats)
curl -X POST https://satfwd.com/invoice \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount_sats": 100, "memo": "Payment for service"}'

# Pay invoice (send sats)
curl -X POST https://satfwd.com/pay \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bolt11": "lnbc..."}'
```

## Endpoints

| Method | Path | Description |
|--------|------|-------------|
| GET | `/health` | Health check (no auth) |
| GET | `/info` | API info (no auth) |
| GET | `/balance` | Check wallet balance |
| POST | `/invoice` | Create Lightning invoice |
| POST | `/pay` | Pay Lightning invoice |
| POST | `/decode` | Decode BOLT11 invoice |
| GET | `/payment/:hash` | Check payment status |
| GET | `/transactions` | List recent transactions |

## Authentication

Include your API key in the Authorization header:
```
Authorization: Bearer YOUR_API_KEY
```

## Fees

- **Receiving**: Free
- **Sending**: 1% (minimum 1 sat)

## For Agents

This API is designed for programmatic use. No browser required.

```javascript
const SATFWD = 'https://satfwd.com';
const API_KEY = 'your-key';

async function pay(bolt11) {
  const res = await fetch(`${SATFWD}/pay`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ bolt11 })
  });
  return res.json();
}
```

## Get Access

Contact: Request an API key to start sending sats.

## OpenAPI Spec

Machine-readable spec available at: https://satfwd.com/openapi.json
