How to price your API: 5 models that work in 2026
You built an API. It works. Developers can call it, get JSON back, and ship features with it. Now comes the part nobody teaches in a coding tutorial: how do you charge for it?
Price too high and nobody signs up. Price too low and you're subsidizing someone else's infrastructure. Skip the free tier and developers never discover you. Make billing too complex and your support inbox fills up with "how do I read my invoice?" tickets.
This guide covers five API pricing models with concrete numbers, shows you who each one serves and where it breaks down, and walks through the billing + key management stack to wire it up with Stripe and Unkey. Botoi's own pricing (free tier through $199/mo Business) serves as the case study throughout.
Start with a working API call
Before you think about pricing, make sure your API delivers clear value in a single request. Here's a botoi endpoint that formats JSON:
curl -X POST https://api.botoi.com/v1/json/format \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"json": "{"name": "Ada Lovelace"}"}' Response:
{
"success": true,
"data": {
"formatted": "{\n \"name\": \"Ada Lovelace\"\n}"
}
}
Every endpoint returns the same success + data structure. This
consistency matters for pricing because customers pay for the whole API, not individual
endpoints. One key, one subscription, 150+ endpoints.
Five API pricing models
| Model | Works for | Breaks when | Example |
|---|---|---|---|
| Free tier + rate limits | Developer adoption, PLG funnels | Abuse from scrapers, no conversion path | Botoi free: 5 req/min, 100/day |
| Flat monthly subscription | Predictable costs, simple billing | Low-usage customers churn, heavy users underpay | $29/mo for unlimited calls |
| Per-request usage-based | Variable workloads, cost-conscious buyers | Unpredictable bills scare off enterprise buyers | $0.001 per API call |
| Tiered bundles | Broad audience (hobby to enterprise) | Gaps between tiers cause friction | Botoi: $9 / $49 / $199 |
| Freemium + premium features | APIs where some endpoints have higher value | Hard to draw the line between free and paid | Free text tools, paid screenshot/PDF |
1. Free tier with rate limits
A free tier removes friction from evaluation. Developers test your API, confirm it solves their problem, and upgrade when they hit the limits. Without a free tier, most developers bounce at the signup page; they won't enter a credit card to evaluate an API they've never tried.
Botoi's free tier allows 5 requests per minute and 100 per day. No API key required. IP-based rate limiting keeps abuse in check. The daily cap is low enough that scrapers move on, but high enough for a developer to test 20-30 endpoints in a single evaluation session.
Key design choice: anonymous access (no signup) converts faster than "free plan with registration." Every form field you add between the developer and their first API call reduces conversion.
Works for: developer tools, utility APIs, any product-led growth funnel where adoption drives revenue.
Breaks when: free users consume expensive compute (GPU inference, browser rendering) or you have no path from free to paid.
2. Flat monthly subscription
Charge one price per month for full API access. No metering, no request counting, no overage fees. Customers know their bill before the month starts.
This model works when usage is predictable and your infrastructure cost per request is low. A $29/mo flat plan that covers "unlimited" requests works if your p95 customer makes 50,000 calls/month and your cost per call is $0.0001.
Works for: APIs with low marginal cost per request, B2B tools where buyers want budget predictability, early-stage APIs that don't have metering infrastructure yet.
Breaks when: one customer makes 10 million requests/month while paying the same $29 as someone making 500. You also lose revenue from light users who'd pay $5 but won't pay $29.
3. Per-request usage-based billing
Charge per API call. $0.001 per request, $0.01 for expensive endpoints. Customers pay for what they use, nothing more.
Usage-based billing aligns cost with value. A customer making 1,000 calls pays $1. A customer making 1,000,000 calls pays $1,000. Your revenue scales with their usage, and neither side overpays.
Works for: APIs with variable workloads (batch processing, event-driven pipelines), cost-conscious startups that need low entry points.
Breaks when: enterprise procurement needs a fixed line item in their budget. Finance teams reject variable-cost services that can't be forecasted. Also: metering failures or billing disputes erode trust fast.
4. Tiered bundles
Offer 3-4 plans at fixed prices, each with a monthly request quota and rate limit. This is the model botoi uses.
| Tier | Price | Rate limit | Monthly quota | Target customer |
|---|---|---|---|---|
| Free | $0 | 5 req/min | 100/day | Evaluators and hobbyists |
| Starter | $9/mo | 30 req/min | 300,000 | Side projects, small SaaS |
| Pro | $49/mo | 300 req/min | 3,000,000 | Growing apps, internal tools |
| Business | $199/mo | 1,000 req/min | 30,000,000 | High-volume production workloads |
Tiers work because they serve different customer segments with one product. A solo developer evaluating the API starts free. A startup building a side project pays $9/mo. A growing SaaS that sends 2 million requests/month upgrades to Pro at $49. An enterprise with heavy API traffic pays $199.
The key to good tiers: each step up should feel like a 3-5x value increase for a 2-5x price increase. Botoi's Starter gives 300,000 requests for $9 ($0.00003/req). Pro gives 3,000,000 for $49 ($0.000016/req). The per-request price drops as you move up, rewarding growth.
Works for: APIs serving hobbyists through enterprises, products where usage correlates with company size.
Breaks when: customers fall between tiers. If someone needs 500,000 requests/month, they're forced to pay $49 for a 3,000,000 quota they'll never use. Solve this with overage pricing or a custom tier.
5. Freemium with premium features
Give away basic endpoints for free and charge for high-value ones. Text formatting, encoding, and hashing are free. Screenshots, PDF generation, and AI-powered endpoints require a paid plan.
This model works when some endpoints cost more to run (browser rendering for screenshots, GPU compute for ML) or deliver higher business value (PII detection, compliance checks).
Works for: APIs with a wide range of endpoint complexity, products where free endpoints drive adoption for paid ones.
Breaks when: the line between free and paid feels arbitrary. If a developer builds a workflow using three free endpoints and one paid one, they feel nickeled. Keep the upgrade trigger clear and value-aligned.
Decision flowchart: pick your model
Answer these six questions to narrow down which pricing model fits your API:
| Question | If yes... | If no... |
|---|---|---|
| Do you want developers to try before buying? | Add a free tier with rate limits | Flat subscription (but expect fewer signups) |
| Is usage predictable per customer? | Tiered bundles work well | Usage-based billing fits better |
| Do you serve both hobbyists and enterprises? | Tiered plans ($9 / $49 / $199) | Single plan with usage-based pricing |
| Are some endpoints more valuable than others? | Freemium with premium features gated | All-access tiers with request limits only |
| Can you meter every request accurately? | Usage-based or hybrid (tier + overage) | Flat subscription is simpler to start |
| Do customers want cost predictability? | Tiered bundles with included quotas | Pay-per-request with spending alerts |
Most APIs land on a hybrid: free tier + tiered bundles. This is the model used by Stripe (free tier + volume pricing), Twilio (usage-based + committed-use discounts), and botoi (free tier + 3 paid tiers).
Wire up Stripe + Unkey for billing and key management
Choosing a pricing model is the strategy. Wiring it up is the engineering. Here's the stack botoi uses: Stripe handles payments and subscriptions, Unkey handles API key creation and per-key rate limiting.
Step 1: Create a Stripe Checkout session
When a customer picks a plan on your pricing page, create a Stripe Checkout session that redirects them to Stripe's hosted payment form.
import Stripe from "stripe";
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
// Create a checkout session for the Starter plan
const session = await stripe.checkout.sessions.create({
mode: "subscription",
payment_method_types: ["card"],
line_items: [
{
price: "price_1TL5XDE8YS41k76x3Ig0F9Uv", // Starter $9/mo
quantity: 1,
},
],
success_url: "https://yourapi.com/dashboard?session_id={CHECKOUT_SESSION_ID}",
cancel_url: "https://yourapi.com/pricing",
metadata: {
tier: "starter",
},
});
// Redirect the user to session.url
The metadata.tier field is critical. Your webhook handler reads this to
know which rate limits to apply when creating the API key.
Step 2: Handle the Stripe webhook
After payment succeeds, Stripe sends a checkout.session.completed event
to your webhook endpoint. This is where you create the API key and store the customer
record.
// Stripe webhook handler (Hono example)
app.post("/webhooks/stripe", async (c) => {
const sig = c.req.header("stripe-signature");
const body = await c.req.text();
const event = stripe.webhooks.constructEvent(body, sig, WEBHOOK_SECRET);
switch (event.type) {
case "checkout.session.completed": {
const session = event.data.object;
const tier = session.metadata.tier;
// 1. Create API key via Unkey with tier-specific rate limits
// 2. Store customer record in your database
// 3. Send welcome email with the API key
break;
}
case "customer.subscription.updated": {
const sub = event.data.object;
// Update rate limits on the existing Unkey key
break;
}
case "customer.subscription.deleted": {
// Revoke or downgrade the Unkey key
break;
}
}
return c.json({ received: true });
}); Step 3: Create an API key with Unkey
Unkey creates API keys with embedded rate limit metadata. When your middleware verifies a key, Unkey returns the remaining rate limit in the response. No database lookup on your side.
// After Stripe webhook confirms payment, create an API key
const response = await fetch("https://api.unkey.com/v1/keys.createKey", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_UNKEY_ROOT_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
apiId: "api_your_api_id",
prefix: "botoi",
meta: {
userId: customer.id,
tier: "starter",
stripeSubscriptionId: subscription.id,
},
ratelimit: {
type: "fast",
limit: 30, // 30 requests
refillRate: 30, // refill 30 tokens
refillInterval: 60000, // every 60 seconds
},
}),
});
const { key } = await response.json();
// Send this key to the customer via email or dashboard
The ratelimit object tells Unkey to enforce 30 requests per 60 seconds for
this key. When the customer upgrades to Pro, you update the key's rate limit to 300
req/min through the Unkey API.
Step 4: Enforce rate limits in middleware
Your API middleware verifies the key, reads the rate limit status, and blocks requests that exceed the quota.
// Middleware that reads rate limits from Unkey key metadata
async function authMiddleware(c, next) {
const apiKey = c.req.header("Authorization")?.replace("Bearer ", "");
if (!apiKey) {
// Anonymous access: 5 req/min, 100 req/day
return applyAnonymousLimits(c, next);
}
// Verify key with Unkey (returns metadata + remaining rate limit)
const verification = await fetch("https://api.unkey.com/v1/keys.verifyKey", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ key: apiKey }),
});
const result = await verification.json();
if (!result.valid) {
return c.json({ success: false, error: { message: "Invalid API key" } }, 401);
}
if (result.ratelimit?.remaining === 0) {
return c.json({ success: false, error: { message: "Rate limit exceeded" } }, 429);
}
c.set("tier", result.meta.tier);
return next();
} This middleware handles both anonymous and authenticated requests. Anonymous callers hit the free tier limits (5 req/min, 100/day). Authenticated callers get limits from their Unkey key metadata.
Three mistakes that cost API builders revenue
Mistake 1: pricing based on infrastructure cost alone
Your server cost per request is $0.00005. So you charge $0.0001 and call it a 2x markup. This ignores documentation, support, uptime monitoring, SDK maintenance, and the value your API delivers. A developer who uses your email validation endpoint to prevent 500 fake signups per month gets far more than $0.0001 of value from each call. Price on value, not cost.
Mistake 2: no free tier
Requiring a credit card to make the first API call kills adoption. Developers evaluate 3-5 APIs before picking one. If your competitor has a free tier and you don't, they win the evaluation. Botoi's free tier (no signup, no key, 5 req/min) lets developers copy a curl command from the docs and get a response in under 10 seconds.
Mistake 3: complex metering that confuses customers
"Each endpoint has a different credit weight. GET endpoints cost 1 credit, POST endpoints cost 2-5 credits depending on response size, and batch endpoints cost 1 credit per item in the batch." Stop. Customers can't predict their bill, support gets flooded with billing questions, and engineers spend more time building the metering system than building the API.
Simpler alternatives: flat per-request pricing (every call costs the same), or tiered plans where every endpoint is included. Botoi uses the second approach. $9/mo gets you 300,000 requests across all 150+ endpoints. No credit math. No endpoint-specific pricing.
Case study: how botoi prices 150+ endpoints
Botoi started with a free tier and three paid plans. Here's why each tier exists:
- Free ($0): 5 req/min, 100/day. Exists to drive developer adoption. No signup, no API key. IP-based rate limiting via Cloudflare Workers KV. Converts at roughly 3-5% to paid plans.
- Starter ($9/mo): 30 req/min, 300,000/month. Targets solo developers and side projects. Low enough that a credit card swipe doesn't need manager approval.
- Pro ($49/mo): 300 req/min, 3,000,000/month. Targets startups and growing SaaS products. The 10x request increase for a 5.4x price increase makes the upgrade obvious.
- Business ($199/mo): 1,000 req/min, 30,000,000/month. Targets production workloads with high throughput needs. The per-request cost drops to $0.0000066.
Every tier includes all 150+ endpoints. No feature gating, no endpoint restrictions. The only variable is request volume. This keeps the model simple for customers and simple to enforce on the backend.
The billing stack: Stripe handles subscriptions and payment collection. Unkey handles API key creation, verification, and per-key rate limiting. A Stripe webhook listener ties them together: payment confirmed triggers key creation, plan change triggers rate limit update, cancellation triggers key revocation.
Pick a model and ship it
The "perfect" pricing model doesn't exist. Every model has tradeoffs. The worse outcome is spending months analyzing pricing while your API sits behind a "contact us for pricing" page that nobody contacts.
Start with a free tier and one paid plan. Measure conversion rates, usage patterns, and churn. Add tiers when you see clear segments in your customer base. Adjust prices based on data, not guesses.
The tools to build this exist today: Stripe for billing, Unkey for key management, and Cloudflare Workers or any edge runtime for rate limiting middleware. You can go from "free API" to "monetized API with four tiers" in a weekend.
Frequently asked questions
- Should every API offer a free tier?
- Yes, if your goal is developer adoption. A free tier with rate limits (e.g. 5 req/min, 100/day) lets developers test your API before committing money. APIs without free tiers lose 60-80% of potential evaluators at the signup page.
- What is usage-based API billing?
- Usage-based billing charges customers per API request instead of a flat monthly fee. You meter every call, aggregate totals at the end of the billing cycle, and invoice based on volume. Stripe Billing and Metronome both support metered billing natively.
- How do I prevent users from exceeding their plan limits?
- Issue API keys through a key management service like Unkey. Attach rate limit metadata (requests per minute, per day, per month) to each key. Your API middleware checks the key, reads the limits, and returns HTTP 429 when the caller exceeds them.
- What is the most common API pricing mistake?
- Pricing too low. Many API builders set prices based on infrastructure cost alone and forget to account for support, documentation, uptime monitoring, and the value the API delivers. A JSON formatting endpoint that saves a developer 4 hours of work is worth more than $0.001 per call.
- Can I combine multiple pricing models?
- Yes, and most successful APIs do. Botoi combines a free tier (rate-limited, no key required) with tiered subscriptions ($9/$49/$199). Each tier includes a monthly request quota. This hybrid approach captures hobbyists, startups, and enterprises with one product.
Try this API
JWT Decoder API — interactive playground and code examples
More guide posts
Start building with botoi
150+ API endpoints for lookup, text processing, image generation, and developer utilities. Free tier, no credit card.