Loading...
Loading...
v0 by Vercel expert guidance. Use when discussing AI code generation, generating UI components from prompts, v0 CLI usage, v0 SDK/API integration, or integrating v0 into development workflows with GitHub and Vercel deployment.
npx skill4agent add vercel-labs/vercel-plugin v0-devv0# Initialize v0 in an existing Next.js project (one-time setup)
npx v0@latest init
# Add a specific v0-generated component by ID
npx v0@latest add <component-id>
# With pnpm
pnpm dlx v0@latest init
pnpm dlx v0@latest add <component-id>v0 init@radix-ui/react-iconsclsxlucide-reactcomponents.jsonnpx shadcn@latest add "https://v0.dev/chat/b/<project_id>?token=<token>"# 1. Scaffold a Next.js app
npx create-next-app@latest --typescript --tailwind --eslint
# 2. Initialize v0 integration
npx v0@latest init
# 3. Generate a component on v0.dev, get its ID
# 4. Add the component locally
npx v0@latest add a1B2c3d4
# 5. Import and use in your app# Create a new project from v0 templates
npx create-v0-sdk-app@latest my-v0-app
# Use the v0-clone template (full v0.dev replica with auth, DB, streaming)
npx create-v0-sdk-app@latest --template v0-clonenpm install v0-sdkimport { v0 } from 'v0-sdk'
// Automatically reads from process.env.V0_API_KEY
// Or create a custom client:
import { createClient } from 'v0-sdk'
const v0 = createClient({ apiKey: process.env.CUSTOM_V0_KEY })import { v0 } from 'v0-sdk'
const chat = await v0.chats.create({
message: 'Create a responsive navbar with dark mode toggle using Tailwind',
system: 'You are an expert React developer',
})
console.log(`Open in browser: ${chat.webUrl}`)import { v0 } from 'v0-sdk'
// Create a project
const project = await v0.projects.create({ name: 'My App' })
// Initialize a chat with existing code
const chat = await v0.chats.init({
type: 'files',
files: [{ name: 'App.tsx', content: existingCode }],
projectId: project.id,
})
// Send follow-up instructions
await v0.chats.sendMessage({
chatId: chat.id,
message: 'Add a sidebar with navigation links and a user avatar',
})
// Deploy when ready
const deployment = await v0.deployments.create({
projectId: project.id,
chatId: chat.id,
versionId: chat.latestVersion.id,
})
console.log(`Live at: ${deployment.url}`)// Download files from a specific chat version
const files = await v0.chats.downloadVersion({
chatId: chat.id,
versionId: chat.latestVersion.id,
})v0.chats.create(params)v0.chats.sendMessage(params)v0.chats.getById(params)v0.chats.update(params)v0.chats.findVersions(params)v0.chats.getVersion(params)v0.chats.updateVersion(params)v0.chats.downloadVersion(params)v0.chats.resume(params)v0.projects.create(params)v0.projects.getById(params)v0.projects.update(params)v0.projects.find()v0.projects.assign(params)v0.projects.getByChatId(params)v0.projects.createEnvVars(params)v0.deployments.create(params)v0.deployments.getById(params)v0.deployments.delete(params)v0.deployments.find(params)v0.deployments.findLogs(params)https://api.v0.dev/v1Authorization: Bearer <V0_API_KEY>| Method | Endpoint | Description |
|---|---|---|
| | List projects |
| | Create project |
| | Get project |
| | Update project |
| | Delete project |
| | Create/initialize chat |
| | Get messages |
| | Send message |
| | Create deployment |
v0-1.5-mdv0-1.5-lgv0-1.0-mdnpm i @ai-sdk/vercelimport { vercel } from '@ai-sdk/vercel'
import { generateText } from 'ai'
const { text } = await generateText({
model: vercel('v0-1.5-md'),
prompt: 'Create a login form with email and password fields',
})npm install @v0-sdk/ai-tools aiimport { generateText } from 'ai'
import { openai } from '@ai-sdk/openai'
import { v0Tools } from '@v0-sdk/ai-tools'
const result = await generateText({
model: openai('gpt-5.2'),
prompt: 'Create a new React dashboard project with charts and a data table',
tools: v0Tools({ apiKey: process.env.V0_API_KEY }),
})import { createChatTools, createProjectTools, createDeploymentTools } from '@v0-sdk/ai-tools'v0ToolscreateChatsendMessagegetChatupdateChatdeleteChatfavoriteChatforkChatlistChatscreateProjectgetProjectupdateProjectlistProjectsassignChatToProjectcreateEnvironmentVariablescreateDeploymentgetDeploymentdeleteDeploymentlistDeploymentsgetDeploymentLogs{
"mcpServers": {
"v0": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.v0.dev",
"--header",
"Authorization: Bearer ${V0_API_KEY}"
]
}
}
}v0/main-e7bad8e4mainv0/main-abc123main+Weak: "Build a dashboard"
Strong: "Build a support ticket dashboard. Mobile-first, light theme, high
contrast. Color code: red for urgent, yellow for medium, green for low.
Show agent status badges. Maximum 2 columns on mobile.""Build a real-time chat app using: Next.js 16 with App Router,
Socket.io for messaging, Vercel Postgres for storage,
NextAuth.js for authentication.""Create a team collaboration tool with admin, manager, and member
roles, task assignment, progress tracking, and file sharing.""Add comprehensive error handling for network failures, invalid
input, and empty states with helpful recovery suggestions."npx v0@latest init
npx v0@latest add <component-id>import { DataTable } from '@/components/data-table'
export default function DashboardPage() {
return <DataTable data={rows} columns={columns} />
}import { v0 } from 'v0-sdk'
// Generate a component from a design spec
const chat = await v0.chats.create({
message: `Create a pricing table component with these tiers:
- Free: 0/mo, 1 project, community support
- Pro: $20/mo, unlimited projects, priority support
- Enterprise: Custom, SLA, dedicated support`,
})
// Wait for generation, then download
const files = await v0.chats.downloadVersion({
chatId: chat.id,
versionId: chat.latestVersion.id,
})import { Agent } from 'ai'
import { v0Tools } from '@v0-sdk/ai-tools'
const agent = new Agent({
model: openai('gpt-5.2'),
tools: {
...v0Tools({ apiKey: process.env.V0_API_KEY }),
// ... other tools
},
system: 'You are a full-stack developer. Use v0 to generate UI components.',
})
const { text } = await agent.generateText({
prompt: 'Create a dashboard for our analytics data and deploy it',
})