SuiteScript
NetSuite 2025.2
2026-08-25

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.

Affects:SuiteScript 2.1N/documentCaptureN/llmServer Scripts

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

  1. Search your codebase for any calls to documentCapture.getRemainingFreeUsage (both sync and promise variants).
  2. Add N/llm to your define dependency array if it is not already loaded:
    define(['N/llm'], function(llm) { ... })
  3. Replace each call with the equivalent llm.getRemainingUsage() or llm.getRemainingUsage.promise().
  4. 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.
  5. Remove the N/documentCapture dependency from any script that loaded it solely for this method.
  6. Test in sandbox before promoting — the deprecated method still works today but Oracle has flagged it for removal, so do not defer the migration.