OAuth gpt-image-2 requests send unsupported top-level model gpt-5.4-mini
Bug description
When calling gpt-image-2 through an OpenAI OAuth account, Sub2API sends a Responses API request whose top-level model is gpt-5.4-mini. ChatGPT/Codex rejects the request with HTTP 400:
The 'gpt-5.4-mini' model is not supported when using Codex with a ChatGPT account.
Sub2API then fails over across multiple accounts and ultimately returns HTTP 502.
Reproduction
- Sub2API version:
v0.2.3 - Account type: OpenAI OAuth / ChatGPT account
- Endpoint:
POST /v1/images/generations - Input model:
gpt-image-2 - Request ID:
cba38f75-be17-44ea-8cff-2f03ced14eb0 - Observed: 2026-09-09 09:53:45–09:53:51 +0800
Actual request construction
In backend/internal/service/openai_images.go:
openAIImagesResponsesMainModel = "gpt-5.4-mini"
In buildOpenAIImagesResponsesRequest, the generated body is effectively:
{
"model": "gpt-5.4-mini",
"tools": [
{
"type": "image_generation",
"model": "gpt-image-2"
}
]
}
The same implementation is present in the v0.2.3 tag. The release notes for v0.2.3 do not mention this OAuth image-model compatibility issue.
Expected behavior
The OAuth image adapter should send a top-level model that is supported by ChatGPT/Codex for image generation, or otherwise apply the correct compatibility mapping, so that gpt-image-2 requests do not fail because of the hard-coded unsupported top-level model.
Could you confirm the intended top-level model and fix the OAuth image request mapping?
我有修复好的版本,自己改的源码,需要加bygzyz
我有修复好的版本,自己改的源码,需要加bygzyz
垃圾,到处打广告。大家小心诈骗
素质低下,上来就垃圾,没受过教育的东西说不出什么好话