-
-
Notifications
You must be signed in to change notification settings - Fork 0
Provider Anthropic
Direct HTTPS API integration with api.anthropic.com.
provider: anthropic
providers:
anthropic:
api_key: sk-ant-...
model: claude-opus-4-8Equivalent CLI / env:
commitbrief config set provider anthropic
commitbrief config set providers.anthropic.api_key sk-ant-...
commitbrief config set providers.anthropic.model claude-opus-4-8
# Or via env:
export ANTHROPIC_API_KEY=sk-ant-...Get an API key from https://console.anthropic.com/.
The static list registered by the binary:
| Model ID | Default? | Notes |
|---|---|---|
claude-opus-4-8 |
✓ | Highest capability; 1M-token context. |
claude-sonnet-4-6 |
— | Mid-tier; 1M-token context. |
claude-haiku-4-5-20251001 |
— | Fastest, cheapest. |
The setup wizard offers the same three. Any model name accepted by the Anthropic Messages API works at runtime — the static list is just for the wizard's pick-list.
Snapshot from the binary's pricing table:
| Model | Input | Output | Cached input |
|---|---|---|---|
claude-opus-4-8 |
$5.00 | $25.00 | $0.50 |
claude-sonnet-4-6 |
$3.00 | $15.00 | $0.30 |
claude-haiku-4-5-20251001 |
$1.00 | $5.00 | $0.10 |
The cost preflight (cost.warn_threshold_usd) uses these figures
plus an output-token heuristic to estimate per-review spend before
firing.
Rates are updated when Anthropic changes them; check
internal/provider/anthropic/pricing.go against
https://www.anthropic.com/pricing if accuracy matters.
| Model | Context window |
|---|---|
claude-opus-4-8 |
1,000,000 tokens |
claude-sonnet-4-6 |
1,000,000 tokens |
claude-haiku-4-5-20251001 |
200,000 tokens |
Reported by the provider for dry-run and the cost preflight's
"will this fit?" check.
CommitBrief uses Anthropic's ephemeral prompt-caching (5-minute
TTL) to cut repeated-input cost ~10×. The cache happens on
Anthropic's side; CommitBrief sends the system-prompt section
marked for caching. Cache hits show in the verbose footer as
Cached input: N tokens.
The Anthropic integration uses a tool-call (forced) to get
structured JSON back, then parses against the v1 schema. If the
first attempt produces unparseable JSON, one retry fires with a
nudge to produce strict JSON — see ADR-0014 §4. A second failure
falls back to markdown rendering and prints a warning: LLM produced malformed JSON; falling back to plain-text view.
- Providers — overview + comparison.
- Cost preflight — how the estimate is computed.
- JSON schema — the v1 findings schema.
Home · Installation · Quick start · Troubleshooting · GitHub repo · Issues
CommitBrief — local, LLM-powered code review for git diffs. This wiki documents only what ships in the binary.
Getting started
Commands · reviewing
Commands · summarizing
Commands · committing
Commands · setup
Commands · integration
Commands · inspect
Commands · maintenance
Configuration
Providers
Output
Operations
Reference