{"record":{"id":"4c3412c3fcd8a670","repo":"chatboxai/chatbox","slug":"image-model-is-not-available-provider-modeli","errorCode":null,"errorMessage":"Image model is not available: ${provider}/${modelId}. Use \"chatbox image models\" to list available models.","messagePattern":"Image model is not available: (.+?)/(.+?)\\. Use \"chatbox image models\" to list available models\\.","errorType":"validation","errorClass":"ChatboxCliUsageError","httpStatus":null,"severity":"warning","filePath":"src/renderer/packages/chatbox-cli/images.ts","lineNumber":247,"sourceCode":"  if (persistedExecutionValue !== null) {\n    if (persistedExecutionValue.signature !== signature) {\n      throw new Error(`Tool call ${cacheKey} was reused with different image arguments.`)\n    }\n    const persistedRecord = await platform.getImageGenerationStorage().getById(persistedExecutionValue.recordId)\n    if (!persistedRecord) {\n      throw new Error(\n        'The image record linked to this approved tool call no longer exists. Start a new request and ask the user to approve it again.'\n      )\n    }\n    return restoredExecutionResult(persistedRecord)\n  }\n\n  if (settings.providers?.[provider]?.excludedModels?.includes(modelId)) {\n    throw new ChatboxCliUsageError(`Image model is disabled in settings: ${provider}/${modelId}`)\n  }\n  availableModels ??= await getAvailableImageModels(settings)\n  if (!availableModels.some((model) => model.provider === provider && model.modelId === modelId)) {\n    throw new ChatboxCliUsageError(\n      `Image model is not available: ${provider}/${modelId}. Use \"chatbox image models\" to list available models.`\n    )\n  }\n\n  if (!approvedRequest) {\n    const licenseDetail = settings.licenseDetail\n    await requestAppActionApproval(\n      toolCallId,\n      'image.generate',\n      'Generate image',\n      [\n        `Provider: ${JSON.stringify(provider)}`,\n        `Model: ${JSON.stringify(modelId)}`,\n        `Images: ${count}`,\n        ...(aspectRatio ? [`Aspect ratio: ${JSON.stringify(aspectRatio)}`] : []),\n        ...(dalleStyle ? [`Style: ${JSON.stringify(dalleStyle)}`] : []),\n        `Prompt: ${JSON.stringify(prompt)}`,\n      ].join('\\n'),","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/renderer/packages/chatbox-cli/images.ts#L229-L265","documentation":"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).","triggerScenarios":"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.","commonSituations":"An LLM hallucinating a model name, a copied id from another account/region, or credentials that unlock a different model set.","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."],"exampleFix":"// before\nawait executeChatboxCliCommand({ argv: ['image','generate','--prompt',p,'--model','dalle-3'] }, ctx)\n\n// after: discover the exact id first\nconst models = await executeChatboxCliCommand({ argv: ['image','models'] }, ctx)\nconst exact = models.results[0] // { provider, modelId }\nawait executeChatboxCliCommand({ argv: ['image','generate','--prompt',p,'--provider',exact.provider,'--model',exact.modelId] }, ctx)","handlingStrategy":"validation","validationCode":"// Discover an exact available provider/model pair before dispatching.\nconst models = await executeChatboxCliCommand({ argv: ['image','models'] }, ctx)\nconst available = models.results?.find(\n  (m) => m.provider === provider && m.modelId === modelId\n)\nif (!available) {\n  return { error: `Model ${provider}/${modelId} is not available`, kind: 'usage' }\n}\nawait executeChatboxCliCommand({ argv: ['image','generate','--prompt', p, '--provider', provider, '--model', modelId] }, ctx)","typeGuard":"function isAvailableModel(models: Array<{ provider: string; modelId: string }>, provider: string, modelId: string): boolean {\n  return models.some((m) => m.provider === provider && m.modelId === modelId)\n}","tryCatchPattern":"const res = await executeChatboxCliCommand({ argv }, ctx)\nif (!res.ok && res.kind === 'usage' && res.error.includes('not available')) {\n  // re-list models and retry with a valid id\n}","preventionTips":["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."],"tags":["chatbox-cli","usage","image-generation","validation","configuration"],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}