401 Unauthorized means the API key is missing or invalid. In AI Hub, keys are NEVER stored directly — only the env var name. Common causes in order of likelihood:
1. Typo in api_key_env_var field (e.g., 'ANTHRPOIC_API_KEY' instead of 'ANTHROPIC_API_KEY')
2. .env file exists but the server wasn't restarted after adding the key
3. .env file not in the right directory or not loaded
4. The actual key has been revoked or rotated by the vendor
5. Wrong provider_type selected (training providers don't need a key)
Your Challenge
Your provider returns 401 Unauthorized on every API call. The base_url is correct and the model exists. Walk through your diagnostic steps in order of most likely cause. For each step: describe what you check, how you check it, and what the fix is.