Skip to content

The OPENAI_API_KEY environment variable is missing or empty when deploy the project on vercel #53

Description

@qingtian1771

I add and .env file and change the content, but when I deploy the project to vercel, the project build successful, but I got following error when I access the web page.

Error: The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).
at (node_modules/openai/index.mjs:26:0)
at (app/function-calling.tsx:4:15)
at (webpack/bootstrap:21:0)
at (app/action.tsx:383:8)
at (webpack/bootstrap:21:0)
at (node_modules/next/dist/esm/server/lib/app-dir-module.js:10:0)
at (node_modules/next/dist/esm/lib/metadata/resolve-metadata.js:238:0)
at (node_modules/next/dist/esm/lib/metadata/resolve-metadata.js:290:0)
at (node_modules/next/dist/esm/lib/metadata/resolve-metadata.js:476:0)
at (node_modules/next/dist/esm/lib/metadata/metadata.js:39:0)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions