2026-06-13 21:08:37 +07:00
import { withCodexReviewModels } from "../models/helpers.js" ;
2026-09-10 21:23:24 +07:00
// Codex CLI version seen by OpenAI's backend — single source for the Version /
// User-Agent identity headers. Bump when the installed codex CLI is upgraded.
const CODEX_CLI_VERSION = "0.154.0" ;
2026-06-13 21:08:37 +07:00
export default {
id : "codex" ,
2026-06-14 18:49:38 +07:00
priority : 30 ,
2026-06-13 21:08:37 +07:00
alias : "cx" ,
2026-06-14 14:32:59 +07:00
uiAlias : "cx" ,
2026-06-14 13:15:48 +07:00
display : {
2026-06-14 14:32:59 +07:00
name : "OpenAI Codex" ,
icon : "code" ,
color : "#3B82F6" ,
website : "https://chatgpt.com/codex" ,
notice : {
signupUrl : "https://chatgpt.com/codex" ,
},
deprecated : true ,
deprecationNotice : "RISK_NOTICE" ,
kindNotice : {
image : "Requires a ChatGPT Plus (or higher) account. Free accounts are not supported for image generation." ,
},
2026-06-14 13:15:48 +07:00
},
category : "oauth" ,
2026-06-14 14:32:59 +07:00
thinkingConfig : {
options : [
"auto" ,
"none" ,
"low" ,
"medium" ,
"high" ,
],
defaultMode : "auto" ,
},
2026-06-13 21:08:37 +07:00
transport : {
baseUrl : "https://chatgpt.com/backend-api/codex/responses" ,
format : "openai-responses" ,
2026-06-13 22:05:01 +07:00
forceStream : true ,
2026-09-10 21:23:24 +07:00
cliVersion : CODEX_CLI_VERSION ,
2026-06-13 21:08:37 +07:00
headers : {
2026-06-14 14:32:59 +07:00
originator : "codex_cli_rs" ,
2026-09-10 21:23:24 +07:00
"User-Agent" : `codex_cli_rs/ ${ CODEX_CLI_VERSION } ` ,
2026-06-14 14:32:59 +07:00
},
usage : {
url : "https://chatgpt.com/backend-api/wham/usage" ,
2026-07-03 15:02:28 +07:00
resetCreditsUrl : "https://chatgpt.com/backend-api/wham/rate-limit-reset-credits" ,
2026-06-15 18:18:04 +07:00
resetCreditsConsumeUrl : "https://chatgpt.com/backend-api/wham/rate-limit-reset-credits/consume" ,
2026-06-13 21:08:37 +07:00
},
2026-06-14 13:15:48 +07:00
},
2026-06-14 14:32:59 +07:00
models : [
2026-09-05 22:57:00 +07:00
{ id : "gpt-6-astra" , name : "GPT 6.0 Astra" },
2026-07-10 13:08:58 +07:00
{ id : "gpt-5.6-sol" , name : "GPT 5.6 Sol" },
{ id : "gpt-5.6-sol-review" , name : "GPT 5.6 Sol Review" , upstreamModelId : "gpt-5.6-sol" , quotaFamily : "review" },
{ id : "gpt-5.6-terra" , name : "GPT 5.6 Terra" },
{ id : "gpt-5.6-terra-review" , name : "GPT 5.6 Terra Review" , upstreamModelId : "gpt-5.6-terra" , quotaFamily : "review" },
{ id : "gpt-5.6-luna" , name : "GPT 5.6 Luna" },
{ id : "gpt-5.6-luna-review" , name : "GPT 5.6 Luna Review" , upstreamModelId : "gpt-5.6-luna" , quotaFamily : "review" },
2026-06-14 14:32:59 +07:00
{ id : "gpt-5.5" , name : "GPT 5.5" },
{ id : "gpt-5.5-review" , name : "GPT 5.5 Review" , upstreamModelId : "gpt-5.5" , quotaFamily : "review" },
{ id : "gpt-5.4" , name : "GPT 5.4" },
{ id : "gpt-5.4-review" , name : "GPT 5.4 Review" , upstreamModelId : "gpt-5.4" , quotaFamily : "review" },
{ id : "gpt-5.4-mini" , name : "GPT 5.4 Mini" },
{ id : "gpt-5.4-mini-review" , name : "GPT 5.4 Mini Review" , upstreamModelId : "gpt-5.4-mini" , quotaFamily : "review" },
{ id : "gpt-5.3-codex-spark" , name : "GPT 5.3 Codex Spark" },
{ id : "gpt-5.3-codex-spark-review" , name : "GPT 5.3 Codex Spark Review" , upstreamModelId : "gpt-5.3-codex-spark" , quotaFamily : "review" },
2026-09-18 17:03:57 +07:00
// Codex CLI's auto-review virtual model. Unlike the "-review" variants above it is not derived
// from a base model, so it is forwarded verbatim instead of having "-review" stripped (#1398).
{ id : "codex-auto-review" , name : "Codex Auto Review" , upstreamModelId : "codex-auto-review" , quotaFamily : "review" },
2026-09-10 22:06:17 +07:00
{ id : "gpt-image-2.5" , name : "GPT Image 2.5" , capabilities : [ "text2img" , "edit" , "multiImage" ], params : [ "size" , "quality" , "background" , "image_detail" , "output_format" ], kind : "image" },
{ id : "gpt-image-2.5-flare" , name : "GPT Image 2.5 Flare" , capabilities : [ "text2img" , "edit" , "multiImage" ], params : [ "size" , "quality" , "background" , "image_detail" , "output_format" ], kind : "image" },
{ id : "gpt-image-2.5-sunburst" , name : "GPT Image 2.5 Sunburst" , capabilities : [ "text2img" , "edit" , "multiImage" ], params : [ "size" , "quality" , "background" , "image_detail" , "output_format" ], kind : "image" },
{ id : "gpt-image-2" , name : "GPT Image 2" , capabilities : [ "text2img" , "edit" , "multiImage" ], params : [ "size" , "quality" , "background" , "image_detail" , "output_format" ], kind : "image" },
{ id : "gpt-image-1.5" , name : "GPT Image 1.5" , capabilities : [ "text2img" , "edit" , "multiImage" ], params : [ "size" , "quality" , "background" , "image_detail" , "output_format" ], kind : "image" },
2026-09-05 21:00:51 +07:00
{ id : "gpt-5.6-sol-image" , name : "GPT 5.6 Sol Image" , capabilities : [ "text2img" , "edit" ], params : [ "size" , "quality" , "background" , "image_detail" , "output_format" ], kind : "image" },
{ id : "gpt-5.6-terra-image" , name : "GPT 5.6 Terra Image" , capabilities : [ "text2img" , "edit" ], params : [ "size" , "quality" , "background" , "image_detail" , "output_format" ], kind : "image" },
{ id : "gpt-5.6-luna-image" , name : "GPT 5.6 Luna Image" , capabilities : [ "text2img" , "edit" ], params : [ "size" , "quality" , "background" , "image_detail" , "output_format" ], kind : "image" },
2026-06-14 14:32:59 +07:00
{ id : "gpt-5.5-image" , name : "GPT 5.5 Image" , capabilities : [ "text2img" , "edit" ], params : [ "size" , "quality" , "background" , "image_detail" , "output_format" ], kind : "image" },
{ id : "gpt-5.4-image" , name : "GPT 5.4 Image" , capabilities : [ "text2img" , "edit" ], params : [ "size" , "quality" , "background" , "image_detail" , "output_format" ], kind : "image" },
{ id : "gpt-5.3-image" , name : "GPT 5.3 Image" , capabilities : [ "text2img" , "edit" ], params : [ "size" , "quality" , "background" , "image_detail" , "output_format" ], kind : "image" },
],
serviceKinds : [ "llm" , "image" ],
2026-06-14 13:15:48 +07:00
oauth : {
2026-06-13 21:08:37 +07:00
clientId : "app_EMoamEEZ73f0CkXaXp7hrann" ,
2026-06-14 13:15:48 +07:00
authorizeUrl : "https://auth.openai.com/oauth/authorize" ,
tokenUrl : "https://auth.openai.com/oauth/token" ,
scope : "openid profile email offline_access" ,
codeChallengeMethod : "S256" ,
fixedPort : 1455 ,
callbackPath : "/auth/callback" ,
extraParams : {
id_token_add_organizations : "true" ,
codex_cli_simplified_flow : "true" ,
2026-06-14 14:32:59 +07:00
originator : "codex_cli_rs" ,
},
refreshLeadMs : 432000000 ,
refresh : {
encoding : "form" ,
scope : "openid profile email offline_access" ,
},
maxRefreshAgeMs : 691200000 ,
trackRefreshAt : true ,
2026-06-14 13:15:48 +07:00
},
2026-06-14 14:32:59 +07:00
features : {
usage : true ,
2026-06-13 21:08:37 +07:00
},
};