Vercel

Send Message

Creates a new message in an existing chat. Triggers a model response using the provided prompt, with optional attachments and configuration settings.

POST/v1/chats/{chatId}/messages

Usage

TypeScript Example
import { v0 } from 'v0-sdk'const result = await v0.chats.sendMessage({  chatId: '123',  message: 'Add dark mode',})console.log(result)

API Signature

Request

Path Parameters

chatId: string

The unique identifier of the chat to send the message to. Provided as a path parameter.

Body

message: string

The prompt or instruction to send to the model as part of the chat.

attachments?: object[]

A list of files or assets to include with the message.

url: string
system?: string

Provides system-level context or background for the chat. This is typically used to specify frameworks, tools, or development environments relevant to the task.

modelConfiguration?: object

Overrides for the model behavior.

modelId?: 'v0-mini' | 'v0-pro' | 'v0-max'
deprecated

Deprecated Model ID field preserved for backward compatibility.

imageGenerations?: boolean

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

thinking?: boolean

Enables thinking to generate a response in multiple steps.

responseMode?: 'sync' | 'async' | 'experimental_stream'

Controls how the response is delivered.

  • "sync": The response is returned immediately with the HTTP request.
  • "async": Returns a message placeholder immediately; use getById to poll for completion status and final output.
  • "experimental_stream": Returns content parts as Server-Sent Events for real-time streaming.
mcpServerIds?: string[]

Array of MCP server IDs to enable for this message. When provided, only the specified servers will be used. When omitted, falls back to the user's enabled MCP servers. Pass an empty array to explicitly disable all MCP servers.

Response

id: string

A unique identifier for the chat.

object: 'chat'

Fixed value identifying this object as a chat.

shareable: boolean
deprecated

Deprecated: Use the privacy field instead. A chat is shareable when privacy is public or unlisted.

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

Defines the visibility of the chat—private, team-only, or public.

name?: string

An optional name assigned to the chat by the user.

title?: string
deprecated

Deprecated title field preserved for backward compatibility.

createdAt: string

The ISO timestamp representing when the chat was created.

updatedAt?: string

The ISO timestamp of the last update to the chat.

favorite: boolean

Indicates whether the chat is marked as a favorite.

authorId: string

The ID of the user who created the chat.

projectId?: string

Optional ID of the v0 project associated with this chat.

vercelProjectId?: string

Optional ID of the linked Vercel project, if connected.

webUrl: string

Web URL to view this chat in the browser.

apiUrl: string

API URL to access this chat via the API.

latestVersion?: object

Full details of the most recent generated version, if available.

id: string

A unique identifier for the version.

object: 'version'

Fixed value identifying this object as a version.

status: 'pending' | 'completed' | 'failed'

The current status of the version generation process.

demoUrl?: string

Optional URL for previewing the generated output.

screenshotUrl?: string

URL to retrieve a screenshot of this version.

createdAt: string

The date and time when the version was created, in ISO 8601 format.

updatedAt?: string

The date and time when the version was last updated, in ISO 8601 format.

files: object[]

A list of files that were generated or included in this version.

url: string
deprecated

The canonical URL to access this chat.

messages: object[]

All messages exchanged in the chat, including user and assistant entries.

id: string

A unique identifier for the message.

object: 'message'

Fixed value identifying this object as a message.

content: string

The main text content of the message.

experimental_content?: any[] | any[][]

The parsed content of the message as an array structure containing AST nodes. This is an experimental field that may change.

createdAt: string

The ISO timestamp representing when the message was created.

updatedAt?: string

The ISO timestamp representing when the message was last updated.

type: 'message' | 'forked-block' | 'forked-chat' | 'open-in-v0' | 'refinement' | 'added-environment-variables' | 'added-integration' | 'deleted-file' | 'moved-file' | 'renamed-file' | 'edited-file' | 'replace-src' | 'reverted-block' | 'fix-with-v0' | 'auto-fix-with-v0' | 'sync-git' | 'pull-changes' | 'fix-cve' | 'answered-questions'

Indicates the format or category of the message, such as plain text or code.

role: 'user' | 'assistant'

Specifies whether the message was sent by the user or the assistant.

finishReason?: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other' | 'unknown'

The reason why the message generation finished.

apiUrl: string

API URL to access this message via the API.

authorId: stringnull

The ID of the user who sent the message.

parentId?: stringnull

The ID of the parent message.

attachments?: object[]
url: string

The URL where the attachment file can be accessed.

name?: string

The original filename of the attachment.

contentType?: string

The MIME type of the attachment file (e.g., image/png, application/pdf).

size: number

The size of the attachment file in bytes.

content?: string

The base64-encoded content of the attachment file, if available.

type?: 'screenshot' | 'figma' | 'zip'

Optional v0-specific attachment type for enhanced processing.

files?: object[]

Optional array of files associated with the chat context.

lang: string

Programming language used in the file (e.g., JavaScript, Python).

meta: object

A key-value map of metadata associated with the file (e.g., path, type).

source: string

The origin or identifier of the file source (e.g., path or upload label).

demo?: string
deprecated

Deprecated demo URL used for previewing the chat result.

text: string

The main user prompt or instruction that started the chat.

modelConfiguration?: object

The configuration used to generate responses in this chat.

modelId?: 'v0-mini' | 'v0-pro' | 'v0-max'
deprecated

Deprecated Model ID field preserved for backward compatibility.

imageGenerations?: boolean

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

thinking?: boolean

Enables thinking to generate a response in multiple steps.

permissions: object
write: boolean

If true, the user has write access to the chat.

metadata: Record<string, string>

Arbitrary key-value data associated with this chat.

On this page