NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #2028 most downloaded on pub.dev
Dart client for the Anthropic API. Provides type-safe access to Claude models with streaming, tool use, and batch processing support.
Last release 22 days ago
16 Sep 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 33 of 33 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
34 releases · first in 2024
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Requires Dart 3.12 or later; upgrade your Dart SDK or the Dart SDK bundled with Flutter before updating this package.
anthropic_sdk_dart v8.0.0
anthropic_sdk_dart v8.0.0
One column per month.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Syncs to the Anthropic OpenAPI spec shipped with python SDK 1.3.0, covering the Claude Fable 5.1 / Mythos 5.1 launch and the July–September release notes: preserved-thinking controls (ThinkingBlockBinding, Message.inputTransformations, ThinkingDisplayMode.updates progress updates), turn-scoped and effort-only mid-conversation system messages (InputMessage.system(clearAt:), InputMessage.systemEffort), the GA computer-use and browser-use toolsets with browser_state tool results, image transformations, container skills, FallbacksParam.defaultMode(), the now-GA Files and Skills APIs (cursor pagination, file expiration, multi-file SkillFile uploads), user-profile access types, and Managed Agents budgets, advisor roster entries and per-tool configs. It also adds the typed ThinkingInputBlock/RedactedThinkingInputBlock request variants and Message.toInputMessage() for replaying assistant turns with thinking intact (surfaced by genkit-dart#400), and defaults docs and examples to claude-sonnet-5. Breaking: the mid_conv_system block is removed in favour of InputMessage.system(...), the fallbacks/container request fields became typed unions, the Files, Skills and user-profile models follow the GA shapes, Managed Agents tool configs and rosters are sealed unions, and several exported sealed unions gained variants — see the Migration Guide.
anthropic_sdk_dart v7.0.0
anthropic_sdk_dart v7.0.0
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Adds the beta Dreams API (client.dreams) for asynchronous memory-consolidation jobs over memory stores and session transcripts, mid-conversation tool changes that add or remove tools between turns via tool_addition/tool_removal blocks while preserving the prompt cache, and a strict/best_effort redemption mode for fallback credit tokens, with the outcome reported on the new Usage.fallbackCredit field. Breaking: MessageCreateRequest.fallbackCreditToken changed from String? to FallbackCreditTokenParam? to carry the new redemption mode. Also adds managed-agent effort levels, initialEvents session seeding, and new environment/memory-store webhook events, and switches memory store endpoints to the agent-memory-2026-07-22 beta header (replacing managed-agents-2026-04-01).
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Syncs to Anthropic OpenAPI spec 506a5ad7, adding Claude Sonnet 5 (claude-sonnet-5), the web_search_20260318/web_fetch_20260318 built-in tool versions with the new responseInclusion control, and Managed Agents parity: event-delta streaming, credential injection location for env-var vault credentials, per-session agent overrides, backward session pagination, and 13 new agent/deployment webhook events. Breaking: user_profile_id moved from the message request body to the anthropic-user-profile-id header (now a userProfileId method parameter), and two closed-enum String fields are now typed enums (SpanModelUsage.speed, WebSearchResultError.errorCode). Also fixes two buildUrl edge cases with custom base URLs: a trailing slash no longer produces a double slash in the path (which some gateways 404 on), and query params embedded in the base URL (including repeated keys) are now preserved instead of being dropped or collapsed.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Syncs to the latest Anthropic OpenAPI spec (cross-checked field-for-field against anthropic-sdk-python). Adds the new code_execution_20260521 code-execution tool version — now the default for both the GA BuiltInTool.codeExecution(...) and the beta CodeExecutionTool — plus the fallback refusal trigger (FallbackBlock.trigger, a new FallbackRefusalTrigger that explains why a model handed over at a fallback hop) and the session.updated webhook event (WebhookSessionUpdatedEventData). The breaking surface is small and won't affect most users: FallbackBlock/FallbackInputBlock are normally consumed via fromJson, so pure-deserialization callers are unaffected; the only behavioral change is the code-execution default version, which you can pin by passing type explicitly. See the Migration Guide for details.
Adds scheduled deployments for Managed Agents — run an agent session on a cron schedule (or on demand) through the new client.deployments and client.d
Adds scheduled deployments for Managed Agents — run an agent session on a cron schedule (or on demand) through the new client.deployments and client.deploymentRuns beta resources, with each firing producing a deployment run. Also introduces the beta Fallback API for Messages — supply a fallbacks chain to automatically re-run a refused request on another model (e.g. Fable 5) or retry manually with a refusal credit token — plus environment-variable vault credentials for Managed Agents. Also fixes a latent runtime crash where passing an untyped empty literal (e.g. UpdateSessionParams(vaultIds: [])) to the Update*Params family threw a TypeError.
Completes field-level parity for the advisor and computer-use built-in beta tools, whose parameters were previously dropped on the Dart side and silen
Completes field-level parity for the advisor and computer-use built-in beta tools, whose parameters were previously dropped on the Dart side and silently lost on serialization. AdvisorTool now carries allowedCallers, deferLoading, and strict; ComputerUseTool adds those plus inputExamples (all versions) and enableZoom (only on the computer_20251124 tool version). See the Anthropic API release notes for the underlying tool updates.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Refreshes the package to the latest Anthropic OpenAPI spec for the Claude Opus 4.8 release. Adds mid-conversation system messages — the new mid_conv_system content block (via InputContentBlock.midConversationSystem) updates system instructions inside the messages array without a separate user turn or disrupting prompt caching — plus the spec's new system message role (MessageRole.system, InputMessage.system(...) / systemBlocks(...)), an outputTokensDetails reasoning-token breakdown on Usage/MessageDeltaUsage, and a nullable stopReason on advisor results. The breaking surface is very small and won't affect most users: the only breaks are one new variant on the exported sealed union InputContentBlock and one new value (system) on the MessageRole enum, which affect only code that switches over those types exhaustively without a wildcard or Unknown*/default branch. Pure-deserialization consumers are unaffected.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Completes the four-part Anthropic spec refresh and layers on several beta capabilities: prompt-cache diagnostics (pass DiagnosticsParam.previousMessageId and read Message.diagnostics?.cacheMissReason to learn why a cache prefix diverged), full request- and response-side search-result citations for grounding answers in your own RAG content, multiagent orchestration with outcome evaluations and rubrics, Session Threads (CRUD + streaming), inbound webhook event parsing, and MCP-OAuth credential validation. Also tolerates missing/null signature on streamed ThinkingBlocks from Anthropic-compatible servers (e.g. MiniMax). Breaking: the surface is small and mostly forward-compatibility hardening — new variants were added to the exported sealed unions Citation, InputContentBlock, SessionEvent, and EventParams, so only code with exhaustive switch statements that lack a wildcard/Unknown* branch needs updating; additionally UserProfile.relationship is now a required constructor parameter. Pure-deserialization consumers are unaffected.
Adds the Memory Stores beta API — 14 new endpoints exposed under client.memoryStores with child accessors for memories and memory versions. Memory Sto
Adds the Memory Stores beta API — 14 new endpoints exposed under client.memoryStores with child accessors for memories and memory versions. Memory Stores let you persist named memories that can be mounted into agent sessions, with append-only versioning, content-SHA preconditions, view modes (basic/full), and per-version redaction. Surfaces the full data model (MemoryStore, Memory, MemoryVersion, sealed MemoryListItem/MemoryPrecondition, ManagedAgentActor), three new enums, patch-style update params with null-as-delete metadata semantics, and three memory-specific error classes. SessionResource is extended with a new memory_store variant for mounting stores into agent sessions.
Adds support for Claude Opus 4.7 and refreshes the package to the latest Anthropic OpenAPI spec. Introduces the User Profiles beta API — 5 endpoints e
Adds support for Claude Opus 4.7 and refreshes the package to the latest Anthropic OpenAPI spec. Introduces the User Profiles beta API — 5 endpoints exposed as client.userProfiles for registering end-user profiles with metadata, per-feature trust grants, and short-lived enrollment URLs. Also extends EffortLevel with xhigh, adds TokenTaskBudget and OutputConfig.taskBudget for client-side compaction budgets, wires optional encrypted_content through compaction blocks, and adds MessageCreateRequest.userProfileId for end-user profile routing.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Adds the beta advisor tool for pairing a faster executor model with a stronger advisor model in a single request, plus MCPToolUseBlock/MCPToolResultBlock content types for mid-generation MCP tool calls. All examples migrate from deprecated claude-sonnet-4-20250514 to claude-sonnet-4-6 ahead of the June 15, 2026 end-of-life. Breaking: six Session fields moved from nullable to required non-nullable in the constructor — direct instantiation requires updates.
Adds full support for the Managed Agents API (beta) with 33 endpoints across agents, sessions, vaults, and credentials — including SSE streaming for s
Adds full support for the Managed Agents API (beta) with 33 endpoints across agents, sessions, vaults, and credentials — including SSE streaming for session events. Also adds structured refusal details (RefusalStopDetails, RefusalCategory) to messages and deltas when stopReason is refusal, and session-scoped file filtering via FileScope and scopeId.
Adds an extra overflow field to InputSchema for passing additional JSON Schema keywords (like additionalProperties: false) that the Anthropic API now
Adds an extra overflow field to InputSchema for passing additional JSON Schema keywords (like additionalProperties: false) that the Anthropic API now requires on object-type tool input schemas. All examples and integration tests have been updated accordingly.
Adds README Usage sections for models, files, and skills resources, and adds a strict semver bullet to the package README.
Aligns with the latest Anthropic OpenAPI spec, adding model capabilities (ModelCapabilities, CapabilitySupport), thinking display modes (ThinkingDispl
Aligns with the latest Anthropic OpenAPI spec, adding model capabilities (ModelCapabilities, CapabilitySupport), thinking display modes (ThinkingDisplayMode), and WebFetchTool v20260309 with cache bypass control. Also standardizes equality helper locations and overhauls documentation with llms.txt ecosystem files.
Complete McpToolset.toString() to include all fields (authorizationToken, cacheControl) that were previously missing.
Fixed verification warnings in generated model classes.
DOCS: Improve READMEs with badges, sponsor section, and vertex_ai deprecation (#90).
This release adds inline streaming error detection and top-level cache control support for request parameters.
Internal improvements to build tooling and package publishing configuration.
Added baseUrl and defaultHeaders parameters to withApiKey constructors, fixed WebSearchToolResultBlock.fromJson crash, and improved hashCode for list
Added baseUrl and defaultHeaders parameters to withApiKey constructors, fixed WebSearchToolResultBlock.fromJson crash, and improved hashCode for list fields.
Added withApiKey convenience constructors for simplified client initialization and convenience methods for common API patterns like single-message res
Added withApiKey convenience constructors for simplified client initialization and convenience methods for common API patterns like single-message responses and streaming text.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
TL;DR: Complete reimplementation with a new architecture, minimal dependencies, resource-based API, and improved developer experience. Hand-crafted models (no code generation), interceptor-driven architecture, comprehensive error handling, full Anthropic API coverage, and alignment with the latest Anthropic OpenAPI (2026-02-19).
client.messages — Message creation, streaming, token countingclient.messages.batches — Batch message processingclient.models — Model listing and retrievalclient.files — File upload/managementclient.skills — Custom skills managementAuthProvider interface.abortTrigger parameter.AnthropicConfig (timeouts, retry policy, log level, baseUrl, auth).http, logging, meta only).copyWith using sentinel pattern.InputMessage.user(), InputMessage.assistant()).createStream() vs create())..text, .hasToolUse, .toolUseBlocks, .thinkingBlocks).client.createMessage() → client.messages.create()client.createMessageStream() → client.messages.createStream()client.countMessageTokens() → client.messages.countTokens()client.createMessageBatch() → client.messages.batches.create()client.listMessageBatches() → client.messages.batches.list()client.listModels() → client.models.list()client.retrieveModel() → client.models.retrieve()CreateMessageRequest → MessageCreateRequestMessage → InputMessageMessageContent.text() → InputMessage.user() / InputMessage.assistant()Block.text() → TextInputBlockBlock.image() → ImageInputBlockBlock.toolResult() → InputContentBlock.toolResult()Model.model(Models.xxx) → String model ID (e.g., 'claude-sonnet-4-20250514')AnthropicConfig with AuthProvider pattern:
AnthropicClient(apiKey: 'KEY') → AnthropicClient(config: AnthropicConfig(authProvider: ApiKeyProvider('KEY')))AnthropicClient.fromEnvironment() to read ANTHROPIC_API_KEY.AnthropicClientException with typed hierarchy:
ApiException, AuthenticationException, RateLimitException, ValidationException, TimeoutException, AbortedException..map() callbacks:
event.map(contentBlockDelta: (e) => ...) → if (event is ContentBlockDeltaEvent) ...Skill.source: String → SkillSource enum (SkillSource.custom, SkillSource.anthropic)Message.role: String → MessageRole enum (MessageRole.assistant)SkillsResource.list() source parameter: String? → SkillSource?tools parameter: List<Map<String, dynamic>> → List<ToolDefinition>toolChoice parameter: Map<String, dynamic> → ToolChoiceendSession() → close().freezed, json_serializable; now minimal (http, logging, meta).See MIGRATION.md for step-by-step examples and mapping tables.
FIX: Add signature_delta support to BlockDelta (fixes #811) (#878).
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
REFACTOR: Fix pub format warnings (#809).
FEAT: Migrate to Freezed v3 (#773).
BUILD: Update dependencies (#751).
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
REFACTOR: Add new lint rules and fix issues (#621).
FEAT: Add support for tool use (#469).
FEAT: Implement anthropic_sdk_dart, a Dart client for Anthropic API (#433). (e5412b)
- Bootstrap package.
Your coding agent can read these notes before it upgrades. Set up the MCP server →