Anthropic SDK v0.45 (Python) & v0.35 (TypeScript) — Structured Output Helpers
The first developer-focused release of 2026 has landed: Anthropic Python SDK v0.45.0 and TypeScript SDK v0.35.0 ship new structured output helper classes that make it significantly easier to enforce typed schemas on Claude's responses without manually wrapping every call in a validation layer. Both SDKs introduce a parse() method on the response object that validates the output against a Pydantic model (Python) or Zod schema (TypeScript) and raises a typed exception on mismatch.
# Python — structured output with automatic validation
from anthropic import Anthropic
import anthropic
client = Anthropic()
class AnalysisResult(BaseModel):
sentiment: Literal["positive", "negative", "neutral"]
confidence: float
summary: str
response = client.messages.create(
model="claude-sonnet-4-5",
max_tokens=512,
messages=[{"role": "user", "content": "Analyse this review: ..."}]
)
result = response.parse(AnalysisResult)
print(result.sentiment) # typed, validated
Both SDKs also add a stream_to_file() helper that pipelines a streaming response directly to a file object, closing a longstanding gap for developers building document-generation pipelines. The Python SDK ships with updated type stubs generated from the OpenAPI spec, reducing IDE false-positives on newer parameters.