Skills
A skill is a folder of instructions and files that an agent loads when a task needs it. Its SKILL.md file names the skill and says when to use it. With this API you can upload a skill, list the skills your key can read and download any version.
A skill you create belongs to the key's owner and is private to them until they share it in the Context app.
Creating, versioning and deleting skills needs a personal key with skills:write, which the key's owner must
grant. A built-in skill (source.type is anthropic) is read-only.
What an upload contains
Send the skill's files as multipart/form-data. Either send each file as a files[] part whose filename is its
path in the skill, or send one zip archive of the files.
SKILL.mdsits at the root of the upload, or at the root of its one top-level folder. That folder's name is dropped from every path.SKILL.mdis UTF-8 text with YAML front matter.namecan be at most 64 characters of lowercase letters, digits and hyphens. IfSKILL.mdhas noname, the skill takes the top-level folder's name, and an upload with neither returns400.descriptionis required and can be at most 1,024 characters, with no XML tags.- The files total at most 30 MiB (31,457,280 bytes) uncompressed. A single file has no limit of its own. The request itself can be up to 32 MiB.
- Paths are relative. A path returns
400if it starts with/, contains a backslash or has an empty,.or..segment. Sending the same path twice also returns400. A zip's__MACOSX/and.DS_Storeentries are skipped.
A key can have at most 2 uploads in progress at once.
A skill's name is its SKILL.md name, and every version of a skill keeps that name. You can't own two skills with
the same name. Creating a skill whose name you already use returns 409 with the existing skill's ID, so you can
upload a new version of it instead.
A skill keeps its latest 500 versions, not counting versions given a name in the Context app. Saving more deletes the oldest unnamed versions.
The skill object
| Field | Type | Description |
|---|---|---|
id | string | The skill's ID. A built-in skill's ID is its slug, such as pptx. |
type | string | Always skill. |
display_name | string | The skill's name, the same as the name in its SKILL.md. |
source | object | Who made the skill. source.type is custom for a skill a user uploaded, or anthropic for one of your deployment's built-in skills. |
latest_version_id | string | The ID of the skill's newest version. An agent always runs a skill's newest version. |
created_at | string | When the skill was created, as an RFC 3339 timestamp. |
updated_at | string | When the skill last changed, as an RFC 3339 timestamp. |
A skill version describes one saved state of the skill's files:
| Field | Type | Description |
|---|---|---|
id | string | The version's ID. |
type | string | Always skill_version. |
skill_id | string | The ID of the skill the version belongs to. |
name | string | The name in SKILL.md. It is the same for every version of a skill. |
description | string | The description in SKILL.md at this version. |
created_at | string | When the version was saved, as an RFC 3339 timestamp. |
Example
Code
Differences from Anthropic's API
This API follows Anthropic's Managed Agents API, with these differences:
- A skill is personal to the key's owner and belongs to no workspace. If a request sends the
anthropic-workspace-idheader, Context checks that the key's owner works in that workspace, then ignores it. If the owner doesn't work there, the request returns404. display_namemust equal thenameinSKILL.md, or be left out. A different value returns400.- Deleting a skill version returns
400. Upload a new version, or delete the whole skill. - The built-in skills are this deployment's own, listed by slug (
pptx,xlsx,docxand others). The list has nopdfskill. - A list response holds at most 200 skills or 100 versions per page. Anthropic's API allows up to 1,000.
- Uploads are limited to 32 MiB per request and 2 in progress per key.
For every difference in one place, see Coming from Anthropic's API.
List skills
Lists the skills the key's owner can read.
The list holds your organization's skills that the key's owner can read, and the built-in skills. Skills an
administrator has marked as verified come first, then the rest by updated_at, newest first. The list leaves
out skills shared from another organization, archived skills and skills with no version yet.
The key must have the skills:read capability. For what each capability allows, see Keys.
Response
Returns 200 with a page of skill objects in data and a next_page value to pass as page. A response can hold fewer skills than limit, or none, and still have a next_page value. Keep requesting pages until next_page is null. For every field, see Skills.
Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 400 | invalid_request_error | limit is outside 1 to 200. Send a value from 1 to 200. |
| 400 | invalid_request_error | source is not custom or anthropic. Send one of them, or leave it out. |
| 400 | invalid_request_error | The request has a query parameter other than limit, page and source. Remove it. |
query Parameters
limitThe maximum number of skills to return. Must be between 1 and 200.
The maximum number of skills to return. Must be between 1 and 200.
pageThe next_page value from the previous response. Leave it out to get the first page.
The next_page value from the previous response. Leave it out to get the first page.
sourceThe set of skills to return. One of custom (your organization's skills) or anthropic (built-in skills). Leave it out to return both.
The set of skills to return. One of custom (your organization's skills) or anthropic (built-in skills). Leave it out to return both.
Headers
anthropic-workspace-idThe ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
The ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
List skills › Responses
Returns 200 with a page of skill objects in data and a next_page value to pass as page. A response can hold fewer skills than limit, or none, and still have a next_page value. Keep requesting pages until next_page is null. For every field, see Skills.
next_pageCreate a skill
Creates a skill from uploaded files. The skill belongs to the owner of the API key.
Send multipart/form-data with the skill's files in files[]. To upload a zip archive instead, send it as the
only files[] part. For the rules an upload must follow, see
Skills. Only the key's owner can see
the skill until they share it in the Context app.
If the request fails partway, the server deletes the skill, so no partial skill is left. If your organization
uses the newer permissions model, a skill uploaded with files besides SKILL.md is saved as two versions:
SKILL.md alone, then the whole upload. latest_version_id always points to the version that holds the whole
upload.
The key must be a personal key with the skills:write capability. For what each capability allows, see Keys.
Response
Returns 200 with the skill object. For every field, see Skills.
Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 400 | invalid_request_error | The upload breaks a rule: SKILL.md is missing or not at the root, name or description is missing or invalid, a path is unsafe, or the files total over 30 MiB (31,457,280 bytes) uncompressed. The message names the rule. Fix the files and upload again. |
| 400 | invalid_request_error | display_name is not the name in SKILL.md. Leave it out, or send that name. |
| 400 | invalid_request_error | The form has a field other than files[] and display_name, or the request has a query parameter. Remove it. |
| 403 | permission_error | The key lacks skills:write, is not a personal key, or its owner doesn't have permission to create skills in this organization. Use a personal key with skills:write. |
| 409 | invalid_request_error | The key's owner already has a skill with this name. The message gives its ID. Upload a new version of that skill, or change name in SKILL.md. |
| 413 | request_too_large | The request is over 32 MiB (33,554,432 bytes). Remove files until the request is under 32 MiB. |
| 429 | rate_limit_error | This key already has 2 skill uploads in progress, or the server is processing too many uploads. Wait for the time in Retry-After, then retry. The SDKs retry it for you. |
Headers
anthropic-workspace-idThe ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
The ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
Create a skill › Request Body
filesThe skill's files. On the wire each file is one files[] part, with the file's path in the skill as the filename. The SDKs send the files parameter this way. You can instead send one zip archive that contains all the files.
display_nameThe skill's display name. Must equal the name in SKILL.md.
Create a skill › Responses
Returns 200 with the skill object. For every field, see Skills.
typeidcreated_atdisplay_namelatest_version_idupdated_atGet a skill
Returns a skill by its ID.
To get a built-in skill, pass its slug, such as pptx, as skill_id. Archived skills and skills with no version return 404.
The key must have the skills:read capability. For what each capability allows, see Keys.
Response
Returns 200 with the skill object. For every field, see Skills.
Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 404 | not_found_error | No skill with this ID exists, the key's owner can't read it, the skill is archived, or it has no version yet. Check the ID and the key. To get an archived skill, unarchive it in the Context app. To get a skill with no version, create a version first. |
path Parameters
skill_idThe ID of the skill, or a built-in skill's slug.
The ID of the skill, or a built-in skill's slug.
Headers
anthropic-workspace-idThe ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
The ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
Get a skill › Responses
Returns 200 with the skill object. For every field, see Skills.
typeidcreated_atdisplay_namelatest_version_idupdated_atDelete a skill
Deletes a skill, its versions and their files.
The skill is also removed from every agent it is assigned to. A built-in skill can't be deleted. The key's owner must be able to edit the skill. The delete can't be undone. In some organizations the skill's files are kept in Drive trash until the trash is emptied.
The key must be a personal key with the skills:write capability. For what each capability allows, see Keys.
Response
Returns 200 with an object that holds the skill's id and a type of skill_deleted.
Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 400 | invalid_request_error | The skill is a built-in skill, which is read-only. Check that the ID is a custom skill's. |
| 403 | permission_error | The key lacks skills:write, is not a personal key, or its owner can't edit this skill. Use a personal key with skills:write whose owner can edit the skill. |
| 404 | not_found_error | No skill with this ID exists, or the key's owner can't read it. Check the ID. |
path Parameters
skill_idThe ID of the skill to delete.
The ID of the skill to delete.
Headers
anthropic-workspace-idThe ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
The ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
Delete a skill › Responses
Returns 200 with an object that holds the skill's id and a type of skill_deleted.
idtypeList skill versions
Lists a skill's versions, newest first.
You can't delete a single version: DELETE /v1/skills/{skill_id}/versions/{version} returns 400. To replace a version, upload a new one. To remove every version, delete the skill.
The key must have the skills:read capability. For what each capability allows, see Keys.
Response
Returns 200 with a page of skill version objects in data, newest first, and a next_page value to pass as page. next_page is null on the last page. A version's id is what {version} takes. For every field, see Skills.
Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 400 | invalid_request_error | limit is outside 1 to 100. Send a value from 1 to 100. |
| 404 | not_found_error | No skill with this ID or slug exists, or the key's owner can't read it. Check the ID or slug, and that the key's owner can read the skill. |
path Parameters
skill_idThe ID of the skill, or a built-in skill's slug.
The ID of the skill, or a built-in skill's slug.
query Parameters
limitThe maximum number of versions to return. Must be between 1 and 100.
The maximum number of versions to return. Must be between 1 and 100.
pageThe next_page value from the previous response. Leave it out to get the first page.
The next_page value from the previous response. Leave it out to get the first page.
Headers
anthropic-workspace-idThe ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
The ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
List skill versions › Responses
Returns 200 with a page of skill version objects in data, newest first, and a next_page value to pass as page. next_page is null on the last page. A version's id is what {version} takes. For every field, see Skills.
next_pageCreate a skill version
Saves a new version of a skill from its complete set of files.
Send every file of the skill, the same way as for
Create a skill. A version is a whole snapshot: any file you
leave out is not in the new version. The name in SKILL.md must be the skill's name. The key's owner must be
able to edit the skill.
The upload becomes the skill's newest version at once, so agents that have the skill use this version from their next session. An upload identical to the newest version saves nothing and returns that version.
The key must be a personal key with the skills:write capability. For what each capability allows, see Keys.
Response
Returns 200 with the skill version. For every field, see Skills.
Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 400 | invalid_request_error | The upload breaks a rule, such as SKILL.md missing or the files totaling over 30 MiB (31,457,280 bytes) uncompressed. The message names the rule. Fix the files and upload again. |
| 400 | invalid_request_error | The name in SKILL.md is not the skill's name. Keep the skill's name, or create a separate skill. |
| 400 | invalid_request_error | The skill is a built-in skill, which is read-only. Create your own skill instead. |
| 400 | invalid_request_error | The form has a field other than files[]. Remove it. |
| 403 | permission_error | The key lacks skills:write, is not a personal key, or its owner can't edit this skill. Use a personal key with skills:write whose owner can edit the skill. |
| 404 | not_found_error | No skill with this ID exists, or the key's owner can't read it. Check the ID, and check that the key's owner can read the skill. |
| 413 | request_too_large | The request is over 32 MiB (33,554,432 bytes). Remove files until the request is under 32 MiB. |
| 429 | rate_limit_error | This key already has 2 skill uploads in progress, or the server is processing too many uploads. Wait for the time in Retry-After, then retry. The SDKs retry it for you. |
path Parameters
skill_idThe ID of the skill.
The ID of the skill.
Headers
anthropic-workspace-idThe ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
The ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
Create a skill version › Request Body
filesThe skill's files. On the wire each file is one files[] part, with the file's path in the skill as the filename. The SDKs send the files parameter this way. You can instead send one zip archive that contains all the files.
Create a skill version › Responses
Returns 200 with the skill version. For every field, see Skills.
typeidcreated_atdescriptionnameskill_idGet a skill version
Returns one version of a skill, or its newest version if you pass latest as version.
The key must have the skills:read capability. For what each capability allows, see Keys.
Response
Returns 200 with the skill version. For every field, see Skills.
Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 404 | not_found_error | No skill with this ID or slug exists, the key's owner can't read it, or the version is not one of this skill's. Check skill_id and version, and that the key's owner can read the skill. |
path Parameters
skill_idThe ID of the skill, or a built-in skill's slug.
The ID of the skill, or a built-in skill's slug.
versionThe version's ID, or latest.
The version's ID, or latest.
Headers
anthropic-workspace-idThe ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
The ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
Get a skill version › Responses
Returns 200 with the skill version. For every field, see Skills.
typeidcreated_atdescriptionnameskill_idDownload a skill version
Returns a version's files as one zip archive.
The archive holds SKILL.md and the supporting files under one folder named after the skill's name, the same layout that Create a skill version accepts. The zip file has the same name. If a skill made in the Context app has a name with other characters than lowercase letters, digits and hyphens, the folder name is rewritten in those characters, so Q3 / Q4 report becomes q3-q4-report. If no letters or digits are left, the folder is named after the skill's ID. Pass latest as version for the newest version.
The key must have the skills:read capability. For what each capability allows, see Keys.
Response
Returns 200 with a zip archive. The content-type response header is application/zip, and content-disposition names the file after the skill, such as pr-summary.zip.
Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 400 | invalid_request_error | The version was saved before your deployment stored skill file contents, so the server has no files to return. Download a later version. If none exists, upload the skill's files again as a new version. |
| 404 | not_found_error | No skill with this ID or slug exists, the key's owner can't read it, or the version is not one of this skill's. Check skill_id and version, and that the key's owner can read the skill. |
path Parameters
skill_idThe ID of the skill, or a built-in skill's slug.
The ID of the skill, or a built-in skill's slug.
versionThe version's ID, or latest.
The version's ID, or latest.
Headers
anthropic-workspace-idThe ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
The ID of a workspace in the key's organization that the key's owner works in. Agent and session requests run in that workspace; other requests only check it. The response echoes it. If the owner doesn't work there, the request returns 404. Without it, a new session runs in the agent's workspace or the owner's private workspace: see Where a session runs.
Download a skill version › Responses
Returns 200 with a zip archive. The content-type response header is application/zip, and content-disposition names the file after the skill, such as pr-summary.zip.