chatgpt 4V 识图功能

1.获取图片的sig和file_id

2e0edc6e489ed13a3f32f0dd87527d77.jpg是本地图片的名字

头部认证信息自己F12 抓取

复制代码
1.获取图片的sig

https://chat.openai.com/backend-api/files

Authorization:Bearer eyJhbGc****************5V-lztYwLb9hr6LP7g
Cookie:  *************************D


{"file_name":"2e0edc6e489ed13a3f32f0dd87527d77.jpg","file_size":51010,"use_case":"multimodal"}

返回{
    "status": "success",
    "upload_url": "https://fileserviceuploadsperm.blob.core.windows.net/files/file-KVRbTP1Xy0NP1WKKZRDKSPL1?se=2023-10-16T11%3A24%3A03Z&sp=c&sv=2021-08-06&sr=b&sig=oXzcBB7Q8HWyZr6JUSbuUYtgwgOWVdia7EiO8ALBe%2Bw%3D",
    "file_id": "file-KVRbTP1Xy0NP1WKKZRDKSPL1"
}

2.上传二进制图片

复制代码
https://fileserviceuploadsperm.blob.core.windows.net/files/file-KVRbTP1Xy0NP1WKKZRDKSPL1?se=2023-10-16T11%3A24%3A03Z&sp=c&sv=2021-08-06&sr=b&sig=oXzcBB7Q8HWyZr6JUSbuUYtgwgOWVdia7EiO8ALBe%2Bw%3D


Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
Connection: keep-alive

Content-Type: image/jpeg
Host: fileserviceuploadsperm.blob.core.windows.net
Origin: https://chat.openai.com
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.60
sec-ch-ua: "Microsoft Edge";v="117", "Not;A=Brand";v="8", "Chromium";v="117"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
x-ms-blob-type: BlockBlob
x-ms-version: 2020-04-08
无返回

3.put图片

复制代码
https://fileserviceuploadsperm.blob.core.windows.net/files/file-KVRbTP1Xy0NP1WKKZRDKSPL1?se=2023-10-16T11%3A24%3A03Z&sp=c&sv=2021-08-06&sr=b&sig=oXzcBB7Q8HWyZr6JUSbuUYtgwgOWVdia7EiO8ALBe%2Bw%3D
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
Connection: keep-alive
Content-Length: 51010
Content-Type: image/jpeg
Host: fileserviceuploadsperm.blob.core.windows.net
Origin: https://chat.openai.com
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.60
sec-ch-ua: "Microsoft Edge";v="117", "Not;A=Brand";v="8", "Chromium";v="117"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
x-ms-blob-type: BlockBlob
x-ms-version: 2020-04-08

form-data
本地图片地址

4.上传二进制图片

复制代码
4.上传二进制图片
https://chat.openai.com/backend-api/files/file-KVRbTP1Xy0NP1WKKZRDKSPL1/uploaded

Authorization:Bearer eyJ*****tYwLb9hr6LP7g
Cookie:  *HS%2BvXw%3D

提交空
{}

返回
{
    "status": "success",
    "download_url": "https://fileserviceuploadsperm.blob.core.windows.net/files/file-KVRbTP1Xy0NP1WKKZRDKSPL1?se=2023-10-16T11%3A34%3A11Z&sp=r&sv=2021-08-06&sr=b&rscd=attachment%3B%20filename%3D2e0edc6e489ed13a3f32f0dd87527d77.jpg&sig=LJbEvMeV6KtlkTi6Y1udDd%2BK3YSbgfUWnsGCEi5rGSs%3D",
    "metadata": null
}

5.和chatgpt问题绑定,提问

复制代码
https://chat.openai.com/backend-api/conversation
Authorization:Bearer eyJhbGciOiJSU******%3D


{
	"action": "next",
	"messages": [{
		"id": "aaa27270-f62e-454a-962c-f62794152450",
		"author": {
			"role": "user"
		},
		"content": {
			"content_type": "multimodal_text",
			"parts": [{
				"asset_pointer": "file-service://file-KVRbTP1Xy0NP1WKKZRDKSPL1",
				"size_bytes": 239505,
				"width": 1706,
				"height": 1280
			}, "再看看"]
		},
		"metadata": {}
	}],
	"conversation_id": "41181b17-b71d-4748-8db5-3a80d7a27a33",
	"parent_message_id": "49bd950f-372f-45f6-9f72-b6f27fa04373",
	"model": "gpt-4",
	"timezone_offset_min": -480,
	"suggestions": [],
	"history_and_training_disabled": false,

	"force_paragen": false
}

返回答案
相关推荐
xiaoye-duck2 天前
《C++ 项目:手写大模型接入 SDK》ChatGPT接口设计(下):流式响应实现和测试
网络·c++·语言模型·chatgpt
奈落243 天前
Codex 并进 ChatGPT 之后,“编程智能体“是变浅了还是变顺了:从官方概览页的功能分工到五家公司开发者反馈,读一次产品化合并的得与失
人工智能·chatgpt·工作流·ai 编程
xiaoye-duck3 天前
《C++ 项目:手写大模型接入 SDK》ChatGPT接口设计(中):全量响应实现和测试
网络·c++·语言模型·chatgpt
孤狼GPT3 天前
ChatGPT、Codex数据库实战:MyBatis-Plus第一页查询正常,翻到第10000页为什么越来越慢?
mysql·chatgpt·mybatis-plus·codex·深分页
jerrywus4 天前
普通人怎么用 Codex:从表格、文件和小工具开始
chatgpt·agent·mcp
仙逆GPT5 天前
ChatGPT、Codex工程实战:Agent接入企业知识库,文档明明更新了,为什么回答还是旧版本?
chatgpt·codex·rag·企业知识库·ai agent
lucas_AI5 天前
「无限 Codex」白嫖项目终结?OpenAI 12 月起把 ChatGPT 与 Codex 额度合成一个池子
chatgpt·openai
孤狼GPT5 天前
ChatGPT、Codex工程实战:Spring Boot的SSE一直在推送,为什么经过Nginx后前端才一次性显示?
spring boot·chatgpt·sse·codex·chatgptplus
孤狼GPT5 天前
ChatGPT、Codex性能实战:MySQL升级到8.0后,SQL没改,为什么接口P99反而翻倍?
spring boot·chatgpt·sql优化·codex·mysql8.0
山顶夕景6 天前
【VLM】VideoChat-A1:用镜头链推理CoS思考长视频
cos·多模态·视频理解·长视频