Skip to main content
Use Anthropic Claude models with Hypertic agent.

Installation

Install the Anthropic package:
pip install hypertic[anthropic]

Setup

Set your Anthropic API key as an environment variable:
export ANTHROPIC_API_KEY=sk-...

Initialize Model

Create an Anthropic model instance:
from hypertic.models import Anthropic

model = Anthropic(
    model="claude-sonnet-4-5",
    max_tokens=1000,
    temperature=0.5,
)

Use with Agent

Pass the model to your agent:
from hypertic.agents import Agent
from hypertic.models import Anthropic

model = Anthropic(model="claude-sonnet-4-5")
agent = Agent(
    model=model,
    tools=[get_weather],
)

response = agent.run("What's the weather in SF?")
print(response.content)

Configuration Options

Supported parameters for Anthropic models:
from hypertic.models import Anthropic

model = Anthropic(
    model="claude-sonnet-4-5",
    temperature=0.7,      # Controls randomness (0.0-1.0)
    max_tokens=1000,       # Maximum response length
)
For the full list of available models and parameters, see the Anthropic API documentation.