SuiteScript
NetSuite 2025.1
2026-08-25

N/llm getRemainingFreeEmbedUsage Deprecated — Use getRemainingUsage Instead

The llm.getRemainingFreeEmbedUsage() method and its promise variant are deprecated in the N/llm module. Replace all calls with llm.getRemainingUsage(), which returns remaining AI Units.

Affects:SuiteScript 2.1N/llm

What changed

The llm.getRemainingFreeEmbedUsage() method (and its async variant llm.getRemainingFreeEmbedUsage.promise()) in the N/llm module is now deprecated. Oracle has consolidated embed-usage tracking under a broader "AI Units" model. The deprecated method already delegates internally to llm.getRemainingUsage.promise(), so the two return identical values today, but the old method may be removed in a future release.

Key details from the source:

  • Module: N/llm (introduced 2025.1)
  • Script types: Server-side scripts only (Scheduled, Map/Reduce, Suitelet, User Event, RESTlet, etc.)
  • Governance: None — neither the old nor the new method consumes governance units.

The naming shift from "free embed usage" to "remaining usage (AI Units)" reflects Oracle's move to a unified metering concept for all LLM-related calls, not just embeddings. The source does not specify when the deprecated method will be removed; it states only that removal may happen in a future release.

What to do

  1. Search your codebase for any references to getRemainingFreeEmbedUsage — both the synchronous and promise forms. A simple SuiteCloud IDE or file-system search should surface all call sites.
  2. Replace every occurrence:
    • llm.getRemainingFreeEmbedUsage()llm.getRemainingUsage()
    • llm.getRemainingFreeEmbedUsage.promise()llm.getRemainingUsage.promise()
  3. Update any downstream logic that interprets the return value. The value semantics are the same (a number representing remaining units), but if your code labels the value as "free embed" credits in logs or UI, rename those references to "AI Units" for clarity.
  4. Test in Sandbox before deploying to production. Confirm that llm.getRemainingUsage() returns the expected numeric value in your server script context.
  5. Monitor future release notes for the removal timeline. Because Oracle has not committed to a specific version for removal, treat this as a soft deprecation for now — but do not delay the migration.