Skip to content
tokz

Anthropic integration

Reduce Anthropic tool-result context without summarizing it.

The Tokz Anthropic wrapper targets verbose tool results in Messages workflows. It selects relevant source material while preserving the tool envelope and the distinction between structural and prose paths.

anthropic.ts
import Anthropic from "@anthropic-ai/sdk";
import { withTokz } from "@tokz/anthropic";

const anthropic = withTokz(new Anthropic(), {
  apiKey: process.env.TOKZ_API_KEY!,
});

await anthropic.messages.create({ model: "claude-sonnet-4-5", messages });

A tool result is model context

Large search results, logs, and API responses recur in agent loops. Compressing at the wrapper boundary keeps the next request focused while the original remains available to your application.

Preserve the message contract

The integration keeps tool-call identity and supported result envelope fields. Add explicit required-field rules where a workflow depends on an identifier or status.

Limitations

Tokz does not summarize, call a generative model, or make Anthropic responses deterministic. Evaluate the downstream task on your own payloads.