Getting Started

Start building with eval0 in minutes

1Install Package

command line
npm install eval0

2Add OpenAI API Key

.env.local
OPENAI_API_KEY=your-api-key-here

Get your API key from OpenAI's dashboard

3Usage Example

app/api/eval0/route.ts
import { eval0 } from 'eval0'
import { NextResponse } from 'next/server'

export async function POST() {
  try {
   
    const { value } = await eval0(
      "Create a React button component"
    )

    return NextResponse.json(value)   
  } catch (error) {
    return NextResponse.json({ error: error.message }, { status: 500 })
  }
}

Features

  • Generate React components with Tailwind CSS
  • Create optimized SVG icons and animations
  • Schema validation with Zod
  • Type-safe responses