skills-guide
build-with-claude/skills-guide
History
build-with-claude/skills-guide Changed · +1 / -1 lines
## Managing custom Skills <Warning id="workspace-scoped-access"> - **Custom Skills are accessible to your entire workspace, not scoped to an end user, conversation, or session.** Any API key in the same workspace can read, invoke, and delete every custom Skill uploaded there, and all of your keys share your organization's Default Workspace unless you have assigned them to separate [workspaces](https://platform.claude.com/docs/en/manage-claude/workspaces#api-keys-and-resource-scoping). + **Custom Skills are accessible to your entire workspace, not scoped to an end user, conversation, or session.** Any API key with access to a workspace can read, invoke, and delete every custom Skill uploaded to that workspace. Every service account, and every user whose organization role allows API access, can use the Default Workspace in addition to any workspace you add them to, so keep Skills that must stay separate in their own [workspace](https://platform.claude.com/docs/en/manage-claude/workspaces#api-keys-and-resource-scoping) and access them only with keys scoped to that workspace. If you are building a multi-tenant platform on the Skills API, create a separate [workspace](https://platform.claude.com/docs/en/manage-claude/workspaces) for each tenant. The workspace is the isolation boundary for custom Skills, so a workspace per tenant gives each tenant's Skills hard isolation from every other tenant. Each organization can have up to 100 workspaces by default (see [How workspaces work](https://platform.claude.com/docs/en/manage-claude/workspaces#how-workspaces-work)); if you need more for tenant isolation, contact your account team. </Warning>
build-with-claude/skills-guide Changed · +79 / -114 lines
``` ```php PHP - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); - $message = $client->beta->messages->create( + $message = $client->messages->create( maxTokens: 4096, messages: [ ['role' => 'user', 'content' => 'Create a presentation about renewable energy'] ], model: 'claude-opus-5', - betas: ['code-execution-2025-08-25', 'skills-2025-10-02'], container: [ 'skills' => [ [ 'type' => 'anthropic', - 'skill_id' => 'pptx', + 'skillID' => 'pptx', 'version' => 'latest' ] ]
--raw-output) # Step 4: Download the file using Files API - ant files download \ - --file-id "$FILE_ID" \ - --output "$FILENAME" > /dev/null + ant files download --file-id "$FILE_ID" --output "$FILENAME" > /dev/null printf 'Downloaded: %s\n' "$FILENAME" ```
``` ```php PHP - // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs. - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); // Step 1: Use a Skill to create a file - $response = $client->beta->messages->create( + $response = $client->messages->create( maxTokens: 4096, messages: [ ['role' => 'user', 'content' => 'Create an Excel file with a simple budget spreadsheet'] ], model: 'claude-opus-5', - betas: ['code-execution-2025-08-25', 'skills-2025-10-02'], container: [ 'skills' => [ - ['type' => 'anthropic', 'skill_id' => 'xlsx', 'version' => 'latest'] + ['type' => 'anthropic', 'skillID' => 'xlsx', 'version' => 'latest'] ] ], tools: [
// Step 3: Download the file using Files API foreach (extractFileIds($response) as $fileId) { - $fileMetadata = $client->beta->files->retrieveMetadata($fileId); - $fileContent = $client->beta->files->download($fileId); + $fileMetadata = $client->files->retrieveMetadata($fileId); + $fileContent = $client->files->download($fileId); // Step 4: Save to disk file_put_contents($fileMetadata->filename, $fileContent);
--format yaml # List all files - ant files list \ - --transform '{filename,created_at}' \ - --format yaml + ant files list --transform '{filename,created_at}' --format yaml # Delete a file ant files delete --file-id "$FILE_ID" >/dev/null
``` ```php PHP - // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs. $client = new Client(); $fileId = 'file_011CNha8iCJcU1wXNR6q4V8w'; // Get file metadata - $fileInfo = $client->beta->files->retrieveMetadata($fileId); + $fileInfo = $client->files->retrieveMetadata($fileId); echo "Filename: {$fileInfo->filename}, Size: {$fileInfo->sizeBytes} bytes\n"; // List files (first page) - $files = $client->beta->files->list(); - foreach ($files->data as $file) { + foreach ($client->files->list()->getItems() as $file) { echo "{$file->filename} - {$file->createdAt->format(DATE_ATOM)}\n"; } // Delete a file - $client->beta->files->delete($fileId); + $client->files->delete($fileId); ``` ```ruby Ruby
``` ```php PHP - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); - $response1 = $client->beta->messages->create( + $response1 = $client->messages->create( maxTokens: 4096, messages: [ ['role' => 'user', 'content' => 'Create a sample sales dataset and analyze it'] ], model: 'claude-opus-5', - betas: ['code-execution-2025-08-25', 'skills-2025-10-02'], container: [ 'skills' => [ - ['type' => 'anthropic', 'skill_id' => 'xlsx', 'version' => 'latest'] + ['type' => 'anthropic', 'skillID' => 'xlsx', 'version' => 'latest'] ] ], tools: [
['role' => 'user', 'content' => 'What was the total revenue?'] ]; - $response2 = $client->beta->messages->create( + $response2 = $client->messages->create( maxTokens: 4096, messages: $messages, model: 'claude-opus-5', - betas: ['code-execution-2025-08-25', 'skills-2025-10-02'], container: [ 'id' => $response1->container->id, 'skills' => [ - ['type' => 'anthropic', 'skill_id' => 'xlsx', 'version' => 'latest'] + ['type' => 'anthropic', 'skillID' => 'xlsx', 'version' => 'latest'] ] ], tools: [
``` ```php PHP - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); $messages = [
]; $maxRetries = 10; - $response = $client->beta->messages->create( + $response = $client->messages->create( maxTokens: 4096, messages: $messages, model: 'claude-opus-5', - betas: ['code-execution-2025-08-25', 'skills-2025-10-02'], container: [ 'skills' => [ [ 'type' => 'custom', - 'skill_id' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', + 'skillID' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', 'version' => 'latest' ] ]
$messages[] = ['role' => 'assistant', 'content' => $response->content]; - $response = $client->beta->messages->create( + $response = $client->messages->create( maxTokens: 4096, messages: $messages, model: 'claude-opus-5', - betas: ['code-execution-2025-08-25', 'skills-2025-10-02'], container: [ 'id' => $response->container->id, 'skills' => [ [ 'type' => 'custom', - 'skill_id' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', + 'skillID' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', 'version' => 'latest' ] ]
``` ```php PHP - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); - $message = $client->beta->messages->create( + $message = $client->messages->create( maxTokens: 4096, messages: [ ['role' => 'user', 'content' => 'Analyze sales data and create a presentation'] ], model: 'claude-opus-5', - betas: ['code-execution-2025-08-25', 'skills-2025-10-02'], container: [ 'skills' => [ [ 'type' => 'anthropic', - 'skill_id' => 'xlsx', + 'skillID' => 'xlsx', 'version' => 'latest' ], [ 'type' => 'anthropic', - 'skill_id' => 'pptx', + 'skillID' => 'pptx', 'version' => 'latest' ], [ 'type' => 'custom', - 'skill_id' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', + 'skillID' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', 'version' => 'latest' ] ]
``` ```php PHP - // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. use Anthropic\Core\FileParam; // ...
$client = new Client(); // Option 1: Using a zip file - $skill = $client->beta->skills->create( + $skill = $client->skills->create( files: [ - FileParam::fromResource(fopen('example_skill.zip', 'r')) + FileParam::fromResource(fopen('example_skill.zip', 'r')), ], ); // Option 2: Using individual files - $skill = $client->beta->skills->create( + $skill = $client->skills->create( files: [ - FileParam::fromResource(fopen('financial_skill/SKILL.md', 'r'), 'financial_skill/SKILL.md', 'text/markdown'), - FileParam::fromResource(fopen('financial_skill/analyze.py', 'r'), 'financial_skill/analyze.py', 'text/x-python') + FileParam::fromResource( + fopen('financial_skill/SKILL.md', 'r'), + filename: 'financial_skill/SKILL.md', + contentType: 'text/markdown', + ), + FileParam::fromResource( + fopen('financial_skill/analyze.py', 'r'), + filename: 'financial_skill/analyze.py', + contentType: 'text/x-python', + ), ], ); echo "Created skill: {$skill->id}\n"; - echo "Latest version: {$skill->latestVersion}\n"; + echo "Latest version: {$skill->latestVersionID}\n"; ``` ```ruby Ruby
``` ```php PHP - // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. $client = new Client(); // List Skills (first page) - $skills = $client->beta->skills->list(); - - foreach ($skills->data as $skill) { - echo "{$skill->id}: {$skill->displayTitle} (source: {$skill->source})\n"; + foreach ($client->skills->list()->getItems() as $skill) { + echo "{$skill->id}: {$skill->displayName} (source: {$skill->source->type})\n"; } // List only custom Skills - $customSkills = $client->beta->skills->list( + $customSkills = $client->skills->list( source: 'custom', ); ```
``` ```bash CLI - ant skills retrieve \ - --skill-id skill_01AbCdEfGhIjKlMnOpQrStUv + ant skills retrieve --skill-id skill_01AbCdEfGhIjKlMnOpQrStUv ``` ```python Python
``` ```php PHP - // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. $client = new Client(); - $skill = $client->beta->skills->retrieve( - skillID: 'skill_01AbCdEfGhIjKlMnOpQrStUv', - ); + $skill = $client->skills->retrieve('skill_01AbCdEfGhIjKlMnOpQrStUv'); - echo "Skill: " . $skill->displayTitle . "\n"; - echo "Latest version: " . $skill->latestVersion . "\n"; - echo "Created: " . $skill->createdAt . "\n"; + echo "Skill: {$skill->displayName}\n"; + echo "Latest version: {$skill->latestVersionID}\n"; + echo "Created: {$skill->createdAt->format(DATE_ATOM)}\n"; ``` ```ruby Ruby
``` ```bash CLI - ant skills delete \ - --skill-id skill_01AbCdEfGhIjKlMnOpQrStUv >/dev/null + ant skills delete --skill-id skill_01AbCdEfGhIjKlMnOpQrStUv >/dev/null ``` ```python Python
``` ```php PHP - // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. $client = new Client(); - // In the beta namespace, a Skill's versions must be deleted before the Skill itself. - $skillId = 'skill_01AbCdEfGhIjKlMnOpQrStUv'; - foreach ($client->beta->skills->versions->list($skillId)->pagingEachItem() as $version) { - $client->beta->skills->versions->delete($version->version, skillID: $skillId); - } - $client->beta->skills->delete($skillId); + $client->skills->delete('skill_01AbCdEfGhIjKlMnOpQrStUv'); ``` ```ruby Ruby
``` ```php PHP - // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. use Anthropic\Core\FileParam; - // ... + $client = new Client(); // Create a new version - $newVersion = $client->beta->skills->versions->create( + $newVersion = $client->skills->versions->create( skillID: 'skill_01AbCdEfGhIjKlMnOpQrStUv', files: [ - FileParam::fromResource(fopen('financial_skill/SKILL.md', 'r'), 'financial_skill/SKILL.md', 'text/markdown'), - FileParam::fromResource(fopen('financial_skill/analyze.py', 'r'), 'financial_skill/analyze.py', 'text/x-python'), + FileParam::fromResource( + fopen('financial_skill/SKILL.md', 'r'), + filename: 'financial_skill/SKILL.md', + contentType: 'text/markdown', + ), + FileParam::fromResource( + fopen('financial_skill/analyze.py', 'r'), + filename: 'financial_skill/analyze.py', + contentType: 'text/x-python', + ), ], ); // Use specific version - $response = $client->beta->messages->create( + $response = $client->messages->create( maxTokens: 4096, messages: [['role' => 'user', 'content' => 'Use updated Skill']], model: 'claude-opus-5', - betas: ['code-execution-2025-08-25', 'skills-2025-10-02'], container: [ 'skills' => [[ 'type' => 'custom', - 'skill_id' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', - 'version' => $newVersion->version + 'skillID' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', + 'version' => $newVersion->id ]] ], tools: [['type' => 'code_execution_20250825', 'name' => 'code_execution']]
echo $response; // Use latest version - $latestResponse = $client->beta->messages->create( + $latestResponse = $client->messages->create( maxTokens: 4096, messages: [['role' => 'user', 'content' => 'Use latest Skill version']], model: 'claude-opus-5', - betas: ['code-execution-2025-08-25', 'skills-2025-10-02'], container: [ 'skills' => [[ 'type' => 'custom', - 'skill_id' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', + 'skillID' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', 'version' => 'latest' ]] ],
``` ```php PHP - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); // Custom DCF analysis Skill (ID obtained from Skills API create response) - $dcfSkillId = "skill_01AbCdEfGhIjKlMnOpQrStUv"; + $dcfSkillId = 'skill_01AbCdEfGhIjKlMnOpQrStUv'; // Use with Excel to create financial model - $message = $client->beta->messages->create( + $message = $client->messages->create( maxTokens: 4096, messages: [ ['role' => 'user', 'content' => 'Build a DCF valuation model for a SaaS company'] ], model: 'claude-opus-5', - betas: ['code-execution-2025-08-25', 'skills-2025-10-02'], container: [ 'skills' => [ - ['type' => 'anthropic', 'skill_id' => 'xlsx', 'version' => 'latest'], - ['type' => 'custom', 'skill_id' => $dcfSkillId, 'version' => 'latest'] + ['type' => 'anthropic', 'skillID' => 'xlsx', 'version' => 'latest'], + ['type' => 'custom', 'skillID' => $dcfSkillId, 'version' => 'latest'] ] ], tools: [
$container = [ 'skills' => [[ 'type' => 'custom', - 'skill_id' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', - 'version' => '1759178010641129' + 'skillID' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', + 'version' => 'skver_01AbCdEfGhIjKlMnOpQrStUv' ]] ]; ```
$container = [ 'skills' => [[ 'type' => 'custom', - 'skill_id' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', + 'skillID' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', 'version' => 'latest' ]] ];
``` ```php PHP - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); // Skills render into the system prompt in a fixed, cache-friendly order - $response1 = $client->beta->messages->create( + $response1 = $client->messages->create( maxTokens: 4096, messages: [ ['role' => 'user', 'content' => 'Analyze sales data'] ], model: 'claude-opus-5', - betas: [ - 'code-execution-2025-08-25', - 'skills-2025-10-02', - ], container: [ 'skills' => [ - ['type' => 'anthropic', 'skill_id' => 'xlsx', 'version' => 'latest'] + ['type' => 'anthropic', 'skillID' => 'xlsx', 'version' => 'latest'] ] ], tools: [
echo $response1; // Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit - $response2 = $client->beta->messages->create( + $response2 = $client->messages->create( maxTokens: 4096, messages: [ ['role' => 'user', 'content' => 'Create a presentation'] ], model: 'claude-opus-5', - betas: [ - 'code-execution-2025-08-25', - 'skills-2025-10-02', - ], container: [ 'skills' => [ - ['type' => 'anthropic', 'skill_id' => 'xlsx', 'version' => 'latest'], - ['type' => 'anthropic', 'skill_id' => 'pptx', 'version' => 'latest'] + ['type' => 'anthropic', 'skillID' => 'xlsx', 'version' => 'latest'], + ['type' => 'anthropic', 'skillID' => 'pptx', 'version' => 'latest'] ] ], tools: [
``` ```php PHP - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. use Anthropic\Core\Exceptions\BadRequestException; $client = new Client(); try { - $message = $client->beta->messages->create( + $message = $client->messages->create( maxTokens: 4096, messages: [ ['role' => 'user', 'content' => 'Process data'] ], model: 'claude-opus-5', - betas: ['code-execution-2025-08-25', 'skills-2025-10-02'], container: [ 'skills' => [ [ 'type' => 'custom', - 'skill_id' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', + 'skillID' => 'skill_01AbCdEfGhIjKlMnOpQrStUv', 'version' => 'latest' ] ]
build-with-claude/skills-guide Changed · +18 / -5 lines
1. **Claude API key** from the [Claude Console](https://platform.claude.com/settings/keys) 2. **[Code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool)** enabled in your requests -Skills are generally available on the Claude API and don't require an `anthropic-beta` header, either for the Skills API or for `container.skills` in Messages requests. Requests that still send the `skills-2025-10-02` beta header keep working, and Skills API requests that send it keep the earlier beta response format. The PHP tabs on this page still call the SDK's `beta` namespace and send that header, so their printed output shows the earlier response fields. - Skills require the code execution tool, so use a model from its [model compatibility list](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#model-compatibility). ***
``` ```php PHP + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); $message = $client->beta->messages->create(
``` ```php PHP + // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs. + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); // Step 1: Use a Skill to create a file
``` ```php PHP + // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs. $client = new Client(); $fileId = 'file_011CNha8iCJcU1wXNR6q4V8w';
``` ```php PHP + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); $response1 = $client->beta->messages->create(
``` ```php PHP + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); $messages = [
``` ```php PHP + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); $message = $client->beta->messages->create(
``` ```php PHP + // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. use Anthropic\Core\FileParam; // ...
``` ```php PHP + // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. $client = new Client(); // List Skills (first page)
``` ```php PHP + // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. $client = new Client(); $skill = $client->beta->skills->retrieve(
``` ```php PHP + // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. $client = new Client(); - // The PHP SDK still uses the beta Skills namespace, where a Skill's versions - // must be deleted before the Skill itself. + // In the beta namespace, a Skill's versions must be deleted before the Skill itself. $skillId = 'skill_01AbCdEfGhIjKlMnOpQrStUv'; foreach ($client->beta->skills->versions->list($skillId)->pagingEachItem() as $version) { $client->beta->skills->versions->delete($version->version, skillID: $skillId);
``` ```php PHP + // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. use Anthropic\Core\FileParam; // ...
``` ```php PHP + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); // Custom DCF analysis Skill (ID obtained from Skills API create response)
The SDK tabs in this section show the `container` value to include in a Messages request. The cURL and CLI tabs show the full request. -**For production:** pin a specific version, so Skill updates never change your deployed behavior. If you omit `version` or set it to `"latest"`, requests use the newest version of the Skill, so a version uploaded by anyone in the [workspace](https://platform.claude.com/docs/en/build-with-claude/skills-guide#workspace-scoped-access) immediately changes what your production agents run. The version ID comes from the create-version response in [Versioning](https://platform.claude.com/docs/en/build-with-claude/skills-guide#versioning) or from the [List Skill Versions API](https://platform.claude.com/docs/en/api/skills/versions/list). The ID is always a string, so quote it in JSON or YAML (versions created under the `skills-2025-10-02` beta header have numeric-looking epoch-timestamp IDs). +**For production:** pin a specific version, so Skill updates never change your deployed behavior. If you omit `version` or set it to `"latest"`, requests use the newest version of the Skill, so a version uploaded by anyone in the [workspace](https://platform.claude.com/docs/en/build-with-claude/skills-guide#workspace-scoped-access) immediately changes what your production agents run. The version ID comes from the create-version response in [Versioning](https://platform.claude.com/docs/en/build-with-claude/skills-guide#versioning) or from the [List Skill Versions API](https://platform.claude.com/docs/en/api/skills/versions/list). The ID is always a string, so quote it in JSON or YAML even when it looks numeric. <CodeGroup> ```bash cURL
``` ```php PHP + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $client = new Client(); // Skills render into the system prompt in a fixed, cache-friendly order
``` ```php PHP + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. use Anthropic\Core\Exceptions\BadRequestException; $client = new Client();
build-with-claude/skills-guide Changed · +597 / -738 lines
The two sides of this change are too far apart to line up, so this is the differ's own diff of it.
<Note> For complete API reference including request/response schemas and all parameters, see: - * [Skill Management API Reference](https://platform.claude.com/docs/en/api/beta/skills/list) - CRUD operations for Skills - * [Skill Versions API Reference](https://platform.claude.com/docs/en/api/beta/skills/versions/list) - Version management + * [Skill Management API Reference](https://platform.claude.com/docs/en/api/skills/list) - CRUD operations for Skills + * [Skill Versions API Reference](https://platform.claude.com/docs/en/api/skills/versions/list) - Version management </Note> <Note>
You can use Skills from two sources: -| Aspect | Anthropic Skills | Custom Skills | -| ------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| **Type value** | `anthropic` | `custom` | -| **Skill IDs** | Short names: `pptx`, `xlsx`, `docx`, `pdf` | Generated: `skill_01AbCdEfGhIjKlMnOpQrStUv` | -| **Version format** | Date-based: `20251013` or `latest` | Version ID: `skver_01AbCdEfGhIjKlMnOpQrStUv` or `latest` | -| **Management** | Pre-built and maintained by Anthropic | Upload and manage through the [Skills API](https://platform.claude.com/docs/en/api/beta/skills/create) | -| **Availability** | Available to all users | Private to your workspace | - -Both skill sources are returned by the [List Skills endpoint](https://platform.claude.com/docs/en/api/beta/skills/list) (use the `source` parameter to filter). The integration shape and execution environment are identical. The only difference is where the Skills come from and how they're managed. +| Aspect | Anthropic Skills | Custom Skills | +| ------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------- | +| **Type value** | `anthropic` | `custom` | +| **Skill IDs** | Short names: `pptx`, `xlsx`, `docx`, `pdf` | Generated: `skill_01AbCdEfGhIjKlMnOpQrStUv` | +| **Version format** | Date-based: `20251013` or `latest` | Version ID: `skver_01AbCdEfGhIjKlMnOpQrStUv` or `latest` | +| **Management** | Pre-built and maintained by Anthropic | Upload and manage through the [Skills API](https://platform.claude.com/docs/en/api/skills/create) | +| **Availability** | Available to all users | Private to your workspace | + +Both skill sources are returned by the [List Skills endpoint](https://platform.claude.com/docs/en/api/skills/list) (use the `source` parameter to filter). The integration shape and execution environment are identical. The only difference is where the Skills come from and how they're managed. ### Prerequisites
1. **Claude API key** from the [Claude Console](https://platform.claude.com/settings/keys) 2. **[Code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool)** enabled in your requests -Skills are generally available on the Claude API and don't require an `anthropic-beta` header, either for the Skills API or for `container.skills` in Messages requests. The examples in this guide still send the `skills-2025-10-02` beta header (plus `code-execution-2025-08-25` in Messages requests) and use the SDKs' `beta` namespace. Both headers remain valid opt-ins, so the examples work as written, and you can omit them in your own requests. +Skills are generally available on the Claude API and don't require an `anthropic-beta` header, either for the Skills API or for `container.skills` in Messages requests. Requests that still send the `skills-2025-10-02` beta header keep working, and Skills API requests that send it keep the earlier beta response format. The PHP tabs on this page still call the SDK's `beta` namespace and send that header, so their printed output shows the earlier response fields. Skills require the code execution tool, so use a model from its [model compatibility list](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#model-compatibility).
curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d '{ "model": "claude-opus-5",
``` ```bash CLI - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 <<'YAML' + ant messages create <<'YAML' model: claude-opus-5 max_tokens: 4096 container:
```python Python client = anthropic.Anthropic() - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "skills": [{"type": "anthropic", "skill_id": "pptx", "version": "latest"}] },
```typescript TypeScript const client = new Anthropic(); - const response = await client.beta.messages.create({ + const response = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ {
{ Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "pptx", Version = "latest", }, ], }, Messages = [new() { Role = Role.User, Content = "Create a presentation about renewable energy" }], - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - var message = await client.Beta.Messages.Create(parameters); + var message = await client.Messages.Create(parameters); Console.WriteLine(message); ``` ```go Go client := anthropic.NewClient() - response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{ - "code-execution-2025-08-25", - anthropic.AnthropicBetaSkills2025_10_02, - }, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeAnthropic, + Type: anthropic.SkillParamsTypeAnthropic, SkillID: "pptx", Version: anthropic.String("latest"), }, }, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Create a presentation about renewable energy")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Create a presentation about renewable energy")), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
``` ```java Java - import com.anthropic.models.beta.messages.BetaContainerParams; - import com.anthropic.models.beta.messages.BetaSkillParams; - import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825; + import com.anthropic.models.messages.ContainerParams; + import com.anthropic.models.messages.SkillParams; + import com.anthropic.models.messages.CodeExecutionTool20250825; // ... void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv();
MessageCreateParams params = MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() - .addSkill(BetaSkillParams.builder() - .type(BetaSkillParams.Type.ANTHROPIC) + .container(ContainerParams.builder() + .addSkill(SkillParams.builder() + .type(SkillParams.Type.ANTHROPIC) .skillId("pptx") .version("latest") .build()) .build()) .addUserMessage("Create a presentation about renewable energy") - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build(); - BetaMessage response = client.beta().messages().create(params); + Message response = client.messages().create(params); System.out.println(response); } ```
```ruby Ruby client = Anthropic::Client.new - message = client.beta.messages.create( + message = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ {
RESPONSE=$(curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d '{ "model": "claude-opus-5",
# Step 3: Get filename from metadata FILENAME=$(curl "https://api.anthropic.com/v1/files/$FILE_ID" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ - -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: files-api-2025-04-14" | jq -r '.filename') + -H "anthropic-version: 2023-06-01" | jq -r '.filename') # Step 4: Download the file using Files API curl "https://api.anthropic.com/v1/files/$FILE_ID/content" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: files-api-2025-04-14" \ --output "$FILENAME" echo "Downloaded: $FILENAME"
```bash CLI # Step 1: Use the xlsx Skill to create a file # Step 2: Extract file_id from the response with --transform (GJSON path) - FILE_ID=$(ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 \ + FILE_ID=$(ant messages create \ --transform 'content.#.content.content.#.file_id|@flatten|0' \ --raw-output <<'YAML' model: claude-opus-5
) # Step 3: Get the filename from file metadata - FILENAME=$(ant beta:files retrieve-metadata \ + FILENAME=$(ant files retrieve-metadata \ --file-id "$FILE_ID" \ --transform filename \ --raw-output) # Step 4: Download the file using Files API - ant beta:files download \ + ant files download \ --file-id "$FILE_ID" \ --output "$FILENAME" > /dev/null
client = anthropic.Anthropic() # Step 1: Use a Skill to create a file - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}] },
# Step 3: Download the file using Files API for file_id in extract_file_ids(response): - file_metadata = client.beta.files.retrieve_metadata(file_id=file_id) - file_content = client.beta.files.download(file_id=file_id) + file_metadata = client.files.retrieve_metadata(file_id=file_id) + file_content = client.files.download(file_id=file_id) # Step 4: Save to disk file_content.write_to_file(file_metadata.filename)
const client = new Anthropic(); // Step 1: Use a Skill to create a file - const response = await client.beta.messages.create({ + const response = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }] },
// Step 3: Download each file and save to disk for (const fileId of fileIds) { - const fileMetadata = await client.beta.files.retrieveMetadata(fileId); - const fileResponse = await client.beta.files.download(fileId); + const fileMetadata = await client.files.retrieveMetadata(fileId); + const fileResponse = await client.files.download(fileId); await writeFile(fileMetadata.filename, Buffer.from(await fileResponse.arrayBuffer())); console.log(`Downloaded: ${fileMetadata.filename}`);
{ Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "xlsx", Version = "latest", }, ], }, Messages = [new() { Role = Role.User, Content = "Create an Excel file with a simple budget spreadsheet" }], - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - var response = await client.Beta.Messages.Create(parameters); + var response = await client.Messages.Create(parameters); // Step 2: Extract file IDs from the response List<string> fileIds = []; foreach (var block in response.Content) { if (block.TryPickBashCodeExecutionToolResult(out var toolResult) - && toolResult.Content.TryPickBetaBashCodeExecutionResultBlock(out var result)) + && toolResult.Content.TryPickBashCodeExecutionResultBlock(out var result)) { foreach (var output in result.Content) {
// Step 3: Download each file and save to disk foreach (var fileId in fileIds) { - var fileMetadata = await client.Beta.Files.RetrieveMetadata(fileId); - using var download = await client.Beta.Files.Download(fileId); + var fileMetadata = await client.Files.RetrieveMetadata(fileId); + using var download = await client.Files.Download(fileId); using var downloadStream = await download.ReadAsStream(); using var outputFile = File.Create(fileMetadata.Filename); await downloadStream.CopyToAsync(outputFile);
client := anthropic.NewClient() // Step 1: Use a Skill to create a file - response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02}, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeAnthropic, + Type: anthropic.SkillParamsTypeAnthropic, SkillID: "xlsx", Version: anthropic.String("latest"), }, }, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Create an Excel file with a simple budget spreadsheet")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Create an Excel file with a simple budget spreadsheet")), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
// Step 3: Download the file using Files API for _, fileID := range fileIDs { - fileMetadata, err := client.Beta.Files.GetMetadata(context.TODO(), fileID, anthropic.BetaFileGetMetadataParams{}) + fileMetadata, err := client.Files.GetMetadata(context.TODO(), fileID) if err != nil { log.Fatal(err) } - fileContent, err := client.Beta.Files.Download(context.TODO(), fileID, anthropic.BetaFileDownloadParams{}) + fileContent, err := client.Files.Download(context.TODO(), fileID) if err != nil { log.Fatal(err) }
} } - func extractFileIDs(response *anthropic.BetaMessage) []string { + func extractFileIDs(response *anthropic.Message) []string { var fileIDs []string for _, item := range response.Content { switch v := item.AsAny().(type) { - case anthropic.BetaBashCodeExecutionToolResultBlock: + case anthropic.BashCodeExecutionToolResultBlock: if v.Content.Type == "bash_code_execution_result" { for _, output := range v.Content.Content { fileIDs = append(fileIDs, output.FileID)
``` ```java Java - import com.anthropic.models.beta.messages.BetaContainerParams; - import com.anthropic.models.beta.messages.BetaSkillParams; - import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825; - import com.anthropic.models.beta.messages.BetaContentBlock; - import com.anthropic.models.beta.files.FileMetadata; + import com.anthropic.models.messages.ContainerParams; + import com.anthropic.models.messages.SkillParams; + import com.anthropic.models.messages.CodeExecutionTool20250825; + import com.anthropic.models.messages.ContentBlock; + import com.anthropic.models.files.FileMetadata; import com.anthropic.core.http.HttpResponse; // ... void main() throws Exception {
MessageCreateParams params = MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() - .addSkill(BetaSkillParams.builder() - .type(BetaSkillParams.Type.ANTHROPIC) + .container(ContainerParams.builder() + .addSkill(SkillParams.builder() + .type(SkillParams.Type.ANTHROPIC) .skillId("xlsx") .version("latest") .build()) .build()) .addUserMessage("Create an Excel file with a simple budget spreadsheet") - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build(); - BetaMessage response = client.beta().messages().create(params); + Message response = client.messages().create(params); // Step 2: Extract file IDs from the response List<String> fileIds = new ArrayList<>(); - for (BetaContentBlock block : response.content()) { + for (ContentBlock block : response.content()) { if (block.isBashCodeExecutionToolResult()) { var content = block.asBashCodeExecutionToolResult().content(); - if (content.isBetaBashCodeExecutionResultBlock()) { - for (var outputBlock : content.asBetaBashCodeExecutionResultBlock().content()) { + if (content.isBashCodeExecutionResultBlock()) { + for (var outputBlock : content.asBashCodeExecutionResultBlock().content()) { fileIds.add(outputBlock.fileId()); } }
// Step 3: Download the file using Files API for (String fileId : fileIds) { - FileMetadata fileMetadata = client.beta().files().retrieveMetadata(fileId); - HttpResponse fileContent = client.beta().files().download(fileId); + FileMetadata fileMetadata = client.files().retrieveMetadata(fileId); + HttpResponse fileContent = client.files().download(fileId); // Step 4: Save to disk try (InputStream is = fileContent.body();
client = Anthropic::Client.new # Step 1: Use a Skill to create a file - response = client.beta.messages.create( + response = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }] },
# Step 3: Download the file using Files API extract_file_ids(response).each do |file_id| - file_metadata = client.beta.files.retrieve_metadata(file_id) - - file_content = client.beta.files.download(file_id) + file_metadata = client.files.retrieve_metadata(file_id) + + file_content = client.files.download(file_id) # Step 4: Save to disk File.binwrite(file_metadata.filename, file_content.read)
# Get file metadata curl "https://api.anthropic.com/v1/files/$FILE_ID" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ - -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: files-api-2025-04-14" + -H "anthropic-version: 2023-06-01" # List all files curl "https://api.anthropic.com/v1/files" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ - -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: files-api-2025-04-14" + -H "anthropic-version: 2023-06-01" # Delete a file curl -X DELETE "https://api.anthropic.com/v1/files/$FILE_ID" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ - -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: files-api-2025-04-14" + -H "anthropic-version: 2023-06-01" ``` ```bash CLI # Get file metadata - ant beta:files retrieve-metadata \ + ant files retrieve-metadata \ --file-id "$FILE_ID" \ --transform '{filename,size_bytes}' \ --format yaml # List all files - ant beta:files list \ + ant files list \ --transform '{filename,created_at}' \ --format yaml # Delete a file - ant beta:files delete --file-id "$FILE_ID" >/dev/null + ant files delete --file-id "$FILE_ID" >/dev/null ``` ```python Python client = anthropic.Anthropic() file_id = "file_011CNha8iCJcU1wXNR6q4V8w" # Get file metadata - file_info = client.beta.files.retrieve_metadata(file_id=file_id) + file_info = client.files.retrieve_metadata(file_id=file_id) print(f"Filename: {file_info.filename}, Size: {file_info.size_bytes} bytes") # List all files - for file in client.beta.files.list(): + for file in client.files.list(): print(f"{file.filename} - {file.created_at}") # Delete a file - client.beta.files.delete(file_id=file_id) + client.files.delete(file_id=file_id) ``` ```typescript TypeScript
const fileId = "file_011CNha8iCJcU1wXNR6q4V8w"; // Get file metadata - const fileInfo = await client.beta.files.retrieveMetadata(fileId); + const fileInfo = await client.files.retrieveMetadata(fileId); console.log(`Filename: ${fileInfo.filename}, Size: ${fileInfo.size_bytes} bytes`); // List all files - for await (const file of client.beta.files.list()) { + for await (const file of client.files.list()) { console.log(`${file.filename} - ${file.created_at}`); } // Delete a file - await client.beta.files.delete(fileId); + await client.files.delete(fileId); ``` ```csharp C#
var fileId = "file_011CNha8iCJcU1wXNR6q4V8w"; // Get file metadata - var fileInfo = await client.Beta.Files.RetrieveMetadata(fileId); + var fileInfo = await client.Files.RetrieveMetadata(fileId); Console.WriteLine($"Filename: {fileInfo.Filename}, Size: {fileInfo.SizeBytes} bytes"); // List files - await foreach (var file in (await client.Beta.Files.List()).Paginate()) + await foreach (var file in (await client.Files.List()).Paginate()) { Console.WriteLine($"{file.Filename} - {file.CreatedAt}"); } // Delete the file - await client.Beta.Files.Delete(fileId); + await client.Files.Delete(fileId); ``` ```go Go
fileID := "file_011CNha8iCJcU1wXNR6q4V8w" // Get file metadata - fileInfo, err := client.Beta.Files.GetMetadata(context.TODO(), fileID, anthropic.BetaFileGetMetadataParams{}) + fileInfo, err := client.Files.GetMetadata(context.TODO(), fileID) if err != nil { log.Fatal(err) } fmt.Printf("Filename: %s, Size: %d bytes\n", fileInfo.Filename, fileInfo.SizeBytes) // List all files - files := client.Beta.Files.ListAutoPaging(context.TODO(), anthropic.BetaFileListParams{}) + files := client.Files.ListAutoPaging(context.TODO(), anthropic.FileListParams{}) for files.Next() { file := files.Current() fmt.Printf("%s - %s\n", file.Filename, file.CreatedAt)
} // Delete a file - _, err = client.Beta.Files.Delete(context.TODO(), fileID, anthropic.BetaFileDeleteParams{}) + _, err = client.Files.Delete(context.TODO(), fileID) if err != nil { log.Fatal(err) } ``` ```java Java - import com.anthropic.models.beta.files.FileMetadata; - import com.anthropic.models.beta.files.FileListPage; + import com.anthropic.models.files.FileMetadata; + import com.anthropic.models.files.FileListPage; // ... void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv(); String fileId = "file_011CNha8iCJcU1wXNR6q4V8w"; // Get file metadata - FileMetadata fileInfo = client.beta().files().retrieveMetadata(fileId); + FileMetadata fileInfo = client.files().retrieveMetadata(fileId); System.out.println("Filename: " + fileInfo.filename() + ", Size: " + fileInfo.sizeBytes() + " bytes"); // List files (first page) - FileListPage files = client.beta().files().list(); + FileListPage files = client.files().list(); for (var file : files.data()) { System.out.println(file.filename() + " - " + file.createdAt()); } // Delete a file - client.beta().files().delete(fileId); + client.files().delete(fileId); } ```
file_id = "file_011CNha8iCJcU1wXNR6q4V8w" # Get file metadata - file_info = client.beta.files.retrieve_metadata(file_id) + file_info = client.files.retrieve_metadata(file_id) puts "Filename: #{file_info.filename}, Size: #{file_info.size_bytes} bytes" # List all files - client.beta.files.list.auto_paging_each do |file| + client.files.list.auto_paging_each do |file| puts "#{file.filename} - #{file.created_at}" end # Delete a file - client.beta.files.delete(file_id) + client.files.delete(file_id) ``` </CodeGroup>
```bash CLI # First request creates container - CONTAINER_ID=$(ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 \ + CONTAINER_ID=$(ant messages create \ --transform container.id \ --raw-output <<'YAML' model: claude-opus-5
) # Continue conversation with same container - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML + ant messages create <<YAML model: claude-opus-5 max_tokens: 4096 container:
client = anthropic.Anthropic() # First request creates container - response1 = client.beta.messages.create( + response1 = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}] },
{"role": "user", "content": "What was the total revenue?"}, ] - response2 = client.beta.messages.create( + response2 = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "id": response1.container.id, # Reuse container "skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}],
const client = new Anthropic(); // First request creates container - const response1 = await client.beta.messages.create({ + const response1 = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }] },
}); // Continue conversation with same container - const messages: Anthropic.Beta.Messages.BetaMessageParam[] = [ + const messages: Anthropic.MessageParam[] = [ { role: "user", content: "Create a sample sales dataset and analyze it" }, { role: "assistant",
{ role: "user", content: "What was the total revenue?" } ]; - const response2 = await client.beta.messages.create({ + const response2 = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { id: response1.container!.id, // Reuse container skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }]
{ Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "xlsx", Version = "latest", }, ], }, Messages = [new() { Role = Role.User, Content = "Create a sample sales dataset and analyze it" }], - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - var response1 = await client.Beta.Messages.Create(parameters1); + var response1 = await client.Messages.Create(parameters1); // Continue the conversation in the same container // Carry the assistant's text forward; container.id carries the execution state
{ Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { ID = response1.Container!.ID, Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "xlsx", Version = "latest", },
new() { Role = Role.Assistant, Content = assistantText }, new() { Role = Role.User, Content = "What was the total revenue?" }, ], - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - var response2 = await client.Beta.Messages.Create(parameters2); + var response2 = await client.Messages.Create(parameters2); Console.WriteLine(response2); ``` ```go Go client := anthropic.NewClient() - response1, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response1, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02}, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeAnthropic, + Type: anthropic.SkillParamsTypeAnthropic, SkillID: "xlsx", Version: anthropic.String("latest"), }, }, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Create a sample sales dataset and analyze it")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Create a sample sales dataset and analyze it")), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
} assistantText := strings.Join(textParts, "\n") - response2, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response2, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02}, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ ID: anthropic.String(response1.Container.ID), // Reuse container - Skills: []anthropic.BetaSkillParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeAnthropic, + Type: anthropic.SkillParamsTypeAnthropic, SkillID: "xlsx", Version: anthropic.String("latest"), }, }, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Create a sample sales dataset and analyze it")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Create a sample sales dataset and analyze it")), { - Role: anthropic.BetaMessageParamRoleAssistant, - Content: []anthropic.BetaContentBlockParamUnion{anthropic.NewBetaTextBlock(assistantText)}, + Role: anthropic.MessageParamRoleAssistant, + Content: []anthropic.ContentBlockParamUnion{anthropic.NewTextBlock(assistantText)}, }, - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("What was the total revenue?")), + anthropic.NewUserMessage(anthropic.NewTextBlock("What was the total revenue?")), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
``` ```java Java - import com.anthropic.models.beta.messages.BetaContainerParams; - import com.anthropic.models.beta.messages.BetaSkillParams; - import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825; - import com.anthropic.models.beta.messages.BetaContentBlock; + import com.anthropic.models.messages.ContainerParams; + import com.anthropic.models.messages.SkillParams; + import com.anthropic.models.messages.CodeExecutionTool20250825; + import com.anthropic.models.messages.ContentBlock; // ... void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv();
MessageCreateParams params1 = MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() - .addSkill(BetaSkillParams.builder() - .type(BetaSkillParams.Type.ANTHROPIC) + .container(ContainerParams.builder() + .addSkill(SkillParams.builder() + .type(SkillParams.Type.ANTHROPIC) .skillId("xlsx") .version("latest") .build()) .build()) .addUserMessage("Create a sample sales dataset and analyze it") - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build(); - BetaMessage response1 = client.beta().messages().create(params1); + Message response1 = client.messages().create(params1); MessageCreateParams params2 = MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() + .container(ContainerParams.builder() .id(response1.container().get().id()) - .addSkill(BetaSkillParams.builder() - .type(BetaSkillParams.Type.ANTHROPIC) + .addSkill(SkillParams.builder() + .type(SkillParams.Type.ANTHROPIC) .skillId("xlsx") .version("latest") .build())
.addUserMessage("Create a sample sales dataset and analyze it") // Carry the assistant's text forward; container.id carries the execution state .addAssistantMessage(response1.content().stream() - .filter(BetaContentBlock::isText) + .filter(ContentBlock::isText) .map(block -> block.asText().text()) .collect(Collectors.joining("\n"))) .addUserMessage("What was the total revenue?") - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build(); - BetaMessage response2 = client.beta().messages().create(params2); + Message response2 = client.messages().create(params2); System.out.println(response2); } ```
```ruby Ruby client = Anthropic::Client.new - response1 = client.beta.messages.create( + response1 = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }] },
{ role: "user", content: "What was the total revenue?" } ] - response2 = client.beta.messages.create( + response2 = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { id: response1.container.id, skills: [
RESPONSE=$(curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d '{ "model": "claude-opus-5",
RESPONSE=$(curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d "{ \"model\": \"claude-opus-5\",
RESP=$(mktemp) # Initial request: capture the full JSON response to a temp file - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 \ - > "$RESP" <<'YAML' + ant messages create > "$RESP" <<'YAML' model: claude-opus-5 max_tokens: 4096 container:
# assistant turn. Repeat until stop_reason is no longer "pause_turn". CONTAINER_ID=$(jq -r '.container.id' "$RESP") - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 \ - > "$RESP" <<YAML + ant messages create > "$RESP" <<YAML model: claude-opus-5 max_tokens: 4096 container:
messages = [{"role": "user", "content": "Generate and process a large sample dataset"}] max_retries = 10 - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "skills": [ {
break messages.append({"role": "assistant", "content": response.content}) - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "id": response.container.id, "skills": [
```typescript TypeScript const client = new Anthropic(); - const messages: Anthropic.Beta.Messages.BetaMessageParam[] = [ + const messages: Anthropic.MessageParam[] = [ { role: "user", content: "Generate and process a large sample dataset" } ]; const maxRetries = 10; - let response = await client.beta.messages.create({ + let response = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [{ type: "custom", skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv", version: "latest" }] },
messages.push({ role: "assistant", - content: response.content as Anthropic.Beta.Messages.BetaContentBlockParam[] + content: response.content as Anthropic.ContentBlockParam[] }); - response = await client.beta.messages.create({ + response = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { id: response.container!.id, skills: [
// ... AnthropicClient client = new(); - List<BetaMessageParam> messages = + List<MessageParam> messages = [ new() { Role = Role.User, Content = "Generate and process a large sample dataset" }, ]; var maxRetries = 10; string? containerId = null; - BetaMessage? response = null; + Message? response = null; for (var i = 0; i < maxRetries; i++) {
{ Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], Container = containerId is null - ? new BetaContainerParams + ? new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Custom, + Type = SkillParamsType.Custom, SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv", Version = "latest", }, ], } - : new BetaContainerParams + : new ContainerParams { ID = containerId, Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Custom, + Type = SkillParamsType.Custom, SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv", Version = "latest", }, ], }, Messages = messages, - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - response = await client.Beta.Messages.Create(parameters); + response = await client.Messages.Create(parameters); containerId = response.Container!.ID; - if (response.StopReason != BetaStopReason.PauseTurn) + if (response.StopReason != StopReason.PauseTurn) { break; }
var assistantContent = JsonSerializer.SerializeToElement( response.Content.Select(block => block.Json).ToArray() ); - messages.Add(new() { Role = Role.Assistant, Content = new BetaMessageParamContent(assistantContent) }); + messages.Add(new() { Role = Role.Assistant, Content = new MessageParamContent(assistantContent) }); } ``` ```go Go client := anthropic.NewClient() - messages := []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Generate and process a large sample dataset")), + messages := []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Generate and process a large sample dataset")), } maxRetries := 10 - response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02}, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeCustom, + Type: anthropic.SkillParamsTypeCustom, SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv", Version: anthropic.String("latest"), },
}, }, Messages: messages, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
} for i := 0; i < maxRetries; i++ { - if response.StopReason != anthropic.BetaStopReasonPauseTurn { + if response.StopReason != anthropic.StopReasonPauseTurn { break } messages = append(messages, response.ToParam()) - response, err = client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response, err = client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02}, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ ID: anthropic.String(response.Container.ID), // Reuse container - Skills: []anthropic.BetaSkillParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeCustom, + Type: anthropic.SkillParamsTypeCustom, SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv", Version: anthropic.String("latest"), },
}, }, Messages: messages, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
``` ```java Java - import com.anthropic.models.beta.messages.BetaContainerParams; - import com.anthropic.models.beta.messages.BetaSkillParams; - import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825; - import com.anthropic.models.beta.messages.BetaStopReason; + import com.anthropic.models.messages.ContainerParams; + import com.anthropic.models.messages.SkillParams; + import com.anthropic.models.messages.CodeExecutionTool20250825; + import com.anthropic.models.messages.StopReason; // ... void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv(); - List<BetaMessageParam> messages = new ArrayList<>(); + List<MessageParam> messages = new ArrayList<>(); messages.add( - BetaMessageParam.builder() - .role(BetaMessageParam.Role.USER) + MessageParam.builder() + .role(MessageParam.Role.USER) .content("Generate and process a large sample dataset") .build() ); int maxRetries = 10; - BetaMessage response = client.beta().messages().create( + Message response = client.messages().create( MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() - .addSkill(BetaSkillParams.builder() - .type(BetaSkillParams.Type.CUSTOM) + .container(ContainerParams.builder() + .addSkill(SkillParams.builder() + .type(SkillParams.Type.CUSTOM) .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv") .version("latest") .build()) .build()) .messages(messages) - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build()); for (int i = 0; i < maxRetries; i++) { if (!response.stopReason().isPresent() - || !response.stopReason().get().equals(BetaStopReason.PAUSE_TURN)) { + || !response.stopReason().get().equals(StopReason.PAUSE_TURN)) { break; } messages.add(response.toParam()); - response = client.beta().messages().create( + response = client.messages().create( MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() + .container(ContainerParams.builder() .id(response.container().get().id()) - .addSkill(BetaSkillParams.builder() - .type(BetaSkillParams.Type.CUSTOM) + .addSkill(SkillParams.builder() + .type(SkillParams.Type.CUSTOM) .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv") .version("latest") .build()) .build()) .messages(messages) - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build()); } }
] max_retries = 10 - response = client.beta.messages.create( + response = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ {
messages << { role: "assistant", content: response.content } - response = client.beta.messages.create( + response = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { id: response.container.id, skills: [
curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d '{ "model": "claude-opus-5",
``` ```bash CLI - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 <<'YAML' + ant messages create <<'YAML' model: claude-opus-5 max_tokens: 4096 container:
```python Python client = anthropic.Anthropic() - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "skills": [ {"type": "anthropic", "skill_id": "xlsx", "version": "latest"},
```typescript TypeScript const client = new Anthropic(); - const response = await client.beta.messages.create({ + const response = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ {
{ Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "xlsx", Version = "latest", }, - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "pptx", Version = "latest", }, - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Custom, + Type = SkillParamsType.Custom, SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv", Version = "latest", }, ], }, Messages = [new() { Role = Role.User, Content = "Analyze sales data and create a presentation" }], - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - var message = await client.Beta.Messages.Create(parameters); + var message = await client.Messages.Create(parameters); Console.WriteLine(message); ``` ```go Go client := anthropic.NewClient() - response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{ - "code-execution-2025-08-25", - anthropic.AnthropicBetaSkills2025_10_02, - }, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeAnthropic, + Type: anthropic.SkillParamsTypeAnthropic, SkillID: "xlsx", Version: anthropic.String("latest"), }, { - Type: anthropic.BetaSkillParamsTypeAnthropic, + Type: anthropic.SkillParamsTypeAnthropic, SkillID: "pptx", Version: anthropic.String("latest"), }, { - Type: anthropic.BetaSkillParamsTypeCustom, + Type: anthropic.SkillParamsTypeCustom, SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv", Version: anthropic.String("latest"), }, }, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Analyze sales data and create a presentation")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Analyze sales data and create a presentation")), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
``` ```java Java - import com.anthropic.models.beta.messages.BetaContainerParams; - import com.anthropic.models.beta.messages.BetaSkillParams; - import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825; + import com.anthropic.models.messages.ContainerParams; + import com.anthropic.models.messages.SkillParams; + import com.anthropic.models.messages.CodeExecutionTool20250825; // ... void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv();
MessageCreateParams params = MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() + .container(ContainerParams.builder() .skills(List.of( - BetaSkillParams.builder() - .type(BetaSkillParams.Type.ANTHROPIC) + SkillParams.builder() + .type(SkillParams.Type.ANTHROPIC) .skillId("xlsx") .version("latest") .build(), - BetaSkillParams.builder() - .type(BetaSkillParams.Type.ANTHROPIC) + SkillParams.builder() + .type(SkillParams.Type.ANTHROPIC) .skillId("pptx") .version("latest") .build(), - BetaSkillParams.builder() - .type(BetaSkillParams.Type.CUSTOM) + SkillParams.builder() + .type(SkillParams.Type.CUSTOM) .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv") .version("latest") .build() )) .build()) .addUserMessage("Analyze sales data and create a presentation") - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build(); - BetaMessage response = client.beta().messages().create(params); + Message response = client.messages().create(params); System.out.println(response); } ```
```ruby Ruby client = Anthropic::Client.new - message = client.beta.messages.create( + message = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ {
curl -X POST "https://api.anthropic.com/v1/skills" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" \ -F "files[]=@financial_skill/SKILL.md;filename=financial_skill/SKILL.md" \ -F "files[]=@financial_skill/analyze.py;filename=financial_skill/analyze.py" ``` - ```bash CLI - ant beta:skills create \ - --file example_skill.zip \ - --beta skills-2025-10-02 - - # Per-file upload requires path-qualified filenames, which the CLI - # can't currently set. Upload a zip archive instead. - ``` + <MultiFileExample language="cli" label="CLI"> + ```bash CLI + zip -r financial_skill.zip financial_skill/ + ant skills create --file financial_skill.zip + ``` + + <File filename="financial_skill/SKILL.md"> + ```markdown + --- + name: financial-skill + description: Docs example skill. + --- + ``` + </File> + + <File filename="financial_skill/analyze.py"> + ```python + print("financial analysis helper") + ``` + </File> + </MultiFileExample> ```python Python from anthropic.lib import files_from_dir
client = anthropic.Anthropic() # Option 1: Using a zip file - skill = client.beta.skills.create( + skill = client.skills.create( files=[open("example_skill.zip", "rb")], ) # Option 2: Using file tuples (filename, file_content, mime_type) - skill = client.beta.skills.create( + skill = client.skills.create( files=[ ( "financial_skill/SKILL.md",
) # Option 3: Using the files_from_dir helper (Python only) - skill = client.beta.skills.create( + skill = client.skills.create( files=files_from_dir("financial_skill"), ) print(f"Created skill: {skill.id}") - print(f"Latest version: {skill.latest_version}") + print(f"Latest version: {skill.latest_version_id}") ``` ```typescript TypeScript
const client = new Anthropic(); // Option 1: Using a zip file - const skillFromZip = await client.beta.skills.create({ + const skillFromZip = await client.skills.create({ files: [await toFile(fs.createReadStream("example_skill.zip"), "example_skill.zip")] }); // Option 2: Using individual file objects - const skill = await client.beta.skills.create({ + const skill = await client.skills.create({ files: [ await toFile(fs.createReadStream("financial_skill/SKILL.md"), "financial_skill/SKILL.md", { type: "text/markdown"
}); console.log(`Created skill: ${skill.id}`); - console.log(`Latest version: ${skill.latest_version}`); + console.log(`Latest version: ${skill.latest_version_id}`); ``` ```csharp C#
Files = [File.OpenRead("example_skill.zip")], }; - var skill = await client.Beta.Skills.Create(parameters); + var skill = await client.Skills.Create(parameters); // Option 2: Using individual files (path-qualified filenames preserve the Skill's directory layout) var parameters2 = new SkillCreateParams
], }; - var skill2 = await client.Beta.Skills.Create(parameters2); + var skill2 = await client.Skills.Create(parameters2); Console.WriteLine($"Created skill: {skill.ID}"); - Console.WriteLine($"Latest version: {skill.LatestVersion}"); + Console.WriteLine($"Latest version: {skill.LatestVersionID}"); Console.WriteLine($"Created skill 2: {skill2.ID}"); ```
} defer zipFile.Close() - skill, err := client.Beta.Skills.New(context.TODO(), anthropic.BetaSkillNewParams{ + skill, err := client.Skills.New(context.TODO(), anthropic.SkillNewParams{ Files: []io.Reader{zipFile}, }) if err != nil {
} defer analyzePy.Close() - skill2, err := client.Beta.Skills.New(context.TODO(), anthropic.BetaSkillNewParams{ + skill2, err := client.Skills.New(context.TODO(), anthropic.SkillNewParams{ Files: []io.Reader{ anthropic.File(skillMd, "financial_skill/SKILL.md", "text/markdown"), anthropic.File(analyzePy, "financial_skill/analyze.py", "text/x-python"),
} fmt.Printf("Created skill: %s\n", skill.ID) - fmt.Printf("Latest version: %s\n", skill.LatestVersion) + fmt.Printf("Latest version: %s\n", skill.LatestVersionID) fmt.Printf("Created skill 2: %s\n", skill2.ID) ``` ```java Java import com.anthropic.core.MultipartField; - import com.anthropic.models.beta.skills.SkillCreateParams; - import com.anthropic.models.beta.skills.SkillCreateResponse; + import com.anthropic.models.skills.SkillCreateParams; + import com.anthropic.models.skills.Skill; // ... void main() throws Exception { // ...
.build()) .build(); - SkillCreateResponse skill = client.beta().skills().create(params); + Skill skill = client.skills().create(params); // Option 2: Using individual files (path-qualified filenames preserve the Skill's directory layout) SkillCreateParams params2 = SkillCreateParams.builder()
.build()) .build(); - SkillCreateResponse skill2 = client.beta().skills().create(params2); + Skill skill2 = client.skills().create(params2); System.out.println("Created skill: " + skill.id()); - System.out.println("Latest version: " + skill.latestVersion().orElseThrow()); + System.out.println("Latest version: " + skill.latestVersionId()); System.out.println("Created skill 2: " + skill2.id()); } ```
client = Anthropic::Client.new # Option 1: Using a zip file - skill = client.beta.skills.create( + skill = client.skills.create( files: [ File.open("example_skill.zip", "rb") ] ) # Option 2: Using individual files - skill = client.beta.skills.create( + skill = client.skills.create( files: [ Anthropic::FilePart.new( Pathname("financial_skill/SKILL.md"),
) puts "Created skill: #{skill.id}" - puts "Latest version: #{skill.latest_version}" + puts "Latest version: #{skill.latest_version_id}" ``` </CodeGroup>
* `name`: Maximum 64 characters, lowercase letters/numbers/hyphens only, no XML tags, no reserved words ("anthropic", "claude") * `description`: Maximum 1024 characters, non-empty, no XML tags -For complete request/response schemas, see the [Create Skill API reference](https://platform.claude.com/docs/en/api/beta/skills/create). +For complete request/response schemas, see the [Create Skill API reference](https://platform.claude.com/docs/en/api/skills/create). ### Listing Skills
# List all Skills curl "https://api.anthropic.com/v1/skills" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ - -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" + -H "anthropic-version: 2023-06-01" # List only custom Skills curl "https://api.anthropic.com/v1/skills?source=custom" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ - -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" + -H "anthropic-version: 2023-06-01" ``` ```bash CLI # List all Skills - ant beta:skills list + ant skills list # List only custom Skills - ant beta:skills list --source custom + ant skills list --source custom ``` ```python Python client = anthropic.Anthropic() # List all Skills - for skill in client.beta.skills.list(): - print(f"{skill.id}: {skill.display_title} (source: {skill.source})") + for skill in client.skills.list(): + print(f"{skill.id}: {skill.display_name} (source: {skill.source.type})") # List only custom Skills - custom_skills = client.beta.skills.list(source="custom") + custom_skills = client.skills.list(source="custom") ``` ```typescript TypeScript const client = new Anthropic(); // List all Skills - for await (const skill of client.beta.skills.list()) { - console.log(`${skill.id}: ${skill.display_title} (source: ${skill.source})`); + for await (const skill of client.skills.list()) { + console.log(`${skill.id}: ${skill.display_name} (source: ${skill.source.type})`); } // List only custom Skills - const customSkills = await client.beta.skills.list({ + const customSkills = await client.skills.list({ source: "custom" }); ```
AnthropicClient client = new(); // List all Skills - await foreach (var skill in (await client.Beta.Skills.List()).Paginate()) + await foreach (var skill in (await client.Skills.List()).Paginate()) { - Console.WriteLine($"{skill.ID}: {skill.DisplayTitle} (source: {skill.Source})"); + Console.WriteLine($"{skill.ID}: {skill.DisplayName} (source: {skill.Source.Type})"); } // List only custom Skills - var customSkills = await client.Beta.Skills.List(new SkillListParams { Source = "custom" }); + var customSkills = await client.Skills.List(new SkillListParams { Source = "custom" }); ``` ```go Go client := anthropic.NewClient() // List all Skills - skills := client.Beta.Skills.ListAutoPaging(context.TODO(), anthropic.BetaSkillListParams{}) + skills := client.Skills.ListAutoPaging(context.TODO(), anthropic.SkillListParams{}) for skills.Next() { skill := skills.Current() - fmt.Printf("%s: %s (source: %s)\n", skill.ID, skill.DisplayTitle, skill.Source) + fmt.Printf("%s: %s (source: %s)\n", skill.ID, skill.DisplayName, skill.Source.Type) } if skills.Err() != nil { log.Fatal(skills.Err()) } // List only custom Skills - customSkills := client.Beta.Skills.ListAutoPaging(context.TODO(), anthropic.BetaSkillListParams{ + customSkills := client.Skills.ListAutoPaging(context.TODO(), anthropic.SkillListParams{ Source: anthropic.String("custom"), }) for customSkills.Next() { skill := customSkills.Current() - fmt.Printf("%s: %s (source: %s)\n", skill.ID, skill.DisplayTitle, skill.Source) + fmt.Printf("%s: %s (source: %s)\n", skill.ID, skill.DisplayName, skill.Source.Type) } if customSkills.Err() != nil { log.Fatal(customSkills.Err())
``` ```java Java - import com.anthropic.models.beta.skills.SkillListParams; - import com.anthropic.models.beta.skills.SkillListPage; - import com.anthropic.models.beta.skills.SkillListResponse; + import com.anthropic.models.skills.SkillListParams; + import com.anthropic.models.skills.SkillListPage; + import com.anthropic.models.skills.Skill; // ... void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv(); // List Skills (first page) - SkillListPage skills = client.beta().skills().list(); - - for (SkillListResponse skill : skills.data()) { - System.out.println(skill.id() + ": " + skill.displayTitle().orElseThrow() + " (source: " + skill.source() + ")"); + SkillListPage skills = client.skills().list(); + + for (Skill skill : skills.data()) { + System.out.println(skill.id() + ": " + skill.displayName() + " (source: " + skill.source().type() + ")"); } // List only custom Skills
.source("custom") .build(); - SkillListPage customSkills = client.beta().skills().list(customParams); + SkillListPage customSkills = client.skills().list(customParams); } ```
client = Anthropic::Client.new # List all Skills - client.beta.skills.list.auto_paging_each do |skill| - puts "#{skill.id}: #{skill.display_title} (source: #{skill.source})" + client.skills.list.auto_paging_each do |skill| + puts "#{skill.id}: #{skill.display_name} (source: #{skill.source.type})" end # List only custom Skills - custom_skills = client.beta.skills.list( + custom_skills = client.skills.list( source: "custom" ) ``` </CodeGroup> -See the [List Skills API reference](https://platform.claude.com/docs/en/api/beta/skills/list) for pagination and filtering options. +See the [List Skills API reference](https://platform.claude.com/docs/en/api/skills/list) for pagination and filtering options. ### Retrieving a Skill
```bash cURL curl "https://api.anthropic.com/v1/skills/skill_01AbCdEfGhIjKlMnOpQrStUv" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ - -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" + -H "anthropic-version: 2023-06-01" ``` ```bash CLI - ant beta:skills retrieve \ + ant skills retrieve \ --skill-id skill_01AbCdEfGhIjKlMnOpQrStUv ``` ```python Python client = anthropic.Anthropic() - skill = client.beta.skills.retrieve(skill_id="skill_01AbCdEfGhIjKlMnOpQrStUv") - - print(f"Skill: {skill.display_title}") - print(f"Latest version: {skill.latest_version}") + skill = client.skills.retrieve(skill_id="skill_01AbCdEfGhIjKlMnOpQrStUv") + + print(f"Skill: {skill.display_name}") + print(f"Latest version: {skill.latest_version_id}") print(f"Created: {skill.created_at}") ``` ```typescript TypeScript const client = new Anthropic(); - const skill = await client.beta.skills.retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv"); - - console.log(`Skill: ${skill.display_title}`); - console.log(`Latest version: ${skill.latest_version}`); + const skill = await client.skills.retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv"); + + console.log(`Skill: ${skill.display_name}`); + console.log(`Latest version: ${skill.latest_version_id}`); console.log(`Created: ${skill.created_at}`); ``` ```csharp C# AnthropicClient client = new(); - var skill = await client.Beta.Skills.Retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv"); - - Console.WriteLine($"Skill: {skill.DisplayTitle}"); - Console.WriteLine($"Latest version: {skill.LatestVersion}"); + var skill = await client.Skills.Retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv"); + + Console.WriteLine($"Skill: {skill.DisplayName}"); + Console.WriteLine($"Latest version: {skill.LatestVersionID}"); Console.WriteLine($"Created: {skill.CreatedAt}"); ``` ```go Go client := anthropic.NewClient() - skill, err := client.Beta.Skills.Get( + skill, err := client.Skills.Get( context.TODO(), "skill_01AbCdEfGhIjKlMnOpQrStUv", - anthropic.BetaSkillGetParams{}, ) if err != nil { log.Fatal(err) } - fmt.Printf("Skill: %s\n", skill.DisplayTitle) - fmt.Printf("Latest version: %s\n", skill.LatestVersion) + fmt.Printf("Skill: %s\n", skill.DisplayName) + fmt.Printf("Latest version: %s\n", skill.LatestVersionID) fmt.Printf("Created: %s\n", skill.CreatedAt) ``` ```java Java - import com.anthropic.models.beta.skills.SkillRetrieveResponse; + import com.anthropic.models.skills.Skill; // ... void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv(); - SkillRetrieveResponse skill = client.beta().skills().retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv"); - - System.out.println("Skill: " + skill.displayTitle().orElseThrow()); - System.out.println("Latest version: " + skill.latestVersion().orElseThrow()); + Skill skill = client.skills().retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv"); + + System.out.println("Skill: " + skill.displayName()); + System.out.println("Latest version: " + skill.latestVersionId()); System.out.println("Created: " + skill.createdAt()); } ```
```ruby Ruby client = Anthropic::Client.new - skill = client.beta.skills.retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv") - - puts "Skill: #{skill.display_title}" - puts "Latest version: #{skill.latest_version}" + skill = client.skills.retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv") + + puts "Skill: #{skill.display_name}" + puts "Latest version: #{skill.latest_version_id}" puts "Created: #{skill.created_at}" ``` </CodeGroup> ### Deleting a Skill -Deleting a Skill also removes all of its versions. The cascade is GA-only behavior, so unlike the other examples in this guide, these call the GA surface directly rather than the `beta` namespace. +Deleting a Skill also removes all of its versions. <CodeGroup defaultLanguage="CLI"> ```bash cURL
```php PHP $client = new Client(); - $client->skills->delete( - skillID: 'skill_01AbCdEfGhIjKlMnOpQrStUv', - ); + // The PHP SDK still uses the beta Skills namespace, where a Skill's versions + // must be deleted before the Skill itself. + $skillId = 'skill_01AbCdEfGhIjKlMnOpQrStUv'; + foreach ($client->beta->skills->versions->list($skillId)->pagingEachItem() as $version) { + $client->beta->skills->versions->delete($version->version, skillID: $skillId); + } + $client->beta->skills->delete($skillId); ``` ```ruby Ruby
NEW_VERSION=$(curl -X POST "https://api.anthropic.com/v1/skills/skill_01AbCdEfGhIjKlMnOpQrStUv/versions" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" \ -F "files[]=@financial_skill/SKILL.md;filename=financial_skill/SKILL.md" \ -F "files[]=@financial_skill/analyze.py;filename=financial_skill/analyze.py") - VERSION_NUMBER=$(echo "$NEW_VERSION" | jq -r '.version') + VERSION_ID=$(echo "$NEW_VERSION" | jq -r '.id') # Use specific version curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d "{ \"model\": \"claude-opus-5\",
\"skills\": [{ \"type\": \"custom\", \"skill_id\": \"skill_01AbCdEfGhIjKlMnOpQrStUv\", - \"version\": \"$VERSION_NUMBER\" + \"version\": \"$VERSION_ID\" }] }, \"messages\": [{\"role\": \"user\", \"content\": \"Use updated Skill\"}],
curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d '{ "model": "claude-opus-5",
```bash CLI # Create a new version - VERSION_NUMBER=$(ant beta:skills:versions create \ + VERSION_ID=$(ant skills:versions create \ --skill-id skill_01AbCdEfGhIjKlMnOpQrStUv \ --file financial_skill.zip \ - --transform version \ + --transform id \ --raw-output) # Use specific version - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML + ant messages create <<YAML model: claude-opus-5 max_tokens: 4096 container: skills: - type: custom skill_id: skill_01AbCdEfGhIjKlMnOpQrStUv - version: "$VERSION_NUMBER" + version: "$VERSION_ID" messages: - role: user content: Use updated Skill
YAML # Use latest version - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML + ant messages create <<YAML model: claude-opus-5 max_tokens: 4096 container:
# Create a new version - new_version = client.beta.skills.versions.create( + new_version = client.skills.versions.create( skill_id="skill_01AbCdEfGhIjKlMnOpQrStUv", files=files_from_dir("financial_skill"), ) # Use specific version - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "skills": [ { "type": "custom", "skill_id": "skill_01AbCdEfGhIjKlMnOpQrStUv", - "version": new_version.version, + "version": new_version.id, } ] },
) # Use latest version - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "skills": [ {
const client = new Anthropic(); // Create a new version from a zip of the complete financial_skill/ bundle - const newVersion = await client.beta.skills.versions.create("skill_01AbCdEfGhIjKlMnOpQrStUv", { + const newVersion = await client.skills.versions.create("skill_01AbCdEfGhIjKlMnOpQrStUv", { files: [fs.createReadStream("financial_skill.zip")] }); // Use specific version - const specificVersionResponse = await client.beta.messages.create({ + const specificVersionResponse = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ { type: "custom", skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv", - version: newVersion.version + version: newVersion.id } ] },
}); // Use latest version - const latestVersionResponse = await client.beta.messages.create({ + const latestVersionResponse = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ {
```csharp C# using Anthropic.Core; - using Anthropic.Models.Beta.Skills.Versions; + using Anthropic.Models.Skills.Versions; // ... AnthropicClient client = new();
], }; - var newVersion = await client.Beta.Skills.Versions.Create("skill_01AbCdEfGhIjKlMnOpQrStUv", versionParams); + var newVersion = await client.Skills.Versions.Create("skill_01AbCdEfGhIjKlMnOpQrStUv", versionParams); // Use specific version var specificVersionParams = new MessageCreateParams { Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Custom, + Type = SkillParamsType.Custom, SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv", - Version = newVersion.Version, + Version = newVersion.ID, }, ], }, Messages = [new() { Role = Role.User, Content = "Use updated Skill" }], - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - var response = await client.Beta.Messages.Create(specificVersionParams); + var response = await client.Messages.Create(specificVersionParams); Console.WriteLine(response); // Use latest version
{ Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Custom, + Type = SkillParamsType.Custom, SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv", Version = "latest", }, ], }, Messages = [new() { Role = Role.User, Content = "Use latest Skill version" }], - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - var latestResponse = await client.Beta.Messages.Create(latestVersionParams); + var latestResponse = await client.Messages.Create(latestVersionParams); Console.WriteLine(latestResponse); ```
} defer analyzePy.Close() - newVersion, err := client.Beta.Skills.Versions.New( + newVersion, err := client.Skills.Versions.New( context.TODO(), "skill_01AbCdEfGhIjKlMnOpQrStUv", - anthropic.BetaSkillVersionNewParams{ + anthropic.SkillVersionNewParams{ Files: []io.Reader{ anthropic.File(skillMd, "financial_skill/SKILL.md", "text/markdown"), anthropic.File(analyzePy, "financial_skill/analyze.py", "text/x-python"),
} // Use specific version - response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02}, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeCustom, + Type: anthropic.SkillParamsTypeCustom, SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv", - Version: anthropic.String(newVersion.Version), + Version: anthropic.String(newVersion.ID), }, }, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Use updated Skill")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Use updated Skill")), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
fmt.Println(response) // Use latest version - latestResponse, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + latestResponse, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02}, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeCustom, + Type: anthropic.SkillParamsTypeCustom, SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv", Version: anthropic.String("latest"), }, }, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Use latest Skill version")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Use latest Skill version")), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
``` ```java Java - import com.anthropic.models.beta.messages.MessageCreateParams; - import com.anthropic.models.beta.messages.BetaMessage; + import com.anthropic.models.messages.MessageCreateParams; + import com.anthropic.models.messages.Message; import com.anthropic.models.messages.Model; import com.anthropic.core.MultipartField; - import com.anthropic.models.beta.messages.BetaContainerParams; - import com.anthropic.models.beta.messages.BetaSkillParams; - import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825; - import com.anthropic.models.beta.skills.versions.VersionCreateParams; - import com.anthropic.models.beta.skills.versions.VersionCreateResponse; + import com.anthropic.models.messages.ContainerParams; + import com.anthropic.models.messages.SkillParams; + import com.anthropic.models.messages.CodeExecutionTool20250825; + import com.anthropic.models.skills.versions.VersionCreateParams; + import com.anthropic.models.skills.versions.SkillVersion; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path;
.build()) .build(); - VersionCreateResponse newVersion = client.beta().skills().versions() + SkillVersion newVersion = client.skills().versions() .create("skill_01AbCdEfGhIjKlMnOpQrStUv", versionParams); // Use specific version MessageCreateParams specificVersionParams = MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() - .addSkill(BetaSkillParams.builder() - .type(BetaSkillParams.Type.CUSTOM) + .container(ContainerParams.builder() + .addSkill(SkillParams.builder() + .type(SkillParams.Type.CUSTOM) .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv") - .version(newVersion.version()) + .version(newVersion.id()) .build()) .build()) .addUserMessage("Use updated Skill") - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build(); - BetaMessage response = client.beta().messages().create(specificVersionParams); + Message response = client.messages().create(specificVersionParams); System.out.println(response); // Use latest version MessageCreateParams latestVersionParams = MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() - .addSkill(BetaSkillParams.builder() - .type(BetaSkillParams.Type.CUSTOM) + .container(ContainerParams.builder() + .addSkill(SkillParams.builder() + .type(SkillParams.Type.CUSTOM) .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv") .version("latest") .build()) .build()) .addUserMessage("Use latest Skill version") - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build(); - BetaMessage latestResponse = client.beta().messages().create(latestVersionParams); + Message latestResponse = client.messages().create(latestVersionParams); System.out.println(latestResponse); ```
client = Anthropic::Client.new # Create a new version - new_version = client.beta.skills.versions.create( + new_version = client.skills.versions.create( "skill_01AbCdEfGhIjKlMnOpQrStUv", files: [ Anthropic::FilePart.new(
) # Use specific version - response = client.beta.messages.create( + response = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [{ type: "custom", skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv", - version: new_version.version + version: new_version.id }] }, messages: [{ role: "user", content: "Use updated Skill" }],
puts response # Use latest version - latest_response = client.beta.messages.create( + latest_response = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [{ type: "custom",
``` </CodeGroup> -See the [Create Skill Version API reference](https://platform.claude.com/docs/en/api/beta/skills/versions/create) for complete details. +See the [Create Skill Version API reference](https://platform.claude.com/docs/en/api/skills/versions/create) for complete details. ***
DCF_SKILL=$(curl -X POST "https://api.anthropic.com/v1/skills" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" \ -F "files[]=@dcf_skill/SKILL.md;filename=dcf_skill/SKILL.md") DCF_SKILL_ID=$(echo "$DCF_SKILL" | jq -r '.id')
curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d "{ \"model\": \"claude-opus-5\",
```bash CLI # Create custom DCF analysis Skill - DCF_SKILL_ID=$(ant beta:skills create \ + DCF_SKILL_ID=$(ant skills create \ --file dcf_skill.zip \ --transform id \ --raw-output) # Use with Excel to create financial model - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML + ant messages create <<YAML model: claude-opus-5 max_tokens: 4096 container:
# Create custom DCF analysis Skill - dcf_skill = client.beta.skills.create( + dcf_skill = client.skills.create( files=files_from_dir("/path/to/dcf_skill"), ) # Use with Excel to create financial model - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "skills": [ {"type": "anthropic", "skill_id": "xlsx", "version": "latest"},
const client = new Anthropic(); // Create custom DCF analysis Skill - const dcfSkill = await client.beta.skills.create({ + const dcfSkill = await client.skills.create({ files: [await toFile(fs.createReadStream("dcf_skill.zip"), "dcf_skill.zip")] }); // Use with Excel to create financial model - const response = await client.beta.messages.create({ + const response = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ { type: "anthropic", skill_id: "xlsx", version: "latest" },
AnthropicClient client = new(); // Create custom DCF analysis Skill - var dcfSkill = await client.Beta.Skills.Create(new SkillCreateParams + var dcfSkill = await client.Skills.Create(new SkillCreateParams { Files = [
{ Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "xlsx", Version = "latest", }, - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Custom, + Type = SkillParamsType.Custom, SkillID = dcfSkill.ID, Version = "latest", }, ], }, Messages = [new() { Role = Role.User, Content = "Build a DCF valuation model for a SaaS company" }], - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - var message = await client.Beta.Messages.Create(parameters); + var message = await client.Messages.Create(parameters); Console.WriteLine(message); ```
dcfSkillID := "skill_01AbCdEfGhIjKlMnOpQrStUv" // Use with Excel to create financial model - response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{ - "code-execution-2025-08-25", - anthropic.AnthropicBetaSkills2025_10_02, - }, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeAnthropic, + Type: anthropic.SkillParamsTypeAnthropic, SkillID: "xlsx", Version: anthropic.String("latest"), }, { - Type: anthropic.BetaSkillParamsTypeCustom, + Type: anthropic.SkillParamsTypeCustom, SkillID: dcfSkillID, Version: anthropic.String("latest"), }, }, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Build a DCF valuation model for a SaaS company")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Build a DCF valuation model for a SaaS company")), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
``` ```java Java - import com.anthropic.models.beta.messages.BetaContainerParams; - import com.anthropic.models.beta.messages.BetaSkillParams; - import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825; + import com.anthropic.models.messages.ContainerParams; + import com.anthropic.models.messages.SkillParams; + import com.anthropic.models.messages.CodeExecutionTool20250825; // ... void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv();
MessageCreateParams params = MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() + .container(ContainerParams.builder() .skills(List.of( - BetaSkillParams.builder() - .type(BetaSkillParams.Type.ANTHROPIC) + SkillParams.builder() + .type(SkillParams.Type.ANTHROPIC) .skillId("xlsx") .version("latest") .build(), - BetaSkillParams.builder() - .type(BetaSkillParams.Type.CUSTOM) + SkillParams.builder() + .type(SkillParams.Type.CUSTOM) .skillId(dcfSkillId) .version("latest") .build() )) .build()) .addUserMessage("Build a DCF valuation model for a SaaS company") - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build(); - BetaMessage response = client.beta().messages().create(params); + Message response = client.messages().create(params); System.out.println(response); } ```
client = Anthropic::Client.new # Create custom DCF analysis Skill - dcf_skill = client.beta.skills.create( + dcf_skill = client.skills.create( files: [ Anthropic::FilePart.new( Pathname("dcf_skill/SKILL.md"),
) # Use with Excel to create financial model - response = client.beta.messages.create( + response = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ { type: "anthropic", skill_id: "xlsx", version: "latest" },
The SDK tabs in this section show the `container` value to include in a Messages request. The cURL and CLI tabs show the full request. -**For production:** pin a specific version, so Skill updates never change your deployed behavior. If you omit `version` or set it to `"latest"`, requests use the newest version of the Skill, so a version uploaded by anyone in the [workspace](https://platform.claude.com/docs/en/build-with-claude/skills-guide#workspace-scoped-access) immediately changes what your production agents run. The version ID comes from the create-version response in [Versioning](https://platform.claude.com/docs/en/build-with-claude/skills-guide#versioning) or from the [List Skill Versions API](https://platform.claude.com/docs/en/api/beta/skills/versions/list). The ID is always a string: quote epoch-timestamp IDs in JSON or YAML. +**For production:** pin a specific version, so Skill updates never change your deployed behavior. If you omit `version` or set it to `"latest"`, requests use the newest version of the Skill, so a version uploaded by anyone in the [workspace](https://platform.claude.com/docs/en/build-with-claude/skills-guide#workspace-scoped-access) immediately changes what your production agents run. The version ID comes from the create-version response in [Versioning](https://platform.claude.com/docs/en/build-with-claude/skills-guide#versioning) or from the [List Skill Versions API](https://platform.claude.com/docs/en/api/skills/versions/list). The ID is always a string, so quote it in JSON or YAML (versions created under the `skills-2025-10-02` beta header have numeric-looking epoch-timestamp IDs). <CodeGroup> ```bash cURL
curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d '{ "model": "claude-opus-5",
"skills": [{ "type": "custom", "skill_id": "skill_01AbCdEfGhIjKlMnOpQrStUv", - "version": "1759178010641129" + "version": "skver_01AbCdEfGhIjKlMnOpQrStUv" }] }, "messages": [{"role": "user", "content": "Analyze the sales data"}],
```bash CLI # Pin to specific versions for stability - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML + ant messages create <<YAML model: claude-opus-5 max_tokens: 4096 container: skills: - type: custom skill_id: skill_01AbCdEfGhIjKlMnOpQrStUv - version: "1759178010641129" # quoted: the API requires a string + version: "skver_01AbCdEfGhIjKlMnOpQrStUv" messages: - role: user content: Analyze the sales data
{ "type": "custom", "skill_id": "skill_01AbCdEfGhIjKlMnOpQrStUv", - "version": "1759178010641129", + "version": "skver_01AbCdEfGhIjKlMnOpQrStUv", } ] }
```typescript TypeScript // Pin to specific versions for stability - const container: Anthropic.Beta.Messages.BetaContainerParams = { + const container: Anthropic.ContainerParams = { skills: [ { type: "custom", skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv", - version: "1759178010641129" + version: "skver_01AbCdEfGhIjKlMnOpQrStUv" } ] }; ``` ```csharp C# - using Anthropic.Models.Beta.Messages; + using Anthropic.Models.Messages; // Pin to specific versions for stability - var container = new BetaContainerParams + var container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Custom, + Type = SkillParamsType.Custom, SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv", - Version = "1759178010641129", + Version = "skver_01AbCdEfGhIjKlMnOpQrStUv", }, ], };
```go Go // Pin to specific versions for stability - container := anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + container := anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeCustom, + Type: anthropic.SkillParamsTypeCustom, SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv", - Version: anthropic.String("1759178010641129"), + Version: anthropic.String("skver_01AbCdEfGhIjKlMnOpQrStUv"), }, }, },
``` ```java Java - import com.anthropic.models.beta.messages.BetaContainerParams; - import com.anthropic.models.beta.messages.BetaSkillParams; + import com.anthropic.models.messages.ContainerParams; + import com.anthropic.models.messages.SkillParams; void main() { // Pin to specific versions for stability - BetaContainerParams container = BetaContainerParams.builder() - .addSkill(BetaSkillParams.builder() - .type(BetaSkillParams.Type.CUSTOM) + ContainerParams container = ContainerParams.builder() + .addSkill(SkillParams.builder() + .type(SkillParams.Type.CUSTOM) .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv") - .version("1759178010641129") + .version("skver_01AbCdEfGhIjKlMnOpQrStUv") .build()) .build(); }
skills: [{ type: "custom", skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv", - version: "1759178010641129" + version: "skver_01AbCdEfGhIjKlMnOpQrStUv" }] } ```
curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d '{ "model": "claude-opus-5",
```bash CLI # Use latest for active development - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML + ant messages create <<YAML model: claude-opus-5 max_tokens: 4096 container:
```typescript TypeScript // Use latest for active development - const container: Anthropic.Beta.Messages.BetaContainerParams = { + const container: Anthropic.ContainerParams = { skills: [ { type: "custom",
``` ```csharp C# - using Anthropic.Models.Beta.Messages; + using Anthropic.Models.Messages; // Use latest for active development - var container = new BetaContainerParams + var container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Custom, + Type = SkillParamsType.Custom, SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv", Version = "latest", },
```go Go // Use latest for active development - container := anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + container := anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeCustom, + Type: anthropic.SkillParamsTypeCustom, SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv", Version: anthropic.String("latest"), },
``` ```java Java - import com.anthropic.models.beta.messages.BetaContainerParams; - import com.anthropic.models.beta.messages.BetaSkillParams; + import com.anthropic.models.messages.ContainerParams; + import com.anthropic.models.messages.SkillParams; void main() { // Use latest for active development - BetaContainerParams container = BetaContainerParams.builder() - .addSkill(BetaSkillParams.builder() - .type(BetaSkillParams.Type.CUSTOM) + ContainerParams container = ContainerParams.builder() + .addSkill(SkillParams.builder() + .type(SkillParams.Type.CUSTOM) .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv") .version("latest") .build())
curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d '{ "model": "claude-opus-5",
curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \ -H "content-type: application/json" \ -d '{ "model": "claude-opus-5",
```bash CLI # Skills render into the system prompt in a fixed, cache-friendly order - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 <<'YAML' + ant messages create <<'YAML' model: claude-opus-5 max_tokens: 4096 container:
YAML # Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit - ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 <<'YAML' + ant messages create <<'YAML' model: claude-opus-5 max_tokens: 4096 container:
client = anthropic.Anthropic() # Skills render into the system prompt in a fixed, cache-friendly order - response1 = client.beta.messages.create( + response1 = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=[ - "code-execution-2025-08-25", - "skills-2025-10-02", - ], container={ "skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}] },
) # Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit - response2 = client.beta.messages.create( + response2 = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=[ - "code-execution-2025-08-25", - "skills-2025-10-02", - ], container={ "skills": [ {"type": "anthropic", "skill_id": "xlsx", "version": "latest"},
const client = new Anthropic(); // Skills render into the system prompt in a fixed, cache-friendly order - const response1 = await client.beta.messages.create({ + const response1 = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }] },
}); // Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit - const response2 = await client.beta.messages.create({ + const response2 = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ { type: "anthropic", skill_id: "xlsx", version: "latest" },
{ Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "xlsx", Version = "latest", }, ], }, Messages = [new() { Role = Role.User, Content = "Analyze sales data" }], - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - var response1 = await client.Beta.Messages.Create(parameters1); + var response1 = await client.Messages.Create(parameters1); Console.WriteLine(response1); // Different Skill set ([xlsx] vs [xlsx, pptx]) = a different prefix: a cache miss (an identical set is a cache hit)
{ Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "xlsx", Version = "latest", }, - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "pptx", Version = "latest", }, ], }, Messages = [new() { Role = Role.User, Content = "Create a presentation" }], - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - var response2 = await client.Beta.Messages.Create(parameters2); + var response2 = await client.Messages.Create(parameters2); Console.WriteLine(response2); ```
client := anthropic.NewClient() // Skills render into the system prompt in a fixed, cache-friendly order - response1, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response1, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{ - "code-execution-2025-08-25", - anthropic.AnthropicBetaSkills2025_10_02, - }, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeAnthropic, + Type: anthropic.SkillParamsTypeAnthropic, SkillID: "xlsx", Version: anthropic.String("latest"), }, }, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Analyze sales data")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Analyze sales data")), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
fmt.Println(response1) // Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit - response2, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response2, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{ - "code-execution-2025-08-25", - anthropic.AnthropicBetaSkills2025_10_02, - }, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeAnthropic, + Type: anthropic.SkillParamsTypeAnthropic, SkillID: "xlsx", Version: anthropic.String("latest"), }, { - Type: anthropic.BetaSkillParamsTypeAnthropic, + Type: anthropic.SkillParamsTypeAnthropic, SkillID: "pptx", Version: anthropic.String("latest"), }, }, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Create a presentation")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Create a presentation")), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, }) if err != nil {
``` ```java Java - import com.anthropic.models.beta.messages.BetaContainerParams; - import com.anthropic.models.beta.messages.BetaSkillParams; - import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825; + import com.anthropic.models.messages.ContainerParams; + import com.anthropic.models.messages.SkillParams; + import com.anthropic.models.messages.CodeExecutionTool20250825; // ... void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv();
MessageCreateParams params1 = MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() + .container(ContainerParams.builder() .skills(List.of( - BetaSkillParams.builder() - .type(BetaSkillParams.Type.ANTHROPIC) + SkillParams.builder() + .type(SkillParams.Type.ANTHROPIC) .skillId("xlsx") .version("latest") .build() )) .build()) .addUserMessage("Analyze sales data") - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build(); - BetaMessage response1 = client.beta().messages().create(params1); + Message response1 = client.messages().create(params1); System.out.println(response1); // Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit MessageCreateParams params2 = MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() + .container(ContainerParams.builder() .skills(List.of( - BetaSkillParams.builder() - .type(BetaSkillParams.Type.ANTHROPIC) + SkillParams.builder() + .type(SkillParams.Type.ANTHROPIC) .skillId("xlsx") .version("latest") .build(), - BetaSkillParams.builder() - .type(BetaSkillParams.Type.ANTHROPIC) + SkillParams.builder() + .type(SkillParams.Type.ANTHROPIC) .skillId("pptx") .version("latest") .build() )) .build()) .addUserMessage("Create a presentation") - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build(); - BetaMessage response2 = client.beta().messages().create(params2); + Message response2 = client.messages().create(params2); System.out.println(response2); } ```
client = Anthropic::Client.new # Skills render into the system prompt in a fixed, cache-friendly order - response1 = client.beta.messages.create( + response1 = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: [ - "code-execution-2025-08-25", - "skills-2025-10-02", - ], container: { skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }] },
puts response1 # Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit - response2 = client.beta.messages.create( + response2 = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: [ - "code-execution-2025-08-25", - "skills-2025-10-02", - ], container: { skills: [ { type: "anthropic", skill_id: "xlsx", version: "latest" },
``` ```bash CLI - if ! RESULT=$(ant beta:messages create \ - --beta code-execution-2025-08-25,skills-2025-10-02 \ + if ! RESULT=$(ant messages create \ --transform-error error.message \ --format-error yaml 2>&1 <<'YAML' model: claude-opus-5
client = anthropic.Anthropic() try: - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=4096, - betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "skills": [ {
const client = new Anthropic(); try { - const response = await client.beta.messages.create({ + const response = await client.messages.create({ model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ { type: "custom", skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv", version: "latest" }
{ Model = "claude-opus-5", MaxTokens = 4096, - Betas = ["code-execution-2025-08-25", "skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Custom, + Type = SkillParamsType.Custom, SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv", Version = "latest", }, ], }, Messages = [new() { Role = Role.User, Content = "Process data" }], - Tools = [new BetaCodeExecutionTool20250825()], + Tools = [new CodeExecutionTool20250825()], }; - var response = await client.Beta.Messages.Create(parameters); + var response = await client.Messages.Create(parameters); Console.WriteLine(response); } catch (AnthropicBadRequestException e) when (e.Message.Contains("skill"))
```go Go client := anthropic.NewClient() - response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{ + response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{ Model: "claude-opus-5", MaxTokens: 4096, - Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02}, - Container: anthropic.BetaMessageNewParamsContainerUnion{ - OfContainers: &anthropic.BetaContainerParams{ - Skills: []anthropic.BetaSkillParams{ + Container: anthropic.MessageCreateParamsContainerUnion{ + OfContainers: &anthropic.ContainerParams{ + Skills: []anthropic.SkillParams{ { - Type: anthropic.BetaSkillParamsTypeCustom, + Type: anthropic.SkillParamsTypeCustom, SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv", Version: anthropic.String("latest"), }, }, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Process data")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Process data")), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}}, }, })
```java Java import com.anthropic.errors.BadRequestException; - import com.anthropic.models.beta.messages.BetaContainerParams; - import com.anthropic.models.beta.messages.BetaSkillParams; - import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825; + import com.anthropic.models.messages.ContainerParams; + import com.anthropic.models.messages.SkillParams; + import com.anthropic.models.messages.CodeExecutionTool20250825; // ... void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv();
MessageCreateParams params = MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(4096L) - .addBeta("code-execution-2025-08-25") - .addBeta("skills-2025-10-02") - .container(BetaContainerParams.builder() - .addSkill(BetaSkillParams.builder() - .type(BetaSkillParams.Type.CUSTOM) + .container(ContainerParams.builder() + .addSkill(SkillParams.builder() + .type(SkillParams.Type.CUSTOM) .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv") .version("latest") .build()) .build()) .addUserMessage("Process data") - .addTool(BetaCodeExecutionTool20250825.builder().build()) + .addTool(CodeExecutionTool20250825.builder().build()) .build(); - BetaMessage response = client.beta().messages().create(params); + Message response = client.messages().create(params); System.out.println(response); } catch (BadRequestException e) { if (e.getMessage().contains("skill")) {
client = Anthropic::Client.new begin - response = client.beta.messages.create( + response = client.messages.create( model: "claude-opus-5", max_tokens: 4096, - betas: ["code-execution-2025-08-25", "skills-2025-10-02"], container: { skills: [ {
## Next steps <CardGroup cols={3}> - <Card title="API reference" icon="book" href="https://platform.claude.com/docs/en/api/beta/skills/create"> + <Card title="API reference" icon="book" href="https://platform.claude.com/docs/en/api/skills/create"> Complete API reference with all endpoints </Card>
build-with-claude/skills-guide Changed · +22 / -155 lines
| ------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ | | **Type value** | `anthropic` | `custom` | | **Skill IDs** | Short names: `pptx`, `xlsx`, `docx`, `pdf` | Generated: `skill_01AbCdEfGhIjKlMnOpQrStUv` | -| **Version format** | Date-based: `20251013` or `latest` | Epoch timestamp: `1759178010641129` or `latest` | +| **Version format** | Date-based: `20251013` or `latest` | Version ID: `skver_01AbCdEfGhIjKlMnOpQrStUv` or `latest` | | **Management** | Pre-built and maintained by Anthropic | Upload and manage through the [Skills API](https://platform.claude.com/docs/en/api/beta/skills/create) | | **Availability** | Available to all users | Private to your workspace |
To use Skills, you need: 1. **Claude API key** from the [Claude Console](https://platform.claude.com/settings/keys) +2. **[Code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool)** enabled in your requests -2. **Beta headers:** +Skills are generally available on the Claude API and don't require an `anthropic-beta` header, either for the Skills API or for `container.skills` in Messages requests. The examples in this guide still send the `skills-2025-10-02` beta header (plus `code-execution-2025-08-25` in Messages requests) and use the SDKs' `beta` namespace. Both headers remain valid opt-ins, so the examples work as written, and you can omit them in your own requests. - * `code-execution-2025-08-25` - Enables code execution (required for Skills) - * `skills-2025-10-02` - Enables Skills API - * `files-api-2025-04-14` - Required only when you use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files) to upload input files or download files a Skill produces - -3. **[Code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool)** enabled in your requests - Skills require the code execution tool, so use a model from its [model compatibility list](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#model-compatibility). ***
### Container parameter -Skills are specified using the `container` parameter in the Messages API. You can include up to 8 Skills for each request. +Skills are specified using the `container` parameter in the Messages API. You can include up to 20 Skills for each request. The structure is identical for both Anthropic and custom Skills. Specify the required `type` and `skill_id`, and optionally include `version` to pin to a specific version:
Upload your custom Skill to make it available in your workspace. You can upload a zip archive or individual file objects. The Python SDK also provides a `files_from_dir` helper that accepts a directory path. -Files are identified by the filename you attach. Per-file uploads must keep a common top-level directory in their paths (the `;filename=` suffix in the cURL example and the filename arguments in the SDK examples). A zip archive must contain the skill directory as its single top-level entry. For the walkthrough's skill, create one with `zip -r financial_skill.zip financial_skill/` and substitute it for the `example_skill.zip` placeholder in the zip-upload options. +Files are identified by the filename you attach (the `;filename=` suffix in the cURL example and the filename arguments in the SDK examples). For the walkthrough's skill, create a zip with `zip -r financial_skill.zip financial_skill/` and substitute it for the `example_skill.zip` placeholder in the zip-upload options. <CodeGroup defaultLanguage="CLI"> ```bash cURL
**Requirements:** -* Must include a `SKILL.md` file at the top level +* Must include a `SKILL.md` file at the upload root (or at the top of a single enclosing folder) -* All files must specify a common root directory in their paths +* `display_name` is optional: when omitted, it derives from the `SKILL.md` `name`; an explicit value may be up to 255 characters and does not need to be unique within the workspace -* The top-level directory name must match the `name` in `SKILL.md` frontmatter (case and underscore insensitive: `Financial_Skill` matches `financial-skill`) - -* `display_title` is optional: when omitted, it derives from the `SKILL.md` `name`; an explicit value must be unique among the custom skills in your workspace - * Total upload size must be under 30 MB (uncompressed) * YAML frontmatter requirements:
### Deleting a Skill -To delete a Skill, you must first delete all its versions: +Deleting a Skill also removes all of its versions. The cascade is GA-only behavior, so unlike the other examples in this guide, these call the GA surface directly rather than the `beta` namespace. <CodeGroup defaultLanguage="CLI"> ```bash cURL - # Step 1: List the versions, then delete each one - curl "https://api.anthropic.com/v1/skills/skill_01AbCdEfGhIjKlMnOpQrStUv/versions" \ - -H "x-api-key: $ANTHROPIC_API_KEY" \ - -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" - - # Repeat for each version the list returned - curl -X DELETE "https://api.anthropic.com/v1/skills/skill_01AbCdEfGhIjKlMnOpQrStUv/versions/1759178010641129" \ - -H "x-api-key: $ANTHROPIC_API_KEY" \ - -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" - - # Step 2: Delete the Skill curl -X DELETE "https://api.anthropic.com/v1/skills/skill_01AbCdEfGhIjKlMnOpQrStUv" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ - -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" + -H "anthropic-version: 2023-06-01" ``` ```bash CLI - # Step 1: List the versions, then delete each one - ant beta:skills:versions list \ - --skill-id skill_01AbCdEfGhIjKlMnOpQrStUv \ - --transform version \ - --raw-output - - # Repeat for each version id the list returned - ant beta:skills:versions delete \ - --skill-id skill_01AbCdEfGhIjKlMnOpQrStUv \ - --version 1759178010641129 >/dev/null - - # Step 2: Delete the Skill - ant beta:skills delete \ + ant skills delete \ --skill-id skill_01AbCdEfGhIjKlMnOpQrStUv >/dev/null ```
```python Python client = anthropic.Anthropic() - # Step 1: Delete all versions - for version in client.beta.skills.versions.list( - skill_id="skill_01AbCdEfGhIjKlMnOpQrStUv" - ): - client.beta.skills.versions.delete( - skill_id="skill_01AbCdEfGhIjKlMnOpQrStUv", - version=version.version, - ) - - # Step 2: Delete the Skill - client.beta.skills.delete(skill_id="skill_01AbCdEfGhIjKlMnOpQrStUv") + client.skills.delete(skill_id="skill_01AbCdEfGhIjKlMnOpQrStUv") ``` ```typescript TypeScript const client = new Anthropic(); - // Step 1: Delete all versions - for await (const version of client.beta.skills.versions.list( - "skill_01AbCdEfGhIjKlMnOpQrStUv" - )) { - await client.beta.skills.versions.delete(version.version, { - skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv" - }); - } - - // Step 2: Delete the Skill - await client.beta.skills.delete("skill_01AbCdEfGhIjKlMnOpQrStUv"); + await client.skills.delete("skill_01AbCdEfGhIjKlMnOpQrStUv"); ``` ```csharp C# - using Anthropic.Models.Beta.Skills.Versions; - // ... AnthropicClient client = new(); - // Step 1: Delete all versions - await foreach (var version in (await client.Beta.Skills.Versions.List("skill_01AbCdEfGhIjKlMnOpQrStUv")).Paginate()) - { - await client.Beta.Skills.Versions.Delete( - version.Version, - new VersionDeleteParams { SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv" } - ); - } - - // Step 2: Delete the Skill - await client.Beta.Skills.Delete("skill_01AbCdEfGhIjKlMnOpQrStUv"); + await client.Skills.Delete("skill_01AbCdEfGhIjKlMnOpQrStUv"); ``` ```go Go client := anthropic.NewClient() - // Step 1: Delete all versions - versions := client.Beta.Skills.Versions.ListAutoPaging( + _, err := client.Skills.Delete( context.TODO(), "skill_01AbCdEfGhIjKlMnOpQrStUv", - anthropic.BetaSkillVersionListParams{}, ) - - for versions.Next() { - version := versions.Current() - _, err := client.Beta.Skills.Versions.Delete( - context.TODO(), - version.Version, - anthropic.BetaSkillVersionDeleteParams{ - SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv", - }, - ) - if err != nil { - log.Fatal(err) - } - } - if versions.Err() != nil { - log.Fatal(versions.Err()) - } - - // Step 2: Delete the Skill - _, err := client.Beta.Skills.Delete( - context.TODO(), - "skill_01AbCdEfGhIjKlMnOpQrStUv", - anthropic.BetaSkillDeleteParams{}, - ) if err != nil { log.Fatal(err) }
``` ```java Java - import com.anthropic.models.beta.skills.versions.VersionListPage; - import com.anthropic.models.beta.skills.versions.VersionDeleteParams; - // ... void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv(); - // Step 1: Delete all versions - VersionListPage versions = client.beta().skills().versions().list("skill_01AbCdEfGhIjKlMnOpQrStUv"); - - for (var version : versions.autoPager()) { - client.beta().skills().versions().delete( - version.version(), - VersionDeleteParams.builder() - .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv") - .build() - ); - } - - // Step 2: Delete the Skill - client.beta().skills().delete("skill_01AbCdEfGhIjKlMnOpQrStUv"); + client.skills().delete("skill_01AbCdEfGhIjKlMnOpQrStUv"); } ```
```php PHP $client = new Client(); - // Step 1: Delete all versions - $versions = $client->beta->skills->versions->list( + $client->skills->delete( skillID: 'skill_01AbCdEfGhIjKlMnOpQrStUv', ); - - foreach ($versions->pagingEachItem() as $version) { - $client->beta->skills->versions->delete( - skillID: 'skill_01AbCdEfGhIjKlMnOpQrStUv', - version: $version->version, - ); - } - - // Step 2: Delete the Skill - $client->beta->skills->delete( - skillID: 'skill_01AbCdEfGhIjKlMnOpQrStUv', - ); ``` ```ruby Ruby client = Anthropic::Client.new - # Step 1: Delete all versions - client.beta.skills.versions.list("skill_01AbCdEfGhIjKlMnOpQrStUv").auto_paging_each do |version| - client.beta.skills.versions.delete( - version.version, - skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv" - ) - end - - # Step 2: Delete the Skill - client.beta.skills.delete("skill_01AbCdEfGhIjKlMnOpQrStUv") + client.skills.delete("skill_01AbCdEfGhIjKlMnOpQrStUv") ``` </CodeGroup> -Attempting to delete a Skill with existing versions returns a 400 error. - ### Versioning Skills support versioning to manage updates safely:
**Custom Skills:** -* Auto-generated epoch timestamps: `1759178010641129` +* Auto-generated version IDs: `skver_01AbCdEfGhIjKlMnOpQrStUv` * Use `"latest"` to always get the most recent version * Create new versions when updating Skill files -A new version is a complete snapshot, not a delta: upload the Skill's full file set each time, under the same top-level directory name used at creation. Files you omit are not carried over. The following examples re-upload the complete `financial_skill/` bundle from [Creating a Skill](https://platform.claude.com/docs/en/build-with-claude/skills-guide#creating-a-skill). +A new version is a complete snapshot, not a delta: upload the Skill's full file set each time. Files you omit are not carried over, and the `name` in the new version's `SKILL.md` must match the Skill's existing name. The following examples re-upload the complete `financial_skill/` bundle from [Creating a Skill](https://platform.claude.com/docs/en/build-with-claude/skills-guide#creating-a-skill). <CodeGroup defaultLanguage="CLI"> ```bash cURL
### Request limits -* **Maximum Skills per request:** 8 +* **Maximum Skills per request:** 20 * **Maximum Skill upload size:** 30 MB (all files combined, uncompressed)
build-with-claude/skills-guide Changed · +11 / -1 lines
## Audit logging
## Managing custom Skills +<Warning id="workspace-scoped-access"> + **Custom Skills are accessible to your entire workspace, not scoped to an end user, conversation, or session.** Any API key in the same workspace can read, invoke, and delete every custom Skill uploaded there, and all of your keys share your organization's Default Workspace unless you have assigned them to separate [workspaces](https://platform.claude.com/docs/en/manage-claude/workspaces#api-keys-and-resource-scoping). + + If you are building a multi-tenant platform on the Skills API, create a separate [workspace](https://platform.claude.com/docs/en/manage-claude/workspaces) for each tenant. The workspace is the isolation boundary for custom Skills, so a workspace per tenant gives each tenant's Skills hard isolation from every other tenant. Each organization can have up to 100 workspaces by default (see [How workspaces work](https://platform.claude.com/docs/en/manage-claude/workspaces#how-workspaces-work)); if you need more for tenant isolation, contact your account team. +</Warning> + ### Creating a Skill A Skill bundle is a directory containing a `SKILL.md` file at the top level with `name` and `description` YAML frontmatter, plus any supporting scripts or resources. See [Get started with Agent Skills in the API](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/quickstart) to author one, and the **Requirements** list following the examples for the full constraints.
The SDK tabs in this section show the `container` value to include in a Messages request. The cURL and CLI tabs show the full request. -**For production:** pin a specific version, so Skill updates never change your deployed behavior. The version ID comes from the create-version response in [Versioning](https://platform.claude.com/docs/en/build-with-claude/skills-guide#versioning) or from the [List Skill Versions API](https://platform.claude.com/docs/en/api/beta/skills/versions/list). The ID is always a string: quote epoch-timestamp IDs in JSON or YAML. +**For production:** pin a specific version, so Skill updates never change your deployed behavior. If you omit `version` or set it to `"latest"`, requests use the newest version of the Skill, so a version uploaded by anyone in the [workspace](https://platform.claude.com/docs/en/build-with-claude/skills-guide#workspace-scoped-access) immediately changes what your production agents run. The version ID comes from the create-version response in [Versioning](https://platform.claude.com/docs/en/build-with-claude/skills-guide#versioning) or from the [List Skill Versions API](https://platform.claude.com/docs/en/api/beta/skills/versions/list). The ID is always a string: quote epoch-timestamp IDs in JSON or YAML. <CodeGroup> ```bash cURL
Agent Skills are not covered by ZDR arrangements. Skill definitions and execution data are retained according to Anthropic's standard data retention policy. For ZDR eligibility across all features, see [API and data retention](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention). + +## Audit logging + +If your organization has the [Compliance API](https://platform.claude.com/docs/en/manage-claude/compliance-api) enabled, its [Activity Feed](https://platform.claude.com/docs/en/manage-claude/compliance-activity-feed) records the creation and deletion of Skills and Skill versions made with a Claude API key or from the Claude Console. Operations that occur while the Compliance API is off are not recorded and cannot be recovered later, so [set up the Compliance API](https://platform.claude.com/docs/en/manage-claude/compliance-api-access) before you rely on this audit trail. ## Next steps
build-with-claude/skills-guide First recorded · 4966 lines, first recorded
## Quick links ## Overview ### Using Skills ### Prerequisites ## Using Skills in Messages ### Container parameter ### Downloading generated files ### Multi-turn conversations ### Long-running operations ### Using multiple Skills ## Managing custom Skills ### Creating a Skill ### Listing Skills ### Retrieving a Skill ### Deleting a Skill ### Versioning ## How Skills are loaded ## Use cases ### Example: financial modeling ## Limits and constraints ### Request limits ### Environment constraints ## Best practices ### When to use multiple Skills ### Version management strategy ### Prompt caching considerations ### Error handling ## Data retention ## Next steps
The first capture of this source. The page was already there, and this is what it said.
---
title: Using Agent Skills with the API
url: https://platform.claude.com/docs/en/build-with-claude/skills-guide
description: Learn how to use Agent Skills to extend Claude's capabilities through the API.
---
Agent Skills extend Claude's capabilities through organized folders of instructions, scripts, and resources. This guide shows you how to use both pre-built and custom Skills with the Claude API.
<Note>
For complete API reference including request/response schemas and all parameters, see:
* [Skill Management API Reference](https://platform.claude.com/docs/en/api/beta/skills/list) - CRUD operations for Skills
* [Skill Versions API Reference](https://platform.claude.com/docs/en/api/beta/skills/versions/list) - Version management
</Note>
<Note>
For how zero data retention (ZDR) applies to this feature, see [API and data retention](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention).
</Note>
## Quick links
<CardGroup cols={2}>
<Card title="Get started with Agent Skills in the API" icon="rocket" href="https://platform.claude.com/docs/en/agents-and-tools/agent-skills/quickstart">
Learn how to use Agent Skills to create documents with the Claude API in under 10 minutes.
</Card>
<Card title="Skill authoring best practices" icon="hammer" href="https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices">
Learn how to write effective Skills that Claude can discover and use successfully.
</Card>
</CardGroup>
## Overview
<Note>
For a detailed look at the architecture and real-world applications of Agent Skills, read the engineering blog post: [Equipping agents for the real world with Agent Skills](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills).
</Note>
Skills integrate with the Messages API through the [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool). Whether using pre-built Skills managed by Anthropic or custom Skills you've uploaded, the integration shape is identical: both require code execution and use the same `container` structure.
### Using Skills
Skills integrate identically in the Messages API regardless of source. You specify Skills in the `container` parameter with a `skill_id`, `type`, and optional `version`, and they run in the code execution environment.
You can use Skills from two sources:
| Aspect | Anthropic Skills | Custom Skills |
| ------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| **Type value** | `anthropic` | `custom` |
| **Skill IDs** | Short names: `pptx`, `xlsx`, `docx`, `pdf` | Generated: `skill_01AbCdEfGhIjKlMnOpQrStUv` |
| **Version format** | Date-based: `20251013` or `latest` | Epoch timestamp: `1759178010641129` or `latest` |
| **Management** | Pre-built and maintained by Anthropic | Upload and manage through the [Skills API](https://platform.claude.com/docs/en/api/beta/skills/create) |
| **Availability** | Available to all users | Private to your workspace |
Both skill sources are returned by the [List Skills endpoint](https://platform.claude.com/docs/en/api/beta/skills/list) (use the `source` parameter to filter). The integration shape and execution environment are identical. The only difference is where the Skills come from and how they're managed.
### Prerequisites
To use Skills, you need:
1. **Claude API key** from the [Claude Console](https://platform.claude.com/settings/keys)
2. **Beta headers:**
* `code-execution-2025-08-25` - Enables code execution (required for Skills)
* `skills-2025-10-02` - Enables Skills API
* `files-api-2025-04-14` - Required only when you use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files) to upload input files or download files a Skill produces
3. **[Code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool)** enabled in your requests
Skills require the code execution tool, so use a model from its [model compatibility list](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#model-compatibility).
***
## Using Skills in Messages
### Container parameter
Skills are specified using the `container` parameter in the Messages API. You can include up to 8 Skills for each request.
The structure is identical for both Anthropic and custom Skills. Specify the required `type` and `skill_id`, and optionally include `version` to pin to a specific version:
<CodeGroup>
```bash cURL
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-5",
"max_tokens": 4096,
"container": {
"skills": [
{
"type": "anthropic",
"skill_id": "pptx",
"version": "latest"
}
]
},
"messages": [{
"role": "user",
"content": "Create a presentation about renewable energy"
}],
"tools": [{
"type": "code_execution_20250825",
"name": "code_execution"
}]
}'
```
```bash CLI
ant beta:messages create \
--beta code-execution-2025-08-25,skills-2025-10-02 <<'YAML'
model: claude-opus-5
max_tokens: 4096
container:
skills:
- type: anthropic
skill_id: pptx
version: latest
messages:
- role: user
content: Create a presentation about renewable energy
tools:
- type: code_execution_20250825
name: code_execution
YAML
```
```python Python
client = anthropic.Anthropic()
response = client.beta.messages.create(
model="claude-opus-5",
max_tokens=4096,
betas=["code-execution-2025-08-25", "skills-2025-10-02"],
container={
"skills": [{"type": "anthropic", "skill_id": "pptx", "version": "latest"}]
},
messages=[
{"role": "user", "content": "Create a presentation about renewable energy"}
],
tools=[{"type": "code_execution_20250825", "name": "code_execution"}],
)
```
```typescript TypeScript
const client = new Anthropic();
const response = await client.beta.messages.create({
model: "claude-opus-5",
max_tokens: 4096,
betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
container: {
skills: [
{
type: "anthropic",
skill_id: "pptx",
version: "latest"
}
]
},
messages: [
{
role: "user",
content: "Create a presentation about renewable energy"
}
],
tools: [
{
type: "code_execution_20250825",
name: "code_execution"
}
]
});
```
```csharp C#
AnthropicClient client = new();
var parameters = new MessageCreateParams
{
Model = "claude-opus-5",
MaxTokens = 4096,
Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
Container = new BetaContainerParams
{
Skills =
[
new BetaSkillParams
{
Type = BetaSkillParamsType.Anthropic,
SkillID = "pptx",
Version = "latest",
},
],
},
Messages = [new() { Role = Role.User, Content = "Create a presentation about renewable energy" }],
Tools = [new BetaCodeExecutionTool20250825()],
};
var message = await client.Beta.Messages.Create(parameters);
Console.WriteLine(message);
```
```go Go
client := anthropic.NewClient()
response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
Model: "claude-opus-5",
MaxTokens: 4096,
Betas: []anthropic.AnthropicBeta{
"code-execution-2025-08-25",
anthropic.AnthropicBetaSkills2025_10_02,
},
Container: anthropic.BetaMessageNewParamsContainerUnion{
OfContainers: &anthropic.BetaContainerParams{
Skills: []anthropic.BetaSkillParams{
{
Type: anthropic.BetaSkillParamsTypeAnthropic,
SkillID: "pptx",
Version: anthropic.String("latest"),
},
},
},
},
Messages: []anthropic.BetaMessageParam{
anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Create a presentation about renewable energy")),
},
Tools: []anthropic.BetaToolUnionParam{
{OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(response)
```
```java Java
import com.anthropic.models.beta.messages.BetaContainerParams;
import com.anthropic.models.beta.messages.BetaSkillParams;
import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825;
// ...
void main() {
AnthropicClient client = AnthropicOkHttpClient.fromEnv();
MessageCreateParams params = MessageCreateParams.builder()
.model(Model.CLAUDE_OPUS_5)
.maxTokens(4096L)
.addBeta("code-execution-2025-08-25")
.addBeta("skills-2025-10-02")
.container(BetaContainerParams.builder()
.addSkill(BetaSkillParams.builder()
.type(BetaSkillParams.Type.ANTHROPIC)
.skillId("pptx")
.version("latest")
.build())
.build())
.addUserMessage("Create a presentation about renewable energy")
.addTool(BetaCodeExecutionTool20250825.builder().build())
.build();
BetaMessage response = client.beta().messages().create(params);
System.out.println(response);
}
```
```php PHP
$client = new Client();
$message = $client->beta->messages->create(
maxTokens: 4096,
messages: [
['role' => 'user', 'content' => 'Create a presentation about renewable energy']
],
model: 'claude-opus-5',
betas: ['code-execution-2025-08-25', 'skills-2025-10-02'],
container: [
'skills' => [
[
'type' => 'anthropic',
'skill_id' => 'pptx',
'version' => 'latest'
]
]
],
tools: [
['type' => 'code_execution_20250825', 'name' => 'code_execution']
]
);
echo $message;
```
```ruby Ruby
client = Anthropic::Client.new
message = client.beta.messages.create(
Cut at 300 lines.