Authentication and licensing
Most real deployments use licensed models exported from the DENKweit Vision AI Hub. To run them, you need a personal access token and a suitable license source.
Step 1: Create a personal access token
- Open the Integration Page.
- Create a service user or select an existing one.
- Generate a PAT for that service user.
- Store the PAT securely. It will only be shown once.
Treat the PAT like a password.



Step 2: Choose a license mode
HubLicenseSource
Use this when the target system can stay online.
- Python
- C / C++
from denkflow import HubLicenseSource
license_source = HubLicenseSource.from_pat(
"YOUR-PAT",
license_id="YOUR-LICENSE-ID",
)
You can also let Pipeline.from_denkflow(...) build this implicitly by passing pat=.
from denkflow import Pipeline
pipeline = Pipeline.from_denkflow("model.denkflow", pat="YOUR-PAT")
DenkflowHubLicenseSource* license_source = NULL;
handle_error(
denkflow_hub_license_source_from_pat(&license_source, "YOUR-PAT", "YOUR-LICENSE-ID", NULL),
"denkflow_hub_license_source_from_pat"
);
DenkflowPipeline* pipeline = NULL;
handle_error(
denkflow_pipeline_from_denkflow(&pipeline, "model.denkflow", (void*)license_source),
"denkflow_pipeline_from_denkflow"
);
OneTimeLicenseSource
Use this when the deployment must continue working offline after initial activation.
- Python
- C / C++
from denkflow import HubLicenseSource
hub_source = HubLicenseSource.from_pat(
"YOUR-PAT",
license_id="YOUR-LICENSE-ID",
)
license_source = hub_source.to_one_time_license_source()
DenkflowHubLicenseSource* hub_source = NULL;
handle_error(
denkflow_hub_license_source_from_pat(&hub_source, "YOUR-PAT", "YOUR-LICENSE-ID", NULL),
"denkflow_hub_license_source_from_pat"
);
DenkflowOneTimeLicenseSource* license_source = NULL;
handle_error(
denkflow_hub_license_source_to_one_time_license_source(&license_source, &hub_source),
"denkflow_hub_license_source_to_one_time_license_source"
);
Notes:
- Offline activation must be enabled for your license.
- The first activation needs online connectivity.
- The persisted offline state is stored in
DENKFLOW_DATA_DIRECTORY. - If you add new licensed models later, refresh the license while online:
- Python
- C / C++
license_source.refresh()
handle_error(
one_time_license_source_refresh(license_source),
"one_time_license_source_refresh"
);
Step 3: Keep licensing stable in production
For reliable deployments:
- Keep SDK persistent data on a volume that survives restarts. In Docker, the usual approach is to mount a host directory onto the default data path (for Linux as
root,/root/.config/denkflow— the same as$HOME/.config/denkflow). You only need to setDENKFLOW_DATA_DIRECTORYif you choose a non-default path inside the container. - Keep
/etc/machine-idstable in Docker deployments. - Reuse the same persistent volume across restarts.
Which option should you use?
Use HubLicenseSource when:
- the system stays online
- you want the simplest rollout
Use OneTimeLicenseSource when:
- the system must run offline after first activation
- you can guarantee stable persistent storage
Pitfalls
- Using a PAT without access to the required license.
- Persistent state is not actually persistent: the SDK data directory (default or whatever
DENKFLOW_DATA_DIRECTORYpoints to) must be writable and survive restarts — in Docker, typically by mounting a host volume at/root/.config/denkflow(or at your custom path if you setDENKFLOW_DATA_DIRECTORY). - The machine identity changes between restarts: keep
/etc/machine-idstable, especially in Docker deployments. - Adding new licensed models while offline without refreshing the offline license state first.