The simplest way to use v0. Just prompt and see your app generated instantly - no chat management, no complexity. Build AI-powered apps with real-time generation and seamless deployment to Vercel.
Install dependencies:
pnpm install
Configure environment:
Create a .env.local
file in the root directory:
V0_API_KEY=your_api_key_here# Optional: For rate limiting (if not provided, rate limiting is disabled)KV_REST_API_URL=your_kv_rest_api_urlKV_REST_API_TOKEN=your_kv_rest_api_token
Run development server:
pnpm dev
Open http://localhost:3000 to view the application.
GET /api/validate
- Validate API keyGET /api/projects
- List all projectsGET /api/projects/[id]
- Get project details with associated chatsPOST /api/generate
- Generate or continue app conversationGET /api/chats/[id]
- Retrieve chat details and historyDELETE /api/chats/[id]
- Delete a chat conversationPATCH /api/chats/[id]
- Update chat (rename)POST /api/chats/fork
- Create a new chat from an existing onePOST /api/deployments
- Deploy generated apps to VercelThis application implements optional rate limiting to prevent abuse and ensure fair usage:
v0.chats.create()
or v0.chats.sendMessage()
When the rate limit is exceeded, users receive a 429 status code with information about when they can try again.
├── app/│ ├── api/ # API route handlers│ │ ├── chats/[chatId]/ # Chat CRUD operations│ │ ├── deployments/ # Vercel deployment handling│ │ ├── generate/ # AI app generation│ │ ├── projects/ # Project management│ │ └── validate/ # API key validation│ ├── components/ # App-specific components│ ├── projects/[projectId]/ # Dynamic project pages│ │ └── chats/[chatId]/ # Individual chat pages│ ├── globals.css # Global styles and Tailwind config│ ├── layout.tsx # Root layout with metadata│ └── page.tsx # Homepage with main interface├── components/│ └── ui/ # Reusable UI components (buttons, dialogs, etc.)├── lib/│ ├── hooks/ # Custom React hooks│ └── utils.ts # Utility functions└── public/ # Static assets
Variable | Required | Description |
---|---|---|
V0_API_KEY | Yes | Your v0 Platform API key from v0.dev/settings |
KV_REST_API_URL | No | Upstash Redis REST URL for rate limiting (if not provided, rate limiting is disabled) |
KV_REST_API_TOKEN | No | Upstash Redis REST token for rate limiting (if not provided, rate limiting is disabled) |
# Install dependenciespnpm install# Start development server with Turbopackpnpm dev# Build for productionpnpm build# Start production serverpnpm start# Run lintingpnpm lint# Format codepnpm format# Check formattingpnpm format:check