sub2api icon indicating copy to clipboard operation
sub2api copied to clipboard

OAuth gpt-image-2 requests send unsupported top-level model gpt-5.4-mini

Open Hugh-Top opened this issue 2 months ago • 3 comments

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?

Hugh-Top avatar Sep 09 '26 02:09 Hugh-Top

我有修复好的版本,自己改的源码,需要加bygzyz

zhenghuanluck avatar Sep 09 '26 03:09 zhenghuanluck

我有修复好的版本,自己改的源码,需要加bygzyz

垃圾,到处打广告。大家小心诈骗

axdlee avatar Sep 09 '26 05:09 axdlee

素质低下,上来就垃圾,没受过教育的东西说不出什么好话

zhenghuanluck avatar Sep 09 '26 05:09 zhenghuanluck