> ## Documentation Index
> Fetch the complete documentation index at: https://sferadev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# v0-api

> Type-safe v0 API client

A type-safe API client for the [v0 by Vercel](https://v0.dev) API, auto-generated from the official OpenAPI specification with full TypeScript support.

## Features

* **Type-Safe** - Full TypeScript support with auto-generated types from OpenAPI spec
* **Zod Schemas** - Runtime validation with Zod schemas for all API types
* **Auto-Updated** - Daily regeneration from upstream OpenAPI specs

## Installation

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm add v0-api
  ```

  ```bash npm theme={null}
  npm install v0-api
  ```

  ```bash yarn theme={null}
  yarn add v0-api
  ```
</CodeGroup>

## Usage

### Basic Usage

```typescript theme={null}
import { createClient } from "v0-api";

const client = createClient({
  baseUrl: "https://api.v0.dev",
  headers: {
    Authorization: `Bearer ${process.env.V0_TOKEN}`,
  },
});

// List projects
const projects = await client.getProjects();

// Generate a component
const generation = await client.createGeneration({
  prompt: "Create a login form with email and password",
});
```

### Type Exports

```typescript theme={null}
import type { Types } from "v0-api";

// Use TypeScript types for your application
type Project = Types.Project;
type Generation = Types.Generation;
```

### Zod Schemas

```typescript theme={null}
import { Schemas } from "v0-api";

// Validate API responses at runtime
const projectSchema = Schemas.project;
const validated = projectSchema.parse(response);
```

## API Reference

The client exposes v0 API endpoints for AI-powered component generation and project management.
