Bin-Huang / chatbox

User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)
https://chatboxai.app
GNU General Public License v3.0
20.73k stars 2.1k forks source link

自定义API在mac正常使用,ios和网页端均失败 #1469

Open vimyang opened 1 month ago

vimyang commented 1 month ago

mac正常使用,通过curl也可以正常使用

curl --location 'http://141.11.251.8:8080/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
     "model": "gpt-4o-mini",
     "messages": [{"role": "user", "content": "Say this is a test!"}],
     "stream": true
   }'

image

通过ios,使用相同的api和model报错,在网页端一样,以下均截图网页版

image

直接复制curl命令,可以正常访问

image
vimyang commented 1 month ago

找到问题了,目标接口不支持跨域访问,导致通过curl可以访问,但是网页不可以访问。