Skip to main content
Claude is Anthropic’s family of AI models, known for their advanced reasoning capabilities and extended thinking modes. Avante.nvim supports both API key authentication and Claude Pro/Max subscription authentication.

Quick Start

API Key Authentication

1

Get your API key

Sign up at Anthropic Console and create an API key.
2

Set environment variable

Add to your shell configuration:
3

Configure provider

Claude Pro/Max Subscription

If you have a Claude Pro or Max subscription, you can authenticate using OAuth:
1

Enable OAuth authentication

2

Authenticate in browser

When you open Neovim, the authentication process will start in your browser.
3

Enter authorization code

Copy the code shown in your browser and paste it into the Neovim prompt.
If you previously had a different provider selected, run :AvanteSwitchProvider claude to initiate authentication.

Configuration

Basic Configuration

Available Models

Authentication Types

Environment Variables

Claude uses the following environment variables:
When using auth_type = "max", API keys are not required as OAuth is used instead.

Advanced Features

Prompt Caching

Claude supports prompt caching to reduce costs and latency for repeated prompts:
Avante automatically applies caching to:
  • System prompts
  • Tool definitions
  • The last text message in history

Extended Thinking

Claude models support extended thinking for complex reasoning tasks. This is automatically enabled when the model returns thinking content.

Custom Endpoint

For self-hosted or proxy setups:

Proxy Configuration

Rate Limiting

Claude automatically handles rate limiting by:
  1. Detecting rate limit headers
  2. Calculating sleep time based on reset timestamps
  3. Pausing requests until limits reset
You can monitor rate limits in the response headers:
  • anthropic-ratelimit-tokens-remaining
  • anthropic-ratelimit-tokens-reset
  • anthropic-ratelimit-requests-reset

Troubleshooting

Authentication Failed

Ensure your API key is set in your environment:
Restart Neovim after setting the variable.
If the OAuth code doesn’t work:
  1. Ensure you copied the entire code from the browser
  2. Try the authentication flow again
  3. Check that auth_type = "max" is set correctly
OAuth tokens are automatically refreshed. If you see expiration errors:
  1. Wait a moment for auto-refresh
  2. Restart Neovim to trigger re-authentication

Quota Exceeded

If you see quota errors:
Check your usage at Anthropic Console and add credits or upgrade your plan.

Temperature Errors

Claude requires temperature between 0 and 1:

Best Practices

Model Selection

  • Sonnet 4.5: Best balance of speed and capability
  • Opus 4: Maximum capability for complex tasks
  • Haiku 3.5: Fastest, best for simple tasks

Token Management

  • Use prompt caching for repeated contexts
  • Set appropriate max_tokens limits
  • Monitor usage in Anthropic Console

Temperature Settings

  • 0.0-0.3: Focused, deterministic responses
  • 0.4-0.7: Balanced creativity and consistency
  • 0.8-1.0: More creative and varied responses

OAuth vs API Key

  • OAuth: For Claude Pro/Max subscribers
  • API Key: For pay-per-use developers
  • Both work with same models

Example Configurations