API Subscription Plans

Offer monthly or yearly subscription plans alongside pay-per-use. Your customers choose their billing model — you earn recurring revenue.

Consumer chooses plan USDC Opsalis subscription manager subscription token verified API Calls unlimited within plan limits Owner 95% revenue in USDC

Consumer pays USDC for a subscription plan → receives token → makes unlimited calls within limits → owner earns 95% revenue

Why Subscriptions on Opsalis?

Pay-per-use is great for occasional consumers, but high-volume users want predictable costs. Opsalis lets API owners offer both models simultaneously: pay-per-call for light users, monthly or yearly subscriptions for power users.

Subscription plans are managed entirely on-chain. When a consumer subscribes, USDC is transferred upfront and the subscription period starts immediately. The consumer receives a cryptographic token that authorizes unlimited API calls within their plan limits for the subscription duration.

For API owners, subscriptions mean recurring, predictable revenue. No invoice generation, no payment reminders, no churn management headaches. When the subscription expires, the consumer either renews or falls back to pay-per-use pricing.

Try It Live

1

Subscribe

Choose a plan and pay with USDC

2

Check Status

Verify active subscription

3

Make Calls

Use your subscription allowance

4

Review Usage

See remaining time and calls

Subscription Manager

Monthly
$9.99
10,000 calls/mo
Yearly
$99.99
150,000 calls/yr
Click "Subscribe & Run Full Flow" to see the complete subscription lifecycle

Code Samples

# Step 1: Subscribe to an API
$ curl -X POST https://opsalis.com/api/demo/api/subscribe \
  -H "Content-Type: application/json" \
  -H "X-Consumer-Key: demo-public-key-2026" \
  -d '{
    "api_id": "bb-sse-ticker",
    "plan": "monthly",
    "payment_token": "usdc_demo_token"
  }'

# Step 2: Check subscription status
$ curl https://opsalis.com/api/demo/api/subscription/status \
  -H "X-Consumer-Key: demo-public-key-2026" \
  -H "X-Subscription-Token: sub_abc123"

# Step 3: Make API calls (subscription auth)
$ curl https://opsalis.com/api/demo/api/bb-sse-ticker \
  -H "X-Consumer-Key: demo-public-key-2026" \
  -H "X-Subscription-Token: sub_abc123"
// Step 1: Subscribe to an API
const subResponse = await fetch('https://opsalis.com/api/demo/api/subscribe', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Consumer-Key': 'demo-public-key-2026'
  },
  body: JSON.stringify({
    api_id: 'bb-sse-ticker',
    plan: 'monthly',
    payment_token: 'usdc_demo_token'
  })
});
const { subscription_token } = await subResponse.json();

// Step 2: Check status
const statusResponse = await fetch('https://opsalis.com/api/demo/api/subscription/status', {
  headers: {
    'X-Consumer-Key': 'demo-public-key-2026',
    'X-Subscription-Token': subscription_token
  }
});
const status = await statusResponse.json();
console.log('Calls remaining:', status.calls_remaining);

// Step 3: Make API calls with subscription
const apiResponse = await fetch('https://opsalis.com/api/demo/api/bb-sse-ticker', {
  headers: {
    'X-Consumer-Key': 'demo-public-key-2026',
    'X-Subscription-Token': subscription_token
  }
});
const data = await apiResponse.json();
# Step 1: Subscribe to an API
import requests

sub = requests.post(
    'https://opsalis.com/api/demo/api/subscribe',
    headers={
        'Content-Type': 'application/json',
        'X-Consumer-Key': 'demo-public-key-2026'
    },
    json={
        'api_id': 'bb-sse-ticker',
        'plan': 'monthly',
        'payment_token': 'usdc_demo_token'
    }
).json()

token = sub['subscription_token']

# Step 2: Check status
status = requests.get(
    'https://opsalis.com/api/demo/api/subscription/status',
    headers={
        'X-Consumer-Key': 'demo-public-key-2026',
        'X-Subscription-Token': token
    }
).json()

print(f"Calls remaining: {status['calls_remaining']}")

# Step 3: Make API calls with subscription
data = requests.get(
    'https://opsalis.com/api/demo/api/bb-sse-ticker',
    headers={
        'X-Consumer-Key': 'demo-public-key-2026',
        'X-Subscription-Token': token
    }
).json()

print(data)

Self-Host in Minutes

1

Install Opsalis

Pull and run the free Docker container on your own hardware. No cloud dependency.

$ docker pull opsalis/node:latest
$ docker run -d --name opsalis -p 3000:3000 opsalis/node:latest
2

Register Your API

Add your API endpoint in the control center and enable subscription billing.

# In the Opsalis control center:
API Name:       my-data-api
Endpoint URL:   http://localhost:8080/api
Billing Mode:   Subscription + Pay-per-use
3

Configure Subscription Plans

Define plan tiers with pricing, call limits, and duration. Consumers see available plans when they discover your API.

# Subscription plans:
Monthly:  $9.99 USDC  / 10,000 calls / 30 days
Yearly:   $99.99 USDC / 150,000 calls / 365 days
Pay-per:  $0.001 USDC / call (fallback)
4

Earn Recurring Revenue

Consumers subscribe and pay upfront in USDC. You receive 95% immediately on Base L2. Renewals are automatic.