How to add paid hosted checkout to an open-source AI project
Keep the source and the hosted service distinct. Charge for a named service, activate it after verified payment, and give customers a clear way to leave.
Add checkout to an open-source AI project by selling an explicitly defined hosted service, attaching each purchase to an authorized workspace and granting service only after verifying the payment. Keep the rights granted by the source license separate from what the hosting invoice covers. A person who can run the project locally should be able to see why they would pay you to run it for them. Start by choosing between a fixed hosted offer and an order-specific checkout session or buy button.
Decide what your business is selling
Your project and your business can solve different problems. A local install gives a user an application they run. A managed workspace can give a team infrastructure, predictable capacity, updates and a place to ask for help. List only the services you actually provide, and describe the account or period that receives them. Labels like Pro or Enterprise don't explain who pays for model calls or what happens when the hosted period ends.
The Open Source Initiative's Open Source Definition describes the rights and distribution conditions for open-source licensing, and its FAQ explains that businesses can sell services based on open-source code. Still, consult the actual licenses for the components you use. Application code, model weights, datasets and trademarks can have different terms. A successful checkout is not proof that your hosting or distribution arrangement complies with them.
| Offer | Best for | What to grant | What to disclose |
|---|---|---|---|
| Prepaid hosted usage | Customers with intermittent jobs | A defined amount of usable processing in the saved workspace | What counts as a unit, how it is deducted, and any expiry |
| Hosted access for a period | Teams that need a service to remain available | The stated workspace features during verified coverage dates | The service period, capacity limits and what happens at its end |
| Hosted access plus support | Teams that want an operator to help them run the system | The hosted entitlement and a separate support obligation | Coverage, scope and how to open a support request |
| Paid installation on customer infrastructure | Buyers who want to run the software themselves | The agreed work, not a hosted entitlement | What is delivered, who accepts it and what access you need |
A useful test is to remove the project name from the offer and read the remaining sentence. “Buy managed inference for your team's private workspace” says what the customer is getting. “Buy the full version” could mean a different license, an archive, more capacity or simply someone else's servers. Say which one. Tell the buyer what is outside the offer, such as a third-party model account when they must provide one themselves.
Worked example: a local project becomes a managed service
Imagine a fictional open-source document parser. Its maintainers publish code that users can install, but a small law firm asks for a managed instance with access for its staff. The maintainers prepare a hosted offer that includes a workspace, a defined document allowance and a known support channel. They do not promise that purchasing hosting changes the rights the source license already grants. They confirm separately that they can operate the service under the licenses and terms that apply to the software and models involved.
The firm has a technical lead who administers the workspace and a finance employee who pays the invoice. The finance employee should not gain document access by paying. The technical lead should not have to prove the payment by forwarding a private receipt. Attach the invoice to the authorized workspace before sending it, and let verified records rather than browser identity drive delivery. That arrangement helps the same project sell to a single founder and a team without pretending both have the same buyer roles.
Before you start: draw the boundary between source and service
- Find the primary license and dependency terms for the version you intend to host. Confirm you have authority to meet the commitments your purchase page makes. Do not infer that a public repository alone gives permission to market every bundled component as open source.
- Choose one representative offer, a distinct workspace, a Test environment and an owner who can inspect its payment and access history. Use synthetic documents and account data in rehearsals.
- Decide what happens if hosting can't be provisioned, a workspace asks to export data, or an invoice remains unpaid. Give those questions to the people who own the service and the customer terms, not to the checkout button.
One gotcha is placing the merchant's billing configuration into the distributed project. A public sample, fork or deploy template must not point to private credentials or silently send orders through the maintainer's Live account. A user running their own copy should get their own configuration and explicit behavior. Keep the managed business's live payment connections with the authorized deployment, not in the repository distributed to everyone.
1. Attach checkout to a server-owned service order
- Open the purchase page from the hosted workspace. Show the offer, the quantity or period, and the destination workspace. Require the signed-in user to have the appropriate role, or direct them to the agreed procurement route. A person who can process documents isn't necessarily someone allowed to spend the team's money.
- Look up the approved terms. Use the selected offer and your trusted catalog to determine price, currency and entitlement. Save the exact accepted terms and stable reference before opening payment. The buyer's browser or an AI assistant shouldn't be able to supply a new amount or recipient by describing it in prose.
- Choose the collection route for the order. A recurring public offer may have a reusable page; access for one authenticated workspace generally benefits from a known order reference. A company that needs a purchase order may instead want an invoice tied to the exact coverage and recipient. Railbed's B2B AI API checkout guide compares purchase shapes where the payer and consumer are different.
- Explain the hosted handoff. Tell the buyer where payment will take place and how to recover the original order. In Railbed's card route details go on the provider's page, and buyer ID checks depend on the provider. Don't ask account administrators to send card details to project maintainers in issues, email or chat.
Expected result: before any card payment takes place, you can answer what is being bought, who authorized the order and which workspace should receive it. You can find the same information after a browser tab disappears. For an invoice, an authorized payer can identify the service without obtaining access to its underlying documents or model inputs.
Make it clear which product a fork is buying
A maintainer might run both a public demo and a paid production service. A fork might use the same name with a different deployment. Keep each checkout action tied to the authorized seller and deployment. Identify the managed service and its operator on the purchase page rather than assuming a repository link will establish who is collecting. For a fork or a new operator, disable the button until that operator has deliberately configured its own collection route.
The same clarity matters when an AI coding agent adds a checkout. Ask it to read the service's catalog and ownership rules, then build the supported route. Do not let examples in a README create a second source of truth for prices or environment settings. Railbed maintains checkouts.md, which defines an open format for recording how a project takes payments. Point the agent to the project-specific record and keep secret values out of public files, logs and chat.
2. Verify the payment and provision the workspace separately
- Find the order from trusted payment evidence. Check the original reference, environment, amount, currency and confirmed status before delivering. Do not grant access because the user returned from checkout or because a receipt email appeared. Railbed's payment verification guide explains the role of signed notifications and authenticated payment lookup.
- Write a single entitlement or capacity grant. Save the covered workspace, offer and dimensions that matter, such as credits purchased or start and end dates. A duplicate notification should find the same grant rather than creating another workspace or adding a fresh allotment.
- Work through the service's readiness checks. If you need to allocate a new instance, identify which environment and owner will do so. The purchase can be confirmed before the instance is ready. Show both facts rather than erasing the payment when provisioning fails or showing an active service before the instance exists.
- Give support the original evidence. Use authorized views of order, payment and provisioning. A failed setup needs a provisioning retry or a commercial resolution, not a blind second checkout. A delayed payment needs an inspection of the original attempt, not an instruction to provision based on a screenshot.
Expected result: a verified payment gives the correct workspace what it bought once. The customer can see whether the payment is pending, the payment was confirmed and setup is still underway, or the service is ready. The finance team can reconcile the original sale separately from the engineering team resolving any deployment issue.
Worked example: the deployment isn't ready even though the customer paid
A hosted inference service sells a capacity pack for a new team workspace. The payment verifies, but the service cannot allocate the specified model because the configured pool is unavailable. The account page says that the payment is confirmed and the service is awaiting setup. Support sees the same paid order and the provisioning record, and gives the customer an authorized next step rather than asking them to buy again.
If the original configuration becomes available, retry provisioning against the existing entitlement. If only a different configuration is available, check the agreement before substituting anything. A lower-capacity instance or a changed data handling arrangement isn't automatically acceptable because the price was the same. Record the customer's authorized choice and the actual delivery, or use the applicable cancellation and refund process.
If payment occurs for a team's existing workspace, a failed upgrade should not necessarily disable the features they already bought. Keep prior access and the new obligation distinct. For example, a customer whose added seats are still being prepared should still be able to use seats that were already active under their original plan. That is a delivery state you can test without inventing a new payment state.
3. Design the end of a paid period before selling the first one
With Railbed subscriptions, each period the customer gets an invoice and pays it. Save the service dates that a verified invoice covers. An invoice paid early need not start the next period early. An invoice sent but not yet paid does not, by itself, extend the current terms. Show the original dates and the current status where an authorized workspace administrator can find them.
Plan what remains available at the end of paid hosting. If your terms include a data export period, state the duration and the method and make the process usable by the intended role. If service stops at expiry, tell the buyer clearly and make sure any authorized grace period works in practice. Access to the source under its license and access to a managed workspace are separate. Likewise, a right to export customer data doesn't imply access to the operator's credentials, internal monitoring or other tenants' information.
For a prepaid usage offer, define when the app measures units and how it handles interrupted work. A job that was reserved capacity but didn't finish may need a different entry from one that consumed units, according to your terms. An assistant helping a customer plan usage should read the available balance and tell the buyer when a new purchase needs their decision. Don't treat a scheduled job as permission to create a new payment.
4. Check recovery for a service customer and a self-hosted user
- The payer changes jobs. Keep the original receipt and move future billing contacts through the authorized workspace process. Don't transfer admin rights to a new contact solely because their email appears in a payment record.
- A user installs the source locally. Verify they don't inherit the operator's purchase settings or see a live payment button for your hosted account unless that is an explicit, correctly labeled link. Check the sample configuration as someone outside the maintainer team would see it.
- The hosted customer leaves. Test the actual supported export or support path. Do not claim that the local build can import a hosted export unless you've verified the format and any limitations. Record what access remains and who can authorize the export.
- The product serves higher-risk use cases. Verify the policies and laws for the service you actually sell. Keep applicable identity, content, geographic and usage requirements distinct from the payment result. Buying a hosted pack is not consent to use restricted features or sensitive records.
Railbed card checkout fits hosted AI services that accept cards and want proceeds in a wallet they control. Railbed never holds funds. Settlement is almost always USDC on Polygon, and settled sales can't be pulled back from your wallet. That doesn't eliminate disputes or any obligation to issue an appropriate refund. Wallet reconciliation, any bank conversion and the service's own licensing and delivery are the merchant's responsibility. See Railbed's checkout for AI tools for the purchase patterns it supports.
FAQ
Can an open-source AI project sell hosted access by card?
Yes. A business can sell a defined hosted service while preserving the rights granted by the applicable open-source license. Confirm the licenses and terms for the components you intend to operate.
What should the hosted purchase grant?
Grant the specific service the customer accepted, such as capacity, access through clear dates or an agreed support obligation. Save it against the authorized workspace before checkout.
Should a payer automatically become a workspace administrator?
No. Keep payment and product roles separate. An authorized payer can settle the invoice without being allowed to view private data or manage the workspace.
Does a checkout return page prove a hosted upgrade is paid?
No. Verify payment from trusted records against the saved order before granting access. The return page is a navigation step.
How do you handle a paid upgrade that hasn't finished provisioning?
Keep payment confirmed and show the service as not yet ready. Retry or resolve the original obligation without collecting again or creating a second entitlement.
How does Railbed bill a hosted subscription?
Each period the customer gets an invoice and pays it. Your service should use the verified payment and coverage dates to determine access.
Can a public project include the operator's checkout configuration?
Document how to configure it and provide safe examples, but keep real credentials and private operating settings out of public releases. A fork should have no real payment connection until an authorized operator configures it.
One last thing: read the exit instructions as if you just paid
Show a prospective customer which rights come with the source license, which services come with the purchase and what remains available when hosted service ends. Have another person recover a paid order from the application and then find the documented exit path. If payment is easy but those two answers are hard to find, tighten the offer and support records before expanding the service. Buyers who understand the boundary should not need to read your repository history to find out what they bought.