
# `uploadSkill()`

Uploads a skill (a bundle of files) to a provider and returns a `ProviderReference` that can be used in subsequent inference calls.

```ts
import { uploadSkill } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';
import { readFileSync } from 'fs';

const { providerReference } = await uploadSkill({
  api: anthropic.skills(),
  files: [
    {
      path: 'my-skill/SKILL.md',
      content: readFileSync('./SKILL.md'),
    },
  ],
  displayTitle: 'My Skill',
});
```

## Import

<Snippet text={`import { uploadSkill } from "ai"`} prompt={false} />

## API Signature

### Parameters

<PropertiesTable
  content={[
    {
      name: 'api',
      type: 'SkillsV4 | ProviderV4',
      description:
        'The skills API interface to use for uploading. Can be a `SkillsV4` instance (e.g. `anthropic.skills()`) or a provider instance directly (e.g. `anthropic`), in which case `.skills()` is called automatically.',
    },
    {
      name: 'files',
      type: 'SkillsV4File[]',
      description:
        'The files that make up the skill. Each file has a relative `path` and `content` (either a `Uint8Array` or a base64-encoded string).',
    },
    {
      name: 'displayTitle',
      type: 'string',
      isOptional: true,
      description: 'Human-readable title for the skill.',
    },
    {
      name: 'providerOptions',
      type: 'ProviderOptions',
      isOptional: true,
      description: 'Additional provider-specific options.',
    },
  ]}
/>

### Returns

<PropertiesTable
  content={[
    {
      name: 'providerReference',
      type: 'ProviderReference',
      description:
        'A `Record<string, string>` mapping provider names to provider-specific skill identifiers. Pass this when referencing the skill in inference calls.',
    },
    {
      name: 'displayTitle',
      type: 'string',
      isOptional: true,
      description: 'Human-readable title returned by the provider (if supported).',
    },
    {
      name: 'name',
      type: 'string',
      isOptional: true,
      description: 'Skill name inferred by the provider from the uploaded files.',
    },
    {
      name: 'description',
      type: 'string',
      isOptional: true,
      description: 'Skill description inferred by the provider from the uploaded files.',
    },
    {
      name: 'latestVersion',
      type: 'string',
      isOptional: true,
      description: 'Latest version identifier assigned by the provider.',
    },
    {
      name: 'providerMetadata',
      type: 'ProviderMetadata',
      isOptional: true,
      description: 'Additional provider-specific metadata returned from the upload.',
    },
    {
      name: 'warnings',
      type: 'Warning[]',
      description: 'Warnings from the provider (e.g. unsupported settings).',
    },
  ]}
/>


## Navigation

- [generateText](/v7/docs/reference/ai-sdk-core/generate-text)
- [streamText](/v7/docs/reference/ai-sdk-core/stream-text)
- [embed](/v7/docs/reference/ai-sdk-core/embed)
- [embedMany](/v7/docs/reference/ai-sdk-core/embed-many)
- [rerank](/v7/docs/reference/ai-sdk-core/rerank)
- [generateImage](/v7/docs/reference/ai-sdk-core/generate-image)
- [transcribe](/v7/docs/reference/ai-sdk-core/transcribe)
- [generateSpeech](/v7/docs/reference/ai-sdk-core/generate-speech)
- [experimental_generateVideo](/v7/docs/reference/ai-sdk-core/generate-video)
- [uploadFile](/v7/docs/reference/ai-sdk-core/upload-file)
- [uploadSkill](/v7/docs/reference/ai-sdk-core/upload-skill)
- [Agent (Interface)](/v7/docs/reference/ai-sdk-core/agent)
- [ToolLoopAgent](/v7/docs/reference/ai-sdk-core/tool-loop-agent)
- [createAgentUIStream](/v7/docs/reference/ai-sdk-core/create-agent-ui-stream)
- [createAgentUIStreamResponse](/v7/docs/reference/ai-sdk-core/create-agent-ui-stream-response)
- [pipeAgentUIStreamToResponse](/v7/docs/reference/ai-sdk-core/pipe-agent-ui-stream-to-response)
- [tool](/v7/docs/reference/ai-sdk-core/tool)
- [dynamicTool](/v7/docs/reference/ai-sdk-core/dynamic-tool)
- [createMCPClient](/v7/docs/reference/ai-sdk-core/create-mcp-client)
- [Experimental_StdioMCPTransport](/v7/docs/reference/ai-sdk-core/mcp-stdio-transport)
- [jsonSchema](/v7/docs/reference/ai-sdk-core/json-schema)
- [zodSchema](/v7/docs/reference/ai-sdk-core/zod-schema)
- [valibotSchema](/v7/docs/reference/ai-sdk-core/valibot-schema)
- [Output](/v7/docs/reference/ai-sdk-core/output)
- [filterActiveTools](/v7/docs/reference/ai-sdk-core/filter-active-tools)
- [ModelMessage](/v7/docs/reference/ai-sdk-core/model-message)
- [UIMessage](/v7/docs/reference/ai-sdk-core/ui-message)
- [validateUIMessages](/v7/docs/reference/ai-sdk-core/validate-ui-messages)
- [safeValidateUIMessages](/v7/docs/reference/ai-sdk-core/safe-validate-ui-messages)
- [createProviderRegistry](/v7/docs/reference/ai-sdk-core/provider-registry)
- [customProvider](/v7/docs/reference/ai-sdk-core/custom-provider)
- [cosineSimilarity](/v7/docs/reference/ai-sdk-core/cosine-similarity)
- [wrapLanguageModel](/v7/docs/reference/ai-sdk-core/wrap-language-model)
- [wrapImageModel](/v7/docs/reference/ai-sdk-core/wrap-image-model)
- [LanguageModelV4Middleware](/v7/docs/reference/ai-sdk-core/language-model-v2-middleware)
- [extractReasoningMiddleware](/v7/docs/reference/ai-sdk-core/extract-reasoning-middleware)
- [simulateStreamingMiddleware](/v7/docs/reference/ai-sdk-core/simulate-streaming-middleware)
- [defaultSettingsMiddleware](/v7/docs/reference/ai-sdk-core/default-settings-middleware)
- [addToolInputExamplesMiddleware](/v7/docs/reference/ai-sdk-core/add-tool-input-examples-middleware)
- [extractJsonMiddleware](/v7/docs/reference/ai-sdk-core/extract-json-middleware)
- [isStepCount](/v7/docs/reference/ai-sdk-core/is-step-count)
- [hasToolCall](/v7/docs/reference/ai-sdk-core/has-tool-call)
- [isLoopFinished](/v7/docs/reference/ai-sdk-core/loop-finished)
- [simulateReadableStream](/v7/docs/reference/ai-sdk-core/simulate-readable-stream)
- [smoothStream](/v7/docs/reference/ai-sdk-core/smooth-stream)
- [generateId](/v7/docs/reference/ai-sdk-core/generate-id)
- [createIdGenerator](/v7/docs/reference/ai-sdk-core/create-id-generator)
- [DefaultGeneratedFile](/v7/docs/reference/ai-sdk-core/default-generated-file)


[Full Sitemap](/sitemap.md)
