Project Setup

In this session, we'll be exploring the fundamentals of the Vercel AI SDK.

Let's start by setting up our project.

Clone the following repository locally.

git clone https://github.com/nicoalbanese/ai-sdk-fundamentals.git
cd ai-sdk-fundamentals

Check out the starter branch.

git checkout starter

Install packages using your preferred package manager.

npm install

Copy the .env.example and rename it to .env.

cp .env.example .env

Add your OpenAI API Key to your .env file.

OPENAI_API_KEY=sk-*****-*************

Run the following command in your terminal.

npx tsx core/index.ts

You should see your OpenAI API Key outputted to the terminal.

Great! You are now ready to go!