← Blog

How I built a two-tier AI consultation system in 1 day

4 min read
case-study ai claude stripe astro automation

The problem: contact forms are a dead end

Classic freelancer setup: portfolio site, contact form, wait for email. Client writes “I want an app”, I reply with qualifying questions, they answer in 3 days, I ask more. A week later I have data I could’ve had in 10 minutes.

80% of inquiries are either low-budget projects (“I have $500 for a SaaS”) or vague briefs with no specifics. Time spent on manual qualification is time lost on delivery.

The solution: AI talks, I analyze

Instead of a form — a two-tier consultation system:

Tier 1 — free conversation (Claude Haiku 4.5). Client clicks “Start conversation”, the bot runs qualification in 8 exchanges. Gathers: problem, technologies, budget, timeline, scale. Cost per session: pennies.

Tier 2 — premium consultation (Claude Opus 4.6). Client pays 200 PLN (~$50) via Stripe, gets 25 exchanges with in-depth technical analysis. Architectural frameworks, technology recommendations, risk identification. The 200 PLN is deducted from the project quote.

How it works technically

Flow

  1. Client visits the site, clicks “Start conversation”
  2. System generates a UUID session, creates a record in Supabase
  3. Claude Haiku runs qualification (BANT for B2B, education parameters for tutoring)
  4. After 8 exchanges — a contact form appears (email + phone)
  5. I receive: full transcript + structured JSON summary
  6. Client receives: formatted summary with key data + “I’ll get back to you in 48h”

Context continuity

When a client upgrades from free to premium, the system passes the Haiku JSON summary to Opus. Opus doesn’t re-ask about budget, problem, or technologies — it digs deeper immediately.

Mechanism: free_session_id in Stripe Checkout metadata → webhook saves the link in Supabase → Opus loads the summary into the system prompt.

Early finish

Premium clients can click “Finish and generate summary” at any point. The system generates JSON based on the conversation so far — even if they used 5 of 25 exchanges.

Prompt engineering — the hardest part

Code took hours. Prompts — iterations across multiple sessions. Key rules:

Identity. The bot MUST refer to me in third person (“Artur builds”, “in Artur’s portfolio”). Without this rule, Claude naturally switches to “I” and impersonates me. Clients would think they’re talking to me, then be confused later.

Language. Pure Polish (or English). No mixing. Technical English terms only if the client uses them first. Mixed languages sound unprofessional.

Don’t guess. The bot never quotes prices or timelines. It says “Artur will assess after analysis”. Better no answer than committing me to a low-margin project or tech debt.

Formatting. Plain text, zero markdown. Bold and italic render as raw asterisks in the chat UI — looks like a bug, not formatting.

Economics

Free session (Haiku)

  • Cost: ~$0.01 per conversation
  • Limit: 2 sessions per IP per week
  • ROI: near-zero cost, value = qualified lead

Premium (Opus)

  • Revenue: 200 PLN (~$50)
  • Worst case (25 exchanges at 4096 tokens each): ~$34 cost → $16 margin (32%)
  • Realistically (~1000 tokens/response): ~$10 cost → $40 margin (80%+)
  • Parameters: 50 messages, 4096 tokens/response, full history in context

The worst case is extreme — it would require 25 exchanges where every bot response maxes out at 4096 tokens. In practice, this doesn’t happen.

Stack

  • Astro 6.0 — SSG + SSR. Static pages for portfolio, serverless functions for API.
  • Claude Haiku 4.5 — qualification. Cheap, fast, sufficient for data gathering.
  • Claude Opus 4.6 — technical analysis. More expensive, but delivers real value for $50.
  • Stripe Checkout — payment + webhooks. Metadata links free→premium.
  • Supabase — PostgreSQL with RLS. Sessions, messages, JSON summaries.
  • Resend — transactional emails. Summaries, transcripts, thank-yous.
  • Vercel — hosting + functions. Git-push deploys in seconds.

Result

The system runs 24/7. Clients get an immediate conversation instead of a form and waiting. I get a qualified lead with full context — problem, technologies, budget, timeline, scale — before writing my first email.

The entire system was built in 1 day. 6 API endpoints, 2 AI models, 5 external integrations. A modern stack lets a solo freelancer build a system that a corporation would take weeks to ship.

Have a project that needs this approach? Let’s talk — the bot is available 24/7.

Case Study

AI Consultation System — two-tier funnel

View case study →

Have a similar problem?

Describe it to AI — it gathers technical context, Artur delivers a quote in 48h.

Start diagnostics