
/v1/models 会漏掉图片模型,生图请求照过。把 gpt-image-* 加进白名单即可恢复自动发现。openai-compatibility 里没写 thinking 的模型,请求 xhigh 到上游会变成 high。给该模型写上 thinking.levels 就能绕开。| 请求 | 结果 |
|---|---|
GET /v1/models | 200,9 个文本模型,没有任何图片模型5 |
POST /v1/images/generations,model=gpt-image-2 | 200,返回非空 data[0].b64_json,约 28 秒5 |
POST /v1/responses + tools[{type:image_generation}] | 200,图片项 status: completed,约 23 秒5 |
credentials.models 是一份 9 项的文本模型白名单,里面没有 gpt-image-2。白名单留空的站不会遇到这件事。scopedModelRecords 里,一行看全:if !account.ModelCatalogEligible() || !item.Enabled || !account.SupportsCodexModel(item.ID) {SupportsCodexModel 的语义决定结果:名单为空放行全部;名单非空就按大小写不敏感精确匹配,匹配不上返回 false6。gpt-image-2 因此被跳过,/v1/models 里就没有它。
nextImageAccount 先用 imagePreferredAccountFilter 只在 Plus 及以上套餐里挑,挑不到再放开到 imageCapableAccountFilter;两个过滤器都只排除中转型账号(IsRelayStyle),整条路上没有一处查模型名单。
grokMediaModelsForAccount 把媒体模型补进目录,注释写明「与媒体端点的调度准入同源」10。Codex 这一支没有这一步,于是目录与调度各说各话。gpt-image-2 以及要用的 -2k、-4k 变体加进该账号的模型白名单。代价是这些 ID 也会出现在对话模型目录里,客户端会看到它们。credentials.models 为空数组的账号流程正常,不需要动。
reasoning_effort 为 xhigh 时,mapConfiguredHighIntent 会在这份表里找替代:候选顺序是 xhigh、max、high,第一个出现在档位表里的胜出,于是落到 high。
shouldMapConfiguredHighIntent 在协议相同时改成比对模型类型是否同族,而 OpenAI 家族名单只认 openai、openai-response、codex 三个值16;兼容模型自报的类型是 openai-compatibility,落在名单外,所以照样进改写。thinking 就按三档走,「超过三档的(例如 max、xhigh)会被钳到 high」,上游支持的话请显式声明 levels17。ThinkingSupport.LevelsAssumed 标记,遇到这个标记就跳过改写与档位校验,把请求的档位原样发上去,让上游自己决定收不收。LevelsAssumed,dev 的 apply.go 里 mapConfiguredHighIntent 仍在原处被调用19。thinking.levels,并把 xhigh 写进去。写进去之后,候选里的第一项就被支持,改写不再发生。openai-compatibility 段里自己列出来的模型。内置 provider 的档位来自模型登记表,不走这条伪造。alpha/history/v2/* 与 alpha/notes/v2/*,理由是 Codex 的实验性上下文管理会单独发这两类请求。他用 v7.2.142 与 Codex CLI 0.153.4 测了四条路径,全部 40420。github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
api.github.com
github.com
api.github.com
github.com
status.openai.com
status.anthropic.com
status.cloud.google.com
codex-reset.com
This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.