{"record":{"id":"98bb2fdddde44eb5","repo":"vercel/ai","slug":"the-provider-does-not-support-skills-make-sure-it","errorCode":null,"errorMessage":"The provider does not support skills. Make sure it exposes a skills() method.","messagePattern":"The provider does not support skills\\. Make sure it exposes a skills\\(\\) method\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/ai/src/upload-skill/upload-skill.ts","lineNumber":33,"sourceCode":"};\n\nexport async function uploadSkill({\n  api,\n  files,\n  displayTitle,\n  providerOptions,\n}: {\n  api: SkillsV4 | ProviderV4;\n} & Omit<SkillsV4UploadSkillCallOptions, 'files'> & {\n    files: UploadSkillFile[];\n  }): Promise<UploadSkillResult> {\n  const skillsApi: SkillsV4 =\n    'uploadSkill' in api\n      ? api\n      : typeof api.skills === 'function'\n        ? api.skills()\n        : (() => {\n            throw new Error(\n              'The provider does not support skills. Make sure it exposes a skills() method.',\n            );\n          })();\n\n  const normalizedFiles: SkillsV4File[] = files.map(file => ({\n    ...file,\n    data:\n      file.data instanceof Uint8Array || typeof file.data === 'string'\n        ? { type: 'data', data: file.data }\n        : file.data,\n  }));\n\n  const result = await skillsApi.uploadSkill({\n    files: normalizedFiles,\n    displayTitle,\n    providerOptions,\n  });\n","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/ai/src/upload-skill/upload-skill.ts#L15-L51","documentation":"uploadSkill (packages/ai/src/upload-skill/upload-skill.ts:33) resolves a SkillsV4 API from the provider: it uses `api.uploadSkill` if present, otherwise calls `api.skills()`. If the provider exposes neither, it throws this Error. Skills upload is an optional provider capability that this provider has not implemented.","triggerScenarios":"Calling `uploadSkill({ api: provider, files, ... })` with a provider instance that has no `skills()` factory method and no `uploadSkill` method.","commonSituations":"Calling uploadSkill against a provider package/version without skills support; passing a model or a different provider's object; using a provider that only supports files but not skills; outdated dependency versions.","solutions":["Pass the correct provider instance that implements skills support (check `typeof provider.skills === 'function'`).","Upgrade the provider package to a version with SkillsV4 (skills()/uploadSkill) support.","Add a capability check before calling uploadSkill and handle unsupported providers gracefully.","Choose a provider that supports skill uploads if this capability is required."],"exampleFix":"// before\nawait uploadSkill({ api: openai('gpt-4o'), files }); // wrong object\n// after\nif (typeof openai.skills !== 'function') throw new Error('Skills unsupported');\nawait uploadSkill({ api: openai, files });","handlingStrategy":"type-guard","validationCode":"function supportsSkills(api: unknown): api is { skills(): SkillsV4 } {\n  return api != null &&\n    (typeof (api as any).skills === 'function' || 'uploadSkill' in (api as any));\n}\nif (!supportsSkills(provider)) throw new Error('Provider does not support skill uploads');","typeGuard":"function hasSkillsApi(api: unknown): api is { skills(): SkillsV4 } | { uploadSkill: SkillsV4['uploadSkill'] } {\n  return typeof api === 'object' && api !== null &&\n    ('uploadSkill' in api || typeof (api as { skills?: unknown }).skills === 'function');\n}","tryCatchPattern":"try {\n  await uploadSkill({ api: provider, files });\n} catch (e) {\n  if (e instanceof Error && e.message.includes('does not support skills')) {\n    throw new Error(`${providerName} does not support skill uploads; use a provider with skills() support`);\n  }\n  throw e;\n}","preventionTips":["Pass the provider instance (not a model) to uploadSkill.","Feature-detect `typeof provider.skills === 'function'` before exposing skill upload UI.","Upgrade provider packages to versions implementing SkillsV4.","Document provider capability requirements where uploadSkill is used."],"tags":["provider-capability","skills","typescript"],"backgroundTag":"unsupported-provider-capability","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}