chatboxai/chatbox · warning · ChatboxCliUsageError
Image model is not available: ${provider}/${modelId}. Use "c
Error message
Image model is not available: ${provider}/${modelId}. Use "chatbox image models" to list available models. What it means
ChatboxCliUsageError thrown when the resolved provider/modelId is not present in the list returned by getAvailableImageModels(settings). Unlike the excludedModels check, this fires when the model is simply not offered at all (wrong id, provider mismatch, or not image-capable).
Source
Thrown at src/renderer/packages/chatbox-cli/images.ts:247
if (persistedExecutionValue !== null) {
if (persistedExecutionValue.signature !== signature) {
throw new Error(`Tool call ${cacheKey} was reused with different image arguments.`)
}
const persistedRecord = await platform.getImageGenerationStorage().getById(persistedExecutionValue.recordId)
if (!persistedRecord) {
throw new Error(
'The image record linked to this approved tool call no longer exists. Start a new request and ask the user to approve it again.'
)
}
return restoredExecutionResult(persistedRecord)
}
if (settings.providers?.[provider]?.excludedModels?.includes(modelId)) {
throw new ChatboxCliUsageError(`Image model is disabled in settings: ${provider}/${modelId}`)
}
availableModels ??= await getAvailableImageModels(settings)
if (!availableModels.some((model) => model.provider === provider && model.modelId === modelId)) {
throw new ChatboxCliUsageError(
`Image model is not available: ${provider}/${modelId}. Use "chatbox image models" to list available models.`
)
}
if (!approvedRequest) {
const licenseDetail = settings.licenseDetail
await requestAppActionApproval(
toolCallId,
'image.generate',
'Generate image',
[
`Provider: ${JSON.stringify(provider)}`,
`Model: ${JSON.stringify(modelId)}`,
`Images: ${count}`,
...(aspectRatio ? [`Aspect ratio: ${JSON.stringify(aspectRatio)}`] : []),
...(dalleStyle ? [`Style: ${JSON.stringify(dalleStyle)}`] : []),
`Prompt: ${JSON.stringify(prompt)}`,
].join('\n'),View on GitHub (pinned to 81571269ad)
Solutions
- Run ['image','models'] to list the actually-available provider/model pairs and copy an exact id.
- Ensure the provider credentials and Chatbox license entitle the desired model.
- Omit --model to let the resolver pick the first available model automatically.
Example fix
// before
await executeChatboxCliCommand({ argv: ['image','generate','--prompt',p,'--model','dalle-3'] }, ctx)
// after: discover the exact id first
const models = await executeChatboxCliCommand({ argv: ['image','models'] }, ctx)
const exact = models.results[0] // { provider, modelId }
await executeChatboxCliCommand({ argv: ['image','generate','--prompt',p,'--provider',exact.provider,'--model',exact.modelId] }, ctx) Defensive patterns
Strategy: validation
Validate before calling
// Discover an exact available provider/model pair before dispatching.
const models = await executeChatboxCliCommand({ argv: ['image','models'] }, ctx)
const available = models.results?.find(
(m) => m.provider === provider && m.modelId === modelId
)
if (!available) {
return { error: `Model ${provider}/${modelId} is not available`, kind: 'usage' }
}
await executeChatboxCliCommand({ argv: ['image','generate','--prompt', p, '--provider', provider, '--model', modelId] }, ctx) Type guard
function isAvailableModel(models: Array<{ provider: string; modelId: string }>, provider: string, modelId: string): boolean {
return models.some((m) => m.provider === provider && m.modelId === modelId)
} Try / catch
const res = await executeChatboxCliCommand({ argv }, ctx)
if (!res.ok && res.kind === 'usage' && res.error.includes('not available')) {
// re-list models and retry with a valid id
} Prevention
- Always source provider/model ids from ['image','models'] rather than hard-coding.
- Omit --model to let the resolver pick the first available model.
- Ensure credentials/license entitle the desired model.
When it happens
Trigger: A misspelled or invented model id, a provider/model combination that does not exist, or a model that is not enabled for image generation under the current credentials/license.
Common situations: An LLM hallucinating a model name, a copied id from another account/region, or credentials that unlock a different model set.
Related errors
- Image generation requires an active chat session.
- Missing --prompt.
- --style must be vivid or natural.
- Missing --provider (or configure a Chatbox license).
- Image model is disabled in settings: ${provider}/${modelId}
AI-assisted analysis of chatboxai/chatbox@81571269ad (2026-08-12).
Data as JSON: /api/errors/4c3412c3fcd8a670.
Report an issue: GitHub.