BerriAI/litellm · error · OCIError

Missing required OCI credentials: oci_user…

Error message

Missing required OCI credentials: oci_user, oci_fingerprint, oci_tenancy, and at least one of oci_key or oci_key_file. These can also be supplied via environment variables: {_OCI_USER_ENV}, {_OCI_FINGERPRINT_ENV}, {_OCI_TENANCY_ENV}, {_OCI_KEY_ENV} (or {_OCI_KEY_FILE_ENV}). Alternatively, provide an oci_signer object from the OCI SDK.

What it means

Error "Missing required OCI credentials: oci_user, oci_fingerprint, oci_tenancy, and at least one of oci_key or oci_key_file. These can also be supplied via environment variables: {_OCI_USER_ENV}, {_OCI_FINGERPRINT_ENV}, {_OCI_TENANCY_ENV}, {_OCI_KEY_ENV} (or {_OCI_KEY_FILE_ENV}). Alternatively, provide an oci_signer object from the OCI SDK." thrown in BerriAI/litellm.

Solutions

  1. Provide oci_user, oci_fingerprint, oci_tenancy and oci_key or oci_key_file via params or the OCI_* environment variables.
  2. Alternatively pass an oci_signer object from the OCI SDK.

When it happens

Trigger: Thrown at litellm/llms/oci/common_utils.py:261 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/823978c5c39da8a1. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/oci/common_utils.py:261

    return headers, body


def sign_with_manual_credentials(
    headers: dict,
    optional_params: dict,
    request_data: dict,
    api_base: str,
) -> tuple[dict, bytes]:
    """Sign a request using manually provided OCI credentials (user/fingerprint/tenancy/key)."""
    creds: Final = resolve_oci_credentials(optional_params)
    oci_user: Final = creds["oci_user"]
    oci_fingerprint: Final = creds["oci_fingerprint"]
    oci_tenancy: Final = creds["oci_tenancy"]
    oci_key: Final = creds["oci_key"]
    oci_key_file: Final = creds["oci_key_file"]

    if not oci_user or not oci_fingerprint or not oci_tenancy or not (oci_key or oci_key_file):
        raise OCIError(
            status_code=401,
            message=(
                "Missing required OCI credentials: oci_user, oci_fingerprint, oci_tenancy, "
                "and at least one of oci_key or oci_key_file. "
                "These can also be supplied via environment variables: "
                f"{_OCI_USER_ENV}, {_OCI_FINGERPRINT_ENV}, {_OCI_TENANCY_ENV}, {_OCI_KEY_ENV} (or {_OCI_KEY_FILE_ENV}). "
                "Alternatively, provide an oci_signer object from the OCI SDK."
            ),
        )

    method: Final = str(optional_params.get("method", "POST")).upper()
    body: Final = json.dumps(request_data).encode("utf-8")
    parsed: Final = urlparse(api_base)
    path: Final = parsed.path or "/"
    host: Final = parsed.netloc

    date: Final = formatdate(usegmt=True)
    content_type: Final = headers.get("content-type", "application/json")

View on GitHub (pinned to 77b7c6c40c)