AI Income LabJoin AI Income Lab ↗

Build guide · By · Published · Updated

OpenCode Stripe Billing Build: A SaaS Case Study

Diagram for the OpenCode Stripe guide: paste the billing prompt, fix the build errors, then test checkout.
Paste the billing prompt → Fix the build errors → Test checkout

Quick answer: The recording pasted one billing prompt into OpenCode, which added Stripe subscription models, a pricing page, a billing invoices page, a checkout success page and an environment setup file. The build then failed twice and OpenCode fixed it by regenerating the Prisma client and installing the missing Stripe packages. No real payment was tested.

Some tool links in this guide are affiliate links, so I may earn a commission or credit.

This is a February 2026 case study from the build of TubeAnalytics.net, a YouTube analytics app. It is a good example of a complete OpenCode build step with the errors left in. It is not a first-time setup: for installing and choosing between tools, start with OpenCode vs Claude Code. If you want to learn this loop on a smaller project first, use the task-list filter exercise.

1. The setup in the recording

The app already had a redesigned landing page, with plans shown from $19 to $149 per month and a 7-day free trial, all as stated in the recording. The Start free trial button did not work because the sign-up page was not connected yet.

The work came from a long master prompt written in Claude with the Opus 4.6 model. Each section of it was pasted, one at a time, into a coding agent. This time the agent was OpenCode, because the Claude Code credit limit had not reset yet. The recording also said OpenCode was essentially free as far as the speaker could tell, because no API keys had to be connected. Check OpenCode’s current free-model terms before you rely on that; OpenCode Go plans and limits covers a paid option.

To install it, the recording pointed to opencode.ai, which offers a one-line curl command, npm, bun and brew. OpenCode was run in the terminal. The VS Code extension was installed too, but it could not find the opencode command and that was not fixed on camera. The recording’s advice was to avoid quitting OpenCode while it is running a task.

2. Paste the billing prompt

The prompt asked for a subscription and billing system. In VS Code the changes appeared as OpenCode worked: subscription models, then a pricing page under the app folder, then a billing invoices page, a checkout success page and navigation links to billing. The pricing page listed the plans, from $19 up to the business plan and a $149 plan.

OpenCode also created an environment setup file holding the Stripe keys. The recording’s warning is worth repeating: add that file to your ignore file so nobody else can get the keys.

3. Fix the errors

The first problem was a missing module import. The recording fixed that line with the Gemini Code Assist extension in VS Code, which is installed from the Extensions panel.

OpenCode then ran the project build. It found a schema problem in Prisma, the database model layer, and fixed it. It regenerated the Prisma client and checked the build again. The build failed again because the Stripe packages were not installed, so OpenCode installed them. A last error in the billing page file was fixed the same way.

The app was kept running with PM2: build the project, then restart it with PM2, which restarts the app if it crashes. The recording recommended that for a self-hosted app.

4. Google sign-in approval

Testing sign-in needed Google OAuth approval, which the recording said had been expected to take three to four weeks. The Google Cloud Console now showed the branding requirements and the privacy policy requirements as met. Google asks for terms and conditions and a privacy policy on the site. The next step named was allowing data access to the YouTube APIs.

What this recording did not test

Before you take payments, test checkout in Stripe’s test mode and read the diff of every file the agent wrote. Claude Code vs Codex shows a second agent reviewing the first.

Watch the walkthrough

Watch on YouTube: OpenCode Makes It Easy To Build SaaS Apps In Minutes!. Also on this site with notes: the watch page.

FAQ

Is OpenCode free?

The recording said it was essentially free as far as the speaker could tell, because no API keys had to be connected. Check opencode.ai for the current terms.

What went wrong during the build?

A missing module import, a Prisma schema issue, missing Stripe packages and an error in the billing page file. OpenCode or Gemini Code Assist fixed each one on camera.

Did the Stripe checkout work?

It was not tested. The recording built the pages and fixed the build, but no checkout or payment was run.

Where should the Stripe keys go?

In an environment file that is listed in your ignore file, as the recording advised, so the keys are never committed.

Sources

Build the next one with AI Income Lab

Step-by-step courses, reusable templates, and a community that answers when you get stuck.

Members get the Claude Code & Skills and Codex Tutorials & Courses lessons.

Join AI Income Lab ↗From $29/month. Cancel anytime.
Join 2,900+ members building with AI

Not ready to join? Get the weekly build notes: new guides and tested builds in one short email.