{"record":{"id":"284de3aca0abcb0f","repo":"BerriAI/litellm","slug":"not-allowed-to-set-k-as-a-cache-control-contact","errorCode":null,"errorMessage":"Not allowed to set {k} as a cache control. Contact admin to change permissions.","messagePattern":"Not allowed to set (.+?) as a cache control\\. Contact admin to change permissions\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/hooks/cache_control_check.py","lineNumber":46,"sourceCode":"        try:\n            verbose_proxy_logger.debug(\"Inside Cache Control Check Pre-Call Hook\")\n            allowed_cache_controls: Final = user_api_key_dict.allowed_cache_controls\n\n            if data.get(\"cache\", None) is None:\n                return\n\n            cache_args: Final = data.get(\"cache\", None)\n            if isinstance(cache_args, dict):\n                for k, v in cache_args.items():\n                    if (\n                        (allowed_cache_controls is not None)\n                        and (isinstance(allowed_cache_controls, list))\n                        and (\n                            len(allowed_cache_controls) > 0\n                        )  # assume empty list to be nullable - https://github.com/prisma/prisma/issues/847#issuecomment-546895663\n                        and k not in allowed_cache_controls\n                    ):\n                        raise HTTPException(\n                            status_code=403,\n                            detail=f\"Not allowed to set {k} as a cache control. Contact admin to change permissions.\",\n                        )\n            else:  # invalid cache\n                return\n\n        except HTTPException as e:\n            raise e\n        except Exception as e:\n            verbose_logger.exception(\n                \"litellm.proxy.hooks.cache_control_check.py::async_pre_call_hook(): Exception occured - %s\", e\n            )\n","sourceCodeStart":28,"sourceCodeEnd":59,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/hooks/cache_control_check.py#L28-L59","documentation":"Error \"Not allowed to set {k} as a cache control. Contact admin to change permissions.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/hooks/cache_control_check.py:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the disallowed cache control field from the request.","Ask the admin to permit the field in the cache control permissions configuration."],"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-14T05:17:10.506Z"}