Anthropic 平台文档(英文全量)
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 or a logged-in ant CLI
- A client SDK for your language, or
curlandjq - 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
To create custom Skills, see the Agent Skills Cookbook for examples of building your own Skills with domain-specific expertise.
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:
# 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"# List Anthropic-managed Skills
ant skills list --source anthropic# List Anthropic-managed Skills
skills = client.skills.list(source="anthropic")
for skill in skills.data:
print(f"{skill.id}: {skill.display_name}")// List Anthropic-managed Skills
const skills = await client.skills.list({ source: "anthropic" });
for (const skill of skills.data) {
console.log(`${skill.id}: ${skill.display_name}`);
}// List Anthropic-managed Skills
var skills = await client.Skills.List(new SkillListParams { Source = "anthropic" });
foreach (var skill in skills.Items)
{
Console.WriteLine($"{skill.ID}: {skill.DisplayName}");
}// List Anthropic-managed Skills
skills, err := client.Skills.List(ctx, anthropic.SkillListParams{
Source: anthropic.String("anthropic"),
})
if err != nil {
panic(err)
}
for _, skill := range skills.Data {
fmt.Printf("%s: %s\n", skill.ID, skill.DisplayName)
}// List Anthropic-managed Skills
SkillListPage skills = client.skills().list(
SkillListParams.builder().source("anthropic").build()
);
for (Skill skill : skills.data()) {
IO.println(skill.id() + ": " + skill.displayName());
}// List Anthropic-managed Skills
$skills = $client->skills->list(source: 'anthropic');
foreach ($skills->getItems() as $skill) {
echo "{$skill->id}: {$skill->displayName}\n";
}# List Anthropic-managed Skills
skills = client.skills.list(source: "anthropic")
skills.data.each do |skill|
puts "#{skill.id}: #{skill.display_name}"
endYou 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:
# 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" \
-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
)# Create a message with the PowerPoint Skill
response=$(ant messages create --format json <<'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
)# Create a message with the PowerPoint Skill
response = client.messages.create(
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"}],
)
print(f"stop_reason={response.stop_reason}, blocks={len(response.content)}")// Create a message with the PowerPoint Skill
const response = await client.messages.create({
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" }],
});
console.log(
`stop_reason=${response.stop_reason}, blocks=${response.content.length}`,
);// Create a message with the PowerPoint Skill
var response = await client.Messages.Create(new MessageCreateParams
{
Model = Model.ClaudeOpus5,
MaxTokens = 16000,
Container = new ContainerParams
{
Skills =
[
new SkillParams
{
Type = SkillParamsType.Anthropic,
SkillID = "pptx",
Version = "latest",
},
],
},
Messages =
[
new MessageParam
{
Role = Role.User,
Content = "Create a presentation about renewable energy with 5 slides",
},
],
Tools = [new CodeExecutionTool20260521()],
});
Console.WriteLine($"stop_reason={response.StopReason?.Raw()}, blocks={response.Content.Count}");// Create a message with the PowerPoint Skill
response, err := client.Messages.New(ctx, anthropic.MessageNewParams{
Model: anthropic.ModelClaudeOpus5,
MaxTokens: 16000,
Container: anthropic.MessageCreateParamsContainerUnion{
OfContainers: &anthropic.ContainerParams{
Skills: []anthropic.SkillParams{
{
Type: anthropic.SkillParamsTypeAnthropic,
SkillID: "pptx",
Version: anthropic.String("latest"),
},
},
},
},
Messages: []anthropic.MessageParam{
anthropic.NewUserMessage(
anthropic.NewTextBlock("Create a presentation about renewable energy with 5 slides"),
),
},
Tools: []anthropic.ToolUnionParam{
{OfCodeExecutionTool20260521: &anthropic.CodeExecutionTool20260521Param{}},
},
})
if err != nil {
panic(err)
}
fmt.Printf("stop_reason=%s, blocks=%d\n", response.StopReason, len(response.Content))// Create a message with the PowerPoint Skill
Message response = client.messages().create(
MessageCreateParams.builder()
.model(Model.CLAUDE_OPUS_5)
.maxTokens(16000)
.container(
ContainerParams.builder()
.addSkill(
SkillParams.builder()
.type(SkillParams.Type.ANTHROPIC)
.skillId("pptx")
.version("latest")
.build()
)
.build()
)
.addUserMessage("Create a presentation about renewable energy with 5 slides")
.addTool(CodeExecutionTool20260521.builder().build())
.build()
);
IO.println(
"stop_reason=" + response.stopReason().orElse(null)
+ ", blocks=" + response.content().size()
);// Create a message with the PowerPoint Skill
$response = $client->messages->create(
model: 'claude-opus-5',
maxTokens: 16000,
container: [
'skills' => [['type' => 'anthropic', 'skillID' => 'pptx', 'version' => 'latest']],
],
messages: [
[
'role' => 'user',
'content' => 'Create a presentation about renewable energy with 5 slides',
],
],
tools: [['type' => 'code_execution_20260521', 'name' => 'code_execution']],
);
printf("stop_reason=%s, blocks=%d\n", $response->stopReason, count($response->content));# Create a message with the PowerPoint Skill
response = client.messages.create(
model: "claude-opus-5",
max_tokens: 16_000,
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"}]
)
puts "stop_reason=#{response.stop_reason}, blocks=#{response.content.length}"The request includes the following parts:
container.skills: Specifies which Skills Claude can usetype: "anthropic": Indicates this is an Anthropic-managed Skillskill_id: "pptx": The PowerPoint Skill identifierversion: "latest": The Skill version set to the most recently publishedtools: Enables code execution (required for Skills)The examples use the
code_execution_20260521tool version, and the Step 3 code parses the result types that current tool versions return. Skills also work with older code execution tool versions such ascode_execution_20250825: any current code execution tool version satisfies the Skills requirement. If you use a different version, use the tooltypelisted on the code execution tool page.
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.
Step 3: Download the created file
The presentation was created in the code execution container and saved as a file. The Step 2 response includes a file reference with a file ID. Extract the file ID and download the file with the Files API. The example saves it to your system temp directory:
# 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.
file_id=$(jq -r '
last(
.content[]
| select(.type == "bash_code_execution_tool_result")
| .content
| select(.type == "bash_code_execution_result")
| .content[].file_id
) // empty
' <<<"$response")
if [[ -n "$file_id" ]]; then
# Download the file and save it
output_path="${TMPDIR:-/tmp}/renewable_energy.pptx"
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" \
-o "$output_path"
echo "Presentation saved to $output_path"
fi# 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.
file_id=$(jq -r '
last(
.content[]
| select(.type == "bash_code_execution_tool_result")
| .content
| select(.type == "bash_code_execution_result")
| .content[].file_id
) // empty
' <<<"$response")
if [[ -n "$file_id" ]]; then
# Download the file and save it
output_path="${TMPDIR:-/tmp}/renewable_energy.pptx"
ant files download --file-id "$file_id" --output "$output_path"
echo "Presentation saved to $output_path"
fi# 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.
file_id = None
for block in response.content:
if block.type == "bash_code_execution_tool_result":
if block.content.type == "bash_code_execution_result":
for output in block.content.content:
file_id = output.file_id
if file_id:
# Download the file and save it
output_path = Path(tempfile.gettempdir()) / "renewable_energy.pptx"
file_content = client.files.download(file_id=file_id)
file_content.write_to_file(output_path)
print(f"Presentation saved to {output_path}")// 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.
let fileId: string | undefined;
for (const block of response.content) {
if (
block.type === "bash_code_execution_tool_result" &&
block.content.type === "bash_code_execution_result"
) {
for (const output of block.content.content) {
fileId = output.file_id;
}
}
}
if (fileId) {
// Download the file and save it
const outputPath = path.join(os.tmpdir(), "renewable_energy.pptx");
const fileContent = await client.files.download(fileId);
await fs.writeFile(outputPath, Buffer.from(await fileContent.arrayBuffer()));
console.log(`Presentation saved to ${outputPath}`);
}// 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.
string? fileId = null;
foreach (var block in response.Content)
{
if (block.TryPickBashCodeExecutionToolResult(out var bashResult)
&& bashResult.Content.TryPickBashCodeExecutionResultBlock(out var bashResultBlock))
{
foreach (var output in bashResultBlock.Content)
{
fileId = output.FileID;
}
}
}
if (fileId is not null)
{
// Download the file and save it
var outputPath = Path.Combine(Path.GetTempPath(), "renewable_energy.pptx");
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);
Console.WriteLine($"Presentation saved to {outputPath}");
}// 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.
var fileID string
for _, block := range response.Content {
switch result := block.AsAny().(type) {
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.Files.Download(ctx, fileID)
if err != nil {
panic(err)
}
defer fileContent.Body.Close()
outFile, err := os.Create(outputPath)
if err != nil {
panic(err)
}
defer outFile.Close()
if _, err := io.Copy(outFile, fileContent.Body); err != nil {
panic(err)
}
fmt.Printf("Presentation saved to %s\n", outputPath)
}// 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.
String fileId = null;
for (ContentBlock block : response.content()) {
if (block.isBashCodeExecutionToolResult()) {
var content = block.asBashCodeExecutionToolResult().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.files().download(fileId)) {
Files.copy(fileContent.body(), outputPath, StandardCopyOption.REPLACE_EXISTING);
}
IO.println("Presentation saved to " + outputPath);
}// 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.
$fileId = null;
foreach ($response->content as $block) {
if ($block->type !== 'bash_code_execution_tool_result') {
continue;
}
$resultBlock = $block->content;
if ($resultBlock->type !== 'bash_code_execution_result') {
continue;
}
foreach ($resultBlock->content as $output) {
$fileId = $output->fileID;
}
}
if ($fileId !== null) {
// Download the file and save it
$outputPath = sys_get_temp_dir() . '/renewable_energy.pptx';
$fileContent = $client->files->download($fileId);
file_put_contents($outputPath, $fileContent);
echo "Presentation saved to {$outputPath}\n";
}# 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.
file_id = nil
response.content.each do |block|
next unless block.type == :bash_code_execution_tool_result
if block.content[:type].to_s == "bash_code_execution_result"
Array(block.content[:content]).each { |output| file_id = output[:file_id] }
end
end
if file_id
# Download the file and save it
output_path = File.join(Dir.tmpdir, "renewable_energy.pptx")
file_content = client.files.download(file_id)
File.binwrite(output_path, file_content.read)
puts "Presentation saved to #{output_path}"
endFor complete details on working with generated files, see Retrieve generated files in the code execution tool documentation.
Try more examples
Try these variations:
Create a spreadsheet
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" \
-d '{
"model": "claude-opus-5",
"max_tokens": 16000,
"container": {
"skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}]
},
"messages": [
{"role": "user", "content": "Create a quarterly sales tracking spreadsheet with sample data"}
],
"tools": [{"type": "code_execution_20260521", "name": "code_execution"}]
}'ant messages create <<'YAML'
model: claude-opus-5
max_tokens: 16000
container:
skills:
- type: anthropic
skill_id: xlsx
version: latest
messages:
- role: user
content: Create a quarterly sales tracking spreadsheet with sample data
tools:
- type: code_execution_20260521
name: code_execution
YAMLresponse = client.messages.create(
model="claude-opus-5",
max_tokens=16000,
container={
"skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}]
},
messages=[
{
"role": "user",
"content": "Create a quarterly sales tracking spreadsheet with sample data",
}
],
tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
)const response = await client.messages.create({
model: "claude-opus-5",
max_tokens: 16000,
container: {
skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }]
},
messages: [
{
role: "user",
content: "Create a quarterly sales tracking spreadsheet with sample data"
}
],
tools: [{ type: "code_execution_20260521", name: "code_execution" }]
});var response = await client.Messages.Create(
new MessageCreateParams
{
Model = Model.ClaudeOpus5,
MaxTokens = 16000,
Container = new ContainerParams
{
Skills =
[
new SkillParams
{
Type = SkillParamsType.Anthropic,
SkillID = "xlsx",
Version = "latest",
},
],
},
Messages =
[
new MessageParam
{
Role = Role.User,
Content = "Create a quarterly sales tracking spreadsheet with sample data",
},
],
Tools = [new CodeExecutionTool20260521()],
}
);response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
Model: anthropic.ModelClaudeOpus5,
MaxTokens: 16000,
Container: anthropic.MessageCreateParamsContainerUnion{
OfContainers: &anthropic.ContainerParams{
Skills: []anthropic.SkillParams{
{
Type: anthropic.SkillParamsTypeAnthropic,
SkillID: "xlsx",
Version: anthropic.String("latest"),
},
},
},
},
Messages: []anthropic.MessageParam{
anthropic.NewUserMessage(anthropic.NewTextBlock("Create a quarterly sales tracking spreadsheet with sample data")),
},
Tools: []anthropic.ToolUnionParam{
{
OfCodeExecutionTool20260521: &anthropic.CodeExecutionTool20260521Param{},
},
},
})
if err != nil {
panic(err)
}Message response = client.messages().create(
MessageCreateParams.builder()
.model(CLAUDE_OPUS_5)
.maxTokens(16000)
.container(
ContainerParams.builder()
.addSkill(
SkillParams.builder()
.type(ANTHROPIC)
.skillId("xlsx")
.version("latest")
.build()
)
.build()
)
.addUserMessage("Create a quarterly sales tracking spreadsheet with sample data")
.addTool(CodeExecutionTool20260521.builder().build())
.build()
);$response = $client->messages->create(
model: 'claude-opus-5',
maxTokens: 16000,
container: [
'skills' => [
['type' => 'anthropic', 'skillID' => 'xlsx', 'version' => 'latest'],
],
],
messages: [
[
'role' => 'user',
'content' => 'Create a quarterly sales tracking spreadsheet with sample data',
],
],
tools: [['type' => 'code_execution_20260521', 'name' => 'code_execution']],
);response = client.messages.create(
model: "claude-opus-5",
max_tokens: 16_000,
container: {
skills: [{type: "anthropic", skill_id: "xlsx", version: "latest"}]
},
messages: [
{
role: "user",
content: "Create a quarterly sales tracking spreadsheet with sample data"
}
],
tools: [{type: "code_execution_20260521", name: "code_execution"}]
)Create a Word document
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" \
-d '{
"model": "claude-opus-5",
"max_tokens": 16000,
"container": {
"skills": [{"type": "anthropic", "skill_id": "docx", "version": "latest"}]
},
"messages": [
{"role": "user", "content": "Write a 2-page report on the benefits of renewable energy"}
],
"tools": [{"type": "code_execution_20260521", "name": "code_execution"}]
}'ant messages create <<'YAML'
model: claude-opus-5
max_tokens: 16000
container:
skills:
- type: anthropic
skill_id: docx
version: latest
messages:
- role: user
content: Write a 2-page report on the benefits of renewable energy
tools:
- type: code_execution_20260521
name: code_execution
YAMLresponse = client.messages.create(
model="claude-opus-5",
max_tokens=16000,
container={
"skills": [{"type": "anthropic", "skill_id": "docx", "version": "latest"}]
},
messages=[
{
"role": "user",
"content": "Write a 2-page report on the benefits of renewable energy",
}
],
tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
)const response = await client.messages.create({
model: "claude-opus-5",
max_tokens: 16000,
container: {
skills: [{ type: "anthropic", skill_id: "docx", version: "latest" }]
},
messages: [
{
role: "user",
content: "Write a 2-page report on the benefits of renewable energy"
}
],
tools: [{ type: "code_execution_20260521", name: "code_execution" }]
});var response = await client.Messages.Create(
new MessageCreateParams
{
Model = Model.ClaudeOpus5,
MaxTokens = 16000,
Container = new ContainerParams
{
Skills =
[
new SkillParams
{
Type = SkillParamsType.Anthropic,
SkillID = "docx",
Version = "latest",
},
],
},
Messages =
[
new MessageParam
{
Role = Role.User,
Content = "Write a 2-page report on the benefits of renewable energy",
},
],
Tools = [new CodeExecutionTool20260521()],
}
);response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
Model: anthropic.ModelClaudeOpus5,
MaxTokens: 16000,
Container: anthropic.MessageCreateParamsContainerUnion{
OfContainers: &anthropic.ContainerParams{
Skills: []anthropic.SkillParams{
{
Type: anthropic.SkillParamsTypeAnthropic,
SkillID: "docx",
Version: anthropic.String("latest"),
},
},
},
},
Messages: []anthropic.MessageParam{
anthropic.NewUserMessage(anthropic.NewTextBlock("Write a 2-page report on the benefits of renewable energy")),
},
Tools: []anthropic.ToolUnionParam{
{
OfCodeExecutionTool20260521: &anthropic.CodeExecutionTool20260521Param{},
},
},
})
if err != nil {
panic(err)
}Message response = client.messages().create(
MessageCreateParams.builder()
.model(CLAUDE_OPUS_5)
.maxTokens(16000)
.container(
ContainerParams.builder()
.addSkill(
SkillParams.builder()
.type(ANTHROPIC)
.skillId("docx")
.version("latest")
.build()
)
.build()
)
.addUserMessage("Write a 2-page report on the benefits of renewable energy")
.addTool(CodeExecutionTool20260521.builder().build())
.build()
);$response = $client->messages->create(
model: 'claude-opus-5',
maxTokens: 16000,
container: [
'skills' => [
['type' => 'anthropic', 'skillID' => 'docx', 'version' => 'latest'],
],
],
messages: [
[
'role' => 'user',
'content' => 'Write a 2-page report on the benefits of renewable energy',
],
],
tools: [['type' => 'code_execution_20260521', 'name' => 'code_execution']],
);response = client.messages.create(
model: "claude-opus-5",
max_tokens: 16_000,
container: {
skills: [{type: "anthropic", skill_id: "docx", version: "latest"}]
},
messages: [
{
role: "user",
content: "Write a 2-page report on the benefits of renewable energy"
}
],
tools: [{type: "code_execution_20260521", name: "code_execution"}]
)Generate a PDF
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" \
-d '{
"model": "claude-opus-5",
"max_tokens": 16000,
"container": {
"skills": [{"type": "anthropic", "skill_id": "pdf", "version": "latest"}]
},
"messages": [
{"role": "user", "content": "Generate a PDF invoice template"}
],
"tools": [{"type": "code_execution_20260521", "name": "code_execution"}]
}'ant messages create <<'YAML'
model: claude-opus-5
max_tokens: 16000
container:
skills:
- type: anthropic
skill_id: pdf
version: latest
messages:
- role: user
content: Generate a PDF invoice template
tools:
- type: code_execution_20260521
name: code_execution
YAMLresponse = client.messages.create(
model="claude-opus-5",
max_tokens=16000,
container={
"skills": [{"type": "anthropic", "skill_id": "pdf", "version": "latest"}]
},
messages=[
{
"role": "user",
"content": "Generate a PDF invoice template",
}
],
tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
)const response = await client.messages.create({
model: "claude-opus-5",
max_tokens: 16000,
container: {
skills: [{ type: "anthropic", skill_id: "pdf", version: "latest" }]
},
messages: [
{
role: "user",
content: "Generate a PDF invoice template"
}
],
tools: [{ type: "code_execution_20260521", name: "code_execution" }]
});var response = await client.Messages.Create(
new MessageCreateParams
{
Model = Model.ClaudeOpus5,
MaxTokens = 16000,
Container = new ContainerParams
{
Skills =
[
new SkillParams
{
Type = SkillParamsType.Anthropic,
SkillID = "pdf",
Version = "latest",
},
],
},
Messages =
[
new MessageParam
{
Role = Role.User,
Content = "Generate a PDF invoice template",
},
],
Tools = [new CodeExecutionTool20260521()],
}
);response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
Model: anthropic.ModelClaudeOpus5,
MaxTokens: 16000,
Container: anthropic.MessageCreateParamsContainerUnion{
OfContainers: &anthropic.ContainerParams{
Skills: []anthropic.SkillParams{
{
Type: anthropic.SkillParamsTypeAnthropic,
SkillID: "pdf",
Version: anthropic.String("latest"),
},
},
},
},
Messages: []anthropic.MessageParam{
anthropic.NewUserMessage(anthropic.NewTextBlock("Generate a PDF invoice template")),
},
Tools: []anthropic.ToolUnionParam{
{
OfCodeExecutionTool20260521: &anthropic.CodeExecutionTool20260521Param{},
},
},
})
if err != nil {
panic(err)
}Message response = client.messages().create(
MessageCreateParams.builder()
.model(CLAUDE_OPUS_5)
.maxTokens(16000)
.container(
ContainerParams.builder()
.addSkill(
SkillParams.builder()
.type(ANTHROPIC)
.skillId("pdf")
.version("latest")
.build()
)
.build()
)
.addUserMessage("Generate a PDF invoice template")
.addTool(CodeExecutionTool20260521.builder().build())
.build()
);$response = $client->messages->create(
model: 'claude-opus-5',
maxTokens: 16000,
container: [
'skills' => [
['type' => 'anthropic', 'skillID' => 'pdf', 'version' => 'latest'],
],
],
messages: [
[
'role' => 'user',
'content' => 'Generate a PDF invoice template',
],
],
tools: [['type' => 'code_execution_20260521', 'name' => 'code_execution']],
);response = client.messages.create(
model: "claude-opus-5",
max_tokens: 16_000,
container: {
skills: [{type: "anthropic", skill_id: "pdf", version: "latest"}]
},
messages: [
{
role: "user",
content: "Generate a PDF invoice template"
}
],
tools: [{type: "code_execution_20260521", name: "code_execution"}]
)Next steps
Learn how to write effective Skills that Claude can discover and use successfully.
Learn how to use Agent Skills to extend Claude's capabilities through the API.
Upload your own Skills for specialized tasks.
Learn about Skills in Claude Code.
Explore example Skills and implementation patterns.