#33055 [Bug]: Anthropic /v1/messages ignores use_bearer_for_custom_base for custom API bases
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
## Description Anthropic Messages passthrough does not honor `use_bearer_for_custom_base` when generating auth headers.
For custom Anthropic-compatible `/v1/messages` gateways such as Cloudflare AI Gateway, the upstream expects:
Authorization: Bearer <token>
But LiteLLM still sends:
x-api-key: <token>
## Repro Configure a model with:
model: anthropic/anthropic/claude-fable-5 api_base: https://api.cloudflare.com/client/v4/accounts/***/ai api_key: *** use_bearer_for_custom_base: true
Call `/v1/messages`.
## Expected LiteLLM sends `Authorization: Bearer <token>` to the custom API base.
## Actual LiteLLM sends `x-api-key: <token>`, causing upstream 401 Authentication error.
## Cause `AnthropicMessagesConfig.validate_anthropic_messages_environment()` calls:
AnthropicModelInfo.get_auth_header(api_key)
without passing `api_base` or `use_bearer_for_custom_base`.
## Fix Read `api_base` and `use_bearer_for_custom_base` from `litellm_params` and pass them into `get_auth_header()`.
### Steps to Reproduce
1. config.yaml
``` model_list: - …