MCPcopy Create free account
hub / github.com/freecodexyz/free-code / mapClaudeModelToCodex

Function mapClaudeModelToCodex

src/services/api/codex-fetch-adapter.ts:37–45  ·  view source on GitHub ↗
(claudeModel: string | null)

Source from the content-addressed store, hash-verified

35 * @returns The corresponding Codex model ID
36 */
37export function mapClaudeModelToCodex(claudeModel: string | null): string {
38 if (!claudeModel) return DEFAULT_CODEX_MODEL
39 if (isCodexModel(claudeModel)) return claudeModel
40 const lower = claudeModel.toLowerCase()
41 if (lower.includes('opus')) return 'gpt-5.1-codex-max'
42 if (lower.includes('haiku')) return 'gpt-5.1-codex-mini'
43 if (lower.includes('sonnet')) return 'gpt-5.2-codex'
44 return DEFAULT_CODEX_MODEL
45}
46
47/**
48 * Checks if a given model string is a valid Codex model.

Callers 1

translateToCodexBodyFunction · 0.85

Calls 1

isCodexModelFunction · 0.85

Tested by

no test coverage detected