小编Das*_* CO的帖子

OpenAI GPT-3 API 错误:“无效 URL (POST /v1/chat/completions)”

这是我的代码片段:

const { Configuration, OpenAI, OpenAIApi } = require ("openai");
const configuration = new Configuration({
    apiKey: 'MY KEY'
})

const openai = new OpenAIApi(configuration)

async function start() {
    const response = await openai.createChatCompletion({
        model:"text-davinci-003",
        prompt: "Write a 90 word essay about Family Guy",
        temperature: 0,
        max_tokens: 1000
    })

    console.log(response.data.choices[0].text)
}

start()
Run Code Online (Sandbox Code Playgroud)

当我跑步时:node index

我遇到这个问题:

data: {
      error: {
        message: 'Invalid URL (POST /v1/chat/completions)',
        type: 'invalid_request_error',
        param: null,
        code: null
      }
    }
  },
  isAxiosError: true,
  toJSON: [Function: toJSON]
}
Run Code Online (Sandbox Code Playgroud)

Node.js …

node.js openai-api gpt-3

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

gpt-3 ×1

node.js ×1

openai-api ×1