Beta Features

Send Anthropic beta headers and their matching request configuration with Agno.

from agno.agent import Agent
from agno.models.anthropic import Claude


def lookup_temperature(city: str) -> str:
    temperatures = {
        "London": "18 C",
        "Paris": "21 C",
        "Tokyo": "25 C",
    }
    return temperatures.get(city, "No reading available")


agent = Agent(
    model=Claude(
        id="claude-sonnet-4-5-20250929",
        betas=["context-management-2025-06-27"],
        context_management={
            "edits": [
                {
                    "type": "clear_tool_uses_20250919",
                    "trigger": {"type": "tool_uses", "value": 2},
                    "keep": {"type": "tool_uses", "value": 1},
                }
            ]
        },
    ),
    tools=[lookup_temperature],
)

if __name__ == "__main__":
    agent.print_response(
        "Call lookup_temperature separately for London, Paris, and Tokyo, then compare the readings."
    )

Agno passes betas to the Anthropic SDK's beta Messages API. Use the exact beta name from the feature documentation and include every request field that the feature requires. An unsupported beta returns a 400 response. Anthropic has also retired specific beta headers by ignoring them, so the absence of an error does not prove that a feature is active.

The example pairs the context-editing beta with its required context_management body. A beta header changes an API request; it does not add tools or external data access by itself.

Run the Example

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Install dependencies

uv pip install -U "agno[anthropic]"

Set your API key

export ANTHROPIC_API_KEY="your_anthropic_api_key"

Save and run

Save the example as betas.py, then run:

python betas.py

Features That Require Beta Headers

FeatureBetaAgno Configuration
Context editingcontext-management-2025-06-27Set betas and context_management
Legacy MCP connectormcp-client-2025-04-04Compatibility path for Agno's mcp_servers shape. The current connector uses mcp-client-2025-11-20 and MCP toolsets in tools; changing the header alone does not migrate the body.

Beta names and availability can change. Check Anthropic's beta-header documentation before enabling one.

The current versions of these Anthropic features do not require a beta header:

When Claude(skills=...) is configured, Agno still adds the accepted legacy Skills and code-execution beta headers. These are adapter compatibility behavior, not a current provider requirement.