{"record":{"id":"b3318018c9d7bce0","repo":"BerriAI/litellm","slug":"too-many-resource-identifiers-in-request","errorCode":null,"errorMessage":"Too many resource identifiers in request.","messagePattern":"Too many resource identifiers in request\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/pass_through_endpoints/managed_id_rewriter.py","lineNumber":210,"sourceCode":"\n\nclass _RawIdGuardBudget:\n    \"\"\"Per-request de-dupe + cap for raw-provider-id guard DB lookups.\"\"\"\n\n    __slots__ = (\"_remaining\", \"_seen\")\n\n    def __init__(self, limit: int = _MAX_RAW_ID_GUARD_LOOKUPS) -> None:\n        self._remaining = limit\n        self._seen: set[str] = set()\n\n    def reserve(self, raw_id: str) -> bool:\n        \"\"\"Return True when a guard lookup for *raw_id* should run. Returns\n        False for a raw id already checked this request (de-dupe). Raises\n        ``HTTPException(400)`` once the per-request lookup budget is exhausted.\"\"\"\n        if raw_id in self._seen:\n            return False\n        if self._remaining <= 0:\n            raise HTTPException(\n                status_code=400,\n                detail=\"Too many resource identifiers in request.\",\n            )\n        self._remaining -= 1\n        self._seen.add(raw_id)\n        return True\n\n\n# ---------------------------------------------------------------------------\n# List routes — GET requests that return a paginated {object:\"list\", data:[…]}\n# These are intercepted and served entirely from the DB rather than forwarded\n# to the upstream provider, so each caller only sees IDs they own.\n# ---------------------------------------------------------------------------\n\n# Maps (provider, canonical_path) -> \"files\" | \"batches\"\n_LIST_ROUTE_TABLE: Final[dict[tuple[str, str], ResourceKind]] = {\n    (\"openai\", \"/v1/files\"): \"files\",\n    (\"openai\", \"/v1/batches\"): \"batches\",","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/pass_through_endpoints/managed_id_rewriter.py#L192-L228","documentation":"Raised by _RawIdGuardBudget.reserve when the per-request budget of raw-provider-id guard DB lookups is exhausted: the request contains more distinct resource identifiers than allowed, protecting the database from unbounded lookup work.","triggerScenarios":"Thrown at litellm/proxy/pass_through_endpoints/managed_id_rewriter.py:210 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send at most one managed resource identifier per request; split multi-resource requests into separate calls."],"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"}