The first hour of building on v0's Platform API
The core is solid. The spec, the generated types, the React package and the docs disagree with each other, and you hit every one of those gaps on day one.
Most people know v0 as the site where you type a prompt and get a UI back. There's also a whole developer side now: a Platform API, an SDK, a React package for showing v0 chats inside your own app, and a starter template. I wanted to see what the first hour on that side feels like, so I set up a project with my own API key and started building.
This is that hour, in the order things went wrong. At the end there's a short list of what I'd change if I worked on v0.
Picking the package
The first question is which package to install, and it's a real question. The current SDK is called v0 and talks to API v2. The old one, v0-sdk, talks to v1 and hasn't shipped since August 3. The old one still gets more than twice the installs:
Show the data
| Week of | v0-sdk | v0 |
|---|---|---|
| Jul 27 | 47097 | 7171 |
| Aug 3 | 33531 | 7692 |
| Aug 10 | 31976 | 8558 |
| Aug 17 | 35489 | 8969 |
| Aug 24 | 36083 | 17256 |
| Aug 31 | 35805 | 23334 |
| Sep 7 | 26267 | 20476 |
| Sep 14 | 34659 | 24011 |
| Sep 21 | 48442 | 25736 |
| Sep 28 | 58563 | 26584 |
| Oct 5 | 51591 | 26132 |
| Oct 12 | 44167 | 22652 |
| Oct 19 | 40666 | 30298 |
| Oct 26 | 74102 | 45227 |
| Nov 2 | 61512 | 48304 |
| Nov 9 | 88095 | 37614 |
v0-sdk and 37,614 for v0.Some of that is old lockfiles that will never move, and that's fine. The problem is that nothing tells a new person to move. v0-sdk isn't marked deprecated, so npm never prints a warning. Its README doesn't mention v0 or v2 at all. The "Migrating from v1 to v2" guide covers the endpoints but never says the package changed names, or that errors went from being thrown to coming back as { data, error, response }. The code samples just start importing from 'v0' without saying so.
The first call
Before I'd set the key, I ran my first request anyway, like everyone does. The new SDK falls back to Vercel OIDC when there's no V0_API_KEY. That's nice once you're deployed on Vercel. On your laptop it means the error talks about something else entirely:
v0 4.0.1
VercelOidcTokenError: The 'x-vercel-oidc-token' header is missing from the request. Unable to find project root directory. Have you linked your project with `vc link?`
v0-sdk 0.16.7, the old one
Error: API key is required. Provide it via config.apiKey or V0_API_KEY environment variable
The old message was better. The new one tells you to link a Vercel project when all you needed was one line in .env.local. It's also not consistent. A missing key throws, so it skips the if (result.error) check the README teaches you to write. An empty key sends no auth header and comes back as a normal 401 result. And if you're coming from the old SDK and pass apiKey, TypeScript catches it, but plain JavaScript ignores it and you're back to the OIDC error. @v0-sdk/ai-tools does take apiKey, so the two packages don't even agree on the option's name.
Copying the docs
The v2 docs are mostly good. I type-checked the code examples against v0@4.0.1 and 51 of 55 compiled, which is better than most docs I've tried this with. One of the four that didn't was the most basic one, listing a chat's messages:
$ v0.messages.list({ chatId: 'chat_abc123' }) error TS2741: Property 'limit' is missing in type '{ chatId: string; }' but required in type '{ chatId: string; limit: number; cursor?: string }'.
Run it anyway and it works. With my key, messages.list with no limit came back with the chat's messages, so the server and the docs agree and the types are the odd one out. The cause is in the OpenAPI spec. limit is marked required and also has a default of 20, which doesn't make sense for something you send. I found six fields like that. My guess is the schema was exported from the response types, where a default really does make a field always present. GET /chats declares the same limit correctly, as optional with a default.
Two other reference examples look like they were filled in with placeholders. Create Webhook sends "events": "example" where the API wants an array of event names, and Create MCP Server sends "auth": "none" where it wants { "type": "none" }. Both come back as a 422 if you copy them as written.
The first error
That 422 is where it gets frustrating. The spec says every error body is { message: string }, and the README handles errors with throw new Error(result.error.message). A validation error doesn't have a message. These are real responses from my account:
- You call
v0.chats.create({ message: "" })- The API answers
422 {"type":"validation","on":"body","found":{"message":""}}result.error.messageundefined- The README's handler throws
Error, with nothing to say what went wrong
So the error you'll hit most while building is the one that throws an Error with nothing in it. The body echoes your input back under found, but never says which field was wrong or why. For the webhook example you get the four fields you sent, and it's on you to figure out that events should be an array. Other errors are fine. Ask for a chat that doesn't exist and you get Chat not found, which is exactly what you want.
Two smaller things nearby. Most POST endpoints check the body before they check auth, so with no key at all you get this same empty 422 and not a 401. And an unknown route returns a plain-text NOT_FOUND, which the SDK hands you as error even though the type says it's an object.
The React package
@v0-sdk/react renders v0 messages in your own app. It's small, ships ESM and CJS, and server-renders cleanly, so I liked it until I trusted autocomplete. The type declarations do export * from "v0/browser", but the JavaScript doesn't re-export anything from it. The types list 54 values you can import, and only 13 of them exist at runtime.
So import { readV0Stream, createDesignModeBridge } from "@v0-sdk/react" type-checks fine and then fails when it runs:
SyntaxError: The requested module '@v0-sdk/react' does not provide an export named 'createDesignModeBridge'
In CommonJS it's worse, because the names are just undefined and you only find out when you call one. The fix is one word in the declarations, export type *, or actually re-exporting the values.
The old docs make this harder. Three v1 pages are still live and still in the sitemap, and they tell you to npm install @v0-sdk/react v0-sdk with no version. That gets you 4.0.1, which removed the components those pages use (StreamingMessage, CodeBlock, ThinkingSection and 12 more) back in 3.0.0. The v1 AI tools page also tells you to install two packages that were never published:
$ npm view @v0-sdk/langchain-tools version npm error code E404 $ npm view @v0-sdk/openai-functions version npm error code E404
And the v2 page says the AI tools come in four categories when the package has seven: chats, mcpServers, messages, securityChecks, settings, usage and webhooks.
Scaffolding an app
Last was the starter. create-v0-sdk-app is honestly nice. Every option has a flag, it finished in about 17 seconds without asking me anything, and the generated monorepo built and type-checked before I'd even added a .env.local. Then I ran npm audit:
Success! Created my-app $ npm run build → 2 successful $ npm run typecheck → 2 successful $ npm audit 8 vulnerabilities (5 high, 3 critical)
Both apps in the template pin "next": "16.2.4" exactly. That version has 34 GitHub advisories, and several were fixed in 16.2.5 back in May. The template shipped November 12, six months later, and because the pin is exact, npm update won't fix it either. For a template people clone and deploy as is, that's the wrong default.
What I’d change if I worked on v0
None of this is a criticism of the core. The API itself is solid. The result type is good, auth errors are the same on every endpoint, and the specs are public. Everything above lives in the gaps between the spec, the generated types, the packages and the docs. Here's the order I'd tackle it in:
- Give 422s a message. Something like
{ message, issues: [{ path, reason }] }. Everyone hits this on day one, and it costs the most time each time. - Fix the six required-with-default fields in the spec. The SDK types get fixed for free, along with any other client generated from the spec.
- Change
export *toexport type *in@v0-sdk/react. It's one line, and right now it's a crash at import time. - Deprecate
v0-sdkon npm and put a banner on the v1 pages. Onenpm deprecatecommand would point most people the right way. - Mention
V0_API_KEYin the no-credentials error. "No v0 credentials. Set V0_API_KEY or pass auth. On Vercel, OIDC is used automatically." - Use caret ranges for Next.js in the starter, or let Renovate keep it current.