Reference · Tools

OpenAI Embeddings

Generate vector embeddings using OpenAI embedding models.

Action AI v1

OpenAI Embeddings turns text into a dense float vector using whichever OpenAI embedding model you select, writing one vector per input item into a configurable field along with model and token usage metadata. A typical build is embedding a document corpus to power semantic search.

Node type
Action
Parameters
5
Outputs
Output, Error
Credentials
OpenAI

OpenAI Embeddings

Generate vector embeddings using OpenAI embedding models.

Overview

OpenAI Embeddings uses the Embeddings API (POST /embeddings) to generate dense vector representations of text. The Model dropdown lists the OpenAI embedding models currently available to the workspace, trading vector quality against cost and storage size. Configurable output dimensions for the v3 embedding models. Each input item produces a float embedding vector placed in a configurable output field, along with model and usage metadata.

Category: AI
Tool Name: openai_embeddings
Version: 1

Appearance: Icon: openai | Color: #10a37f

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires OpenAI credentials. See the Credentials Guide for setup instructions.

Parameters

ParameterTypeRequiredDefaultDescription
ModeloptionsNo(current default)The OpenAI embedding model to use. Always uses the latest version (auto-updated).
Options: the OpenAI embedding models available to your workspace — pick one from the dropdown.
TextstringYesThe text to generate an embedding for. If empty, falls back to item.json.text. Supports expressions.
OptionscollectionNo{}Optional embedding settings — add only the fields you need.
— DimensionsnumberNoOutput vector dimensions. Supported by the v3 embedding models; older non-v3 models ignore it. Lower values reduce storage cost with minimal quality loss.
— Response Field NamestringNoembeddingField name in the output JSON where the embedding vector will be placed.
Include InputbooleanNofalseWhether to include the original input item fields in the output alongside the embedding.
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

One output item per input item. The vector lands on the field named by Response Field Name (embedding by default), with model and usage beside it. The rest of the input item JSON is dropped unless Include Input is on; binary data on the input item is forwarded unchanged.

{
  "embedding": [0.0123, -0.0456, 0.0789],
  "model": "the embedding model that was used",
  "usage": { "prompt_tokens": 12, "total_tokens": 12 }
}
  • The vector is a plain array of floats. Its length is the model’s native size unless you set Dimensions.
  • Turn Include Input on when you are writing vectors to a store and need the source text or an ID to travel with them.

Reference the result downstream by expression, e.g. {{ $json.embedding }}.

Usage Examples

  • Generate embeddings for text chunks for vector search
  • Embed product descriptions for similarity lookup
  • Create reduced-dimension vectors to cut storage cost
  • Vectorize documents for semantic similarity comparison
  • Embed search queries for nearest-neighbor lookup

Example Configuration

Embed the text field of each incoming item:

{
  "type": "openai_embeddings",
  "parameters": {
    "text": "{{ $json.text }}"
  }
}

Embed document chunks at reduced dimensions, keeping the source fields:

{
  "type": "openai_embeddings",
  "parameters": {
    "text": "{{ $json.chunk }}",
    "includeInput": true,
    "maxConcurrency": 20,
    "options": {
      "dimensions": 256,
      "responseFieldName": "vector"
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

OpenAI Embeddings converts text into dense float vectors using whichever OpenAI embedding model is picked in the Model dropdown. Use it when your workflow requires semantic search, similarity matching, or retrieval-augmented generation that depends on vector representations of text. Each input produces a float embedding vector written to a configurable output field, plus model name and token usage metadata on the main output.

Frequently asked questions

How many calls does indexing a corpus cost?

One per input item, so a large corpus is a large number of calls. For bulk indexing, OpenAI Batch is the cheaper route.

Where does the vector go?

Into a configurable output field, alongside the model name and token usage — so it can be written straight into whatever vector store you use.

Which model should I choose?

Whichever suits your cost and quality target from the Model dropdown. What matters most is consistency: query and corpus must be embedded with the same model to be comparable.

Which credential does it need?

An OpenAI credential.

Build with the OpenAI Embeddings node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need OpenAI credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.