Chats

Create Chat (Streaming)

Changed on

Creates a new chat with a user message and returns a Server-Sent Events stream. Events include initial chat state, title deltas, content chunk deltas, and final chat state. The response is text/event-stream; each event is data: <JSON>\n\n where the JSON conforms to ChatStreamEvent. If the stream disconnects before the final event, reconnect with POST /chats/{chatId}/resume instead of sending the message again.

post/chats/stream

Request

  • Base URL
    https://api.v0.dev/v2
  • URL
    https://api.v0.dev/v2/chats/stream
  • Auth
    HTTP bearer

Request body

messagestring required

The prompt or instruction to send to the model.

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.

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

Visibility setting for the new chat.

titlestring

Title for the new chat.

metadataobject

Arbitrary key-value data to attach to the chat.

Response

A single Server-Sent Events payload emitted by streaming chat endpoints. Each SSE event is data: <JSON>\n\n where the JSON conforms to one of the union members.

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 non-success response with the status