N/llm getRemainingFreeUsage Deprecated in Favor of getRemainingUsage
The llm.getRemainingFreeUsage() and its async counterpart llm.getRemainingFreeUsage.promise() are deprecated. Replace all calls with llm.getRemainingUsage() / llm.getRemainingUsage.promise(), which returns remaining AI Units instead of a generic "free usage" count.
What changed
The method llm.getRemainingFreeUsage.promise() (and its synchronous counterpart llm.getRemainingFreeUsage()) in the N/llm module is now deprecated. Internally it already delegates to llm.getRemainingUsage.promise(), so the two calls return the same value today — the number of AI Units remaining for the current script execution context.
Oracle has signaled this method may be removed in a future release. No specific sunset version is stated in the documentation, so it could disappear in any upcoming release without further notice.
Terminology shift
The rename from "FreeUsage" to "Usage" reflects Oracle's rebranding of the metering concept. The return value is now described as AI Units remaining rather than a vague "free usage" count. Governance cost for both the old and new methods remains 0 units.
Scope
- Module:
N/llm(available since 2024.1) - Script types: Server-side scripts only (Scheduled, Map/Reduce, Suitelet, User Event, RESTlet, etc.)
- Governance: None
What to do
- Search your codebase for any reference to
getRemainingFreeUsage. Check both.promise()(async) and direct synchronous calls. - Replace every occurrence:
llm.getRemainingFreeUsage()→llm.getRemainingUsage()llm.getRemainingFreeUsage.promise()→llm.getRemainingUsage.promise() - Test that the returned value (AI Units remaining) is handled correctly in your logic. The data type and shape are unchanged, but confirm any logging or threshold checks still make sense under the "AI Units" label.
- Redeploy affected script deployments. No SDF object changes are required — this is a runtime API swap only.
Note: The exact release in which this deprecation took effect is not stated in the documentation. The N/llm module itself was introduced in 2024.1. If you adopted the module early, audit your scripts now rather than waiting for a hard removal.
Source: Oracle NetSuite Release Notes