MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / toOpenAIModelId

Function toOpenAIModelId

common/src/constants/chatgpt-oauth.ts:65–82  ·  view source on GitHub ↗
(model: string)

Source from the content-addressed store, hash-verified

63 * Example: "openai/gpt-5.3-codex" => "gpt-5.3-codex"
64 */
65export function toOpenAIModelId(model: string): string {
66 if (!model.includes('/')) {
67 return model
68 }
69
70 if (!model.startsWith('openai/')) {
71 throw new Error(
72 `Cannot convert non-OpenAI model to OpenAI model ID: ${model}`,
73 )
74 }
75
76 const mapped = OPENROUTER_TO_OPENAI_MODEL_MAP[model]
77 if (mapped) {
78 return mapped
79 }
80
81 throw new Error(`Model is not supported for ChatGPT OAuth direct routing: ${model}`)
82}

Callers 1

createOpenAIOAuthModelFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected