Skip to main content
日本語
This guide walks through the main features of the Limina API. It focuses on pure text applications, but can extend to processing files.
This guide uses Limina’s cloud API. Get a free API key to run the examples.If you’re using the container instead, follow the container quickstart and replace the endpoint with http://localhost:8080.

Basic Use

The process/text endpoint accepts a list of text strings and replaces each piece of PII found with a redaction marker. A simple request looks like this:
The response contains two main outputs:
  • processed_text, the redacted, masked or synthetic text as defined by processed_text in the input
  • entities, a list of each PII found, which is useful for PII detection and NER (Named Entity Recognition)
Response
If the elements in the list of strings are related, the link_batch parameter can be used to share context throughout the list.
This ensures that the inputs are joined before going to the PII detection system. This way the model sees My phone number is 2345435 instead of My phone number is and 2345435 as two unrelated messages. This allows the phone number to be identified correctly.

Customizing Entity Detection With Selective Redaction

The above example identifies and removes all non-beta entity types. Granular control over entity detection and redaction can be set using Entity Selectors. For example, to only redact the SSN:
The result of this selective redaction is below:

Adding Allow & Block Lists

You can also customize PII detection and redaction using enable/disable Entity Selectors or regex-based Filters, enabling custom handling for company-specific identifiers such as employee IDs or internal database IDs. The example below shows how to combine Entity Selectors with Filters for fine-grained control. In this HR claim scenario, an employee reports a medical injury and requests accommodation. Here, we demonstrate:
  • Two regex-based block filters defining custom entity types for employee IDs and business units, overriding Limina’s defaults.
  • Disabling the injury entity, which may be required for insurance-related workflows.
  • Using a list for the text payload, as expected in conversational contexts, and enabling link_batch to maintain redaction context across the full thread.
  • Disabling numbering of redaction markers.
The above request yields this response:
Redacted Text

Generating Synthetic Entities (Beta)

In addition to replacing PII with redaction markers, tokens, or masks, Limina can generate synthetic PII; realistic fake replacements created with an ML model that fit the surrounding context. This offers several advantages:
  • Synthetic PII preserves most of the original text, reducing the risk of introducing bias compared to generators that create entirely new data, and improving utility for downstream tasks like sentiment analysis.
  • Even though our PII detection engine leads the market, it isn’t perfect. Synthetic PII ensures that any PII detection misses are hidden amongst realistic, fake PII, strengthening protection against re-identification.
  • Synthetic entities resemble natural language more closely than redaction markers or hashes, minimizing disruption to downstream ML systems. To enable synthetic PII generation, set the processed_text object’s marker type to SYNTHETIC in your API request.
Yields the following response: