{"record":{"id":"021d9e03dc81a83a","repo":"BerriAI/litellm","slug":"oci-compartment-id-is-required-for-oci-chat-reques","errorCode":null,"errorMessage":"oci_compartment_id is required for OCI chat requests. Pass it as optional_params or set the OCI_COMPARTMENT_ID env var.","messagePattern":"oci_compartment_id is required for OCI chat requests\\. Pass it as optional_params or set the OCI_COMPARTMENT_ID env var\\.","errorType":"exception","errorClass":"OCIError","httpStatus":400,"severity":"error","filePath":"litellm/llms/oci/chat/transformation.py","lineNumber":529,"sourceCode":"        # OCI rejects both the OpenAI string and the nested OpenAI dict shape.\n        _normalize_tool_choice(selected_params)\n\n        _normalize_response_format(selected_params, vendor)\n\n        return selected_params\n\n    def transform_request(\n        self,\n        model: str,\n        messages: list[AllMessageValues],\n        optional_params: dict,\n        litellm_params: dict,\n        headers: dict,\n    ) -> dict:\n        creds: Final = resolve_oci_credentials(optional_params)\n        oci_compartment_id: Final = creds[\"oci_compartment_id\"]\n        if not oci_compartment_id:\n            raise OCIError(\n                status_code=400,\n                message=(\n                    \"oci_compartment_id is required for OCI chat requests. \"\n                    \"Pass it as optional_params or set the OCI_COMPARTMENT_ID env var.\"\n                ),\n            )\n\n        vendor: Final = get_vendor_from_model(model)\n\n        oci_serving_mode: Final = optional_params.get(\"oci_serving_mode\", \"ON_DEMAND\")\n        if oci_serving_mode not in [\"ON_DEMAND\", \"DEDICATED\"]:\n            raise OCIError(\n                status_code=400,\n                message=\"kwarg `oci_serving_mode` must be either 'ON_DEMAND' or 'DEDICATED'\",\n            )\n\n        if oci_serving_mode == \"DEDICATED\":\n            serving_mode = OCIServingMode(","sourceCodeStart":511,"sourceCodeEnd":547,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/oci/chat/transformation.py#L511-L547","documentation":"Error \"oci_compartment_id is required for OCI chat requests. Pass it as optional_params or set the OCI_COMPARTMENT_ID env var.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/oci/chat/transformation.py:529 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass oci_compartment_id or set OCI_COMPARTMENT_ID."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}