All skills
Skillintermediate

Environment variables

> ## Documentation Index > Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt > Use this file to discover all available pages before exploring further.

Claude Code Knowledge Pack7/10/2026

Overview

Documentation Index

Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt Use this file to discover all available pages before exploring further.

Environment variables

Complete reference for environment variables that control Claude Code behavior.

Claude Code supports the following environment variables to control its behavior. Set them in your shell before launching claude, or configure them in settings.json under the env key to apply them to every session or roll them out across your team.

VariablePurpose
ANTHROPIC_API_KEYAPI key sent as X-Api-Key header. When set, this key is used instead of your Claude Pro, Max, Team, or Enterprise subscription even if you are logged in. In non-interactive mode (-p), the key is always used when present. In interactive mode, you are prompted to approve the key once before it overrides your subscription. To use your subscription instead, run unset ANTHROPIC_API_KEY
ANTHROPIC_AUTH_TOKENCustom value for the Authorization header (the value you set here will be prefixed with Bearer )
ANTHROPIC_BASE_URLOverride the API endpoint to route requests through a proxy or gateway. When set to a non-first-party host, MCP tool search is disabled by default. Set ENABLE_TOOL_SEARCH=true if your proxy forwards tool_reference blocks
ANTHROPIC_BEDROCK_BASE_URLOverride the Bedrock endpoint URL. Use for custom Bedrock endpoints or when routing through an LLM gateway. See Amazon Bedrock
ANTHROPIC_BEDROCK_MANTLE_BASE_URLOverride the Bedrock Mantle endpoint URL. See Mantle endpoint
ANTHROPIC_BETASComma-separated list of additional anthropic-beta header values to include in API requests. Claude Code already sends the beta headers it needs; use this to opt into an Anthropic API beta before Claude Code adds native support. Unlike the --betas flag, which requires API key authentication, this variable works with all auth methods including Claude.ai subscription
ANTHROPIC_CUSTOM_HEADERSCustom headers to add to requests (Name: Value format, newline-separated for multiple headers)
ANTHROPIC_CUSTOM_MODEL_OPTIONModel ID to add as a custom entry in the /model picker. Use this to make a non-standard or gateway-specific model selectable without replacing built-in aliases. See Model configuration
ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTIONDisplay description for the custom model entry in the /model picker. Defaults to Custom model (<model-id>) when not set
ANTHROPIC_CUSTOM_MODEL_OPTION_NAMEDisplay name for the custom model entry in the /model picker. Defaults to the model ID when not set
ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIESSee Model configuration
ANTHROPIC_DEFAULT_HAIKU_MODELSee Model configuration
ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTIONSee Model configuration
ANTHROPIC_DEFAULT_HAIKU_MODEL_NAMESee Model configuration
ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIESSee Model configuration
ANTHROPIC_DEFAULT_OPUS_MODELSee Model configuration
ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTIONSee Model configuration
ANTHROPIC_DEFAULT_OPUS_MODEL_NAMESee Model configuration
ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIESSee Model configuration