{"record":{"id":"fa31f4a8c69df21a","repo":"BerriAI/litellm","slug":"response-text-fa31f4","errorCode":null,"errorMessage":"{response.text}","messagePattern":"\\{response\\.text\\}","errorType":"exception","errorClass":"OCIError","httpStatus":null,"severity":"error","filePath":"litellm/llms/oci/chat/transformation.py","lineNumber":661,"sourceCode":"        signed_json_body: bytes | None = None,\n    ) -> \"OCIStreamWrapper\":\n        if client is None or isinstance(client, AsyncHTTPHandler):\n            client = _get_httpx_client(params={})\n\n        try:\n            response: Final = client.post(\n                api_base,\n                headers=headers,\n                data=(signed_json_body if signed_json_body is not None else json.dumps(data)),\n                stream=True,\n                logging_obj=logging_obj,\n                timeout=STREAMING_TIMEOUT,\n            )\n        except httpx.HTTPStatusError as e:\n            raise OCIError(status_code=e.response.status_code, message=e.response.text)\n\n        if response.status_code != 200:\n            raise OCIError(status_code=response.status_code, message=response.text)\n\n        return OCIStreamWrapper(\n            completion_stream=_iter_sse_events(response.iter_text()),\n            model=model,\n            custom_llm_provider=custom_llm_provider,\n            logging_obj=logging_obj,\n        )\n\n    @track_llm_api_timing()\n    async def get_async_custom_stream_wrapper(\n        self,\n        model: str,\n        custom_llm_provider: str,\n        logging_obj: LiteLLMLoggingObj,\n        api_base: str,\n        headers: dict,\n        data: dict,\n        messages: list,","sourceCodeStart":643,"sourceCodeEnd":679,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/oci/chat/transformation.py#L643-L679","documentation":"Raised when the synchronous streaming request to OCI Generative AI completes but the response status code is not 200. The full response body (OCI's error JSON) is attached to an OCIError with the upstream status code, telling you why the service refused the streaming chat request.","triggerScenarios":"litellm.completion(..., custom_llm_provider='oci' or model='oci/...', stream=True) where OCI returns any non-200: 400 invalid request payload, 401 signing failure, 404 unknown model OCID/action path, 429 throttling, 5xx service error.","commonSituations":"Model OCID copied from a different region or compartment; request payload includes parameters OCI does not accept for that model; tenancy not subscribed to Generative AI; stale api_base override that no longer routes to the inference endpoint; sustained load hitting the service limit.","solutions":["Read e.status_code and e.message (the OCI error JSON) to identify the exact refusal reason.","For 400: strip unsupported parameters (e.g. provider-specific params OCI rejects) or fix the model OCID.","For 401/403: re-check OCI credentials (user OCID, fingerprint, tenancy, key) and that the key is RSA.","For 429/5xx: retry with exponential backoff and jitter, or reduce request concurrency."],"exampleFix":"# before\nstream = litellm.completion(model=\"oci/cohere.command-r-plus\", messages=m, stream=True)\n\n# after\nfrom litellm.llms.oci.common_utils import OCIError\ntry:\n    stream = litellm.completion(model=\"oci/cohere.command-r-plus\", messages=m, stream=True)\nexcept OCIError as e:\n    if e.status_code and 500 <= e.status_code < 600 and attempt < 3:\n        continue  # retry loop\n    raise","handlingStrategy":"retry","validationCode":"import re\nmodel = \"ocid1.generativeai.model.oc1.....\"\nregion = os.environ.get(\"OCI_REGION\", \"\")\nassert re.match(r\"^[a-z][a-z0-9-]{0,30}[a-z0-9]$\", region.strip()), \"bad OCI_REGION\"","typeGuard":"def is_retryable_oci_status(code: int | None) -> bool:\n    return code == 429 or (code is not None and 500 <= code < 600)","tryCatchPattern":"from litellm.llms.oci.common_utils import OCIError\ntry:\n    stream = litellm.completion(model=\"oci/...\", messages=m, stream=True)\nexcept OCIError as e:\n    if is_retryable_oci_status(e.status_code) and attempt < MAX:\n        time.sleep(2 ** attempt + random.random())\n        continue\n    raise","preventionTips":["Smoke-test the exact model OCID + region pair once at deploy time.","Cap streaming concurrency to stay under OCI rate limits.","Log e.status_code and e.message together for fast triage."],"tags":["oci","streaming","http","status-code"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}