Subscription Plans
Define how consumers pay to use your AI product. Create plans from the dashboard under AI Products → your API → Plans.
Billing models
| Model | How it works | Use case |
|---|---|---|
free | No charge, fixed token allowance | Free tier / trial |
flat | Fixed monthly price, fixed token allowance | Simple SaaS |
metered | Pay per token consumed, no upfront cost | API-style pricing |
tiered | Tiered pricing with overage rate after allowance | Usage-based with predictability |
Creating plans
From the dashboard (AI Products → Plans → Add Plan) or via API:
curl -X POST https://api.aerocall.ai/api/v1/gateway/plans \
-H "Authorization: Bearer <your-developer-jwt>" \
-H "Content-Type: application/json" \
-d '{
"api_id": "your-api-id",
"name": "Pro",
"slug": "pro",
"billing_model": "flat",
"price_cents": 2900,
"token_allowance": 1000000,
"trial_days": 14
}'Plan fields
| Field | Type | Description |
|---|---|---|
name | string | Display name (e.g. “Pro”) |
slug | string | URL-safe identifier (e.g. “pro”) |
billing_model | string | free | flat | metered | tiered |
price_cents | integer | Monthly price in cents (e.g. 2900 = $29) |
token_allowance | integer | null | Monthly token limit; null = unlimited |
hard_limit | integer | null | Request blocked after this many tokens |
overage_price_per_1k_tokens | integer | Overage rate for tiered plans (cents per 1k) |
trial_days | integer | Free trial days before billing starts |
Token wallets
Every consumer gets a token wallet. When a plan is assigned:
- Wallet is credited with the plan’s
token_allowance - Each request debits tokens from the wallet
- If
hard_limitis set, requests are blocked at zero balance - Wallets reset at the start of each billing period
Top-up a consumer’s wallet manually (admin operation):
curl -X POST https://api.aerocall.ai/api/v1/gateway/apis/:apiId/consumers/:consumerId/top-up \
-H "Authorization: Bearer <your-developer-jwt>" \
-d '{"tokens": 100000}'Suggested starter plans
A sensible three-tier setup for most AI products:
| Plan | Price | Tokens | Notes |
|---|---|---|---|
| Free | $0 | 10,000/mo | Hard limit; good for tryouts |
| Starter | $19/mo | 500,000/mo | Flat; covers most hobby users |
| Pro | $79/mo | 3,000,000/mo | Flat + overage at $0.002/1k |
Stripe integration is available for flat and metered plans. Set stripe_price_id on the plan to link it to a Stripe Price — Aerostack will report metered usage automatically via Stripe Meter Events.
Consumer self-service
Consumers can query their own wallet and usage via the SDK or directly:
// React
const { data: wallet } = useGatewayWallet('my-chatbot', { consumerKey: '...' })
// wallet.balance, wallet.plan_type, wallet.hard_limit
// Universal SDK
const wallet = await ai.gateway.wallet('my-chatbot')
const usage = await ai.gateway.usage('my-chatbot', 30)These endpoints require only a consumer key or user JWT — no developer credentials needed.