---
title: "Claude Agent SDK: ฟีเจอร์ เวอร์ชัน และ Quickstart · DotsAgent"
description: "Claude Agent SDK โดย Anthropic: ไลเซนส์ เวอร์ชันล่าสุด รองรับ MCP, การรันงานแบบต่อเนื่อง การอนุมัติโดยมนุษย์ การ tracing และ evals พร้อม Quickstart ที่คัดลอกไปใช้ได้"
url: https://dotsagent.io/th/frameworks/claude-agent-sdk
---

เฟรมเวิร์ก · Anthropic

# ภาพรวม Claude Agent SDK

SDK ของ Anthropic เปิดให้ใช้ harness ที่อยู่เบื้องหลัง Claude Code ผ่านโปรแกรม Python หรือ TypeScript ของคุณเอง โดยมีเครื่องมือสำหรับไฟล์และ shell, permissions, hooks, subagents และ skills ต่างจากตัวเลือกอื่นในรายการนี้ตรงที่รองรับเฉพาะ Claude models และการใช้งานอยู่ภายใต้ Commercial Terms ของ Anthropic

**เหมาะสำหรับ:**  แอปที่ต้องการให้ Claude ทำงานจริงกับ filesystem โดยคุณควบคุม permissions ของเครื่องมือได้

## ข้อมูลสำคัญ

- **ผู้ดูแล**: Anthropic
- **ภาษา**: Python, TypeScript
- **ไลเซนส์**: Anthropic Commercial Terms
- **เวอร์ชันล่าสุด**: `Python 0.2.163 / TypeScript 0.3.286` · 30 กันยายน 2569
- **Repository**: [anthropics/claude-agent-sdk-python](https://github.com/anthropics/claude-agent-sdk-python) · 8,200 ดาว
- **ตัวเลือกแบบโฮสต์**: [Claude Managed Agents](https://code.claude.com/docs/en/agent-sdk/overview)Anthropic เป็นผู้โฮสต์ harness ส่วน sessions จะทำงานใน sandbox ที่ Anthropic จัดการหรือที่คุณโฮสต์เอง

## Quickstart

ติดตั้งแพ็กเกจ ตั้งค่าข้อมูลรับรอง แล้วเรียกใช้ agent ตัวอย่างที่เล็กที่สุดจากเอกสารทางการ Model ID เป็นค่าที่เอกสารใช้ และอาจยังไม่ได้เปิดใช้งานในบัญชีของคุณ

### Python

`ติดตั้ง`

```
pip install claude-agent-sdk
```

ต้องใช้ ANTHROPIC_API_KEY

`Python`

```
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions

async def main():
    async for message in query(
        prompt="Find and fix the bug in auth.py",
        options=ClaudeAgentOptions(allowed_tools=["Read", "Edit", "Bash"]),
    ):
        print(message)  # Claude reads the file, finds the bug, edits it

asyncio.run(main())
```

[แหล่งข้อมูล Quickstart](https://code.claude.com/docs/en/agent-sdk/overview)

### TypeScript

`ติดตั้ง`

```
npm install @anthropic-ai/claude-agent-sdk
```

ต้องใช้ ANTHROPIC_API_KEY

`TypeScript`

```
import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const message of query({
  prompt: "Find and fix the bug in auth.ts",
  options: { allowedTools: ["Read", "Edit", "Bash"] }
})) {
  console.log(message); // Claude reads the file, finds the bug, edits it
}
```

[แหล่งข้อมูล Quickstart](https://code.claude.com/docs/en/agent-sdk/overview)

## ฟีเจอร์

| ใช้ได้กับทุกโมเดล | — | รองรับ Claude เท่านั้น ผ่าน Anthropic, Bedrock, Google Cloud หรือ Foundry |
| --- | --- | --- |
| MCP client | — | ตั้งค่าได้ด้วยตัวเลือก mcpServers; plugins สามารถรวม MCP servers ไว้ด้วยกันได้ |
| MCP server | — | — |
| หลาย agent | — | Subagents รับผิดชอบงานย่อยที่เฉพาะเจาะจง |
| การทำงานต่อเนื่องแบบทนทาน | — | กลับมาใช้ sessions ต่อหรือแยกเป็น fork ได้ แต่ไม่มี durable engine |
| การอนุมัติโดยมนุษย์ | — | Permission modes กำหนดว่าเครื่องมือใดต้องได้รับอนุมัติก่อนใช้ |
| Tracing | — | ส่งออกข้อมูลผ่าน OpenTelemetry; traces ยังอยู่ใน beta |
| Evals | — | — |

## การเปลี่ยนแปลงล่าสุด

- เปลี่ยนชื่อจาก Claude Code SDK แล้ว โดยมีคู่มือการย้ายให้ใช้งาน
- ตอนนี้ SDK ทั้งสองตัวมาพร้อม Claude Code binary แบบ native
- ตั้งแต่ 15 June 2026 การใช้ SDK บน subscription plans จะใช้เครดิต Agent SDK รายเดือนแยกต่างหาก
- แอปของบุคคลที่สามห้ามให้เข้าสู่ระบบด้วย claude.ai เว้นแต่จะได้รับอนุมัติจาก Anthropic

## ทางเลือกในภาษาเดียวกัน

- [OpenAI Agents SDK](https://dotsagent.io/th/frameworks/openai-agents-python)

- [OpenAI Agents SDK (JS)](https://dotsagent.io/th/frameworks/openai-agents-js)

- [Google ADK](https://dotsagent.io/th/frameworks/google-adk)

- [Microsoft Agent Framework](https://dotsagent.io/th/frameworks/microsoft-agent-framework)

- [LangGraph](https://dotsagent.io/th/frameworks/langgraph)

- [CrewAI](https://dotsagent.io/th/frameworks/crewai)

## แหล่งข้อมูล

1. [code.claude.com](https://code.claude.com/docs/en/agent-sdk/overview)/docs/en/agent-sdk/overview
2. [code.claude.com](https://code.claude.com/docs/en/agent-sdk/quickstart)/docs/en/agent-sdk/quickstart
3. [code.claude.com](https://code.claude.com/docs/en/agent-sdk/observability)/docs/en/agent-sdk/observability
4. [code.claude.com](https://code.claude.com/docs/en/bedrock-vertex)/docs/en/bedrock-vertex
5. [pypi.org](https://pypi.org/pypi/claude-agent-sdk/json)/pypi/claude-agent-sdk/json
6. [registry.npmjs.org](https://registry.npmjs.org/@anthropic-ai%2fclaude-agent-sdk)/@anthropic-ai%2fclaude-agent-sdk
7. [api.github.com](https://api.github.com/repos/anthropics/claude-agent-sdk-python)/repos/anthropics/claude-agent-sdk-python
8. [api.github.com](https://api.github.com/repos/anthropics/claude-agent-sdk-typescript)/repos/anthropics/claude-agent-sdk-typescript

แหล่งอ้างอิงอิสระสำหรับผู้สร้าง AI agent ไม่มีส่วนเกี่ยวข้องกับผู้ให้บริการที่กล่าวถึง

© 2026 DotsAgent · ตรวจสอบข้อมูลเมื่อ 1 ตุลาคม 2569
