各位佬,newapi里面,比如我用gpt-4o模型,但是它返回图片是空,我让他描述一下,他给我直接返回空回复,如下:
我想问下这个curl各位佬是怎么写的呐,chat都可以呢
参考 OpenAI 官方文档
URL前面怎么有个$符号
把$去掉,newapi是支持图片链接的
亲我去了,还是不行哈。
大佬我也发现了,但还是不行哈
把图片转成base64再试试
这个可以哈,但是不支持url
换个图链?我昨天才试了newapi是支持这个的
还真是渠道不正经
佬,换了也不是太行哈,base64可以的。
哪家的啊,避雷,如果是公益那就另说
佬,方便发下你这个curl嘛,我瞎整的,公益。哈哈
curl https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer sk-xxxx" \
-H "Content-Type: application/json" \
-H "Accept: */*" \
-H "Cache-Control: no-cache" \
-H "Postman-Token: 35f11450-f9b8-40ef-b782-017c16647304" \
-H "Host: api.openai.com" \
-H "Accept-Encoding: gzip, deflate, br" \
-H "Connection: keep-alive" \
-H "Content-Length: 656" \
-H "Cookie: __cf_bm=6LCQO8loegkL_O8SUW92NTruumGI9N37hWgBVKmKmPI-1736129516-1.0.1.1-cYJSIGacHaFEfNzkR0iapqmpZo7sXol0Q.mP0OGxZaraseRen1vBQ4potolS.vveL.ri6.0vrhV22e0fcCjV.w; _cfuvid=O21FDlmc1UqLR8m_AI0BUO7HMyKzEAT4xwXARcjzOcI-1736129516443-0.0.1.1-604800000" \
-d '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "描述这张图片的内容"
},
{
"type": "image_url",
"image_url": {
"url": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
}
}
]
}
],
"stream": false,
"model": "gpt-4o",
"temperature": 1,
"presence_penalty": 0,
"frequency_penalty": 0,
"top_p": 1
}'
有一些请求头不需要可以去掉
curl https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer sk-xxxx" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "描述这张图片的内容"
},
{
"type": "image_url",
"image_url": {
"url": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
}
}
]
}
],
"stream": false,
"model": "gpt-4o",
"temperature": 1,
"presence_penalty": 0,
"frequency_penalty": 0,
"top_p": 1
}'
对,基本的curl就可以过哈
佬友可以啊,是在做漫画汉化吗