OpenAI GPT API Proxy 服务
为了更好的摸鱼和愉快的玩耍~
使用方法
将 api.openai.com
替换成 gpt.viki.moe
即可。
- api.openai.com
+ gpt.viki.moe
如果你使用 openai
的 npm 包,还可以这样操作:
openai v4 版本用法:
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: 'your api key',
baseURL: 'https://gpt.viki.moe/v1' // use proxy api
});
openai v3 版本用法:
import { Configuration, OpenAIApi } from 'openai' // ESM
// or use CommonJS
// const { Configuration, OpenAIApi } = require('openai')
const configuration = new Configuration({
apiKey: 'your openai api key here',
basePath: 'https://gpt.viki.moe/v1' // use proxy api
})
const openai = new OpenAIApi(configuration)
// do something with openai, such as ⬇️
// const { data } = await openai.createChatCompletion(...)