Tailored AI

@tailored-ai/provider-anthropic

Claude models via the Messages API: prompt caching, beta headers, configurable API version, extra-field passthrough, streaming, and model discovery.

This plugin is the home of the anthropic provider id (#236 moved it out of core) — your existing providers.anthropic block keeps working. On older cores that still ship a minimal built-in, the plugin supersedes it; the one-line "Replacing existing entry" startup notice is expected there.

Install

bash
tai plugin install @tailored-ai/provider-anthropic

Configure

yaml
providers:
  anthropic:
    apiKey: "${ANTHROPIC_API_KEY}"
    defaultModel: "claude-haiku-4-5"
    promptCaching: true

agent:
  defaultProvider: anthropic
FieldRequiredNotes
apiKeyyesUse ${ANTHROPIC_API_KEY} to read from the environment.
defaultModelyesA Claude model id. tai edit lists them via listModels.
promptCachingnoCache breakpoints on the system prompt + tool definitions. Recommended for agents — both are re-sent every loop iteration, and cached reads cost ~10% of base input price.
defaultMaxTokensnomax_tokens fallback (the API requires one). Default 4096.
versionnoanthropic-version header. Default 2023-06-01.
betasnoBeta flags for the anthropic-beta header.
baseUrlnoDefault https://api.anthropic.com.

Anthropic-specific parameters

Fields the TAI provider contract doesn't model (extended thinking, top_k, …) pass through ChatParams.extra into the request body. Surfaces with a providerExtra config bag (briefing, suggestions) can use this today; per-agent extra isn't wired into the main loop yet.

Usage accounting

Cache writes and reads are summed into usage.input — token counts reflect what the API processed, with no silent exclusion of cached tokens.