# ModelAuthenticationError
`langchain_core.exceptions.ModelAuthenticationError` means the provider rejected your credentials. It is not retryable.
## Checklist
1. Is the variable set in the actual process environment? Print it (or its presence) from inside the running process. dotenv files that load after the model is constructed, containers that did not get the env file, and notebooks with a stale kernel are the classics.
2. Is the name right? OPENAI_API_KEY, ANTHROPIC_API_KEY. A typo'd variable name looks exactly like a missing key.
3. Is the key valid and current? Keys get rotated and revoked. Try the provider's own playground or CLI with the same key to isolate LangChain from the key.
4. Proxy or non-standard endpoint? Make sure the custom endpoint does not expect a different auth scheme.
## Fix
- Set the variable before the model is constructed, or pass the key explicitly to the model class.
- In JS, the same condition surfaces as the MODEL_AUTHENTICATION error code on the thrown error's `lc_error_code`.
## Rule
Do not paste real keys into code, chat, or skill content. Environment first, always.