Vercel
API ReferenceChats

Create Chat

Creates a new chat from a prompt. The request blocks until the model response is complete and returns the chat.

v2 of the v0 API is currently in beta and not yet ready for production. There may be breaking changes.
POST/v2/chats

Usage

TypeScript Example
import { v0 } from 'v0'const result = await v0.chats.create({  message: 'Hello, world!',})console.log(result)

API Signature

Request

Request Body

message: string

The prompt or instruction to send to the model.

systemPrompt?: string

System-level context for the chat, such as frameworks or development environment details.

modelConfiguration?: object

Overrides for the model behavior.

modelId: 'v0-auto' | 'v0-mini' | 'v0-pro' | 'v0-max' | 'v0-max-fast'

Model to use for the generation.

imageGenerations: boolean

Enables image generations to generate up to 5 images per version.

attachments?: object[]

Files or assets to include with the message.

url: string

URL of the attachment.

mcpServerIds?: string[]

MCP server IDs to enable. When omitted, uses default enabled servers.

skills?: ('remote' | 'memory' | 'project')[]

Skills to force-attach to the chat. Supports skills.sh (remote), user/team memory (memory), and project (project) skills. Maximum 3.

type: 'remote'

Discriminator: a skills.sh skill.

id: string

Skill ID from skills.sh.

privacy?: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'

Visibility setting for the new chat.

title?: string

Title for the new chat.

metadata?: Record<string, string>

Arbitrary key-value data to attach to the chat.

Response

chat: object
id: string

Unique chat identifier.

title?: string

Chat title, if generated.

privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'

Visibility setting of the chat.

createdAt: string

ISO timestamp of when the chat was created.

updatedAt?: string

ISO timestamp of when the chat was last updated.

authorId: string

ID of the user who created the chat.

vercelProjectId?: string

Associated Vercel project ID, if any.

metadata: Record<string, string>

User-defined key-value metadata.

writePermission: boolean

Whether the caller has write access to this chat.

usage: object

Token usage and credit cost for prompt.

tokens: object

Token counts for this message.

input: number

Prompt input value (non-cached).

output: number

Completion output value.

cacheRead: number

Cache-read input value.

cacheWrite: number

Cache-write input value.

total: number

Sum of input, output, cacheRead, and cacheWrite.

creditsCost: object

Credit cost for this message.

input: number

Prompt input value (non-cached).

output: number

Completion output value.

cacheRead: number

Cache-read input value.

cacheWrite: number

Cache-write input value.

total: number

Sum of input, output, cacheRead, and cacheWrite.

On this page