{"record":{"id":"8eb4c51e32aebc77","repo":"BerriAI/litellm","slug":"invalid-argilla-api-key-given-credentials-api-ke","errorCode":null,"errorMessage":"Invalid Argilla API Key given. _credentials_api_key=None.","messagePattern":"Invalid Argilla API Key given\\. _credentials_api_key=None\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/integrations/argilla.py","lineNumber":90,"sourceCode":"    def validate_argilla_transformation_object(self, argilla_transformation_object: dict[str, Any]):\n        if not isinstance(argilla_transformation_object, dict):\n            raise Exception(\"'argilla_transformation_object' must be a dictionary, to log your payload to Argilla.\")\n\n        for v in argilla_transformation_object.values():\n            if v not in SUPPORTED_PAYLOAD_FIELDS:\n                raise Exception(\n                    f\"All values in argilla_transformation_object must be a key in SUPPORTED_PAYLOAD_FIELDS, {v} is not a valid key.\"\n                )\n\n    def get_credentials_from_env(\n        self,\n        argilla_api_key: str | None,\n        argilla_dataset_name: str | None,\n        argilla_base_url: str | None,\n    ) -> ArgillaCredentialsObject:\n        _credentials_api_key: Final = argilla_api_key or os.getenv(\"ARGILLA_API_KEY\")\n        if _credentials_api_key is None:\n            raise Exception(\"Invalid Argilla API Key given. _credentials_api_key=None.\")\n\n        _credentials_base_url: Final = argilla_base_url or os.getenv(\"ARGILLA_BASE_URL\") or \"http://localhost:6900/\"\n        if _credentials_base_url is None:\n            raise Exception(\"Invalid Argilla Base URL given. _credentials_base_url=None.\")\n\n        _credentials_dataset_name = argilla_dataset_name or os.getenv(\"ARGILLA_DATASET_NAME\") or \"litellm-completion\"\n        if _credentials_dataset_name is None:\n            raise Exception(\"Invalid Argilla Dataset give. Value=None.\")\n        else:\n            dataset_response: Final = litellm.module_level_client.get(\n                url=f\"{_credentials_base_url}/api/v1/me/datasets?name={_credentials_dataset_name}\",\n                headers={\"X-Argilla-Api-Key\": _credentials_api_key},\n            )\n            json_response: Final = dataset_response.json()\n            if (\n                \"items\" in json_response\n                and isinstance(json_response[\"items\"], list)\n                and len(json_response[\"items\"]) > 0","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/argilla.py#L72-L108","documentation":"ArgillaLogger needs an API key to authenticate against your Argilla server. `get_credentials_from_env` resolves the key from the constructor argument or the ARGILLA_API_KEY environment variable; if both are absent it raises this Exception with the literal `_credentials_api_key=None` so you can tell the key resolution (not the server connection) failed.","triggerScenarios":"Enabling `litellm.callbacks = [\"argilla\"]` without setting ARGILLA_API_KEY anywhere (constructor arg not passed, since the callback loads by name). Raised during logger init, before any HTTP request to Argilla is made.","commonSituations":"Local Argilla testing where the developer assumed the default API key was picked up automatically; forgetting the env var in docker-compose/k8s deployment of the proxy; env var set in a different shell than the one running litellm; secret name typo (e.g. ARGILLA_KEY).","solutions":["Export the key before starting litellm/proxy: `export ARGILLA_API_KEY=your_key` (owner.api_key from your Argilla instance)","In litellm proxy, inject it via the process environment of the proxy container/pod rather than per-request","Verify with `python -c \"import os; print(os.getenv('ARGILLA_API_KEY'))\"` in the exact runtime environment"],"exampleFix":"# before\nlitellm.callbacks = [\"argilla\"]  # ARGILLA_API_KEY unset -> Exception\n\n# after\nimport os\nos.environ[\"ARGILLA_API_KEY\"] = \"owner.apikey.local.xxx\"\nlitellm.callbacks = [\"argilla\"]","handlingStrategy":"validation","validationCode":"import os\n\nif not os.getenv(\"ARGILLA_API_KEY\"):\n    raise SystemExit(\"ARGILLA_API_KEY is not set; refusing to enable argilla callback\")\nlitellm.callbacks = [\"argilla\"]","typeGuard":null,"tryCatchPattern":"try:\n    ArgillaLogger()\nexcept Exception as e:\n    if \"Argilla API Key\" in str(e):\n        log.warning(\"Argilla logging disabled: no API key\")\n        # proceed without argilla rather than crashing serving\n    else:\n        raise","preventionTips":["Declare ARGILLA_API_KEY in docker-compose/k8s env spec alongside other integration secrets","Add env-var presence checks to a preflight/startup validator for all enabled callbacks"],"tags":["argilla","authentication","environment-variable","credentials"],"backgroundTag":"missing-api-key","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}