codex curl 直接调用 gpt-image-2
- 内容介绍
- 文章标签
- 相关推荐
curl --location 'https://chatgpt.com/backend-api/codex/responses' \
--header 'Authorization: Bearer' \
--header 'chatgpt-account-id: ' \
--header 'user-agent: codex-tui/0.122.0 (Manjaro 26.1.0-pre; x86_64) vscode/3.0.12 (codex-tui; 0.122.0)' \
--header 'version: 0.122.0' \
--header 'originator: codex_cli_rs' \
--header 'session_id: test-session' \
--header 'accept: text/event-stream' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.4",
"input": [
{
"role": "user",
"content": "画一只可爱的猫抱着水獭"
}
],
"tools": [
{
"type": "image_generation",
"output_format": "png"
}
],
"instructions": "you are a helpful assistant",
"tool_choice": "auto",
"stream": true,
"store": false
}'
看了下返回值,貌似是按 token 计算的,并且使用任意模型调用,最终都是 gpt-image-2,再也不用折腾 flow 打码了,这还要什么自行车
image1862×497 128 KB
curl --location 'https://chatgpt.com/backend-api/codex/responses' \
--header 'Authorization: Bearer' \
--header 'chatgpt-account-id: ' \
--header 'user-agent: codex-tui/0.122.0 (Manjaro 26.1.0-pre; x86_64) vscode/3.0.12 (codex-tui; 0.122.0)' \
--header 'version: 0.122.0' \
--header 'originator: codex_cli_rs' \
--header 'session_id: test-session' \
--header 'accept: text/event-stream' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.4",
"input": [
{
"role": "user",
"content": "画一只可爱的猫抱着水獭"
}
],
"tools": [
{
"type": "image_generation",
"output_format": "png"
}
],
"instructions": "you are a helpful assistant",
"tool_choice": "auto",
"stream": true,
"store": false
}'
看了下返回值,貌似是按 token 计算的,并且使用任意模型调用,最终都是 gpt-image-2,再也不用折腾 flow 打码了,这还要什么自行车
image1862×497 128 KB

