Skip to content

feat(ai): add support for uploading provider skills using the provider references abstraction#12880

Merged
felixarntz merged 35 commits intomainfrom
remote-skills-management
Apr 7, 2026
Merged

feat(ai): add support for uploading provider skills using the provider references abstraction#12880
felixarntz merged 35 commits intomainfrom
remote-skills-management

Conversation

@felixarntz
Copy link
Copy Markdown
Collaborator

@felixarntz felixarntz commented Feb 26, 2026

Background

#12995 introduced a new concept of provider references for managing uploaded assets to a provider in a container that supports multi-provider references. In #12995, this was implemented for uploading files (e.g. large media) to a provider for referencing it in inference calls.

This PR uses that same approach for uploading skills to a provider with programmatic tool calling. This is currently supported by Anthropic and OpenAI.

Summary

  • Introduces a new SkillsV4 specification in @ai-sdk/provider for uploading remote skills across providers
  • Adds new core function uploadSkill in the ai package
  • Implements SkillsV4 for both @ai-sdk/openai and @ai-sdk/anthropic, including provider-specific API handling
  • Includes comprehensive unit tests for all new code and example scripts demonstrating basic CRUD and skill-referenced inference for both providers

Manual Verification

Run the new examples included in the PR.

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Future Work

N/A

Related Issues

Fixes #12855

Related: #12995

felixarntz and others added 14 commits February 25, 2026 20:41
Add SkillsManagerV1 interface to @ai-sdk/provider with create, list, retrieve, update, and delete operations. Implement for both OpenAI and Anthropic providers with file upload support via multipart form data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
OpenAI skill responses return stale name/description after updates. Use the version list endpoint (GET /skills/{id}/versions?order=desc&limit=1) to fetch the latest version metadata for create and retrieve operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch from version list to GET /skills/{id}/versions/{version} using latest_version from the skill response. Enriches create, retrieve, and update with accurate name/description from the version object.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
OpenAI's version list and retrieve endpoints are non-functional (list returns empty data, retrieve returns 404 for all versions). Confirmed via real API testing. Only update can enrich using the version CREATE response metadata.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Normalize source to user/provider across spec and providers,
re-capture Anthropic/OpenAI fixtures from real APIs, add explanatory
comments for non-obvious code paths, and fix OpenAI update to promote
default_version via POST.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tigent tigent bot added ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label feature New feature or request provider/anthropic Issues related to the @ai-sdk/anthropic provider provider/openai Issues related to the @ai-sdk/openai provider labels Feb 26, 2026
Comment on lines +10 to +13
/**
* The content of the file, either as a base64 string or binary data.
*/
content: string | Uint8Array;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, this is still using base64 for strings, in alignment with existing types.

However, per the discussion in #12855, this may not be as suitable here, given the content is often Markdown files. A counter-argument would be that skills can still contain binary data, or the entire skill could be a ZIP and no direct Markdown files at all.

But that could still be passed via Uint8Array then. Something to think about further.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: I would suggest, we leave it as is for now, mostly for consistency with present expectations. However, we should probably revise how file parts are being sent anyway: Breaking down the existing file type into distinct file-data, file-url, and file-reference types would clarify the API surface and reduce complexity of having to figure out what the overloaded data field actually contains. This would then also allow us to add e.g. file-text (name TBD), which could be used to pass text file contents in plain text instead of base64-encoded.

I think we should make this change as part of v7, which will then alleviate the concern about base64 vs plain text for skills - we'd allow either.

cc @lgrammel

@felixarntz felixarntz marked this pull request as ready for review April 6, 2026 20:59
@felixarntz felixarntz requested a review from lgrammel April 6, 2026 21:01
@felixarntz felixarntz changed the title feat(ai): add support for creating and managing provider skills feat(ai): add support for uploading provider skills using the provider references abstraction Apr 6, 2026
@felixarntz felixarntz added this to the v7.0 milestone Apr 6, 2026
Comment on lines +41 to +44
/**
* Optional human-readable title for the uploaded skill.
*/
displayTitle?: string;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed in the result if we have it as part of the params?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good to have data like this in the result as it allows verifying the actual display name applied. Providers may do some minor sanitization, or they may add a default display name if none is provided.

Additionally, I think it makes sense to return comprehensive information about the created entity, so you don't have to patch this together yourself if you want to further process or store it.

Copy link
Copy Markdown
Collaborator

@lgrammel lgrammel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be added to our documentation

@felixarntz
Copy link
Copy Markdown
Collaborator Author

@lgrammel added a documentation guide for this in c5b6678

@felixarntz felixarntz enabled auto-merge (squash) April 7, 2026 14:11
@felixarntz felixarntz merged commit 34bd95d into main Apr 7, 2026
18 checks passed
@felixarntz felixarntz deleted the remote-skills-management branch April 7, 2026 14:17
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Apr 7, 2026

🚀 Published in:

Package Version
ai 7.0.0-beta.69
@ai-sdk/alibaba 2.0.0-beta.21
@ai-sdk/amazon-bedrock 5.0.0-beta.25
@ai-sdk/angular 3.0.0-beta.69
@ai-sdk/anthropic 4.0.0-beta.21
@ai-sdk/assemblyai 3.0.0-beta.16
@ai-sdk/azure 4.0.0-beta.25
@ai-sdk/baseten 2.0.0-beta.19
@ai-sdk/black-forest-labs 2.0.0-beta.15
@ai-sdk/bytedance 2.0.0-beta.15
@ai-sdk/cerebras 3.0.0-beta.19
@ai-sdk/cohere 4.0.0-beta.16
@ai-sdk/deepgram 3.0.0-beta.15
@ai-sdk/deepinfra 3.0.0-beta.19
@ai-sdk/deepseek 3.0.0-beta.17
@ai-sdk/devtools 1.0.0-beta.8
@ai-sdk/elevenlabs 3.0.0-beta.15
@ai-sdk/fal 3.0.0-beta.15
@ai-sdk/fireworks 3.0.0-beta.19
@ai-sdk/gateway 4.0.0-beta.38
@ai-sdk/gladia 3.0.0-beta.15
@ai-sdk/google 4.0.0-beta.29
@ai-sdk/google-vertex 5.0.0-beta.38
@ai-sdk/groq 4.0.0-beta.18
@ai-sdk/huggingface 2.0.0-beta.19
@ai-sdk/hume 3.0.0-beta.15
@ai-sdk/klingai 4.0.0-beta.16
@ai-sdk/langchain 3.0.0-beta.69
@ai-sdk/llamaindex 3.0.0-beta.69
@ai-sdk/lmnt 3.0.0-beta.15
@ai-sdk/luma 3.0.0-beta.15
@ai-sdk/mcp 2.0.0-beta.20
@ai-sdk/mistral 4.0.0-beta.17
@ai-sdk/moonshotai 3.0.0-beta.19
@ai-sdk/open-responses 2.0.0-beta.16
@ai-sdk/openai 4.0.0-beta.25
@ai-sdk/openai-compatible 3.0.0-beta.19
@ai-sdk/otel 1.0.0-beta.15
@ai-sdk/perplexity 4.0.0-beta.18
@ai-sdk/prodia 2.0.0-beta.18
@ai-sdk/provider 4.0.0-beta.8
@ai-sdk/provider-utils 5.0.0-beta.14
@ai-sdk/react 4.0.0-beta.69
@ai-sdk/replicate 3.0.0-beta.16
@ai-sdk/revai 3.0.0-beta.16
@ai-sdk/rsc 3.0.0-beta.70
@ai-sdk/svelte 5.0.0-beta.69
@ai-sdk/togetherai 3.0.0-beta.19
@ai-sdk/valibot 3.0.0-beta.14
@ai-sdk/vercel 3.0.0-beta.19
@ai-sdk/vue 4.0.0-beta.69
@ai-sdk/xai 4.0.0-beta.28

gr2m pushed a commit that referenced this pull request Apr 7, 2026
…r references abstraction (#12880)

uploaded assets to a provider in a container that supports
multi-provider references. In #12995, this was implemented for uploading
files (e.g. large media) to a provider for referencing it in inference
calls.

This PR uses that same approach for uploading skills to a provider with
programmatic tool calling. This is currently supported by Anthropic and
OpenAI.

- Introduces a new `SkillsV4` specification in `@ai-sdk/provider` for
uploading remote skills across providers
- Adds new core function `uploadSkill` in the `ai` package
- Implements `SkillsV4` for both `@ai-sdk/openai` and
`@ai-sdk/anthropic`, including provider-specific API handling
- Includes comprehensive unit tests for all new code and example scripts
demonstrating basic CRUD and skill-referenced inference for both
providers

Run the new examples included in the PR.

- [x] Tests have been added / updated (for bug fixes / features)
- [ ] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)

N/A

Fixes #12855

Related: #12995

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
felixarntz added a commit that referenced this pull request Apr 8, 2026
…Skill` as shorthand (#14242)

## Background

`uploadFile` and `uploadSkill` required callers to pass the specific
sub-interface (`FilesV4` / `SkillsV4`) directly. Since `ProviderV4`
already exposes optional `files()` and `skills()` methods returning
those interfaces, it's unnecessarily verbose to call `provider.files()`
manually before passing it in. It still makes sense as API primitive,
but we can make it easier.

## Summary

Both `uploadFile` and `uploadSkill` now accept `ProviderV4` as the `api`
argument in addition to `FilesV4` / `SkillsV4` respectively. When a
provider instance is passed, the SDK automatically resolves the
appropriate sub-interface by calling `.files()` or `.skills()`. If the
provider doesn't expose the required method, a clear error is thrown.

Also adds a general function doc for `uploadSkill` that was missing from
#12880.

Also renames `SkillsV4`'s `upload` method to `uploadSkill`, for
consistency and clarity - this was an oversight in the original PR.

## Manual Verification

You can run the new examples for verify the shorthand works.

## Checklist

- [x] Tests have been added / updated (for bug fixes / features)
- [x] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)

## Future Work

N/A

## Related Issues

Follow up to #12995 and #12855
felixarntz added a commit that referenced this pull request Apr 10, 2026
## Summary

Fixes the changesets for the following v7 major PRs after the fact to
mark them as `major`, for proper referencing in future changelog / docs:
- #13352 
- #13816
- #12880 
- #13553
- #13971
- #14150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label feature New feature or request provider/anthropic Issues related to the @ai-sdk/anthropic provider provider/openai Issues related to the @ai-sdk/openai provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for creating and managing remote skills (e.g. Anthropic, OpenAI) via abstraction with new top-level API

2 participants