cd /news/ai-tools/how-to-charge-a-subscription-in-an-a… · home › topics › ai-tools › article
[ARTICLE · art-171698] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

How to charge a subscription in an AI-built app and unlock features only for those who paid

Ciro Cesar Maciel released Payments, an infrastructure product that lets AI-built apps charge subscriptions through the developer's own Stripe account while gating features by entitlement rather than plan. The system organizes projects, gateways, plans and features so the app checks whether a user has a specific feature such as advanced-reports, with a React SDK (PaymentsProvider, Pricing, FeatureControl, PortalButton) and a server-side /sdk/v1/permissions endpoint that returns active subscription status and unlocked features. Maciel stresses that client-side feature checks only control the interface, and the paid resource itself must be refused on the server: "That one line on the server is the difference between a paywall and a hidden button.

key takeaway

Gate paid features by entitlement ID (e.g. advanced-reports) checked server-side via /sdk/v1/permissions, since client-side FeatureControl only hides UI and leaves the route open.

by read2 min views4 publishedNov 18, 2026

The app the AI helped you build has users, and now you want to charge. The agent usually proposes wiring Stripe directly: products, checkout, a webhook endpoint, subscription state in your database, a check on every screen. It works, but those pieces have to agree with each other. And the classic mistake of an app built in a hurry is hiding the paid button in the frontend while the server route stays open.

This is the path with Payments, from the Infrastructure line (by Ciro Cesar Maciel, who writes this).

A project holds gateways; each gateway holds plans; a customer subscribes to a plan and gets the features linked to it. The app never asks "which plan is this user on?". It asks "does this user have advanced-reports?". Changing what each plan includes needs no code change.

Recurring billing happens in your Stripe account: the money, the invoices and the receipts live there. Payments organizes plans, follows subscriptions through Stripe's events and tells the app who can do what.

https://myinfrastructure.click/products/payments/llms.txt. No account yet? The agent creates it and the project itself; you only read the e-mail code.sk_test_…) connects, answers everything with success and charges no one. @ciromaciel/payments-react, a PaymentsProvider with the project's public key, your own stable userId and the customer's e-mail. Then <Pricing> for the plans (subscribers change plans through the portal, never a second checkout), <FeatureControl featureId="..."> with a fallback, and <PortalButton> for card, invoices and cancellation. Anything in the browser can be changed by whoever is in the browser. FeatureControl and useHasFeature are for the interface: hide, show, invite to upgrade. The paid thing itself (the export, the report, the expensive call) must be refused on the server. Before delivering it, your backend asks for the user's permissions at /sdk/v1/permissions, which returns whether there is an active subscription and which features are unlocked.

That one line on the server is the difference between a paywall and a hidden button.

Upgrades apply at once and Stripe charges the prorated difference. Downgrades, or yearly to monthly, apply at the end of the paid period. The new plan arrives by webhook and the permissions follow.

── more in #ai-tools 4 stories · sorted by recency
── more on @ciro cesar maciel 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-to-charge-a-subs…] indexed:0 read:2min 2026-11-18 · —