🧙 Learn how to start, scale & exit a PROFITABLE SaaS (EXACT Scripts, Code Files & Playbooks): https://www.rosewell.dev/
🖇️ Want my team to build your app + get your first customers 100% DONE-FOR-YOU? Go here: https://www.rosewell.dev/build
🎉 In this video, I'll be explaining how building an API in 2026 will make you rich & sharing examples of simple APIs you can build with REAL use cases today.
🔥 This video covers:
→ Best ideas in 2026 for creating profitable APIs, profitable AI agents
→ A technical guide & prompts for building an API from scratch
→ Examples of real APIs doing great numbers
Prompts:
////////// Building the PRD
Start with this prompt. Adapt it for whichever API idea you picked:
I want to build a simple API product using Next.js and Vercel.
The API does one thing: [describe your API function here].
Tech stack:
Next.js with App Router
TypeScript
Vercel for deployment
Supabase for the database (to track API keys and usage)
I need:
1. A Next.js project with a single API route at /api/v1/[your-endpoint]
2. API key authentication via an x-api-key header
3. A Supabase table called "api_keys" with columns: id, key, email, created_at, requests_used, requests_limit
4. A Supabase table called "usage_logs" with columns: id, api_key_id, endpoint, created_at
5. Middleware that checks the API key, increments usage, and rejects if over limit
6. The actual endpoint logic that processes the request and returns the result
7. A simple landing page at / that explains the API with a code example
Do NOT write any code yet. First, outline the file structure and database schema so I can review it.
////////// Setup Supabase
Go to your Supabase dashboard. Open the SQL Editor. Ask Cursor to generate the SQL for your tables:
Generate the SQL CREATE TABLE statements for the api_keys and
usage_logs tables we discussed. Include Row Level Security policies
that allow the service role to read and write but block public access.
////////// Build Logic
This is where the actual work happens. Tell Cursor to implement the endpoint logic. Be specific about inputs and outputs:
Now implement the /api/v1/screenshot endpoint.
Input: A JSON body with { "url": "https://example.com" }
Output: A PNG image buffer with content-type image/png
Use Puppeteer to render the page. Set viewport to 1280x720.
Wait for the network to be idle before capturing.
Return the image directly in the response.
Handle errors: return 400 for missing URL, 500 for render failures.
Include proper CORS headers for cross-origin access.
Cursor will generate the implementation. Test it locally by running npm run dev in the terminal (Cursor has a built-in terminal, or ask it to run the command for you).
Test your endpoint with curl or any API client:
curl -X POST http://localhost:3000/api/v1/screenshot \
-H "Content-Type: application/json" \
-H "x-api-key: test-key-123" \
-d '{"url": "https://example.com"}'
If something breaks, paste the error back into Cursor chat. It'll diagnose and fix. This back-and-forth loop is the core vibe coding workflow. Describe what's wrong. Let AI fix it. Test again.
Step 5: Deploy to Vercel (15 minutes)
Push your code to GitHub. If you've never done this, ask Cursor:
Help me initialise a git repo, create a GitHub repository,
and push this project. Walk me through each step.
Once it's on GitHub, go to Vercel. Click "Add New Project." Import your GitHub repo. Add your environment variables (Supabase URL, keys, any other secrets). Click Deploy.
Vercel gives you a URL like your-project.vercel.app. Your API is now live at your-project.vercel.app/api/v1/screenshot. That's it. You have a production API.
🖐️ About me:
I'm Olly & I build software apps.
In the last 2 years I have built & exited Response AI: an AI cold email tool, then I built & sold 2 more software products. I love teaching people how to code with AI and make money with software. I teach people how here: https://www.rosewell.dev/
🧙 Start, scale & exit a PROFITABLE Software App with NO experience: https://www.rosewell.dev/