AI ProductsSubscription Plans

Subscription Plans

Define how consumers pay to use your AI product. Create plans from the dashboard under AI Products → your API → Plans.

Billing models

ModelHow it worksUse case
freeNo charge, fixed token allowanceFree tier / trial
flatFixed monthly price, fixed token allowanceSimple SaaS
meteredPay per token consumed, no upfront costAPI-style pricing
tieredTiered pricing with overage rate after allowanceUsage-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

FieldTypeDescription
namestringDisplay name (e.g. “Pro”)
slugstringURL-safe identifier (e.g. “pro”)
billing_modelstringfree | flat | metered | tiered
price_centsintegerMonthly price in cents (e.g. 2900 = $29)
token_allowanceinteger | nullMonthly token limit; null = unlimited
hard_limitinteger | nullRequest blocked after this many tokens
overage_price_per_1k_tokensintegerOverage rate for tiered plans (cents per 1k)
trial_daysintegerFree trial days before billing starts

Token wallets

Every consumer gets a token wallet. When a plan is assigned:

  1. Wallet is credited with the plan’s token_allowance
  2. Each request debits tokens from the wallet
  3. If hard_limit is set, requests are blocked at zero balance
  4. 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:

PlanPriceTokensNotes
Free$010,000/moHard limit; good for tryouts
Starter$19/mo500,000/moFlat; covers most hobby users
Pro$79/mo3,000,000/moFlat + 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.