Installation and setup
The SDK can't be found or imported
The SDK can't be found or imported
- Python
- TypeScript
- Java
ModuleNotFoundError: No module named 'hiddenlayer' means the package isn’t installed for the interpreter that runs your code. Activate your project’s virtual environment, then install and check with that interpreter:hiddenlayer-sdk, but the import name is hiddenlayer. Installing a package named hiddenlayer does not install this SDK.A storage SDK is missing when you scan a model from S3, Azure Blob Storage, or Hugging Face
A storage SDK is missing when you scan a model from S3, Azure Blob Storage, or Hugging Face
ImportError, such as Python package boto3 is not installed. In TypeScript, the scan throws an error naming the package to install. The Java SDK has no download helpers for these sources. See Scan models.The installed version is older than expected, or a method is missing
The installed version is older than expected, or a method is missing
- Check the version your code actually uses. See Check the SDK version.
- Upgrade with the same tool that installed it, and check for pins in
requirements.txt,pyproject.toml,package.json, the lock file,build.gradle, orpom.xml. - If you’re coming from an earlier major version, read its migration guide. Many names changed in Python 4.0.0, TypeScript 4.0.0, and Java 3.0.0.
Configuration errors
Unknown environment, or requests go to the wrong URL
Unknown environment, or requests go to the wrong URL
- Python raises
ValueError: Unknown environment: ...for any name other thanprod-usorprod-eu. - TypeScript treats any other string as a URL, so a misspelled region name fails when the first request is sent.
- Java has two regions,
Environment.PROD_USandEnvironment.PROD_EU. For any other base URL, use.url(...).
base_url in Python, baseUrl in TypeScript, or .url(...) in Java. The HIDDENLAYER_BASE_URL environment variable is used only when you set neither a region nor a base URL in code. To connect to any other endpoint, such as a self-hosted container, use a base URL instead of a region.Java: IllegalStateException when you build the client
Java: IllegalStateException when you build the client
build() found neither a token nor both a client ID and a client secret, in the builder or in the environment.Fix: Set HIDDENLAYER_CLIENT_ID and HIDDENLAYER_CLIENT_SECRET (or HIDDENLAYER_TOKEN) in the environment of the JVM, or pass them to the builder. Python and TypeScript clients construct without credentials and fail on the first request instead. See Authentication and configuration.Authentication and permission errors
403 Forbidden
403 Forbidden
ForbiddenError (HiddenLayerApi.ForbiddenError in TypeScript).404 Not Found
404 Not Found
- The ID is wrong. Check for typos, and check that you passed the right kind of ID, for example a scan ID rather than a model ID.
- The resource exists in a different region. Resources created in
prod-usare not visible fromprod-eu. - The resource is not available yet. For example, scan results can take a moment to appear after you start a scan. When they read a scan’s results, the scanning helpers try up to 5 times on a 404 before they raise it.
NotFoundError (HiddenLayerApi.NotFoundError in TypeScript), on endpoints that declare it.Connection and rate limit errors
The request timed out
The request timed out
429 Too Many Requests
429 Too Many Requests
Retry-After header, and raises the error only after all retries fail. No SDK has a dedicated rate limit error: check for status 429 on the base error (ApiError in Python, HiddenLayerError in TypeScript, HiddenLayerApiException in Java).Fix:- Reduce request concurrency or volume.
- Increase the maximum retries (
max_retries,maxRetries) so the SDK waits longer before giving up. - Avoid adding your own retry loop on top of the SDK’s retries, which can make rate limiting worse.
Model scanning issues
Couldn't download model ...
Couldn't download model ...
RuntimeError and TypeScript an Error, each with a message that starts with Couldn't download model.Fix:- Read the original error from the storage SDK:
e.__cause__in Python. In TypeScript it is part of the message. - Confirm that the object exists and that your cloud credentials can read it. Without a client of your own, the S3 scan uses the AWS SDK’s default credential chain. In Python, the Azure scan uses
DefaultAzureCredentialby default. - Python downloads to
/tmp; TypeScript downloads to the operating system’s temporary directory. Confirm that the process can write there.
A scan seems to hang
A scan seems to hang
- For large models or CI pipelines, start the scan without waiting:
wait_for_results=Falsein Python,waitForResults: falsein TypeScript, or.waitForResults(false)on the Java options. Then read the scan’s results later. See Scan models. - To enforce your own limit, run the scan on a worker thread or task and stop waiting after a deadline, or set a job-level timeout in your CI system.
The scan status is failed
The scan status is failed
failed instead of raising an error.Fix: Read the report to find which files failed and why. Pass the scan ID as the first argument:Python on Windows: errors writing to /tmp
Python on Windows: errors writing to /tmp
scan_s3_model and scan_azure_blob_model always download to /tmp, and scan_huggingface_model downloads to /tmp/<repo_id> by default. That path may not exist on Windows. The TypeScript scans use the operating system’s temporary directory instead.Fix: For Hugging Face models, pass a Windows path as local_dir. For S3 and Azure, download the file yourself and call scan_file, or run the scan from WSL or a Linux container.Warnings in your output
[BETA] ... This endpoint is not GA or Production ready
[BETA] ... This endpoint is not GA or Production ready
hiddenlayer.BetaWarning through Python’s warnings module, with console.warn in TypeScript, or through the java.util.logging logger com.hiddenlayer.api.lib.BetaWarning in Java. The Runtime v2 evaluation endpoints are not beta and don’t warn.Fix: Review what beta status means in Version compatibility and upgrades. If you accept the risk, hide the warning:- Python
- TypeScript
- Java
Debug checklist
If your problem is not listed above, work through these steps. They collect the information support needs.Check the SDK version
mvn dependency:tree -Dincludes=com.hiddenlayer.api. Compare the version with the latest release on PyPI, npm, or Maven Central.
Check environment variables
This script reports whether each variable the SDKs read is set, without printing secret values:HIDDENLAYER_CLIENT_ID and HIDDENLAYER_CLIENT_SECRET, or HIDDENLAYER_TOKEN. If both kinds are set, the token wins. HIDDENLAYER_BASE_URL is used only when the code sets no region or base URL. The SDKs no longer read HIDDENLAYER_LOG or HIDDENLAYER_CUSTOM_HEADERS.
Turn on debug logging
The SDKs’ logging is silent by default. To log each request, configure the client with thedebug level and turn off silent:
debug level, the SDKs log each request’s method, URL, and headers, and each response’s status code. TypeScript and Java also log the response headers. They replace credentials, such as the Authorization request header and Set-Cookie response headers, with [REDACTED], and they don’t log request or response bodies.
Python’s default logger writes through the standard logging module, under the logger name fern, and prints only each message, such as DEBUG - Making HTTP request. To see the method, URL, and headers, pass your own logger in the configuration (logging={"level": "debug", "silent": False, "logger": my_logger}). It needs debug, info, warn, and error methods, and receives the details as keyword arguments.
Inspect raw response headers
Response headers can explain what happened, for example whether a request was blocked or rate limited. They also carry the correlation ID (x-correlation-id) that support can use to find the request. Use the raw-response accessor to read them, or read them from the error:
Contact support
If you still need help, contact HiddenLayer through the Support Portal. Include:- The SDK, its version, and the language runtime version (Python, Node.js, or Java)
- The region (
prod-usorprod-eu) or base URL - The full error type and message
- Relevant IDs, such as a scan ID, workflow ID, evaluation ID, or the correlation ID from the response headers
- Debug logs with secrets and sensitive data removed

