Usage Examples

Basic API Proxy

Protect a simple GET endpoint:

{
  "protectedEndpoints": {
    "GET /cat": {
      "forwardTo": "https://api.thecatapi.com/v1/images/search"
    }
  }
}

Usage:

curl http://localhost:8080/cat
# Returns payment request, then proxies to the API after payment

Multiple Endpoints

Protect multiple endpoints with different prices:

{
  "defaultPrice": "$0.05",
  "protectedEndpoints": {
    "GET /cat": {
      "forwardTo": "https://api.thecatapi.com/v1/images/search"
    },
    "GET /premium-data": {
      "price": "$0.50",
      "forwardTo": "https://api.example.com/premium"
    },
    "POST /generate": {
      "price": "$0.25",
      "forwardTo": "https://api.example.com/generate"
    }
  }
}

AI API Monetization

Monetize AI generation endpoints:

Data API Access

Sell access to valuable datasets:

Endpoint Without Proxy

Return a simple "paid" status without proxying:

Testing

Test your endpoints:

Last updated