llm.embed Parameters in NetSuite 2026.1: Inputs, Dimensions, OCI, Timeout, and Truncation

Use this developer reference to configure every documented llm.embed option introduced or available in NetSuite 2026.1. It covers required inputs, embedding dimensions, Cohere model selection, per-script OCI credentials, timeouts, truncation, examples, and verification.

·7 min read·By NetSuite Changelog

The llm.embed parameters NetSuite 2026.1 developers need include controls for embedding dimensions, model selection, OCI Generative AI access, timeout, and input truncation. options.inputs is required; the other documented options let a script configure its embedding request.

TL;DR: Call llm.embed() with an options.inputs array. NetSuite 2026.1 documents options.dimensions from 1 to 1536, options.embedModelFamily, options.ociConfig, a millisecond-based options.timeout that defaults to 30 seconds, and options.truncate for inputs exceeding 512 tokens. The supported Cohere Embed v4.0 model has a default output of 1536 dimensions.

Key takeaways

  • options.inputs is required and is an array of strings.
  • options.dimensions accepts values from 1 to 1536; the supported Cohere Embed v4.0 model defaults to 1536 dimensions.
  • If options.embedModelFamily is omitted, the default is the Cohere Embed model (cohere.embed-v4.0).
  • Values in options.ociConfig supersede corresponding configuration on the AI Preferences page within NetSuite.
  • options.timeout defaults to 30 seconds, and options.truncate specifies a method from llm.Truncate for inputs exceeding 512 tokens.

What changed for llm.embed in NetSuite 2026.1?

Starting in NetSuite 2026.1, the SuiteScript LLM embedding feature includes parameters intended to enhance OCI Generative AI integration. The documented 2026.1 update specifically added options.dimensions to llm.embed(options), allowing developers to specify the number of dimensions for returned embeddings.

The documented option set covers input strings, dimension selection, model-family selection, OCI configuration, response waiting time, and truncation for oversized inputs. For background on where embedding calls fit into SuiteScript, see the N/llm module overview for NetSuite generative AI integration.

The official NetSuite reference is the source for the parameter behavior summarized here.

llm.embed parameter reference

The following table summarizes the SuiteScript llm.embed() options covered by the NetSuite 2026.1 material. options.inputs is required. The remaining options are optional.

Parameter Type Required? Purpose and documented behavior
options.inputs string[] Yes An array of input strings for which to get embeddings.
options.dimensions number No Sets returned embedding dimensions from 1 to 1536. The supported model defaults to 1536.
options.embedModelFamily string No Defines the model family. The default is the Cohere Embed model (cohere.embed-v4.0).
options.ociConfig Object No Supplies OCI Generative AI configuration for unlimited access through an Oracle Cloud account. Supplied values supersede corresponding AI Preferences settings.
options.timeout number No Sets the maximum response wait in milliseconds. The default is 30 seconds.
options.truncate string No Selects an llm.Truncate method for inputs that exceed 512 tokens.

When a script specifies options.dimensions, the returned embedding dimension count follows that setting. Keep the selected count in mind wherever the returned embeddings are used.

Prerequisites

Before implementing a NetSuite 2026.1 llm.embed() call, decide whether the script will use documented defaults or explicit request options. The examples use an llm reference and focus only on the options described in the 2026.1 parameter material.

Prepare the following information before adding options.ociConfig:

  • The Oracle Cloud compartment identified by compartmentId.
  • An endpointId when using a custom AI cluster.
  • The tenancy and user OCIDs supplied through tenancyId and userId.
  • A fingerprint represented by a NetSuite secret.
  • A privateKey represented by a NetSuite secret.

Also select a dimension count if the 1536-dimension default is not appropriate, and select an llm.Truncate method if input strings can exceed 512 tokens. If usage is relevant to request scheduling, the synchronous free embedding usage method and promise-based free embedding usage syntax provide related SuiteScript patterns.

How do you configure options.inputs and options.dimensions?

  1. Build options.inputs as an array of strings. Even one value is passed as an array, such as inputs: ["Hello World!"].
  2. Choose a dimension count from 1 to 1536 when the default is not appropriate.
  3. Add dimensions as a number, such as dimensions: 512.
  4. Omit options.dimensions to use the supported model's documented 1536-dimension default.

Here is the example from the NetSuite 2026.1 parameter material:

const response = llm.embed({
  inputs: ["Hello World!"],
  embedModelFamily: llm.EmbedModelFamily.COHERE_EMBED,
  dimensions: 512
});

This example uses one input string, selects llm.EmbedModelFamily.COHERE_EMBED, and specifies 512 dimensions. To use the documented 1536-dimension default, omit dimensions: 512. The documented range is 1 to 1536.

How does model selection work with Cohere Embed v4.0?

options.embedModelFamily is an optional string that defines the model family used for the request. When it is omitted, the default is the Cohere Embed model (cohere.embed-v4.0). The supplied example selects the Cohere family with llm.EmbedModelFamily.COHERE_EMBED.

options.embedModelFamily and options.dimensions control separate documented settings: model family and returned dimension count. For the current Cohere Embed v4.0 model described in the source material, the default is 1536 dimensions. A call that needs 512 dimensions includes dimensions: 512.

The supplied 2026.1 material identifies llm.EmbedModelFamily.COHERE_EMBED and the default cohere.embed-v4.0. It does not identify other model-family values.

How do you configure options.ociConfig for OCI Generative AI?

options.ociConfig is an optional object for unlimited access through the OCI Generative AI service, allowing integration with Oracle Cloud accounts. Values supplied in this object supersede corresponding settings on the AI Preferences page within NetSuite.

Use these documented sub-parameters:

Sub-parameter Requirement or purpose
compartmentId Identifies the compartment within the Oracle Cloud.
endpointId Required for custom AI clusters.
fingerprint Only NetSuite secrets are acceptable for this parameter.
privateKey Must be a NetSuite secret.
tenancyId Required OCID for tenancy identification.
userId Required OCID for user identification.

Configure the object with the applicable compartmentId, tenancy OCID, and user OCID. Include endpointId for a custom AI cluster. For fingerprint and privateKey, use NetSuite secrets rather than exposed credential material.

Security requirement for fingerprint and privateKey

Only NetSuite secrets are acceptable for fingerprint, and privateKey must also be a NetSuite secret. Do not hard-code exposed credential material in these properties.

The source material does not provide a secret-creation path or a secret identifier format. This reference therefore does not prescribe an account-specific secret setup.

How do timeout and truncation work?

options.timeout defines the maximum waiting time for the LLM response in milliseconds. It is optional and defaults to 30 seconds, which is 30000 milliseconds.

options.truncate applies when input strings exceed 512 tokens. Its value is a defined method from the llm.Truncate enumeration. The supplied material does not name individual enumeration members, so this reference does not substitute a string value.

Complete OCI-enabled llm.embed example

The following example shows the documented options without supplying account-specific OCIDs, endpoint identifiers, or secret values. Include endpointId when the request uses a custom AI cluster.

function createEmbedding(
  inputText,
  compartmentId,
  endpointId,
  fingerprintSecret,
  privateKeySecret,
  tenancyId,
  userId,
  truncateMode
) {
  const response = llm.embed({
    inputs: [inputText],
    dimensions: 512,
    embedModelFamily: llm.EmbedModelFamily.COHERE_EMBED,
    ociConfig: {
      compartmentId: compartmentId,
      endpointId: endpointId,
      fingerprint: fingerprintSecret,
      privateKey: privateKeySecret,
      tenancyId: tenancyId,
      userId: userId
    },
    timeout: 30000,
    truncate: truncateMode
  });

  return response;
}

The example specifies 512 dimensions, the Cohere model-family enumeration, OCI configuration, an explicit 30-second timeout, and a caller-supplied truncation value. fingerprintSecret and privateKeySecret must be acceptable NetSuite secrets.

Best practices for NetSuite 2026.1 embedding calls

Start with documented defaults unless an implementation needs an explicit setting. Omitting options.dimensions uses the current 1536-dimension default; specifying a valid value makes the requested dimension count explicit.

Keep OCI overrides deliberate. Since options.ociConfig supersedes corresponding AI Preferences settings, review the values passed in the request when investigating an OCI-enabled embedding call.

For inputs that can exceed 512 tokens, select a valid llm.Truncate method. NetSuite's AI Unit estimates by generative AI feature provide related context when embedding volume is part of deployment planning.

How to confirm it worked

Run a call with a known input such as "Hello World!". In the 512-dimension example, confirm that the returned embedding uses the requested 512 dimensions. When options.dimensions is omitted, the supported Cohere Embed v4.0 model's documented default is 1536 dimensions.

For an OCI-enabled call, review the supplied compartmentId, tenancyId, userId, and, where applicable, endpointId. Confirm that fingerprint and privateKey are provided as NetSuite secrets. Because options.ociConfig supersedes corresponding AI Preferences settings, evaluate the request using the values supplied in the script.

Related reading

FAQ

Which parameter is required when calling llm.embed()?

options.inputs is required. It is an array of input strings for which to get embeddings.

What values does options.dimensions accept?

options.dimensions accepts numeric values from 1 to 1536. The supported Cohere Embed v4.0 model defaults to 1536 dimensions when the parameter is omitted.

How do I select the embedding model in NetSuite 2026.1?

Use options.embedModelFamily. When it is omitted, the default is the Cohere Embed model (cohere.embed-v4.0). The documented example uses llm.EmbedModelFamily.COHERE_EMBED.

Which OCI configuration fields must use NetSuite secrets?

Both fingerprint and privateKey must use NetSuite secrets.

What happens to inputs longer than 512 tokens?

Use options.truncate to specify how inputs exceeding 512 tokens should be truncated. The value must be a defined method from the llm.Truncate enumeration.