{"record":{"id":"32a23efc545d783f","repo":"vercel/ai","slug":"imagemodel-32a23e","errorCode":null,"errorMessage":"imageModel","messagePattern":"imageModel","errorType":"exception","errorClass":"NoSuchModelError","httpStatus":null,"severity":"error","filePath":"packages/minimax/src/minimax-provider.ts","lineNumber":150,"sourceCode":"      baseURL: videoBaseURL,\n      headers: getVideoHeaders,\n      fetch: options.fetch,\n    });\n\n  const provider = (modelId: MiniMaxChatModelId) => createChatModel(modelId);\n\n  provider.specificationVersion = 'v4' as const;\n  provider.languageModel = createChatModel;\n  provider.chat = createChatModel;\n  provider.video = createVideoModel;\n  provider.videoModel = createVideoModel;\n\n  provider.embeddingModel = (modelId: string) => {\n    throw new NoSuchModelError({ modelId, modelType: 'embeddingModel' });\n  };\n  provider.textEmbeddingModel = provider.embeddingModel;\n  provider.imageModel = (modelId: string) => {\n    throw new NoSuchModelError({ modelId, modelType: 'imageModel' });\n  };\n\n  return provider;\n}\n\nexport const minimax = createMiniMax();\n","sourceCodeStart":132,"sourceCodeEnd":157,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/minimax/src/minimax-provider.ts#L132-L157","documentation":"The MiniMax provider does not implement image models: minimax.imageModel(modelId) unconditionally throws NoSuchModelError with modelType 'imageModel'. Only language/chat and video model factories are provided.","triggerScenarios":"Calling minimax.imageModel(id) directly, or using the minimax provider in generateImage({ model: ... }) / pipelines that resolve provider.imageModel.","commonSituations":"Assuming MiniMax support for image generation because the provider supports video, or refactoring shared image-generation code to swap providers without checking capability.","solutions":["Use an image-capable provider, e.g. openai.imageModel('dall-e-3') or another provider implementing imageModel, with generateImage.","Restrict minimax usage to chat (minimax.chat) and video (minimax.videoModel) models.","Add a runtime capability check (typeof provider.imageModel === 'function' won't help here — check provider docs/feature matrix) before dispatching image generation."],"exampleFix":"// before\nconst { image } = await generateImage({\n  model: minimax.imageModel('image-01'),\n  prompt,\n});\n// after\nconst { image } = await generateImage({\n  model: openai.imageModel('dall-e-3'),\n  prompt,\n});","handlingStrategy":"validation","validationCode":"if (needsImageGeneration && providerId === 'minimax') {\n  throw new Error('minimax does not implement imageModel; use openai.imageModel or similar');\n}","typeGuard":"function supportsImages(p: any): p is { imageModel: (id: string) => ImageModel } {\n  try { p.imageModel('probe'); return true; } catch { return false; }\n}","tryCatchPattern":"try {\n  await generateImage({ model: provider.imageModel(id), prompt });\n} catch (e) {\n  if (NoSuchModelError.isInstance(e) && e.modelType === 'imageModel') {\n    // switch to an image-capable provider\n  }\n  throw e;\n}","preventionTips":["Do not assume video support implies image support in a provider","Consult the AI SDK provider docs for supported capabilities","Route image generation to providers that implement imageModel","Guard image pipelines with an explicit capability check"],"tags":["minimax","unsupported-model-type","image-generation","nosuchmodelerror"],"backgroundTag":"nosuch-model-error","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}