Create Chat From Template
Creates a new chat from a v0 template, the same way opening it from v0.app/templates does.
Usage
import { v0 } from 'v0'const result = await v0.chats.createFromTemplate({ templateId: 'id_abc123',})console.log(result)API Signature
Request
Request Body
ID of the v0 template to start from, as shown in its v0.app/templates URL.
- Minimum length:
- 1
Visibility setting for the new chat.
Title for the new chat.
Arbitrary key-value data to attach to the chat.
Response
Unique chat identifier.
Chat title, if generated.
Visibility setting of the chat.
ISO timestamp of when the chat was created.
ISO timestamp of when the chat was last updated.
ID of the user who created the chat.
Associated Vercel project ID, if any.
User-defined key-value metadata.
Whether the caller has write access to this chat.
Model, token usage, and credit cost for the prompt.
Model identifier used for the assistant message, or null when not applicable or unavailable.
Token counts for this message.
Prompt input value (non-cached).
Completion output value.
Cache-read input value.
Cache-write input value.
Sum of input, output, cacheRead, and cacheWrite.
Credit cost for this message.
Prompt input value (non-cached).
Completion output value.
Cache-read input value.
Cache-write input value.
Sum of input, output, cacheRead, and cacheWrite.