Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Use DALL · E to generate images and return 401. How to solve this problem #17

Discussion options

You must be logged in to vote

Hi there @djy22032626,

An 401 Unauthorized error response typically indicates that your OpenAI API key is not valid or has expired.

Could you please copy and paste the code snippet that you are using to instantiate and query the API?

Have you gone to https://platform.openai.com/account/api-keys and created an API key, and then used that API key in your code?

Are you using the recommended OPENAI_API_KEY environment variable, and is the value of that variable a valid API key from your Account API Keys screen?

Thanks,

James

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by thejamescollins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants