API에서 Agent Skills 시작하기

API에서 Agent Skills 시작하기 (Get started with Agent Skills in the API)

이 튜토리얼에서는 Agent Skills를 사용해서 PowerPoint 프레젠테이션을 만드는 방법을 알아봐요. Skills를 활성화하고, 요청을 보내고, 생성된 파일에 접근하는 방법까지 차근차근 배워볼게요. 10분이면 충분히 따라올 수 있어요.

출처: 문서

본문

이 튜토리얼에서는 Agent Skills로 PowerPoint 프레젠테이션을 만드는 방법을 배워요. Skills를 활성화하고, 요청을 보내고, 생성된 파일에 접근하는 흐름을 함께 살펴볼게요.

준비 사항 (Prerequisites)

Agent Skills 개요 (Agent Skills overview)

미리 만들어진 Agent Skills는 문서 생성, 데이터 분석, 파일 처리 같은 작업을 위한 특화된 전문성을 바탕으로 Claude의 능력을 확장해줘요. Anthropic은 API에서 다음과 같은 미리 만들어진 Agent Skills를 제공해요:

  • PowerPoint (pptx): 프레젠테이션을 만들고 수정해요
  • Excel (xlsx): 스프레드시트를 만들고 분석해요
  • Word (docx): 문서를 만들고 수정해요
  • PDF (pdf): PDF 문서를 생성해요

참고 (Note) 커스텀 Skills를 만들고 싶다면 Agent Skills Cookbook에서 도메인별 전문성을 가진 나만의 Skills를 만드는 예시를 살펴볼 수 있어요.

1단계: 사용 가능한 Skills 나열하기 (Step 1: List available Skills)

먼저 어떤 Skills를 사용할 수 있는지 확인해볼게요. Skills API를 사용해서 Anthropic이 관리하는 모든 Skills를 나열할 수 있어요. 각 언어 탭은 하나의 연속된 스크립트에서 발췌한 것으로, import와 클라이언트 설정은 맨 위에 있다고 생각하면 돼요:

```bash cURL # Anthropic 관리 Skills 나열 curl --fail-with-body -sS "https://api.anthropic.com/v1/skills?source=anthropic" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" ```
# Anthropic 관리 Skills 나열
ant skills list --source anthropic
# Anthropic 관리 Skills 나열
skills = client.skills.list(source="anthropic")

for skill in skills.data:
    print(f"{skill.id}: {skill.display_name}")
// Anthropic 관리 Skills 나열
const skills = await client.skills.list({ source: "anthropic" });

for (const skill of skills.data) {
  console.log(`${skill.id}: ${skill.display_name}`);
}
// Anthropic 관리 Skills 나열
var skills = await client.Skills.List(new SkillListParams { Source = "anthropic" });

foreach (var skill in skills.Items)
{
    Console.WriteLine($"{skill.ID}: {skill.DisplayName}");
}
// Anthropic 관리 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)
}
// Anthropic 관리 Skills 나열
SkillListPage skills = client.skills().list(
    SkillListParams.builder().source("anthropic").build()
);

for (Skill skill : skills.data()) {
    IO.println(skill.id() + ": " + skill.displayName());
}
// Anthropic 관리 Skills 나열
$skills = $client->skills->list(source: 'anthropic');

foreach ($skills->getItems() as $skill) {
    echo "{$skill->id}: {$skill->displayName}\n";
}
# Anthropic 관리 Skills 나열
skills = client.skills.list(source: "anthropic")

skills.data.each do |skill|
  puts "#{skill.id}: #{skill.display_name}"
end

다음과 같은 Skills가 보일 거예요: pptx, xlsx, docx, pdf.

이 API는 각 Skill의 메타데이터인 이름과 설명을 반환해요. Claude는 시작 시 이 메타데이터를 로드해서 어떤 Skills를 사용할 수 있는지 파악해요. 이것이 바로 점진적 공개(progressive disclosure) 의 첫 번째 단계로, Claude는 전체 지침을 로드하지 않고도 어떤 Skills가 있는지 먼저 발견하게 돼요.

2단계: 프레젠테이션 만들기 (Step 2: Create a presentation)

PowerPoint Skill을 사용해서 재생에너지에 관한 프레젠테이션을 만들어볼게요. Messages API의 container 파라미터로 Skills를 지정할 수 있어요:

```bash cURL # PowerPoint Skill로 메시지 만들기 response=$( curl --fail-with-body -sS https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -d @- <<'EOF' { "model": "claude-opus-5-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 ) ```
# PowerPoint Skill로 메시지 만들기
response=$(ant messages create --format json <<'YAML'
model: claude-opus-5-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
)
# PowerPoint Skill로 메시지 만들기
response = client.messages.create(
    model="claude-opus-5-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)}")
// PowerPoint Skill로 메시지 만들기
const response = await client.messages.create({
  model: "claude-opus-5-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}`,
);
// PowerPoint Skill로 메시지 만들기
var response = await client.Messages.Create(new MessageCreateParams
{
    Model = Model.ClaudeOpus5_5,
    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}");
// PowerPoint Skill로 메시지 만들기
response, err := client.Messages.New(ctx, anthropic.MessageNewParams{
	Model:     anthropic.ModelClaudeOpus5_5,
	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))
// PowerPoint Skill로 메시지 만들기
Message response = client.messages().create(
    MessageCreateParams.builder()
        .model(Model.CLAUDE_OPUS_5_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()
);
// PowerPoint Skill로 메시지 만들기
$response = $client->messages->create(
    model: 'claude-opus-5-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));
# PowerPoint Skill로 메시지 만들기
response = client.messages.create(
  model: "claude-opus-5-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}"

이 요청에는 다음과 같은 부분이 포함돼요:

  • model: 코드 실행 도구를 지원하는 모델
  • container.skills: Claude가 사용할 수 있는 Skills를 지정해요
  • type: "anthropic": 이것이 Anthropic이 관리하는 Skill임을 나타내요
  • skill_id: "pptx": PowerPoint Skill 식별자예요
  • version: "latest": Skill 버전을 가장 최근에 게시된 것으로 설정해요
  • tools: 코드 실행을 활성화해요 (Skills에 필수예요)

참고 (Note) 예시에서는 code_execution_20260521 도구 버전을 사용하고, 3단계의 코드는 현재 도구 버전이 반환하는 결과 유형을 파싱해요. Skills는 code_execution_20250825 같은 이전 코드 실행 도구 버전에서도 동작해요. 즉, 어떤 최신 코드 실행 도구 버전이든 Skills 요구 사항을 충족해요. 다른 버전을 사용한다면 코드 실행 도구 페이지에 나와 있는 도구 type을 사용하면 돼요.

이 요청을 보내면 Claude가 자동으로 작업에 맞는 Skill을 매칭해요. 프레젠테이션을 요청했기 때문에 Claude는 PowerPoint Skill이 관련 있다고 판단하고 전체 지침을 로드해요. 이것이 점진적 공개(progressive disclosure)의 두 번째 단계예요. 그런 다음 Claude는 Skill의 코드를 실행해서 프레젠테이션을 만들어줘요.

3단계: 생성된 파일 다운로드하기 (Step 3: Download the created file)

프레젠테이션은 코드 실행 컨테이너 안에서 만들어지고 파일로 저장돼요. 2단계의 response에는 파일 ID가 있는 파일 참조가 포함돼요. 파일 ID를 추출해서 Files API로 파일을 다운로드해볼게요. 예시에서는 시스템 임시 디렉터리에 저장해요:

```bash cURL # 파일 ID 추출. 코드 실행 도구는 Skill의 코드를 # Bash 하위 도구를 통해 실행하며, 생성된 파일은 bash_code_execution_tool_result # 블록 안의 bash_code_execution_output 항목으로 나타나요. 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 # 파일을 다운로드하고 저장해요 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: $ANTHR...KEY"
-H "anthropic-version: 2023-06-01"
-o "$output_path" echo "Presentation saved to $output_path" fi


```bash CLI
# 파일 ID 추출. 코드 실행 도구는 Skill의 코드를
# Bash 하위 도구를 통해 실행하며, 생성된 파일은 bash_code_execution_tool_result
# 블록 안의 bash_code_execution_output 항목으로 나타나요.
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
  # 파일을 다운로드하고 저장해요
  output_path="${TMPDIR:-/tmp}/renewable_energy.pptx"
  ant files download --file-id "$file_id" --output "$output_path"
  echo "Presentation saved to $output_path"
fi
# 파일 ID 추출. 코드 실행 도구는 Skill의 코드를
# Bash 하위 도구를 통해 실행하며, 생성된 파일은 bash_code_execution_tool_result
# 블록 안의 bash_code_execution_output 항목으로 나타나요.
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:
    # 파일을 다운로드하고 저장해요
    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}")
// 파일 ID 추출. 코드 실행 도구는 Skill의 코드를
// Bash 하위 도구를 통해 실행하며, 생성된 파일은 bash_code_execution_tool_result
// 블록 안의 bash_code_execution_output 항목으로 나타나요.
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) {
  // 파일을 다운로드하고 저장해요
  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}`);
}
// 파일 ID 추출. 코드 실행 도구는 Skill의 코드를
// Bash 하위 도구를 통해 실행하며, 생성된 파일은 bash_code_execution_tool_result
// 블록 안의 bash_code_execution_output 항목으로 나타나요.
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)
{
    // 파일을 다운로드하고 저장해요
    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}");
}
// 파일 ID 추출. 코드 실행 도구는 Skill의 코드를
// Bash 하위 도구를 통해 실행하며, 생성된 파일은 bash_code_execution_tool_result
// 블록 안의 bash_code_execution_output 항목으로 나타나요.
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 != "" {
	// 파일을 다운로드하고 저장해요
	outputPath := filepath.Join(os.TempDir(), "renewable_energy.pptx")
	fileContent, err := client.Files.Download(ctx, fileID, anthropic.FileDownloadParams{})
	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)
}
// 파일 ID 추출. 코드 실행 도구는 Skill의 코드를
// Bash 하위 도구를 통해 실행하며, 생성된 파일은 bash_code_execution_tool_result
// 블록 안의 bash_code_execution_output 항목으로 나타나요.
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) {
    // 파일을 다운로드하고 저장해요
    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);
}
// 파일 ID 추출. 코드 실행 도구는 Skill의 코드를
// Bash 하위 도구를 통해 실행하며, 생성된 파일은 bash_code_execution_tool_result
// 블록 안의 bash_code_execution_output 항목으로 나타나요.
$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) {
    // 파일을 다운로드하고 저장해요
    $outputPath = sys_get_temp_dir() . '/renewable_energy.pptx';
    $fileContent = $client->files->download($fileId);
    file_put_contents($outputPath, $fileContent);
    echo "Presentation saved to {$outputPath}\n";
}
# 파일 ID 추출. 코드 실행 도구는 Skill의 코드를
# Bash 하위 도구를 통해 실행하며, 생성된 파일은 bash_code_execution_tool_result
# 블록 안의 bash_code_execution_output 항목으로 나타나요.
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
  # 파일을 다운로드하고 저장해요
  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}"
end

참고 (Note) 생성된 파일을 다루는 자세한 내용은 코드 실행 도구 문서의 Retrieve generated files를 참고해요.

더 예제 시도해보기 (Try more examples)

다음과 같은 변형도 시도해볼 수 있어요:

스프레드시트 만들기 (Create a spreadsheet)

```bash cURL curl --fail-with-body -sS https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "claude-opus-5-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-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
YAML
response = client.messages.create(
    model="claude-opus-5-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-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_5,
        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_5,
	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_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-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-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"}]
)

Word 문서 만들기 (Create a Word document)

```bash cURL curl --fail-with-body -sS https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "claude-opus-5-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-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
YAML
response = client.messages.create(
    model="claude-opus-5-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-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_5,
        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_5,
	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_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-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-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"}]
)

PDF 생성하기 (Generate a PDF)

```bash cURL curl --fail-with-body -sS https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "claude-opus-5-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-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
YAML
response = client.messages.create(
    model="claude-opus-5-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-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_5,
        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_5,
	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_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-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-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"}]
)

더 알아보기 (Learn more)