*magenta-providers.txt*  Provider configuration for magenta.nvim

==============================================================================
CONTENTS                                          *magenta-providers-contents*

    1. Anthropic ............................... |magenta-anthropic|
    2. Deprecated Providers .................... |magenta-deprecated-providers|

==============================================================================
ANTHROPIC                                                 *magenta-anthropic*

Uses the Anthropic Node SDK.
https://github.com/anthropics/anthropic-sdk-typescript

Supported models:~
  - claude-opus-4-7
  - claude-sonnet-4-5
  - claude-haiku-4-5

Basic configuration:~
>lua
    {
      name = "claude-sonnet",
      provider = "anthropic",
      model = "claude-sonnet-4-5",
      fastModel = "claude-haiku-4-5",
      apiKeyEnvVar = "ANTHROPIC_API_KEY"
    }
<

With thinking/reasoning:~

Opus 4.7 uses adaptive thinking (no explicit budget needed):
>lua
    {
      name = "claude-opus",
      provider = "anthropic",
      model = "claude-opus-4-7",
      apiKeyEnvVar = "ANTHROPIC_API_KEY",
      thinking = {
        enabled = true,
        displayThinking = false,  -- set true to stream thinking summaries
        effort = "max"            -- "low" | "medium" | "high" | "xhigh" | "max"
      }
    }
<

Older models (Opus 4.6 and earlier) require explicit budget:
>lua
    {
      name = "claude-opus-old",
      provider = "anthropic",
      model = "claude-opus-4-6",
      apiKeyEnvVar = "ANTHROPIC_API_KEY",
      thinking = {
        enabled = true,
        budgetTokens = 1024  -- must be >= 1024
      }
    }
<

Configuration options:~
  - `enabled`: Enable thinking for extended processing
  - `budgetTokens`: (optional) Token budget for thinking. Required for
    models before Opus 4.7; Opus 4.7+ uses adaptive allocation
  - `displayThinking`: (optional, default false) Stream thinking summaries
    to chat. Set true to see the thinking process as it streams
  - `effort`: (optional) Steer how aggressively Claude thinks and spends
    tokens on tool calls. One of "low" | "medium" | "high" | "xhigh" | "max".
    Maps to Anthropic's `output_config.effort`. Applies only to
    adaptive-thinking models (Opus 4.7+, Sonnet 4.6+); ignored with a
    warning on older models. See
    https://platform.claude.com/docs/en/build-with-claude/effort

                                                         *magenta-claude-max*
CLAUDE MAX AUTHENTICATION ~

Use OAuth to connect with your Anthropic account subscription instead
of pay-per-token API usage.
>lua
    {
      name = "claude-max",
      provider = "anthropic",
      model = "claude-sonnet-4-5",
      authType = "max"
      -- No apiKeyEnvVar needed
    }
<

How it works:~
  - On first use, opens browser to Anthropic's OAuth page
  - Copy authorization code back to Magenta
  - Tokens stored in `~/.local/share/magenta/auth.json` (0600 permissions)
  - Refresh tokens managed automatically

                                                    *magenta-claude-keychain*
CLAUDE CODE KEYCHAIN AUTHENTICATION ~

On macOS, reuse the Anthropic Console API key that Claude Code stores in
the login Keychain (after authentication with the "Anthropic Console Account" / API-usage-billing
sign-in mode of Claude Code). Magenta will load the key from the Keychain
at startup; no environment variable is required.
>lua
    {
      name = "claude-keychain",
      provider = "anthropic",
      model = "claude-sonnet-4-5",
      authType = "keychain"
      -- No apiKeyEnvVar needed
    }
<

How it works:~
  - Runs `security find-generic-password -s "Claude Code" -a $USER -w`
    to read the `sk-ant-*` key Claude Code stored in the login Keychain
  - Requests include the Claude Code system-prompt shim, since some orgs
    restrict console-managed keys to Claude-Code-shaped traffic
    will fail without an API key

Requires: You must have signed into Claude Code using the "Anthropic
Console Account (API usage billing)" option at least once on this machine.

==============================================================================
DEPRECATED PROVIDERS                            *magenta-deprecated-providers*
                                                             *magenta-openai*
                                                           *magenta-bedrock*
                                                            *magenta-ollama*
                                                           *magenta-copilot*

The following providers were removed in Jan 2026: OpenAI, AWS Bedrock,
Ollama, and GitHub Copilot. The Anthropic provider is the only supported
provider. Contributions to re-add providers are welcome.

vim:tw=78:ts=8:noet:ft=help:norl::ts=8:noet:ft=help:norl:
