BerriAI/litellm · error · HTTPException

Server configuration error: team metadata field 'enforced_fi

Error message

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.

What it means

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.

Source

Thrown at litellm/proxy/openai_files_endpoints/files_endpoints.py:482

        if litellm.enable_loadbalancing_on_batch_endpoints is True:
            json_obj: Final = get_first_json_object(file_source)
            if json_obj:
                router_model = get_model_from_json_obj(json_object=json_obj)
                is_router_model = is_known_model(model=router_model, llm_router=llm_router)

        # Apply team-level file expiry enforcement
        team_metadata: Final = user_api_key_dict.team_metadata or {}
        enforced_file_expiry: Final = team_metadata.get("enforced_file_expires_after")
        if enforced_file_expiry is not None:
            if "anchor" not in enforced_file_expiry or "seconds" not in enforced_file_expiry:
                raise HTTPException(
                    status_code=500,
                    detail={
                        "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.",
                    },
                )
            if enforced_file_expiry["anchor"] != "created_at":
                raise HTTPException(
                    status_code=500,
                    detail={
                        "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.",
                    },
                )
            expires_after = FileExpiresAfter(
                anchor="created_at",
                seconds=int(enforced_file_expiry["seconds"]),
            )

        verbose_proxy_logger.debug("create_file expires_after: %s", expires_after)

        _create_file_request: Final = CreateFileRequest(
            file=file_data,
            purpose=cast(CREATE_FILE_REQUESTS_PURPOSE, purpose),
            expires_after=expires_after,
            **data,
        )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Ask the team/proxy admin to set the 'enforced_file_expires_after' anchor to 'created_at'.

When it happens

Trigger: Thrown at litellm/proxy/openai_files_endpoints/files_endpoints.py:482 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/4a7141e7c279c32a. Report an issue: GitHub.