N/documentCapture getRemainingFreeUsage Deprecated in Favor of N/llm getRemainingUsage
The documentCapture.getRemainingFreeUsage() and its promise variant are deprecated. Scripts should migrate to llm.getRemainingUsage.promise(), which returns remaining AI Units instead of a vague "free usage" count.
What changed
The method documentCapture.getRemainingFreeUsage.promise() (and its synchronous counterpart documentCapture.getRemainingFreeUsage()) in the N/documentCapture module is now deprecated as of 2025.2. Oracle warns it may be removed in a future release.
Under the hood, this method already delegates to llm.getRemainingUsage.promise() from the N/llm module. The return value represents the number of AI Units remaining — a rename that aligns the metric with Oracle's broader AI-unit-based metering across the platform.
Details
- Module: N/documentCapture
- Deprecated method (async):
documentCapture.getRemainingFreeUsage.promise() - Deprecated method (sync):
documentCapture.getRemainingFreeUsage() - Replacement (async):
llm.getRemainingUsage.promise() - Replacement (sync):
llm.getRemainingUsage() - Supported script types: Server scripts only
- Governance: None
What to do
- Search your codebase for any calls to
documentCapture.getRemainingFreeUsage(both sync and promise variants). - Add
N/llmto yourdefinedependency array if it is not already loaded:define(['N/llm'], function(llm) { ... }) - Replace each call with the equivalent
llm.getRemainingUsage()orllm.getRemainingUsage.promise(). - Note that the return value now explicitly represents AI Units remaining. If your code previously interpreted the number as "free usage credits" and applied different logic around that concept, verify the semantics still hold.
- Remove the
N/documentCapturedependency from any script that loaded it solely for this method. - Test in sandbox before promoting — the deprecated method still works today but Oracle has flagged it for removal, so do not defer the migration.
Source: Oracle NetSuite Release Notes