{"record":{"id":"4a7141e7c279c32a","repo":"BerriAI/litellm","slug":"server-configuration-error-team-metadata-field-e-4a7141","errorCode":null,"errorMessage":"Server configuration error: team metadata field 'enforced_file_expires_after' has invalid anchor '{enforced_file_expiry['anchor']}' - must be 'created_at'. Contact your team or proxy admin to fix this setting.","messagePattern":"Server configuration error: team metadata field 'enforced_file_expires_after' has invalid anchor '(.+?)' - must be 'created_at'\\. Contact your team or proxy admin to fix this setting\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/openai_files_endpoints/files_endpoints.py","lineNumber":482,"sourceCode":"        if litellm.enable_loadbalancing_on_batch_endpoints is True:\n            json_obj: Final = get_first_json_object(file_source)\n            if json_obj:\n                router_model = get_model_from_json_obj(json_object=json_obj)\n                is_router_model = is_known_model(model=router_model, llm_router=llm_router)\n\n        # Apply team-level file expiry enforcement\n        team_metadata: Final = user_api_key_dict.team_metadata or {}\n        enforced_file_expiry: Final = team_metadata.get(\"enforced_file_expires_after\")\n        if enforced_file_expiry is not None:\n            if \"anchor\" not in enforced_file_expiry or \"seconds\" not in enforced_file_expiry:\n                raise HTTPException(\n                    status_code=500,\n                    detail={\n                        \"error\": \"Server configuration error: team metadata field 'enforced_file_expires_after' is malformed - must contain 'anchor' and 'seconds' keys. Contact your team or proxy admin to fix this setting.\",\n                    },\n                )\n            if enforced_file_expiry[\"anchor\"] != \"created_at\":\n                raise HTTPException(\n                    status_code=500,\n                    detail={\n                        \"error\": f\"Server configuration error: team metadata field 'enforced_file_expires_after' has invalid anchor '{enforced_file_expiry['anchor']}' - must be 'created_at'. Contact your team or proxy admin to fix this setting.\",\n                    },\n                )\n            expires_after = FileExpiresAfter(\n                anchor=\"created_at\",\n                seconds=int(enforced_file_expiry[\"seconds\"]),\n            )\n\n        verbose_proxy_logger.debug(\"create_file expires_after: %s\", expires_after)\n\n        _create_file_request: Final = CreateFileRequest(\n            file=file_data,\n            purpose=cast(CREATE_FILE_REQUESTS_PURPOSE, purpose),\n            expires_after=expires_after,\n            **data,\n        )","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/openai_files_endpoints/files_endpoints.py#L464-L500","documentation":"Error \"Server configuration error: team metadata field 'enforced_file_expires_after' has invalid anchor '{enforced_file_expiry['anchor']}' - must be 'created_at'. Contact your team or proxy admin to fix this setting.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/openai_files_endpoints/files_endpoints.py:482 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ask the team/proxy admin to set the 'enforced_file_expires_after' anchor to 'created_at'."],"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"}