
---
title: Quickstart
description: Get started with the v0 Platform API in minutes
product: Platform API
type: guide
related:
  - /docs/api/platform/overview
  - /docs/api/platform/packages/v0-sdk
---

# Quickstart



## v0 SDK [#v0-sdk]

The v0 SDK is a TypeScript library that makes it simple to interact with the v0 Platform API.

## Installation [#installation]

```bash
pnpm add v0-sdk
```

## Authentication [#authentication]

Get your API key from your [v0 account settings](https://v0.app/chat/settings/keys) and set it as an environment variable:

Add your API key to `.env`:

```bash
V0_API_KEY=your_api_key_here
```

The SDK automatically uses the `V0_API_KEY` environment variable:

```typescript
import { v0 } from 'v0-sdk'

// No initialization needed - uses V0_API_KEY automatically
```

## Use Case 1: Get a Chat URL for Iframe Embedding [#use-case-1-get-a-chat-url-for-iframe-embedding]

Create a chat and embed it directly in your application:

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

// Use the Demo URL in an iframe
<iframe
  src={chat.latestVersion?.demoUrl}
  width="100%"
  height="600">
</iframe>
```

## Use Case 2: Get Generated Files [#use-case-2-get-generated-files]

Create a chat and access the generated code files:

```typescript
// Create a chat
const chat = await v0.chats.create({
  message: 'Build a todo app with React and TypeScript',
})

// Access the generated files
chat.latestVersion?.files?.forEach((file) => {
  console.log(`File: ${file.name}`)
  console.log(`Content: ${file.content}`)
})
```

## Continue the Conversation [#continue-the-conversation]

Add follow-up messages to refine the output:

```typescript
// Add a follow-up message
const response = await v0.chats.sendMessage({
  chatId: chat.id,
  message: 'Add dark mode support',
})
```

That's it! You now have everything you need to integrate v0's AI-powered code generation into your application.
