1.首先根据该教程创建反代API:https://zhuanlan.zhihu.com/p/622765456?utm_medium=social&utm_oi=684515770554257408&utm_psn=1632372159883579392&utm_source=wechat_session

2.搭建好FastGPT

3.测试反代API是否可用: curl https://你的反代API/v1/images/generations \ -H "Content-Type: application/json" \ -H "Authorization: Bearer sk-xxxxx" \ -d '{ "prompt": "A cute baby sea otter", "n": 2, "size": "1024x1024" }'

3.修改node_modules\openai\base.ts以及F:\FastGPT\node_modules\openai\dist\base.js这两个文件中的https://api.openai.com/v1,将其修改成https://你的反代api/v1

注意:修改前请确保api可用,如果速度过慢的话可以参考以下教程优选CF的IP: https://github.com/XIU2/CloudflareSpeedTest