API ReferenceChats

Create Chat From Vercel Project With Message (Async)

Creates a new chat from an existing Vercel project and processes a first message in the background. Returns immediately with the chat ID and message ID. Poll for the assistant message by ID until finishReason is non-null. If the chat is created but the message cannot be sent, the error names the chat; retry with messages.sendAsync instead of creating another chat.

POST/v2/chats/from-vercel-project/async

Usage

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

API Signature

Request

Request Body

vercelProjectId: string

Vercel project ID in the active user or team scope.

Minimum length:
32
Maximum length:
32
baseBranch?: string

Base branch for a GitHub-linked project. Defaults to the repository default branch. Ignored for projects without a GitHub link.

Minimum length:
1
Maximum length:
250
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.

message: string

The prompt or instruction to send to the model.

Minimum length:
1
modelConfiguration?: object

Overrides for the model behavior.

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

Model to use for the generation. Use a v0 model ID, or an model ID in creator/model format. Gateway models must support tool calling and Zero Data Retention, and are subject to team model policy; unsupported IDs are rejected.

imageGenerations: boolean

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

Response

chatId: string

Unique chat identifier.

messageId: string

ID of the assistant message that will receive the response. Poll this message by ID and check its finishReason field to detect completion.