agentic icon indicating copy to clipboard operation
agentic copied to clipboard

getting 401 with `new ChatGPTAPIBrowser({ ...openAIAuth })`

Open KeyToLove opened this issue 2 years ago • 0 comments

Verify latest release

  • [X] I verified that the issue exists in the latest chatgpt release

Verify webapp is working

  • [X] I verify that the ChatGPT webapp is working properly for this account.

Environment details

image

Describe the Bug

// index.js
import { ChatGPTAPIBrowser, getOpenAIAuth } from 'chatgpt'
import * as dotenv from 'dotenv'
dotenv.config()

const demo = async () => {
  const openAIAuth = await getOpenAIAuth({
    email: process.env.OPENAI_EMAIL,
    password: process.env.OPENAI_PASSWORD,
  })

  const api = new ChatGPTAPIBrowser({ ...openAIAuth })
  await api.initSession()
}
demo()

i just run this demo by Node

node index.js

after then, I've actually logged in to the automatically open chrome image

but the terminal threw the following error image Did I use something wrong?

KeyToLove avatar Jan 14 '23 06:01 KeyToLove