{"record":{"id":"0770174e9a54dd5d","repo":"BerriAI/litellm","slug":"raw-cloud-storage-file-ids-cannot-be-retrieved-dir","errorCode":null,"errorMessage":"Raw cloud storage file ids cannot be retrieved directly. Use the LiteLLM managed file id returned when the file was created.","messagePattern":"Raw cloud storage file ids cannot be retrieved directly\\. Use the LiteLLM managed file id returned when the file was created\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/openai_files_endpoints/files_endpoints.py","lineNumber":734,"sourceCode":"                    }\n                )\n\n            else:\n                response = await managed_files_obj.afile_content(\n                    **{\n                        \"file_id\": file_id,\n                        \"litellm_parent_otel_span\": user_api_key_dict.parent_otel_span,\n                        \"llm_router\": llm_router,\n                        **data,\n                    }\n                )\n        else:\n            # A raw cloud-storage URI (s3://, gs://) supplied here would skip the\n            # managed-file owner/team check that only runs for unified ids, letting\n            # a caller read another tenant's object by its key. Such objects are only\n            # reachable through their managed unified id.\n            if is_managed_cloud_storage_uri(file_id):\n                raise HTTPException(\n                    status_code=400,\n                    detail=\"Raw cloud storage file ids cannot be retrieved directly. Use the LiteLLM managed file id returned when the file was created.\",\n                )\n            # Check for model-based credential routing\n            (\n                should_route,\n                model_used,\n                original_file_id,\n                credentials,\n            ) = handle_model_based_routing(\n                file_id=file_id,\n                request=request,\n                llm_router=llm_router,\n                data=data,\n                check_file_id_encoding=True,\n            )\n\n            if not should_route:","sourceCodeStart":716,"sourceCodeEnd":752,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/openai_files_endpoints/files_endpoints.py#L716-L752","documentation":"HTTPException raised on file-content retrieval: the supplied file_id is a raw cloud-storage URI (s3://, gs://) rather than a LiteLLM managed/unified id. Raw URIs would bypass the managed-file ownership check, so direct retrieval is blocked — the caller must use the managed id returned at creation.","triggerScenarios":"Thrown at litellm/proxy/openai_files_endpoints/files_endpoints.py:734 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the LiteLLM managed file id returned at creation time instead of the raw cloud storage id."],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}