Skip to main content
Anthropic is the Claude provider package: Messages API for complete and stream, native token counting, and SDK retries disabled so the loader owns retry policy.

Why

Choose Anthropic when you want Claude models with first-class streaming and accurate countTokens via the Messages API. You can run Anthropic alongside OpenAI and Google in the same deployment — routing is by model id, not a global client switch.

Setup

  1. Confirm apps/backend/package.json includes "tooling-ai-anthropic": "workspace:*" (default in the boilerplate).
  2. Run make deps-install if you changed dependencies.
  3. Add or extend tools.ai in apps/backend/src/configuration/development.ts (and production.ts when ready):
  1. No compose.yml changes are required — Anthropic is reached over HTTPS; no extra Docker service.
  2. Add to .env.development:
  1. Verify:

Local observability

Anthropic traffic does not ship a local dashboard in Refract. You’ll see ai feature logs and StatsD metrics (ai.request.*) from instrumentation when tools.metrics is configured. Use your Anthropic console for spend and rate-limit debugging.

Adding a new model id

  1. Add the model string to tools.ai.anthropic.models in each environment config that uses Anthropic.
  2. Optionally set defaultModel to that id (must remain in models).
  3. Confirm getAvailableModels returns the new id before exposing it in UI.
  4. Run make test module=tooling-ai-anthropic.

Gotchas

  • Model ids must match Anthropic’s API names exactly — typos throw AiValidationError at the loader, not a clear SDK message.
  • If Anthropic is the only provider configured, omitting params.model uses defaultModel or the first models entry.
  • Loader provider order is anthropic → openai → google; Anthropic is primary only when it is the first block present in config and loaded.

What’s next?