Skip to content

getModelId

getModelId(model): string

Defined in: core/model-shortcuts.ts:244

Extract the model ID from a full model string.

string

Full model string (provider:model-id)

string

Model ID, or the original string if no prefix

getModelId('openai:gpt-4o') // → 'gpt-4o'
getModelId('anthropic:claude') // → 'claude'
getModelId('gpt4') // → 'gpt4'