Messages

Sends a new message to an existing chat. Blocks until the model response is complete and returns the message response. Include designMode to apply element-scoped design edits; message may be omitted when edits are provided.

post/chats/{chatId}/messages

Request

  • Base URL
    https://api.v0.dev/v2
  • URL
    https://api.v0.dev/v2/chats/{chatId}/messages
  • Auth
    HTTP bearer

Path parameters

chatIdstring required

The unique identifier of the chat.

Request body

messagestring

The prompt or instruction to send to the model. May be omitted when designMode contains edits.

systemPromptstring

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

mcpServerIdsstring[]

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

Response

A single message in a chat.

idstring required

Unique message identifier.

chatIdstring required

ID of the chat this message belongs to.

role'user' | 'assistant' required

Who produced this message.

createdAtstring date-time required

ISO timestamp when the message was created.

updatedAtstring date-time required

ISO timestamp when the message was last updated.

contentstring required

The trailing prose of the message — the agent’s closing summary, or the user’s message text. Empty string when there is no closing prose.

finishReason'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other' nullable required

The reason why message generation finished, including standard completion reasons and error states.

restorableboolean required

True when this is an assistant message that produced restorable code and is not the currently active code.

authorIdstring nullable required

ID of the user who authored a user message; null for assistant messages.

Changes

    • breaking

      removed the enum value v0-max of the request property / (media type: application/json)

    • breaking

      removed the enum value v0-max of the request property / (media type: application/x-www-form-urlencoded)

    • breaking

      removed the enum value v0-max of the request property / (media type: multipart/form-data)

    • breaking

      removed the enum value v0-max-fast of the request property / (media type: application/json)

    • breaking

      removed the enum value v0-max-fast of the request property / (media type: application/x-www-form-urlencoded)

    • breaking

      removed the enum value v0-max-fast of the request property / (media type: multipart/form-data)

    • breaking

      removed the enum value v0-mini of the request property / (media type: application/json)

    • breaking

      removed the enum value v0-mini of the request property / (media type: application/x-www-form-urlencoded)

    • breaking

      removed the enum value v0-mini of the request property / (media type: multipart/form-data)

    • breaking

      removed the enum value v0-pro of the request property / (media type: application/json)

    • breaking

      removed the enum value v0-pro of the request property / (media type: application/x-www-form-urlencoded)

    • breaking

      removed the enum value v0-pro of the request property / (media type: multipart/form-data)

    • breaking

      the / request property type changed from string to no type (media type: application/json)

    • info

      added subschema #1 subschema #2 to the / request property anyOf list (media type: application/json)

    • info

      added subschema #1 subschema #2 to the / request property anyOf list (media type: application/x-www-form-urlencoded)

    • info

      added subschema #1 subschema #2 to the / request property anyOf list (media type: multipart/form-data)

    • info

      the / request property type was generalized from string to no type (media type: application/x-www-form-urlencoded)

    • info

      the / request property type was generalized from string to no type (media type: multipart/form-data)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/x-www-form-urlencoded)

    • info

      added the new optional request property (media type: multipart/form-data)

    • info

      the request property became optional (media type: application/json)

    • info

      the request property became optional (media type: application/x-www-form-urlencoded)

    • info

      the request property became optional (media type: multipart/form-data)