Create Chat

Create a new chat

POST
/chats
Authorization<token>

Your v0 API key. Get one at https://v0.dev/chat/settings/keys

In: header

messagestring
attachments?array<object>
system?string
chatPrivacy?string
Default"public"
Value in"public" | "private" | "team-edit" | "team" | "unlisted"
projectId?string
modelConfiguration?object

Response Body

curl -X POST "https://api.v0.dev/v1/chats" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "string"
  }'
{
  "id": "string",
  "object": "chat",
  "url": "string",
  "files": [
    {
      "lang": "string",
      "meta": {
        "property1": "string",
        "property2": "string"
      },
      "source": "string"
    }
  ],
  "demo": "string",
  "text": "string",
  "modelConfiguration": {
    "modelId": "v0-1.5-sm",
    "imageGenerations": false,
    "thinking": false
  }
}
{
  "error": {
    "message": "string",
    "type": "unauthorized_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "forbidden_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "not_found_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "conflict_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "payload_too_large_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "unprocessable_entity_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "too_many_requests_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "internal_server_error"
  }
}

Code Examples

cURL

Create New Chat
curl -X POST "https://api.v0.dev/v1/chats" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Create a responsive navbar with Tailwind CSS",
    "attachments": []
  }'

TypeScript SDK

Using v0-sdk
import { v0 } from 'v0-sdk'

// Create a new chat
const chat = await v0.chats.create({
  message: 'Create a responsive navbar with Tailwind CSS',
  attachments: []
})

console.log('Chat created:', chat.id)
console.log('Chat URL:', chat.url)

// Create chat with image attachment
const chatWithImage = await v0.chats.create({
  message: 'Improve this design',
  attachments: [
    {
      type: 'image',
      url: 'https://example.com/design.png',
      description: 'Current design to improve'
    }
  ]
})