Skip to main content
Free plans let you give every new customer access to a limited set of features at no cost. They’re the foundation of freemium models — customers start free and upgrade when they need more.
Example
A developer tool offers a free tier with 100 API requests per month and 1 workspace. When a user exceeds the limit, they’re prompted to upgrade.

Setting up

Create a plan with no price and set autoEnable: true:
autumn.config.ts
import { feature, item, plan } from 'atmn';

export const apiRequests = feature({
  id: 'api_requests',
  name: 'API Requests',
  type: 'metered',
  consumable: true,
});

export const workspaces = feature({
  id: 'workspaces',
  name: 'Workspaces',
  type: 'metered',
  consumable: false,
});

export const free = plan({
  id: 'free',
  name: 'Free',
  group: 'main',
  autoEnable: true,
  items: [
    item({
      featureId: apiRequests.id,
      included: 100,
      reset: { interval: 'month' },
    }),
    item({
      featureId: workspaces.id,
      included: 1,
    }),
  ],
});
Push changes with atmn push.

How it works

When autoEnable is set, every new customer created via the API or SDK is automatically assigned this plan. This flag can only be set if there are no prices on the plan. Since there are no prices, no payment is required.
If a customer cancels their paid plan and you have an auto-enabled free plan in the same group, the free plan will be re-activated automatically.

Gating features

Use the check endpoint to gate access based on the free plan’s limits:
import { Autumn } from "autumn-js";

const autumn = new Autumn({ secretKey: "am_sk_..." });

const { data } = await autumn.check({
  customer_id: "user_123",
  feature_id: "api_requests",
});

if (!data.allowed) {
  // Prompt user to upgrade
}
When allowed is false, the customer has exhausted their free tier balance. This is a good moment to prompt them to upgrade.