{"record":{"id":"7bd807eccc2e509c","repo":"crewAIInc/crewAI","slug":"invalid-api-key","errorCode":null,"errorMessage":"Invalid API key","messagePattern":"Invalid API key","errorType":"http","errorClass":"HTTPException","httpStatus":401,"severity":"error","filePath":"lib/crewai/src/crewai/a2a/auth/server_schemes.py","lineNumber":717,"sourceCode":"    )\n    api_key: CoercedSecretStr = Field(\n        description=\"Expected API key value\",\n    )\n\n    async def authenticate(self, token: str) -> AuthenticatedUser:\n        \"\"\"Authenticate using API key comparison.\n\n        Args:\n            token: The API key to authenticate.\n\n        Returns:\n            AuthenticatedUser on successful authentication.\n\n        Raises:\n            HTTPException: If authentication fails.\n        \"\"\"\n        if token != self.api_key.get_secret_value():\n            raise HTTPException(\n                status_code=HTTP_401_UNAUTHORIZED,\n                detail=\"Invalid API key\",\n            )\n\n        return AuthenticatedUser(\n            token=token,\n            scheme=\"api_key\",\n        )\n\n\nclass MTLSServerAuth(ServerAuthScheme):\n    \"\"\"Mutual TLS authentication marker for AgentCard declaration.\n\n    This scheme is primarily for AgentCard security_schemes declaration.\n    Actual mTLS verification happens at the TLS/transport layer, not\n    at the application layer via token validation.\n\n    When configured, this signals to clients that the server requires","sourceCodeStart":699,"sourceCodeEnd":735,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai/src/crewai/a2a/auth/server_schemes.py#L699-L735","documentation":"Error \"Invalid API key\" thrown in crewAIInc/crewAI.","triggerScenarios":"Thrown at lib/crewai/src/crewai/a2a/auth/server_schemes.py:717 when the library encounters an invalid state.","commonSituations":"Occurs when the provided API key does not match any configured key. Verify the API key value and that it has not been rotated or revoked.","solutions":["Verify the API key is correct and has not been revoked.","Set the API key via the expected environment variable or configuration."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}