Generate an API key
Create an account at https://app.baserun.ai/sign-up. Then generate an API key for your project in the settings tab and set it as an environment variable.
Example
In this example, we’re using Vercel’s ai npm package to stream the result of an OpenAI chat completion to the client. Note, that Baserun doesn’t supportexport const runtime = "edge";, we we’re keeping this in an ordinary Lambda function deployed by Vercel.
./app/api/chat/route.ts