langchain.js
    Preparing search index...

    Interface ChatAnthropicCallOptions

    interface ChatAnthropicCallOptions {
        betas?: AnthropicBeta[];
        cache_control?: AnthropicCacheControl;
        container?: string;
        headers?: Record<string, string>;
        inferenceGeo?: string;
        mcp_servers?: BetaRequestMCPServerURLDefinition[];
        outputConfig?: OutputConfig;
        outputFormat?: JSONOutputFormat;
        streamUsage?: boolean;
        tool_choice?: AnthropicToolChoice;
        tools?: any[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    betas?: AnthropicBeta[]

    Optional array of beta features to enable for the Anthropic API. Beta features are experimental capabilities that may change or be removed. See https://docs.anthropic.com/en/api/versioning for available beta features.

    cache_control?: AnthropicCacheControl

    Cache control configuration for prompt caching. When provided, applies cache_control to the last content block of the last message, enabling Anthropic's prompt caching feature.

    This is the recommended way to enable prompt caching as it applies cache_control at the final message formatting layer, avoiding issues with message content block manipulation during earlier processing stages.

    container?: string

    Container ID for file persistence across turns with code execution. Used with the code_execution_20250825 tool.

    headers?: Record<string, string>

    Custom headers to pass to the Anthropic API when making a request.

    inferenceGeo?: string

    Specifies the geographic region for inference processing. US-only inference is available at 1.1x pricing for models released after February 1, 2026.

    mcp_servers?: BetaRequestMCPServerURLDefinition[]

    Array of MCP server URLs to use for the request.

    outputConfig?: OutputConfig

    Configuration options for the model's output, such as effort level and output format.

    outputFormat?: JSONOutputFormat

    Use outputConfig.format instead. This parameter will be removed in a future release.

    streamUsage?: boolean

    Whether or not to include token usage data in streamed chunks.

    true
    
    tool_choice?: AnthropicToolChoice

    Whether or not to specify what tool the model should use

    "auto"
    
    tools?: any[]