Buffaly Logo Buffaly

Use Buffaly with Anthropic

Connect an Anthropic API key or a supported Claude account runtime. Both use provider anthropic; Anthropic Feature.DefaultTransport chooses which route is available.

Install the matching Anthropic module

Include Buffaly.Provider.Anthropic through the target release's package/provisioning workflow. Its enabled manifest entry must load AnthropicProviderCatalogSource and AnthropicCompletionExecutor in the consuming host/worker processes. Use the common installation and activation procedure before changing credentials. A package in the release profile is not proof it is loaded locally.

Load the complete database-backed Anthropic Feature settings through provider administration. Preserve the existing document, API settings and nested account settings when saving changes. This module declares chat completion, not an embedding or speech component.

Configure the API-key route

  1. Obtain an Anthropic API key for the intended account and save it with the supported credential control as Anthropic Feature.ApiKey. A Claude subscription login does not populate this key.
  2. Set DefaultTransport to provider_native. Keep BaseUrl=https://api.anthropic.com and Version=2023-06-01 unless your supported endpoint requires another value. MaxTokens must be positive; the current default is 32768.
  3. Use a nonempty Models dictionary and set DefaultModelName to one of its exact API model IDs. Each entry owns SupportedReasoningLevels, DefaultReasoningLevel and ThinkingMode.

This non-secret settings fragment shows a model without reasoning controls. Replace the placeholder with the exact supported API ID and merge it into the existing settings; save the key separately.

{
  "DefaultTransport": "provider_native",
  "BaseUrl": "https://api.anthropic.com",
  "Version": "2023-06-01",
  "MaxTokens": 32768,
  "DefaultModelName": "<exact-api-model-id>",
  "Models": {
    "<exact-api-model-id>": {
      "SupportedReasoningLevels": [],
      "DefaultReasoningLevel": "",
      "ThinkingMode": "none"
    }
  }
}

For reasoning-capable API models, the supported effort vocabulary is low, medium and high. Configure only the levels the model supports, with a default in that list. ThinkingMode accepts none, budget_tokens (also accepted as enabled) or adaptive. Match the mode to that model; native account effort options are not an API capability list.

Configure the Claude account transport

  1. Provision the supported Claude native executable using the vendor's instructions for the target platform. Complete its supported account login under the actual Buffaly execution identity. A desktop administrator's login is not automatically available to a service or separate worker.
  2. In the existing Anthropic Feature, configure ClaudeCode.Enabled=true, ClaudeCode.ExecutablePath as an existing absolute executable file and ClaudeCode.ConfigurationDirectory as an existing absolute native configuration directory.
  3. Populate ClaudeCode.Models with exact native model keys and their model-specific reasoning/thinking settings. Set ClaudeCode.DefaultModelName to a key in that dictionary. Native models can advertise xhigh or max as well as the API effort levels; select only advertised values.
  4. Set DefaultTransport=claude_code. Use provider administration's explicit Claude native refresh when you intend to contact the native control protocol. It updates the last-known-good account, model and limit snapshot; it is different from reading the catalog.
  5. Read back ClaudeVersion, SubscriptionType, LastRefreshUtc and RefreshError. Use the native ModelName key for selection, not optional ResolvedModel metadata.

ClaudeCode.TimeoutSeconds is a positive account-probe budget (default 300), not a completion deadline. DiagnosticDirectory is optional task-data capture and must name an existing absolute directory when intentionally enabled. Keep account credentials in the native login owner, not in settings examples, prompts or logs.

Only the selected transport is enabled. A claude_code failure does not fall back to the API key. This account route is independent of OpenAI's codex_backend authentication and does not restore the retired Codex editing workflow.

Select the route's exact model

After saving and reloading settings, open the complete provider catalog. Find anthropic, its enabled provider_native or claude_code transport and that transport's model rows. Select a model and one of its reasoning values in the session selector; use empty reasoning for a row without controls. Read back the selection. The model-management guide shows the authenticated external selection request.

Verify setup without inference first

  1. Inspect component-load diagnostics, saved non-secret settings and the catalog's Providers and Error. Confirm the intended transport, exact default and efforts.
  2. Check masked key status for API access, or the existing native account/refresh status for account access. Reading a saved snapshot does not launch a native refresh.
  3. Inspect the current session selection without changing it. These checks establish configuration; vendor acceptance requires an intended execution test.
  4. When you choose to test execution, select the model in a test session and send Reply exactly: ANTHROPIC_PROVIDER_OK. Confirm normal assistant text and the intended provider/transport/model. This request uses API billing or account quota.

Common failures

  • Provider absent: check the module's enabled entry, contract/DLL validation and feature/catalog errors.
  • API authentication fails: check the intended feature key and API account access, not the native subscription login.
  • Account route rejected: check executable/configuration paths on every consuming machine and the actual execution identity's native login.
  • Model or effort rejected: compare with the selected transport's catalog; API and native keys/efforts can differ.
  • Refresh fails: read RefreshError and native version/account status. Correct the failing native prerequisite rather than switching transports to hide it.
All providersModule installationManage models