MuseMVP

MuseMVP Base: Next.js for Node and Cloudflare. MuseMVP Flare: an AI SaaS template that runs entirely on Cloudflare. Authentication, billing and administration included.

Product
  • Home
  • Pricing
  • Templates
Resources
  • Docs
  • Blog
  • Changelog
Legal
  • Privacy
  • Terms
  • Community
Open-Launch Top 1 Daily WinnerOpen-Launch Top 1 Daily WinnerVerified DR - Verified Domain Rating for musemvp.comVerified DR - Verified Domain Rating for musemvp.comMuseMVP - Featured on Startup FameMuseMVP - Featured on Startup FameFazier badgeFazier badgeLiftOff award badgeLiftOff award badge

© 2026 MuseMVP. All rights reserved.

MuseMVP
  • Pricing
  • Docs
  • Blog
  • Changelog
Buy MuseMVP Flare
MuseMVP Docs
MuseMVP Docs
OverviewTech StackGet SourceQuick StartProject Structure
DatabaseAPIAuthenticationBillingObject StorageEmail
AI OverviewImagesVideo and VoiceChat and SummariesCredits and Cost Control
Deployment
AI

AI Overview

The four AI studios, where each runs, mock and live modes, configuration, and the code map.

What is included

Flare ships four studios in the workbench, a private media library and public landing pages for each studio. Every studio shares one credit ledger, one task table and one queue.

StudioEndpointRuns onDefault price
ImagesPOST /api/ai/imagesOpenAI GPT Image 2.5 Flare20 credits an image
VideoPOST /api/ai/videosProvider adapter, polled on Queues6, 12 or 23 credits a second at 480P, 720P or 1080P
VoicePOST /api/ai/speechOpenAI GPT-4o Mini TTS · Queues5 credits per 1,000 characters, rounded up
ChatPOST /api/chatOpenAI GPT-6 Luna · SSE1 credit a message
SummariesPOST /api/summaryOpenAI GPT-6 Luna · Queues5 credits
Prompt enhancementPOST /api/ai/prompt/enhanceOpenAI GPT-6 LunaFree, 20 a minute per user

Outputs go to R2 under {userId}/ai/{assetId} and are listed in /app/library. Read Images, Video and voice, Chat and summaries and Credits and cost control for each part.

Mock and live modes

AI_MODE decides whether providers are called:

EnvironmentDefaultOverride
Local development (APP_ENV=development)mock: deterministic images, sample video and audio written to local R2AI_MODE=live pnpm dev
Deployed WorkerliveAI_MODE=mock as a Worker variable

Mock mode needs no account or key and makes no provider calls. For live OpenAI calls, set OPENAI_API_KEY in apps/web/.dev.vars, then run AI_MODE=live pnpm dev. D1, R2 and Queues stay local. In PowerShell:

$env:AI_MODE = 'live'
pnpm dev

Workers AI is optional. To test its models locally, first run wrangler login, then also set WORKERS_AI_REMOTE=true (PowerShell: $env:WORKERS_AI_REMOTE = 'true'). This connects the AI binding to your Cloudflare account and consumes Neurons. OpenAI does not need that switch or a remote AI binding.

Provider keys

SecretPurpose
OPENAI_API_KEYDefault chat, summaries, prompt enhancement, images and speech. Missing media credentials hide the corresponding models; text calls report configuration errors instead of silently using another provider.
DASHSCOPE_API_KEYSeparate video adapter and the retained alternative image/speech models.
DASHSCOPE_HOSTOptional regional or workspace host for that adapter.

Keep local keys in ignored apps/web/.dev.vars. For deployment, put them in root .env, run pnpm muse:doctor, review pnpm muse:deploy --plan, then use pnpm muse:deploy --yes when ready to publish; the CLI uploads the keys as Worker secrets. Never commit keys or expose them through client variables. See deployment.

Provider interfaces and the openaiText, openaiImages and openaiSpeech adapters live in packages/ai. Runtime selection lives in apps/web/src/modules/ai/mode.ts. Workers AI remains available as an explicit alternative. Video keeps its separate provider; review the video and speech lifecycle notes.

Configuration

packages/config/src/index.ts holds the defaults:

SettingDefaultEffect
quotas.welcomeCredits30Granted once after email verification
quotas.chatCredits / quotas.summaryCredits1 / 5Chat and summary prices
ai.maxActiveTasks2Unfinished generations one user may hold
ai.maxAttempts3Attempts before a task fails and returns its credits
ai.dailyBudgetUsd10Estimated upstream spend allowed per UTC day; 0 turns the cap off
ai.refundOnContentRefusaltrueWhether a provider content refusal returns credits
ai.minGrossMargin0.3Margin every model price must keep at your cheapest credit price
ai.uploadLimit200Reference images kept per user

Model prices live in the catalogs: packages/ai/src/catalog.ts (images), video.ts and speech.ts.

Code map

LocationResponsibility
packages/aiCatalogs, provider interfaces, OpenAI, Workers AI and other adapter clients, the image engine, mock media, error classes. Pure TypeScript with no Worker imports.
apps/web/src/modules/aiPricing, reservation, mode selection, task jobs, the library and asset streaming
apps/web/src/server/routes/ai.tsChat, summary, studio, upload and library endpoints
packages/db/src/ai.tsAI tasks, leases, reservations, releases and the daily spend query
apps/web/src/server/queue.ts, jobs.tsQueue consumer and the five-minute recovery
apps/web/src/modules/workbenchStudio pages (image.tsx, video.tsx, voice.tsx, ai.tsx) and library.tsx
apps/web/src/modules/publicPublic /ai/image, /ai/video, /ai/voice and /ai/chat pages

Verify

  • pnpm test:unit and pnpm test:workers cover pricing, reservations, leases, retries and refunds in mock mode.
  • Locally, generate in each studio, refresh, and confirm the library, the usage page and the balance agree.
  • For a live check, use your own account and a small budget. Do not run batch or cost tests against the public demo, and never paste keys into issues.

Model quality, provider quotas and production costs depend on your own accounts and remain your acceptance test.

Email

Configure Cloudflare Email Sending and verify registration, recovery, and production delivery.

Images

Image models, sizes, reference editing, prompt enhancement, the task API and adding a model.

On this page

What is includedMock and live modesProvider keysConfigurationCode mapVerify

One payment. Tax included.

MuseMVP Flare

TanStack Start on Cloudflare, with four AI studios built in.

$69

Buy MuseMVP Flare