Skip to content

feat: add direct Anthropic API authentication and completions - #281

Merged
danielkov merged 5 commits into
mainfrom
feat/anthropic-api-provider
Oct 18, 2026
Merged

danielkov merged 5 commits into
mainfrom
feat/anthropic-api-provider

Conversation

@danielkov

@danielkov danielkov commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add direct Anthropic API completions using AgentKit鈥檚 existing Anthropic adapter, with kit auth login|status|logout anthropic, ANTHROPIC_API_KEY, and provider/model selection across CLI, TUI, and ACP.

Motivation

Claude Max subscribers can claim API credits into a Claude Console organization and use that organization鈥檚 API key with Kit. Direct API requests draw from Anthropic billing without using Claude subscription OAuth credentials.

Impact

Existing provider defaults remain unchanged. Anthropic login accepts a single-workspace API key at a hidden prompt, validates it through the non-inference Models API, and stores it in the selected persistent credential backend. A nonempty environment key overrides the saved key; logout removes only local credentials.

Document direct API setup and credential behavior. Credit balances remain in Claude Console rather than kit usage.

Technical details

Native completion adapter

Pin agentkit-provider-anthropic to 0.10.11; no transitive package versions change. The published archive checksum and packaged source match registry metadata and the upstream commit; provenance remains sole-owner and commit-based without a matching release tag.

Discover models through the authenticated, paginated Anthropic Models API. Resolve selected IDs and aliases through the model-detail endpoint; use returned context limits, output ceilings, and thinking capabilities instead of hardcoded model-name rules. Requests are bounded by time and response size with redirects disabled. Preserve explicitly selected models with default reasoning when discovery is unavailable.

Cross-provider sessions

Remove unsigned foreign reasoning only from the Anthropic-bound transcript projection while preserving Anthropic signed and redacted thinking blocks. This permits switching existing sessions to Anthropic without sending invalid thinking blocks.

Comment thread docs/user/getting-started-and-configuration.md Outdated
kit-code-agent[bot]
kit-code-agent Bot previously approved these changes Oct 17, 2026

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

kit-code-agent[bot]
kit-code-agent Bot previously approved these changes Oct 17, 2026

@kit-code-agent kit-code-agent Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

Took 1 min 43 sec

@danielkov
danielkov enabled auto-merge (squash) October 17, 2026 23:16
@danielkov
danielkov disabled auto-merge October 17, 2026 23:16
kit-code-agent[bot]
kit-code-agent Bot previously approved these changes Oct 18, 2026

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

Took 2 min 37 sec

kit-code-agent[bot]
kit-code-agent Bot previously approved these changes Oct 18, 2026

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

Took 3 min 51 sec

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

Took 3 min 6 sec

@danielkov
danielkov enabled auto-merge (squash) October 18, 2026 09:16
@danielkov
danielkov merged commit 1346c0a into main Oct 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant