Skip to content

Instantly share code, notes, and snippets.

@charl-kruger
Last active July 10, 2025 07:09
Show Gist options
  • Select an option

  • Save charl-kruger/bc6d46823f4827ec919d3b073248eff1 to your computer and use it in GitHub Desktop.

Select an option

Save charl-kruger/bc6d46823f4827ec919d3b073248eff1 to your computer and use it in GitHub Desktop.
v0 API Swagger
openapi: 3.0.3
info:
title: V0 API
version: 1.1.0
description: |
Swagger spec generated from the v0 JavaScript client
**with concrete TypeScript definitions mapped to JSON-schema**.
servers:
- url: https://api.v0.dev/v1
security:
- BearerAuth: []
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT # opaque bearer token
###########################################################################
# SCHEMAS (request / response bodies)
###########################################################################
schemas:
## ------------------------------------------------------ Chats domain ##
ChatPrivacy:
type: string
enum: [public, private, team, team-edit, unlisted]
ChatLatestVersion:
type: object
properties:
id: { type: string }
status: { type: string, enum: [pending, completed, failed] }
required: [id, status]
ChatMessageMeta:
type: object
properties:
id: { type: string }
object: { type: string, enum: [message] }
content: { type: string }
createdAt: { type: string, format: date-time }
type:
type: string
enum:
- message
- refinement
- forked-block
- forked-chat
- open-in-v0
- added-environment-variables
- added-integration
- deleted-file
- moved-file
- renamed-file
- edited-file
- replace-src
- reverted-block
- fix-with-v0
- sync-git
required: [id, object, content, createdAt, type]
ChatDetail:
type: object
properties:
id: { type: string }
object: { type: string, enum: [chat] }
url: { type: string, format: uri }
shareable: { type: boolean }
privacy: { $ref: '#/components/schemas/ChatPrivacy' }
title: { type: string }
updatedAt: { type: string, format: date-time }
favorite: { type: boolean }
authorId: { type: string }
latestVersion: { $ref: '#/components/schemas/ChatLatestVersion' }
messages:
type: array
items: { $ref: '#/components/schemas/ChatMessageMeta' }
required: [id, object, url, shareable, favorite, authorId, messages]
ChatSummary:
type: object
properties:
id: { type: string }
object: { type: string, enum: [chat] }
shareable: { type: boolean }
privacy: { $ref: '#/components/schemas/ChatPrivacy' }
title: { type: string }
updatedAt: { type: string, format: date-time }
favorite: { type: boolean }
authorId: { type: string }
latestVersion: { $ref: '#/components/schemas/ChatLatestVersion' }
required: [id, object, shareable, privacy, updatedAt, favorite, authorId]
MessageFile:
type: object
properties:
lang: { type: string }
meta:
type: object
additionalProperties: true
source: { type: string }
required: [lang, source]
ModelConfiguration:
type: object
properties:
modelId:
type: string
enum: [v0-1.5-sm, v0-1.5-md, v0-1.5-lg]
imageGenerations: { type: boolean }
thinking: { type: boolean }
required: [modelId]
MessageDetail:
type: object
properties:
id: { type: string }
object: { type: string, enum: [message] }
chatId: { type: string }
url: { type: string, format: uri }
files:
type: array
items: { $ref: '#/components/schemas/MessageFile' }
demo: { type: string, format: uri }
text: { type: string }
modelConfiguration: { $ref: '#/components/schemas/ModelConfiguration' }
required: [id, object, chatId, url, text, modelConfiguration]
## ---------------------------------------------------- Projects domain ##
ProjectDetail:
type: object
properties:
id: { type: string }
object: { type: string, enum: [project] }
name: { type: string }
vercelProjectId: { type: string }
required: [id, object, name]
## ----------------------------------------------------- User / scopes ##
ScopeSummary:
type: object
properties:
id: { type: string }
object: { type: string, enum: [scope] }
name: { type: string }
required: [id, object]
UserDetail:
type: object
properties:
id: { type: string }
object: { type: string, enum: [user] }
name: { type: string }
email: { type: string, format: email }
avatar: { type: string, format: uri }
required: [id, object, email, avatar]
## ---------------------------------------------- Vercel integrations ##
VercelProjectDetail:
type: object
properties:
id: { type: string }
object: { type: string, enum: [vercel_project] }
name: { type: string }
required: [id, object, name]
## ------------------------------------------------ Rate-limit payload ##
RateLimitsFindResponse:
type: object
properties:
remaining: { type: integer }
reset: { type: integer }
limit: { type: integer }
required: [limit]
## ---------------------------------------------- Complex auth billing ##
UserTokenBilling:
type: object
properties:
billingType: { type: string, enum: [token] }
data:
type: object
properties:
plan: { type: string }
billingMode: { type: string, enum: [test] }
role: { type: string }
billingCycle:
type: object
properties:
start: { type: integer }
end: { type: integer }
required: [start, end]
balance:
type: object
properties:
remaining: { type: number }
total: { type: number }
required: [remaining, total]
onDemand:
type: object
properties:
balance: { type: number }
blocks:
type: array
items:
type: object
properties:
expirationDate: { type: integer }
effectiveDate: { type: integer }
originalBalance: { type: number }
currentBalance: { type: number }
required: [effectiveDate, originalBalance, currentBalance]
required: [billingType, data]
UserLegacyBilling:
type: object
properties:
billingType: { type: string, enum: [legacy] }
data:
type: object
properties:
remaining: { type: integer }
reset: { type: integer }
limit: { type: integer }
required: [limit]
required: [billingType, data]
## -------------------------------------------------- LIST WRAPPERS ##
List_ChatSummary:
type: object
properties:
object: { type: string, enum: [list] }
data:
type: array
items: { $ref: '#/components/schemas/ChatSummary' }
required: [object, data]
List_ProjectDetail:
type: object
properties:
object: { type: string, enum: [list] }
data:
type: array
items: { $ref: '#/components/schemas/ProjectDetail' }
required: [object, data]
List_VercelProjectDetail:
type: object
properties:
object: { type: string, enum: [list] }
data:
type: array
items: { $ref: '#/components/schemas/VercelProjectDetail' }
required: [object, data]
List_ScopeSummary:
type: object
properties:
object: { type: string, enum: [list] }
data:
type: array
items: { $ref: '#/components/schemas/ScopeSummary' }
required: [object, data]
## --------------------------------------------------- REQUEST SHAPES ##
ChatsCreateRequest:
type: object
properties:
message: { type: string }
attachments:
type: array
items:
type: object
properties:
url: { type: string, format: uri }
required: [url]
system: { type: string }
chatPrivacy: { $ref: '#/components/schemas/ChatPrivacy' }
projectId: { type: string }
modelConfiguration: { $ref: '#/components/schemas/ModelConfiguration' }
required: [message]
ChatsUpdateRequest:
type: object
properties:
privacy: { $ref: '#/components/schemas/ChatPrivacy' }
ChatsFavoriteRequest:
type: object
properties:
isFavorite: { type: boolean }
required: [isFavorite]
ChatsForkRequest:
type: object
properties:
versionId: { type: string }
ChatsCreateMessageRequest:
type: object
properties:
message: { type: string }
attachments:
type: array
items:
type: object
properties:
url: { type: string, format: uri }
required: [url]
modelConfiguration: { $ref: '#/components/schemas/ModelConfiguration' }
required: [message]
UploadFileRequest:
type: object
properties:
file:
type: string
format: binary
required: [file]
ProjectsCreateRequest:
type: object
properties:
name: { type: string }
description: { type: string }
icon: { type: string, format: uri }
environmentVariables:
type: array
items:
type: object
properties:
key: { type: string }
value: { type: string }
required: [key, value]
instructions: { type: string }
required: [name]
ProjectsAssignRequest:
type: object
properties:
chatId: { type: string }
required: [chatId]
IntegrationsVercelProjectsCreateRequest:
type: object
properties:
projectId: { type: string }
name: { type: string }
required: [projectId, name]
## -------------------------------------------------- RESPONSE SHAPES ##
ChatsCreateResponse: { $ref: '#/components/schemas/MessageDetail' }
ChatsFindResponse: { $ref: '#/components/schemas/List_ChatSummary' }
ChatsDeleteResponse:
type: object
properties:
id: { type: string }
object: { type: string, enum: [chat] }
deleted: { type: boolean, enum: [true] }
required: [id, object, deleted]
ChatsFavoriteResponse:
type: object
properties:
id: { type: string }
object: { type: string, enum: [chat] }
favorited: { type: boolean }
required: [id, object, favorited]
ChatsForkResponse: { $ref: '#/components/schemas/ChatDetail' }
ChatsGetByIdResponse: { $ref: '#/components/schemas/ChatDetail' }
ChatsUpdateResponse: { $ref: '#/components/schemas/ChatDetail' }
ChatsCreateMessageResponse: { $ref: '#/components/schemas/MessageDetail' }
ChatsFindIframeResponse:
type: object
properties:
id: { type: string }
object: { type: string, enum: [iframe] }
url: { type: string, format: uri }
required: [id, object, url]
ChatsGetVersionFrameTokenResponse:
type: object
properties:
token: { type: string }
required: [token]
ChatsGetMetadataResponse:
type: object
properties:
git:
type: object
properties:
branch: { type: string }
commit: { type: string }
required: [branch, commit]
deployment:
type: object
properties:
id: { type: string }
required: [id]
project:
type: object
properties:
id: { type: string }
name: { type: string }
url: { type: string, format: uri }
required: [id, name, url]
required: [git, deployment, project]
ChatsUploadResponse:
type: object
properties:
url: { type: string, format: uri }
required: [url]
ChatsResumeResponse: { $ref: '#/components/schemas/MessageDetail' }
DeploymentsFindLogsResponse:
type: object
properties:
error: { type: string }
logs:
type: array
items: { type: string }
nextSince: { type: integer }
required: [logs]
DeploymentsFindErrorsResponse:
type: object
properties:
error: { type: string }
fullErrorText: { type: string }
errorType: { type: string }
formattedError: { type: string }
IntegrationsVercelProjectsFindResponse:
$ref: '#/components/schemas/List_VercelProjectDetail'
IntegrationsVercelProjectsCreateResponse:
$ref: '#/components/schemas/VercelProjectDetail'
ProjectsFindResponse:
$ref: '#/components/schemas/List_ProjectDetail'
ProjectsCreateResponse: { $ref: '#/components/schemas/ProjectDetail' }
ProjectsGetByChatIdResponse: { $ref: '#/components/schemas/ProjectDetail' }
ProjectsAssignResponse:
type: object
properties:
object: { type: string, enum: [project] }
id: { type: string }
assigned:{ type: boolean, enum: [true] }
required: [object, id, assigned]
UserGetResponse: { $ref: '#/components/schemas/UserDetail' }
UserGetBillingResponse:
oneOf:
- $ref: '#/components/schemas/UserTokenBilling'
- $ref: '#/components/schemas/UserLegacyBilling'
UserGetPlanResponse:
type: object
properties:
object: { type: string, enum: [plan] }
plan: { type: string }
billingCycle:
type: object
properties:
start: { type: integer }
end: { type: integer }
required: [start, end]
balance:
type: object
properties:
remaining: { type: number }
total: { type: number }
required: [remaining, total]
required: [object, plan, billingCycle, balance]
UserGetScopesResponse:
$ref: '#/components/schemas/List_ScopeSummary'
###########################################################################
# PATHS
###########################################################################
paths:
/chats:
post:
tags: [Chats]
summary: Create a chat
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsCreateRequest' }
responses:
'200':
description: Chat created (first message returned)
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsCreateResponse' }
get:
tags: [Chats]
summary: List chats
parameters:
- { in: query, name: limit, schema: { type: integer, minimum: 1 } }
- { in: query, name: offset, schema: { type: integer, minimum: 0 } }
- { in: query, name: isFavorite, schema: { type: boolean } }
responses:
'200':
description: A page of chat summaries
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsFindResponse' }
/chats/{chatId}:
parameters:
- { in: path, name: chatId, required: true, schema: { type: string } }
get:
tags: [Chats]
summary: Get a chat
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsGetByIdResponse' }
delete:
tags: [Chats]
summary: Delete a chat
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsDeleteResponse' }
patch:
tags: [Chats]
summary: Update chat privacy
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsUpdateRequest' }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsUpdateResponse' }
/chats/{chatId}/favorite:
put:
tags: [Chats]
summary: Favorite / un-favorite
parameters:
- { in: path, name: chatId, required: true, schema: { type: string } }
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsFavoriteRequest' }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsFavoriteResponse' }
/chats/{chatId}/fork:
post:
tags: [Chats]
summary: Fork a chat
parameters:
- { in: path, name: chatId, required: true, schema: { type: string } }
requestBody:
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsForkRequest' }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsForkResponse' }
/chats/{chatId}/messages:
post:
tags: [Chats]
summary: Add a message
parameters:
- { in: path, name: chatId, required: true, schema: { type: string } }
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsCreateMessageRequest' }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsCreateMessageResponse' }
/chats/{chatId}/messages/{messageId}/resume:
post:
tags: [Chats]
summary: Resume a streamed msg/tool-call
parameters:
- { in: path, name: chatId, required: true, schema: { type: string } }
- { in: path, name: messageId, required: true, schema: { type: string } }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsResumeResponse' }
/chats/{chatId}/upload:
post:
tags: [Chats]
summary: Upload a file
parameters:
- { in: path, name: chatId, required: true, schema: { type: string } }
requestBody:
required: true
content:
multipart/form-data:
schema: { $ref: '#/components/schemas/UploadFileRequest' }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsUploadResponse' }
/chats/{chatId}/metadata:
get:
tags: [Chats]
summary: Chat dev metadata
parameters:
- { in: path, name: chatId, required: true, schema: { type: string } }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsGetMetadataResponse' }
/chats/{chatId}/versions/{versionId}/iframe:
get:
tags: [Chats]
summary: Iframe HTML for a version
parameters:
- { in: path, name: chatId, required: true, schema: { type: string } }
- { in: path, name: versionId, required: true, schema: { type: string } }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsFindIframeResponse' }
/chats/{chatId}/versions/{versionId}/frame-token:
get:
tags: [Chats]
summary: Frame token
parameters:
- { in: path, name: chatId, required: true, schema: { type: string } }
- { in: path, name: versionId, required: true, schema: { type: string } }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ChatsGetVersionFrameTokenResponse' }
###########################################################################
# Projects
###########################################################################
/projects:
get:
tags: [Projects]
summary: List projects
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ProjectsFindResponse' }
post:
tags: [Projects]
summary: Create project
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/ProjectsCreateRequest' }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ProjectsCreateResponse' }
/chats/{chatId}/project:
get:
tags: [Projects]
summary: Project for chat
parameters:
- { in: path, name: chatId, required: true, schema: { type: string } }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ProjectsGetByChatIdResponse' }
/projects/{projectId}/assign:
post:
tags: [Projects]
summary: Assign chat → project
parameters:
- { in: path, name: projectId, required: true, schema: { type: string } }
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/ProjectsAssignRequest' }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/ProjectsAssignResponse' }
###########################################################################
# Deployments
###########################################################################
/deployments/{deploymentId}/logs:
get:
tags: [Deployments]
summary: Deployment logs
parameters:
- { in: path, name: deploymentId, required: true, schema: { type: string } }
- { in: query, name: since, schema: { type: string } }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/DeploymentsFindLogsResponse' }
/deployments/{deploymentId}/errors:
get:
tags: [Deployments]
summary: Deployment errors
parameters:
- { in: path, name: deploymentId, required: true, schema: { type: string } }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/DeploymentsFindErrorsResponse' }
###########################################################################
# Integrations – Vercel
###########################################################################
/integrations/vercel/projects:
get:
tags: [Integrations]
summary: Linked Vercel projects
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/IntegrationsVercelProjectsFindResponse' }
post:
tags: [Integrations]
summary: Link a Vercel project
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/IntegrationsVercelProjectsCreateRequest' }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/IntegrationsVercelProjectsCreateResponse' }
###########################################################################
# Rate Limits
###########################################################################
/rate-limits:
get:
tags: [RateLimits]
summary: Remaining quota
parameters:
- { in: query, name: scope, schema: { type: string } }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/RateLimitsFindResponse' }
###########################################################################
# User
###########################################################################
/user:
get:
tags: [User]
summary: Profile
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/UserGetResponse' }
/user/billing:
get:
tags: [User]
summary: Billing
parameters:
- { in: query, name: scope, schema: { type: string } }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/UserGetBillingResponse' }
/user/plan:
get:
tags: [User]
summary: Subscription plan
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/UserGetPlanResponse' }
/user/scopes:
get:
tags: [User]
summary: Granted scopes
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/UserGetScopesResponse' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment