{"record":{"id":"b6f56865d4f179bc","repo":"BerriAI/litellm","slug":"anthropic-api-key-or-anthropic-auth-token-is-requi","errorCode":null,"errorMessage":"ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is required for Skills API","messagePattern":"ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is required for Skills API","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/anthropic/skills/transformation.py","lineNumber":46,"sourceCode":"\n    @property\n    def custom_llm_provider(self) -> LlmProviders:\n        return LlmProviders.ANTHROPIC\n\n    def validate_environment(self, headers: dict, litellm_params: GenericLiteLLMParams | None) -> dict:\n        \"\"\"Add Anthropic-specific headers\"\"\"\n        from litellm.llms.anthropic.common_utils import AnthropicModelInfo\n\n        # Get API key from litellm_params if available\n        api_key = None\n        api_base = None\n        if litellm_params is not None:\n            api_key = litellm_params.api_key\n            api_base = litellm_params.api_base\n\n        auth_header: Final = AnthropicModelInfo.get_auth_header(api_key, api_base)\n        if auth_header is None:\n            raise ValueError(\"ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is required for Skills API\")\n\n        headers.update(auth_header)\n        headers[\"anthropic-version\"] = \"2023-06-01\"\n\n        # Add beta header for skills API\n        from litellm.constants import ANTHROPIC_SKILLS_API_BETA_VERSION\n\n        if \"anthropic-beta\" not in headers:\n            headers[\"anthropic-beta\"] = ANTHROPIC_SKILLS_API_BETA_VERSION\n        elif isinstance(headers[\"anthropic-beta\"], list):\n            if ANTHROPIC_SKILLS_API_BETA_VERSION not in headers[\"anthropic-beta\"]:\n                headers[\"anthropic-beta\"].append(ANTHROPIC_SKILLS_API_BETA_VERSION)\n        elif isinstance(headers[\"anthropic-beta\"], str):\n            if ANTHROPIC_SKILLS_API_BETA_VERSION not in headers[\"anthropic-beta\"]:\n                headers[\"anthropic-beta\"] = [\n                    headers[\"anthropic-beta\"],\n                    ANTHROPIC_SKILLS_API_BETA_VERSION,\n                ]","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/anthropic/skills/transformation.py#L28-L64","documentation":"Error \"ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is required for Skills API\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/anthropic/skills/transformation.py:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN before calling the Skills API."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}