Find Chats

Find all chats

GET
/chats
Authorization<token>

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

In: header

Query Parameters

limit?number

Query parameter "limit"

Default60
Rangevalue <= 60
offset?number

Query parameter "offset"

Default0
isFavorite?boolean

Query parameter "isFavorite"

Response Body

curl -X GET "https://api.v0.dev/v1/chats?limit=60&offset=0&isFavorite=true"
{
  "object": "list",
  "data": [
    {
      "id": "string",
      "object": "chat",
      "shareable": true,
      "privacy": "string",
      "title": "string",
      "updatedAt": "string",
      "favorite": true,
      "authorId": "string",
      "latestVersion": {
        "id": "string",
        "status": "pending"
      }
    }
  ]
}
{
  "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

List User Chats
curl -X GET "https://api.v0.dev/v1/chats" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

TypeScript SDK

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

// Get chat history
const chats = await v0.chats.find()

console.log(`Found ${chats.length} chats`)
chats.forEach(chat => {
  console.log(`${chat.id}: ${chat.message}`)
})

// Get favorite chats only
const favorites = await v0.chats.find({ favoriteOnly: true })