{"record":{"id":"91dca5c7162d4696","repo":"BerriAI/litellm","slug":"target-model-names-is-required-when-require-manage","errorCode":null,"errorMessage":"target_model_names is required when require_managed_files is enabled in litellm_settings. Provide one or more model aliases via the target_model_names form field (e.g. target_model_names=my-model-alias).","messagePattern":"target_model_names is required when require_managed_files is enabled in litellm_settings\\. Provide one or more model aliases via the target_model_names form field \\(e\\.g\\. target_model_names=my-model-alias\\)\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/openai_files_endpoints/common_utils.py","lineNumber":904,"sourceCode":"    model: str | None = None,\n) -> None:\n    \"\"\"\n    Enforce proxy-level managed files when litellm.require_managed_files is enabled.\n\n    Raises:\n        HTTPException: 400 if the upload would bypass the managed-files flow, i.e.\n            target_model_names is missing or a model parameter routes the request\n            through the direct provider path instead of the managed-files hook.\n    \"\"\"\n    from fastapi import HTTPException\n\n    import litellm\n\n    if litellm.require_managed_files is not True:\n        return\n\n    if not target_model_names:\n        raise HTTPException(\n            status_code=400,\n            detail=(\n                \"target_model_names is required when require_managed_files is enabled \"\n                \"in litellm_settings. Provide one or more model aliases via the \"\n                \"target_model_names form field (e.g. target_model_names=my-model-alias).\"\n            ),\n        )\n\n    if model:\n        raise HTTPException(\n            status_code=400,\n            detail=(\n                \"model is not allowed when require_managed_files is enabled in \"\n                \"litellm_settings. Uploads must go through managed files using \"\n                \"target_model_names instead of the model parameter.\"\n            ),\n        )\n","sourceCodeStart":886,"sourceCodeEnd":922,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/openai_files_endpoints/common_utils.py#L886-L922","documentation":"Error \"target_model_names is required when require_managed_files is enabled in litellm_settings. Provide one or more model aliases via the target_model_names form field (e.g. target_model_names=my-model-alias).\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/openai_files_endpoints/common_utils.py:904 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide one or more model aliases via the target_model_names form field (e.g. target_model_names=my-model-alias)."],"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"}