Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 727 Bytes

README.md

File metadata and controls

28 lines (22 loc) · 727 Bytes

Deno OpenAI proxy

很多VPS代理OpenAI api被封,可以采用Deno Deploy免费服务来做代理,可以在国内直接访问。

一键部署

调用示例

const axios = require('axios')

axios.post("https://xxx.deno.dev/v1/chat/completions", {
  "model": "gpt-3.5-turbo",
  "messages": [{ "role": "user", "content": "Hello!" }],
  "stream": true
}, {
  responseType: "stream",
  headers: {
    "Authorization": 'Bearer $OPENAI_API_KEY'
  }
}).then(resp => {
  resp.data.on("data", (chunk) => {
    console.log(chunk.toString())
  })
})