quickstart
agents-and-tools/agent-skills/quickstart
History
agents-and-tools/agent-skills/quickstart Changed · +16 / -26 lines
``` ```php PHP - // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. // List Anthropic-managed Skills - $skills = $client->beta->skills->list(source: 'anthropic'); + $skills = $client->skills->list(source: 'anthropic'); - foreach ($skills->data as $skill) { - echo "{$skill->id}: {$skill->displayTitle}\n"; + foreach ($skills->getItems() as $skill) { + echo "{$skill->id}: {$skill->displayName}\n"; } ```
``` ```php PHP - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. // Create a message with the PowerPoint Skill - $response = $client->beta->messages->create( + $response = $client->messages->create( model: 'claude-opus-5', maxTokens: 16000, - betas: ['skills-2025-10-02'], container: [ - 'skills' => [['type' => 'anthropic', 'skill_id' => 'pptx', 'version' => 'latest']], + 'skills' => [['type' => 'anthropic', 'skillID' => 'pptx', 'version' => 'latest']], ], messages: [ [
``` ```php PHP - // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs. // Extract the file ID. The code execution tool runs the Skill's code through // its Bash sub-tool, and generated files appear as bash_code_execution_output // items inside the bash_code_execution_tool_result block.
if ($fileId !== null) { // Download the file and save it $outputPath = sys_get_temp_dir() . '/renewable_energy.pptx'; - $fileContent = $client->beta->files->download($fileId); + $fileContent = $client->files->download($fileId); file_put_contents($outputPath, $fileContent); echo "Presentation saved to {$outputPath}\n"; }
``` ```php PHP - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. - $response = $client->beta->messages->create( + $response = $client->messages->create( model: 'claude-opus-5', maxTokens: 16000, - betas: ['skills-2025-10-02'], container: [ 'skills' => [ - ['type' => 'anthropic', 'skill_id' => 'xlsx', 'version' => 'latest'], + ['type' => 'anthropic', 'skillID' => 'xlsx', 'version' => 'latest'], ], ], messages: [
'content' => 'Create a quarterly sales tracking spreadsheet with sample data', ], ], - tools: [new BetaCodeExecutionTool20260521()], + tools: [['type' => 'code_execution_20260521', 'name' => 'code_execution']], ); ```
``` ```php PHP - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. - $response = $client->beta->messages->create( + $response = $client->messages->create( model: 'claude-opus-5', maxTokens: 16000, - betas: ['skills-2025-10-02'], container: [ 'skills' => [ - ['type' => 'anthropic', 'skill_id' => 'docx', 'version' => 'latest'], + ['type' => 'anthropic', 'skillID' => 'docx', 'version' => 'latest'], ], ], messages: [
'content' => 'Write a 2-page report on the benefits of renewable energy', ], ], - tools: [new BetaCodeExecutionTool20260521()], + tools: [['type' => 'code_execution_20260521', 'name' => 'code_execution']], ); ```
``` ```php PHP - // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. - $response = $client->beta->messages->create( + $response = $client->messages->create( model: 'claude-opus-5', maxTokens: 16000, - betas: ['skills-2025-10-02'], container: [ 'skills' => [ - ['type' => 'anthropic', 'skill_id' => 'pdf', 'version' => 'latest'], + ['type' => 'anthropic', 'skillID' => 'pdf', 'version' => 'latest'], ], ], messages: [
'content' => 'Generate a PDF invoice template', ], ], - tools: [new BetaCodeExecutionTool20260521()], + tools: [['type' => 'code_execution_20260521', 'name' => 'code_execution']], ); ```
agents-and-tools/agent-skills/quickstart Changed · +7 / -3 lines
``` ```php PHP + // The PHP SDK exposes the Skills API under the beta namespace; field names can differ from other SDKs. // List Anthropic-managed Skills $skills = $client->beta->skills->list(source: 'anthropic');
``` ```php PHP + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. // Create a message with the PowerPoint Skill $response = $client->beta->messages->create( model: 'claude-opus-5',
* **`tools`:** Enables code execution (required for Skills) <Note> - Skills are generally available on the Claude API and don't require a beta header. This covers the Skills API, the `container.skills` parameter, and the Files API. Requests that still send the `skills-2025-10-02` or `files-api-2025-04-14` header keep working, and the Skills API and Files API return the earlier response format for them. The PHP tabs in this quickstart still call the SDK's `beta` namespace and send those headers, so their printed output shows the earlier response fields. - - The examples use the `code_execution_20260521` tool version, and the Step 3 code parses the result types that current tool versions return. Skills also work with older [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool) versions such as `code_execution_20250825`: any current code execution tool version satisfies the Skills requirement without a beta header. If you use a different version, use the tool `type` listed on the code execution tool page. + The examples use the `code_execution_20260521` tool version, and the Step 3 code parses the result types that current tool versions return. Skills also work with older [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool) versions such as `code_execution_20250825`: any current code execution tool version satisfies the Skills requirement. If you use a different version, use the tool `type` listed on the code execution tool page. </Note> When you make this request, Claude automatically matches your task to the relevant Skill. Because you asked for a presentation, Claude determines the PowerPoint Skill is relevant and loads its full instructions: the second level of progressive disclosure. Then Claude runs the Skill's code to create your presentation.
``` ```php PHP + // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs. // Extract the file ID. The code execution tool runs the Skill's code through // its Bash sub-tool, and generated files appear as bash_code_execution_output // items inside the bash_code_execution_tool_result block.
``` ```php PHP + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $response = $client->beta->messages->create( model: 'claude-opus-5', maxTokens: 16000,
``` ```php PHP + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $response = $client->beta->messages->create( model: 'claude-opus-5', maxTokens: 16000,
``` ```php PHP + // The PHP SDK supports container skills only through $client->beta->messages with the skills beta. $response = $client->beta->messages->create( model: 'claude-opus-5', maxTokens: 16000,
agents-and-tools/agent-skills/quickstart Changed · +126 / -172 lines
# List Anthropic-managed Skills curl --fail-with-body -sS "https://api.anthropic.com/v1/skills?source=anthropic" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ - -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" | - jq -r '.data[] | "\(.id): \(.display_title)"' + -H "anthropic-version: 2023-06-01" ``` ```bash CLI # List Anthropic-managed Skills - ant beta:skills list --source anthropic + ant skills list --source anthropic ``` ```python Python # List Anthropic-managed Skills - skills = client.beta.skills.list(source="anthropic") + skills = client.skills.list(source="anthropic") for skill in skills.data: - print(f"{skill.id}: {skill.display_title}") + print(f"{skill.id}: {skill.display_name}") ``` ```typescript TypeScript // List Anthropic-managed Skills - const skills = await client.beta.skills.list({ source: "anthropic" }); + const skills = await client.skills.list({ source: "anthropic" }); for (const skill of skills.data) { - console.log(`${skill.id}: ${skill.display_title}`); + console.log(`${skill.id}: ${skill.display_name}`); } ``` ```csharp C# // List Anthropic-managed Skills - var skills = await client.Beta.Skills.List(new SkillListParams { Source = "anthropic" }); + var skills = await client.Skills.List(new SkillListParams { Source = "anthropic" }); foreach (var skill in skills.Items) { - Console.WriteLine($"{skill.ID}: {skill.DisplayTitle}"); + Console.WriteLine($"{skill.ID}: {skill.DisplayName}"); } ``` ```go Go // List Anthropic-managed Skills - skills, err := client.Beta.Skills.List(ctx, anthropic.BetaSkillListParams{ + skills, err := client.Skills.List(ctx, anthropic.SkillListParams{ Source: anthropic.String("anthropic"), }) if err != nil {
} for _, skill := range skills.Data { - fmt.Printf("%s: %s\n", skill.ID, skill.DisplayTitle) + fmt.Printf("%s: %s\n", skill.ID, skill.DisplayName) } ``` ```java Java // List Anthropic-managed Skills - SkillListPage skills = client.beta().skills().list( + SkillListPage skills = client.skills().list( SkillListParams.builder().source("anthropic").build() ); - for (SkillListResponse skill : skills.data()) { - IO.println(skill.id() + ": " + skill.displayTitle().orElse("")); + for (Skill skill : skills.data()) { + IO.println(skill.id() + ": " + skill.displayName()); } ```
```ruby Ruby # List Anthropic-managed Skills - skills = client.beta.skills.list(source: "anthropic") + skills = client.skills.list(source: "anthropic") skills.data.each do |skill| - puts "#{skill.id}: #{skill.display_title}" + puts "#{skill.id}: #{skill.display_name}" end ``` </CodeGroup>
-H "content-type: application/json" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" \ -d @- <<'EOF' { "model": "claude-opus-5",
} EOF ) - jq -r '"stop_reason=\(.stop_reason), blocks=\(.content | length)"' <<<"$response" ``` ```bash CLI # Create a message with the PowerPoint Skill - response=$(ant beta:messages create --format json \ - --beta skills-2025-10-02 <<'YAML' + response=$(ant messages create --format json <<'YAML' model: claude-opus-5 max_tokens: 16000 container:
name: code_execution YAML ) - - jq -r '"stop_reason=\(.stop_reason), blocks=\(.content | length)"' <<<"$response" ``` ```python Python # Create a message with the PowerPoint Skill - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=16000, - betas=["skills-2025-10-02"], container={ "skills": [{"type": "anthropic", "skill_id": "pptx", "version": "latest"}] },
```typescript TypeScript // Create a message with the PowerPoint Skill - const response = await client.beta.messages.create({ + const response = await client.messages.create({ model: "claude-opus-5", max_tokens: 16000, - betas: ["skills-2025-10-02"], container: { skills: [{ type: "anthropic", skill_id: "pptx", version: "latest" }], },
```csharp C# // Create a message with the PowerPoint Skill - var response = await client.Beta.Messages.Create(new MessageCreateParams + var response = await client.Messages.Create(new MessageCreateParams { Model = Model.ClaudeOpus5, MaxTokens = 16000, - Betas = ["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 BetaMessageParam + new MessageParam { Role = Role.User, Content = "Create a presentation about renewable energy with 5 slides", }, ], - Tools = [new BetaCodeExecutionTool20260521()], + Tools = [new CodeExecutionTool20260521()], }); Console.WriteLine($"stop_reason={response.StopReason?.Raw()}, blocks={response.Content.Count}");
```go Go // Create a message with the PowerPoint Skill - response, err := client.Beta.Messages.New(ctx, anthropic.BetaMessageNewParams{ + response, err := client.Messages.New(ctx, anthropic.MessageNewParams{ Model: anthropic.ModelClaudeOpus5, MaxTokens: 16000, - Betas: []anthropic.AnthropicBeta{ - 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 with 5 slides"), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage( + anthropic.NewTextBlock("Create a presentation about renewable energy with 5 slides"), ), }, - Tools: []anthropic.BetaToolUnionParam{ - {OfCodeExecutionTool20260521: &anthropic.BetaCodeExecutionTool20260521Param{}}, + Tools: []anthropic.ToolUnionParam{ + {OfCodeExecutionTool20260521: &anthropic.CodeExecutionTool20260521Param{}}, }, }) if err != nil {
```java Java // Create a message with the PowerPoint Skill - BetaMessage response = client.beta().messages().create( + Message response = client.messages().create( MessageCreateParams.builder() .model(Model.CLAUDE_OPUS_5) .maxTokens(16000) - .addBeta(AnthropicBeta.SKILLS_2025_10_02) .container( - BetaContainerParams.builder() + ContainerParams.builder() .addSkill( - BetaSkillParams.builder() - .type(BetaSkillParams.Type.ANTHROPIC) + SkillParams.builder() + .type(SkillParams.Type.ANTHROPIC) .skillId("pptx") .version("latest") .build()
.build() ) .addUserMessage("Create a presentation about renewable energy with 5 slides") - .addTool(BetaCodeExecutionTool20260521.builder().build()) + .addTool(CodeExecutionTool20260521.builder().build()) .build() );
```ruby Ruby # Create a message with the PowerPoint Skill - response = client.beta.messages.create( + response = client.messages.create( model: "claude-opus-5", max_tokens: 16_000, - betas: ["skills-2025-10-02"], container: { skills: [{type: "anthropic", skill_id: "pptx", version: "latest"}] },
* **`tools`:** Enables code execution (required for Skills) <Note> - Skills are generally available on the Claude API and don't require a beta header. The examples on this page still send the `skills-2025-10-02` beta header and use the SDKs' `beta` namespace. Both remain valid, so you can run the examples as written and omit the header in your own requests. + Skills are generally available on the Claude API and don't require a beta header. This covers the Skills API, the `container.skills` parameter, and the Files API. Requests that still send the `skills-2025-10-02` or `files-api-2025-04-14` header keep working, and the Skills API and Files API return the earlier response format for them. The PHP tabs in this quickstart still call the SDK's `beta` namespace and send those headers, so their printed output shows the earlier response fields. The examples use the `code_execution_20260521` tool version, and the Step 3 code parses the result types that current tool versions return. Skills also work with older [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool) versions such as `code_execution_20250825`: any current code execution tool version satisfies the Skills requirement without a beta header. If you use a different version, use the tool `type` listed on the code execution tool page. </Note>
curl --fail-with-body -sS "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" \ -o "$output_path" echo "Presentation saved to $output_path" fi
if [[ -n "$file_id" ]]; then # Download the file and save it output_path="${TMPDIR:-/tmp}/renewable_energy.pptx" - ant beta:files download --file-id "$file_id" --output "$output_path" + ant files download --file-id "$file_id" --output "$output_path" echo "Presentation saved to $output_path" fi ```
if file_id: # Download the file and save it output_path = Path(tempfile.gettempdir()) / "renewable_energy.pptx" - file_content = client.beta.files.download(file_id=file_id) + file_content = client.files.download(file_id=file_id) file_content.write_to_file(output_path) print(f"Presentation saved to {output_path}") ```
if (fileId) { // Download the file and save it const outputPath = path.join(os.tmpdir(), "renewable_energy.pptx"); - const fileContent = await client.beta.files.download(fileId); + const fileContent = await client.files.download(fileId); await fs.writeFile(outputPath, Buffer.from(await fileContent.arrayBuffer())); console.log(`Presentation saved to ${outputPath}`); }
foreach (var block in response.Content) { if (block.TryPickBashCodeExecutionToolResult(out var bashResult) - && bashResult.Content.TryPickBetaBashCodeExecutionResultBlock(out var bashResultBlock)) + && bashResult.Content.TryPickBashCodeExecutionResultBlock(out var bashResultBlock)) { foreach (var output in bashResultBlock.Content) {
{ // Download the file and save it var outputPath = Path.Combine(Path.GetTempPath(), "renewable_energy.pptx"); - using var download = await client.Beta.Files.Download(fileId); + using var download = await client.Files.Download(fileId); await using var source = await download.ReadAsStream(); await using var destination = File.Create(outputPath); await source.CopyToAsync(destination);
var fileID string for _, block := range response.Content { switch result := block.AsAny().(type) { - case anthropic.BetaBashCodeExecutionToolResultBlock: + case anthropic.BashCodeExecutionToolResultBlock: if result.Content.Type == "bash_code_execution_result" { for _, output := range result.Content.Content { fileID = output.FileID
if fileID != "" { // Download the file and save it outputPath := filepath.Join(os.TempDir(), "renewable_energy.pptx") - fileContent, err := client.Beta.Files.Download(ctx, fileID, anthropic.BetaFileDownloadParams{}) + fileContent, err := client.Files.Download(ctx, fileID) if err != nil { panic(err) }
// its Bash sub-tool, and generated files appear as bash_code_execution_output // items inside the bash_code_execution_tool_result block. String fileId = null; - for (BetaContentBlock block : response.content()) { + for (ContentBlock block : response.content()) { if (block.isBashCodeExecutionToolResult()) { var content = block.asBashCodeExecutionToolResult().content(); - if (content.isBetaBashCodeExecutionResultBlock()) { - for (var output : content.asBetaBashCodeExecutionResultBlock().content()) { + if (content.isBashCodeExecutionResultBlock()) { + for (var output : content.asBashCodeExecutionResultBlock().content()) { fileId = output.fileId(); } }
if (fileId != null) { // Download the file and save it Path outputPath = Files.createTempFile("renewable_energy", ".pptx"); - try (HttpResponse fileContent = client.beta().files().download(fileId)) { + try (HttpResponse fileContent = client.files().download(fileId)) { Files.copy(fileContent.body(), outputPath, StandardCopyOption.REPLACE_EXISTING); } IO.println("Presentation saved to " + outputPath);
if file_id # Download the file and save it output_path = File.join(Dir.tmpdir, "renewable_energy.pptx") - file_content = client.beta.files.download(file_id) + file_content = client.files.download(file_id) File.binwrite(output_path, file_content.read) puts "Presentation saved to #{output_path}" end
-H "content-type: application/json" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" \ -d '{ "model": "claude-opus-5", "max_tokens": 16000,
{"role": "user", "content": "Create a quarterly sales tracking spreadsheet with sample data"} ], "tools": [{"type": "code_execution_20260521", "name": "code_execution"}] - }' | jq -r '"stop_reason=\(.stop_reason)"' + }' ``` ```bash CLI - ant beta:messages create --format json \ - --beta skills-2025-10-02 <<'YAML' | jq -r '"stop_reason=\(.stop_reason)"' + ant messages create <<'YAML' model: claude-opus-5 max_tokens: 16000 container:
``` ```python Python - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=16000, - betas=["skills-2025-10-02"], container={ "skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}] },
``` ```typescript TypeScript - const response = await client.beta.messages.create({ + const response = await client.messages.create({ model: "claude-opus-5", max_tokens: 16000, - betas: ["skills-2025-10-02"], container: { skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }] },
``` ```csharp C# - var response = await client.Beta.Messages.Create( + var response = await client.Messages.Create( new MessageCreateParams { Model = Model.ClaudeOpus5, MaxTokens = 16000, - Betas = ["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 BetaMessageParam + new MessageParam { Role = Role.User, Content = "Create a quarterly sales tracking spreadsheet with sample data", }, ], - Tools = [new BetaCodeExecutionTool20260521()], + Tools = [new CodeExecutionTool20260521()], } ); ``` ```go Go - response, err := client.Beta.Messages.New(context.Background(), anthropic.BetaMessageNewParams{ + response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{ Model: anthropic.ModelClaudeOpus5, MaxTokens: 16000, - Betas: []anthropic.AnthropicBeta{ - 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 quarterly sales tracking spreadsheet with sample data")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Create a quarterly sales tracking spreadsheet with sample data")), }, - Tools: []anthropic.BetaToolUnionParam{ + Tools: []anthropic.ToolUnionParam{ { - OfCodeExecutionTool20260521: &anthropic.BetaCodeExecutionTool20260521Param{}, + OfCodeExecutionTool20260521: &anthropic.CodeExecutionTool20260521Param{}, }, }, })
``` ```java Java - BetaMessage response = client.beta().messages().create( + Message response = client.messages().create( MessageCreateParams.builder() .model(CLAUDE_OPUS_5) .maxTokens(16000) - .addBeta(AnthropicBeta.SKILLS_2025_10_02) .container( - BetaContainerParams.builder() + ContainerParams.builder() .addSkill( - BetaSkillParams.builder() + SkillParams.builder() .type(ANTHROPIC) .skillId("xlsx") .version("latest")
.build() ) .addUserMessage("Create a quarterly sales tracking spreadsheet with sample data") - .addTool(BetaCodeExecutionTool20260521.builder().build()) + .addTool(CodeExecutionTool20260521.builder().build()) .build() );
``` ```ruby Ruby - response = client.beta.messages.create( + response = client.messages.create( model: "claude-opus-5", max_tokens: 16_000, - betas: ["skills-2025-10-02"], container: { skills: [{type: "anthropic", skill_id: "xlsx", version: "latest"}] },
-H "content-type: application/json" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" \ -d '{ "model": "claude-opus-5", "max_tokens": 16000,
{"role": "user", "content": "Write a 2-page report on the benefits of renewable energy"} ], "tools": [{"type": "code_execution_20260521", "name": "code_execution"}] - }' | jq -r '"stop_reason=\(.stop_reason)"' + }' ``` ```bash CLI - ant beta:messages create --format json \ - --beta skills-2025-10-02 <<'YAML' | jq -r '"stop_reason=\(.stop_reason)"' + ant messages create <<'YAML' model: claude-opus-5 max_tokens: 16000 container:
``` ```python Python - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=16000, - betas=["skills-2025-10-02"], container={ "skills": [{"type": "anthropic", "skill_id": "docx", "version": "latest"}] },
``` ```typescript TypeScript - const response = await client.beta.messages.create({ + const response = await client.messages.create({ model: "claude-opus-5", max_tokens: 16000, - betas: ["skills-2025-10-02"], container: { skills: [{ type: "anthropic", skill_id: "docx", version: "latest" }] },
``` ```csharp C# - var response = await client.Beta.Messages.Create( + var response = await client.Messages.Create( new MessageCreateParams { Model = Model.ClaudeOpus5, MaxTokens = 16000, - Betas = ["skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "docx", Version = "latest", },
}, Messages = [ - new BetaMessageParam + new MessageParam { Role = Role.User, Content = "Write a 2-page report on the benefits of renewable energy", }, ], - Tools = [new BetaCodeExecutionTool20260521()], + Tools = [new CodeExecutionTool20260521()], } ); ``` ```go Go - response, err := client.Beta.Messages.New(context.Background(), anthropic.BetaMessageNewParams{ + response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{ Model: anthropic.ModelClaudeOpus5, MaxTokens: 16000, - Betas: []anthropic.AnthropicBeta{ - 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: "docx", Version: anthropic.String("latest"), },
}, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Write a 2-page report on the benefits of renewable energy")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Write a 2-page report on the benefits of renewable energy")), }, - Tools: []anthropic.BetaToolUnionParam{ + Tools: []anthropic.ToolUnionParam{ { - OfCodeExecutionTool20260521: &anthropic.BetaCodeExecutionTool20260521Param{}, + OfCodeExecutionTool20260521: &anthropic.CodeExecutionTool20260521Param{}, }, }, })
``` ```java Java - BetaMessage response = client.beta().messages().create( + Message response = client.messages().create( MessageCreateParams.builder() .model(CLAUDE_OPUS_5) .maxTokens(16000) - .addBeta(AnthropicBeta.SKILLS_2025_10_02) .container( - BetaContainerParams.builder() + ContainerParams.builder() .addSkill( - BetaSkillParams.builder() + SkillParams.builder() .type(ANTHROPIC) .skillId("docx") .version("latest")
.build() ) .addUserMessage("Write a 2-page report on the benefits of renewable energy") - .addTool(BetaCodeExecutionTool20260521.builder().build()) + .addTool(CodeExecutionTool20260521.builder().build()) .build() );
``` ```ruby Ruby - response = client.beta.messages.create( + response = client.messages.create( model: "claude-opus-5", max_tokens: 16_000, - betas: ["skills-2025-10-02"], container: { skills: [{type: "anthropic", skill_id: "docx", version: "latest"}] },
-H "content-type: application/json" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ - -H "anthropic-beta: skills-2025-10-02" \ -d '{ "model": "claude-opus-5", "max_tokens": 16000,
{"role": "user", "content": "Generate a PDF invoice template"} ], "tools": [{"type": "code_execution_20260521", "name": "code_execution"}] - }' | jq -r '"stop_reason=\(.stop_reason)"' + }' ``` ```bash CLI - ant beta:messages create --format json \ - --beta skills-2025-10-02 <<'YAML' | jq -r '"stop_reason=\(.stop_reason)"' + ant messages create <<'YAML' model: claude-opus-5 max_tokens: 16000 container:
``` ```python Python - response = client.beta.messages.create( + response = client.messages.create( model="claude-opus-5", max_tokens=16000, - betas=["skills-2025-10-02"], container={ "skills": [{"type": "anthropic", "skill_id": "pdf", "version": "latest"}] },
``` ```typescript TypeScript - const response = await client.beta.messages.create({ + const response = await client.messages.create({ model: "claude-opus-5", max_tokens: 16000, - betas: ["skills-2025-10-02"], container: { skills: [{ type: "anthropic", skill_id: "pdf", version: "latest" }] },
``` ```csharp C# - var response = await client.Beta.Messages.Create( + var response = await client.Messages.Create( new MessageCreateParams { Model = Model.ClaudeOpus5, MaxTokens = 16000, - Betas = ["skills-2025-10-02"], - Container = new BetaContainerParams + Container = new ContainerParams { Skills = [ - new BetaSkillParams + new SkillParams { - Type = BetaSkillParamsType.Anthropic, + Type = SkillParamsType.Anthropic, SkillID = "pdf", Version = "latest", },
}, Messages = [ - new BetaMessageParam + new MessageParam { Role = Role.User, Content = "Generate a PDF invoice template", }, ], - Tools = [new BetaCodeExecutionTool20260521()], + Tools = [new CodeExecutionTool20260521()], } ); ``` ```go Go - response, err := client.Beta.Messages.New(context.Background(), anthropic.BetaMessageNewParams{ + response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{ Model: anthropic.ModelClaudeOpus5, MaxTokens: 16000, - Betas: []anthropic.AnthropicBeta{ - 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: "pdf", Version: anthropic.String("latest"), },
}, }, }, - Messages: []anthropic.BetaMessageParam{ - anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Generate a PDF invoice template")), + Messages: []anthropic.MessageParam{ + anthropic.NewUserMessage(anthropic.NewTextBlock("Generate a PDF invoice template")), }, - Tools: []anthropic.BetaToolUnionParam{ + Tools: []anthropic.ToolUnionParam{ { - OfCodeExecutionTool20260521: &anthropic.BetaCodeExecutionTool20260521Param{}, + OfCodeExecutionTool20260521: &anthropic.CodeExecutionTool20260521Param{}, }, }, })
``` ```java Java - BetaMessage response = client.beta().messages().create( + Message response = client.messages().create( MessageCreateParams.builder() .model(CLAUDE_OPUS_5) .maxTokens(16000) - .addBeta(AnthropicBeta.SKILLS_2025_10_02) .container( - BetaContainerParams.builder() + ContainerParams.builder() .addSkill( - BetaSkillParams.builder() + SkillParams.builder() .type(ANTHROPIC) .skillId("pdf") .version("latest")
.build() ) .addUserMessage("Generate a PDF invoice template") - .addTool(BetaCodeExecutionTool20260521.builder().build()) + .addTool(CodeExecutionTool20260521.builder().build()) .build() );
``` ```ruby Ruby - response = client.beta.messages.create( + response = client.messages.create( model: "claude-opus-5", max_tokens: 16_000, - betas: ["skills-2025-10-02"], container: { skills: [{type: "anthropic", skill_id: "pdf", version: "latest"}] },
Learn how to use Agent Skills to extend Claude's capabilities through the API. </Card> - <Card title="Create custom Skills" icon="code" href="https://platform.claude.com/docs/en/api/skills/create-skill"> + <Card title="Create custom Skills" icon="code" href="https://platform.claude.com/docs/en/api/skills/create"> Upload your own Skills for specialized tasks. </Card>
agents-and-tools/agent-skills/quickstart Changed · +3 / -2 lines
* **`skill_id: "pptx"`:** The PowerPoint Skill identifier * **`version: "latest"`:** The Skill version set to the most recently published * **`tools`:** Enables code execution (required for Skills) -* **Beta header:** `skills-2025-10-02` <Note> - The examples on this page use the `code_execution_20260521` tool version, which is generally available and needs only the `skills-2025-10-02` beta header. The Step 3 code parses the result types that current tool versions return. Skills also work with older [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool) versions such as `code_execution_20250825`: any current code execution tool version satisfies the Skills requirement. If you use a different version, keep its tool `type` and any beta header consistent with the code execution tool page, and always include `skills-2025-10-02`. + Skills are generally available on the Claude API and don't require a beta header. The examples on this page still send the `skills-2025-10-02` beta header and use the SDKs' `beta` namespace. Both remain valid, so you can run the examples as written and omit the header in your own requests. + + The examples use the `code_execution_20260521` tool version, and the Step 3 code parses the result types that current tool versions return. Skills also work with older [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool) versions such as `code_execution_20250825`: any current code execution tool version satisfies the Skills requirement without a beta header. If you use a different version, use the tool `type` listed on the code execution tool page. </Note> When you make this request, Claude automatically matches your task to the relevant Skill. Because you asked for a presentation, Claude determines the PowerPoint Skill is relevant and loads its full instructions: the second level of progressive disclosure. Then Claude runs the Skill's code to create your presentation.
agents-and-tools/agent-skills/quickstart First recorded · 1255 lines, first recorded
## Prerequisites ## Agent Skills overview ## Step 1: List available Skills ## Step 2: Create a presentation ## Step 3: Download the created file ## Try more examples ### Create a spreadsheet ### Create a Word document ### Generate a PDF ## Next steps
The first capture of this source. The page was already there, and this is what it said.
---
title: Get started with Agent Skills in the API
url: https://platform.claude.com/docs/en/agents-and-tools/agent-skills/quickstart
description: Learn how to use Agent Skills to create documents with the Claude API in under 10 minutes.
---
This tutorial shows you how to use Agent Skills to create a PowerPoint presentation. You'll learn how to enable Skills, make a request, and access the generated file.
## Prerequisites
* A [Claude API key](https://platform.claude.com/settings/keys) or a logged-in [ant CLI](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/authentication)
* A [client SDK](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) for your language, or `curl` and `jq`
* Basic familiarity with making API requests
## Agent Skills overview
Pre-built Agent Skills extend Claude's capabilities with specialized expertise for tasks such as creating documents, analyzing data, and processing files. Anthropic provides the following pre-built Agent Skills in the API:
* **PowerPoint (pptx):** Create and edit presentations
* **Excel (xlsx):** Create and analyze spreadsheets
* **Word (docx):** Create and edit documents
* **PDF (pdf):** Generate PDF documents
<Note>
To create custom Skills, see the [Agent Skills Cookbook](https://platform.claude.com/cookbook/skills-notebooks-01-skills-introduction) for examples of building your own Skills with domain-specific expertise.
</Note>
## Step 1: List available Skills
First, check what Skills are available. Use the Skills API to list all Anthropic-managed Skills. Each language tab is an excerpt from one continuous script, with any imports and client setup at the top:
<CodeGroup defaultLanguage="CLI">
```bash cURL
# List Anthropic-managed Skills
curl --fail-with-body -sS "https://api.anthropic.com/v1/skills?source=anthropic" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: skills-2025-10-02" |
jq -r '.data[] | "\(.id): \(.display_title)"'
```
```bash CLI
# List Anthropic-managed Skills
ant beta:skills list --source anthropic
```
```python Python
# List Anthropic-managed Skills
skills = client.beta.skills.list(source="anthropic")
for skill in skills.data:
print(f"{skill.id}: {skill.display_title}")
```
```typescript TypeScript
// List Anthropic-managed Skills
const skills = await client.beta.skills.list({ source: "anthropic" });
for (const skill of skills.data) {
console.log(`${skill.id}: ${skill.display_title}`);
}
```
```csharp C#
// List Anthropic-managed Skills
var skills = await client.Beta.Skills.List(new SkillListParams { Source = "anthropic" });
foreach (var skill in skills.Items)
{
Console.WriteLine($"{skill.ID}: {skill.DisplayTitle}");
}
```
```go Go
// List Anthropic-managed Skills
skills, err := client.Beta.Skills.List(ctx, anthropic.BetaSkillListParams{
Source: anthropic.String("anthropic"),
})
if err != nil {
panic(err)
}
for _, skill := range skills.Data {
fmt.Printf("%s: %s\n", skill.ID, skill.DisplayTitle)
}
```
```java Java
// List Anthropic-managed Skills
SkillListPage skills = client.beta().skills().list(
SkillListParams.builder().source("anthropic").build()
);
for (SkillListResponse skill : skills.data()) {
IO.println(skill.id() + ": " + skill.displayTitle().orElse(""));
}
```
```php PHP
// List Anthropic-managed Skills
$skills = $client->beta->skills->list(source: 'anthropic');
foreach ($skills->data as $skill) {
echo "{$skill->id}: {$skill->displayTitle}\n";
}
```
```ruby Ruby
# List Anthropic-managed Skills
skills = client.beta.skills.list(source: "anthropic")
skills.data.each do |skill|
puts "#{skill.id}: #{skill.display_title}"
end
```
</CodeGroup>
You see the following Skills: `pptx`, `xlsx`, `docx`, and `pdf`.
This API returns each Skill's metadata: its name and description. Claude loads this metadata at startup to determine which Skills are available. This is the first level of **progressive disclosure**, where Claude discovers Skills without loading their full instructions yet.
## Step 2: Create a presentation
Use the PowerPoint Skill to create a presentation about renewable energy. Specify Skills using the `container` parameter in the Messages API:
<CodeGroup>
```bash cURL
# Create a message with the PowerPoint Skill
response=$(
curl --fail-with-body -sS https://api.anthropic.com/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: skills-2025-10-02" \
-d @- <<'EOF'
{
"model": "claude-opus-5",
"max_tokens": 16000,
"container": {
"skills": [{"type": "anthropic", "skill_id": "pptx", "version": "latest"}]
},
"messages": [
{"role": "user", "content": "Create a presentation about renewable energy with 5 slides"}
],
"tools": [{"type": "code_execution_20260521", "name": "code_execution"}]
}
EOF
)
jq -r '"stop_reason=\(.stop_reason), blocks=\(.content | length)"' <<<"$response"
```
```bash CLI
# Create a message with the PowerPoint Skill
response=$(ant beta:messages create --format json \
--beta skills-2025-10-02 <<'YAML'
model: claude-opus-5
max_tokens: 16000
container:
skills:
- type: anthropic
skill_id: pptx
version: latest
messages:
- role: user
content: Create a presentation about renewable energy with 5 slides
tools:
- type: code_execution_20260521
name: code_execution
YAML
)
jq -r '"stop_reason=\(.stop_reason), blocks=\(.content | length)"' <<<"$response"
```
```python Python
# Create a message with the PowerPoint Skill
response = client.beta.messages.create(
model="claude-opus-5",
max_tokens=16000,
betas=["skills-2025-10-02"],
container={
"skills": [{"type": "anthropic", "skill_id": "pptx", "version": "latest"}]
},
messages=[
{
"role": "user",
"content": "Create a presentation about renewable energy with 5 slides",
}
],
tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
)
print(f"stop_reason={response.stop_reason}, blocks={len(response.content)}")
```
```typescript TypeScript
// Create a message with the PowerPoint Skill
const response = await client.beta.messages.create({
model: "claude-opus-5",
max_tokens: 16000,
betas: ["skills-2025-10-02"],
container: {
skills: [{ type: "anthropic", skill_id: "pptx", version: "latest" }],
},
messages: [
{
role: "user",
content: "Create a presentation about renewable energy with 5 slides",
},
],
tools: [{ type: "code_execution_20260521", name: "code_execution" }],
});
console.log(
`stop_reason=${response.stop_reason}, blocks=${response.content.length}`,
);
```
```csharp C#
// Create a message with the PowerPoint Skill
var response = await client.Beta.Messages.Create(new MessageCreateParams
{
Model = Model.ClaudeOpus5,
MaxTokens = 16000,
Betas = ["skills-2025-10-02"],
Container = new BetaContainerParams
{
Skills =
[
new BetaSkillParams
{
Type = BetaSkillParamsType.Anthropic,
SkillID = "pptx",
Version = "latest",
},
],
},
Messages =
[
new BetaMessageParam
{
Role = Role.User,
Content = "Create a presentation about renewable energy with 5 slides",
},
],
Tools = [new BetaCodeExecutionTool20260521()],
});
Console.WriteLine($"stop_reason={response.StopReason?.Raw()}, blocks={response.Content.Count}");
```
```go Go
// Create a message with the PowerPoint Skill
response, err := client.Beta.Messages.New(ctx, anthropic.BetaMessageNewParams{
Model: anthropic.ModelClaudeOpus5,
MaxTokens: 16000,
Betas: []anthropic.AnthropicBeta{
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 with 5 slides"),
),
},
Tools: []anthropic.BetaToolUnionParam{
{OfCodeExecutionTool20260521: &anthropic.BetaCodeExecutionTool20260521Param{}},
},
})
if err != nil {
panic(err)
}
fmt.Printf("stop_reason=%s, blocks=%d\n", response.StopReason, len(response.Content))
```
```java Java
// Create a message with the PowerPoint Skill
BetaMessage response = client.beta().messages().create(
MessageCreateParams.builder()
.model(Model.CLAUDE_OPUS_5)
.maxTokens(16000)
.addBeta(AnthropicBeta.SKILLS_2025_10_02)
.container(
BetaContainerParams.builder()
.addSkill(
BetaSkillParams.builder()
.type(BetaSkillParams.Type.ANTHROPIC)
.skillId("pptx")
.version("latest")
Cut at 300 lines.