> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # ![Anthropic logo](https://models.dev/logos/anthropic.svg)인류학 Mastra의 Model 라우터를 통해 13가지 인류 Model에 액세스하세요. 인증은 다음을 사용하여 자동으로 처리됩니다.`ANTHROPIC_API_KEY` environment variable. 자세한 내용은 다음에서 확인하세요.[Anthropic documentation](https://docs.anthropic.com/en/docs/about-claude/models). ```bash ANTHROPIC_API_KEY=your-api-key ``` ```typescript import { Agent } from "@mastra/core/agent"; const agent = new Agent({ id: "my-agent", name: "My Agent", instructions: "You are a helpful assistant", model: "anthropic/claude-fable-5" }); // Generate a response const response = await agent.generate("Hello!"); // Stream a response const stream = await agent.stream("Tell me a story"); for await (const chunk of stream) { console.log(chunk); } ``` ## Model | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M | | -------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- | | `anthropic/claude-fable-5` | 1.0M | | | | | | $10 | $50 | | `anthropic/claude-haiku-4-5` | 200K | | | | | | $1 | $5 | | `anthropic/claude-haiku-4-5-20251001` | 200K | | | | | | $1 | $5 | | `anthropic/claude-opus-4-5` | 200K | | | | | | $5 | $25 | | `anthropic/claude-opus-4-5-20251101` | 200K | | | | | | $5 | $25 | | `anthropic/claude-opus-4-6` | 1.0M | | | | | | $5 | $25 | | `anthropic/claude-opus-4-7` | 1.0M | | | | | | $5 | $25 | | `anthropic/claude-opus-4-8` | 1.0M | | | | | | $5 | $25 | | `anthropic/claude-opus-5` | 1.0M | | | | | | $5 | $25 | | `anthropic/claude-sonnet-4-5` | 1.0M | | | | | | $3 | $15 | | `anthropic/claude-sonnet-4-5-20250929` | 1.0M | | | | | | $3 | $15 | | `anthropic/claude-sonnet-4-6` | 1.0M | | | | | | $3 | $15 | | `anthropic/claude-sonnet-5` | 1.0M | | | | | | $2 | $10 | ## 고급 구성 ### 맞춤 헤더 ```typescript const agent = new Agent({ id: "custom-agent", name: "custom-agent", model: { id: "anthropic/claude-fable-5", apiKey: process.env.ANTHROPIC_API_KEY, headers: { "X-Custom-Header": "value" } } }); ``` ### 동적 Model 선택 ```typescript const agent = new Agent({ id: "dynamic-agent", name: "Dynamic Agent", model: ({ requestContext }) => { const useAdvanced = requestContext.task === "complex"; return useAdvanced ? "anthropic/claude-sonnet-5" : "anthropic/claude-fable-5"; } }); ``` ## 공급자 옵션 Anthropic은 다음을 통해 제공자별 옵션을 지원합니다.`providerOptions` parameter: ```typescript const response = await agent.generate("Hello!", { providerOptions: { anthropic: { // See available options in the table below } } }); ``` ### 사용 가능한 옵션 **sendReasoning** (`boolean | undefined`) **structuredOutputMode** (`"outputFormat" | "jsonTool" | "auto" | undefined`) **thinking** (`{ type: "adaptive"; display?: "omitted" | "summarized" | undefined; } | { type: "enabled"; budgetTokens?: number | undefined; } | { type: "disabled"; } | undefined`) **disableParallelToolUse** (`boolean | undefined`) **cacheControl** (`{ type: "ephemeral"; ttl?: "5m" | "1h" | undefined; } | undefined`) **metadata** (`{ userId?: string | undefined; } | undefined`) **mcpServers** (`{ type: "url"; name: string; url: string; authorizationToken?: string | null | undefined; toolConfiguration?: { enabled?: boolean | null | undefined; allowedTools?: string[] | null | undefined; } | null | undefined; }[] | undefined`) **container** (`{ id?: string | undefined; skills?: { type: "anthropic" | "custom"; skillId: string; version?: string | undefined; }[] | undefined; } | undefined`) **toolStreaming** (`boolean | undefined`) **effort** (`"low" | "medium" | "high" | "xhigh" | "max" | undefined`) **taskBudget** (`{ type: "tokens"; total: number; remaining?: number | undefined; } | undefined`) **speed** (`"fast" | "standard" | undefined`) **inferenceGeo** (`"us" | "global" | undefined`) **fallbacks** (`"default" | { model: string; max_tokens?: number | undefined; thinking?: Record | undefined; output_config?: Record | undefined; speed?: "fast" | "standard" | undefined; }[] | undefined`) **anthropicBeta** (`string[] | undefined`) **contextManagement** (`{ edits: ({ type: "clear_tool_uses_20250919"; trigger?: { type: "input_tokens"; value: number; } | { type: "tool_uses"; value: number; } | undefined; keep?: { type: "tool_uses"; value: number; } | undefined; clearAtLeast?: { ...; } | undefined; clearToolInputs?: boolean | undefined; excludeTools?: string[] | undefin...`) ## 직접 공급자 설치 이 Provider는 Mastra Model 라우터 문자열 대신 사용할 수 있는 독립 실행형 패키지로 직접 설치할 수도 있습니다. 자세한 내용은 [패키지 문서](https://www.npmjs.com/package/@ai-sdk/anthropic)를 참조하세요. **npm**: ```bash npm install @ai-sdk/anthropic ``` **pnpm**: ```bash pnpm add @ai-sdk/anthropic ``` **Yarn**: ```bash yarn add @ai-sdk/anthropic ``` **Bun**: ```bash bun add @ai-sdk/anthropic ``` 자세한 공급자별 설명서는 다음을 참조하세요.[AI SDK Anthropic provider docs](https://ai-sdk.dev/providers/ai-sdk-providers/anthropic).