The beta messages surface (client.beta.messages) extends the standard messages API with experimental capabilities: agentic tool loops, server-side fallback chaining, structured output, context management, MCP integration, and inference tier control. Server-side fallback chaining automatically retries a request with an alternative model from the fallbacks list when the primary model is unavailable or rate-limited, eliminating the need for extra client-side retry logic. The beta messages surface (client.beta) is the programmatic interface for Organization management in the SDK, supporting admin tooling and multi-tenant access control.
src/anthropic/resources/beta/messages/messages.py implements Messages and AsyncMessages, the client.beta.messages surface, with batches available via the batches cached property.[1] The beta messages module imports tool-runner helpers BetaToolRunner, BetaAsyncToolRunner, BetaStreamingToolRunner, and BetaAsyncStreamingToolRunner from lib/tools, exposing agentic tool-loop capabilities on the beta messages surface — see Tool runner for full semantics.[1] Deprecated-model lists DEPRECATED_MODELS and MODELS_TO_WARN_WITH_THINKING_ENABLED are imported from resources.messages.messages so that the beta surface issues the same model warnings as the non-beta surface.[1] tests/api_resources/beta/test_output_format_conversion.py and tests/lib/_parse/test_beta_messages.py cover the output_format= warning-suppression logic for the beta parse and stream surface. src/anthropic/resources/beta/organization/ exposes Organization management endpoints — API keys, external keys, users, invites, workspaces, service accounts, federation rules, and rate limits. Type definitions for Organization management endpoints live in src/anthropic/types/beta/organization/ and src/anthropic/types/beta/; AnthropicBetaParam is extended to cover Organization-related feature flag values. BetaThinkingConfigEnabledParam and BetaThinkingConfigAdaptiveParam are the beta thinking config parameter types, defined in src/anthropic/types/beta/beta_thinking_config_enabled_param.py and src/anthropic/types/beta/beta_thinking_config_adaptive_param.py; AnthropicBetaParam in src/anthropic/types/anthropic_beta_param.py is kept in sync with these definitions. Type definitions in src/anthropic/types/beta/ for files and skills — including BetaFileMetadata, BetaSkill, BetaSkillSource, BetaContainerSkill, BetaSkillVersion, and BetaDeletedSkillVersion — mirror the stable API contract and are the authoritative shapes for those resources.
client.beta.messages.create accepts fallbacks (type BetaFallbacksParam) and fallback_credit_token as optional parameters for server-side fallback chaining.[1] client.beta.messages.create accepts output_config (BetaOutputConfigParam) and output_format (BetaJSONOutputFormatParam) for structured output control.[1] client.beta.messages.create accepts context_management (BetaContextManagementConfigParam) for server-side context management such as compaction.[1] client.beta.messages.create accepts mcp_servers (Iterable[BetaRequestMCPServerURLDefinitionParam]) for MCP connector integration — full MCP semantics are covered on MCP integration.[1] client.beta.messages.create supports service_tier ("auto" or "standard_only") and speed ("standard" or "fast") for inference tier control.[1] Setting max_tokens=0 on client.beta.messages.create pre-warms the prompt cache without generating a response.[1] In src/anthropic/resources/beta/messages/messages.py, the output_format= deprecation warning is suppressed when .parse(), .stream(), or tool-runner helpers manage output_format internally; the warning fires only when a caller explicitly passes output_format= at the top-level API. BetaThinkingConfigEnabledParam and BetaThinkingConfigAdaptiveParam each expose a display field; supported values include an updates mode that streams intermediate reasoning steps to the caller. The client.beta.files and client.beta.skills resource namespaces use GA (generally available) type shapes; the anthropic-beta header requirement has been removed for both namespaces.
Sources