vercel/ai · error · Error

The provider does not support skills. Make sure it exposes…

Error message

The provider does not support skills. Make sure it exposes a skills() method.

What it means

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.

Solutions

  1. Pass the correct provider instance that implements skills support (check `typeof provider.skills === 'function'`).
  2. Upgrade the provider package to a version with SkillsV4 (skills()/uploadSkill) support.
  3. Add a capability check before calling uploadSkill and handle unsupported providers gracefully.
  4. Choose a provider that supports skill uploads if this capability is required.

Example fix

// before
await uploadSkill({ api: openai('gpt-4o'), files }); // wrong object
// after
if (typeof openai.skills !== 'function') throw new Error('Skills unsupported');
await uploadSkill({ api: openai, files });
Defensive patterns

Strategy: type-guard

Validate before calling

function supportsSkills(api: unknown): api is { skills(): SkillsV4 } {
  return api != null &&
    (typeof (api as any).skills === 'function' || 'uploadSkill' in (api as any));
}
if (!supportsSkills(provider)) throw new Error('Provider does not support skill uploads');

Type guard

function hasSkillsApi(api: unknown): api is { skills(): SkillsV4 } | { uploadSkill: SkillsV4['uploadSkill'] } {
  return typeof api === 'object' && api !== null &&
    ('uploadSkill' in api || typeof (api as { skills?: unknown }).skills === 'function');
}

Try / catch

try {
  await uploadSkill({ api: provider, files });
} catch (e) {
  if (e instanceof Error && e.message.includes('does not support skills')) {
    throw new Error(`${providerName} does not support skill uploads; use a provider with skills() support`);
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling `uploadSkill({ api: provider, files, ... })` with a provider instance that has no `skills()` factory method and no `uploadSkill` method.

Common situations: 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.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/98bb2fdddde44eb5. Report an issue: GitHub.

Appendix: source

Thrown at packages/ai/src/upload-skill/upload-skill.ts:33

};

export async function uploadSkill({
  api,
  files,
  displayTitle,
  providerOptions,
}: {
  api: SkillsV4 | ProviderV4;
} & Omit<SkillsV4UploadSkillCallOptions, 'files'> & {
    files: UploadSkillFile[];
  }): Promise<UploadSkillResult> {
  const skillsApi: SkillsV4 =
    'uploadSkill' in api
      ? api
      : typeof api.skills === 'function'
        ? api.skills()
        : (() => {
            throw new Error(
              'The provider does not support skills. Make sure it exposes a skills() method.',
            );
          })();

  const normalizedFiles: SkillsV4File[] = files.map(file => ({
    ...file,
    data:
      file.data instanceof Uint8Array || typeof file.data === 'string'
        ? { type: 'data', data: file.data }
        : file.data,
  }));

  const result = await skillsApi.uploadSkill({
    files: normalizedFiles,
    displayTitle,
    providerOptions,
  });

View on GitHub (pinned to 69428b1f8b)