On this page

Anthropic Provider

Docs home · Provider guide · Configuration · DeepSeek · OpenAI-compatible · Gemini · 简体中文

Use the Anthropic provider when you want Sigil to call Claude models through the Anthropic Messages streaming API.

Minimal Setup

For temporary local use:

export SIGIL_ANTHROPIC_API_KEY="sk-ant-..."
sigil

For reusable config:

[agent]
provider = "anthropic"
model = "claude-sonnet-4-5"
tool_timeout_secs = 30

[model_request]
request_timeout_secs = 120
stream_idle_timeout_secs = 180

[providers.anthropic]
base_url = "https://api.anthropic.com"
# Prefer SIGIL_ANTHROPIC_API_KEY.
# api_key = "sk-ant-..."
anthropic_version = "2023-06-01"
max_tokens = 4096
beta_headers = []

A full starting template is available at anthropic.toml.

Authentication

Sigil resolves Anthropic authentication in this order:

  1. SIGIL_ANTHROPIC_API_KEY
  2. [providers.anthropic].api_key

Prefer environment variables for local and CI use. Do not commit configs that contain plaintext api_key values.

Environment Overrides

VariableOverrides
SIGIL_ANTHROPIC_BASE_URL[providers.anthropic].base_url
SIGIL_ANTHROPIC_VERSION[providers.anthropic].anthropic_version
SIGIL_ANTHROPIC_MAX_TOKENS[providers.anthropic].max_tokens

Behavior Notes

Sigil handles Anthropic's request format, streaming replies, tool results, usage, and incremental tool input for you. Anthropic-specific options remain on this page, while the normal tool-approval, privacy, and session workflow stays the same.

Image attachments are available only for explicitly recognized Claude model IDs and their accepted dated variants. Unknown names and unrecognized aliases fail before provider transport. See Image Attachments for input methods, local limits, cache behavior, and resume guidance.

Use beta_headers only when you know the Anthropic feature or endpoint requires them.

Verify

Run:

sigil doctor

Check provider name, model, anthropic_version, base URL, and API key source.

Common Problems

SymptomCheck
Request rejected for version/header reasonsConfirm anthropic_version and beta_headers.
Output stops earlyReview max_tokens and model limits.
Auth uses the wrong keyConfirm SIGIL_ANTHROPIC_API_KEY or [providers.anthropic].api_key is set to the intended value.
Tool-use behavior differs from another providerCompare provider support and keep permission policy unchanged while testing.