---
title: openai_embeddings
latest-connect-version: 4.118.0
latest-operator-version: v26.2.6
latest-console-tag: v3.14.0
latest-redpanda-tag: v26.2.7
docname: processors/openai_embeddings
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: processors/openai_embeddings.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/components/pages/processors/openai_embeddings.adoc
description: Generates vector embeddings to represent input text, using the OpenAI API.
page-cloud-available: "true"
page-cloud-available-url: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_embeddings/
page-git-created-date: "2024-08-15"
page-git-modified-date: "2026-10-29"
page-generated-sources:
  - include: connect:components:partial$descriptions/processors/openai_embeddings.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$availability/processors/openai_embeddings.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$fields/processors/openai_embeddings.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$examples/processors/openai_embeddings.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
page-generated-content: partial
---

# openai_embeddings

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

<!-- Source: https://docs.redpanda.com/connect/components/processors/openai_embeddings.md -->

Generates vector embeddings to represent input text, using the OpenAI API.

Introduced in version 4.32.0.

This processor sends text strings to the OpenAI API, which generates vector embeddings. By default, the processor submits the entire payload of each message as a string, unless you use the `text_mapping` configuration field to customize it.

To learn more about vector embeddings, see the [OpenAI API documentation](https://platform.openai.com/docs/guides/embeddings).

#### Common

```yml
processor:
  label: ""
  openai_embeddings:
    server_address: https://api.openai.com/v1
    api_key: "" # No default (required)
    model: "" # No default (required)
    text_mapping: "" # No default (optional)
    dimensions: 0 # No default (optional)
```

#### Advanced

```yml
processor:
  label: ""
  openai_embeddings:
    server_address: https://api.openai.com/v1
    api_key: "" # No default (required)
    model: "" # No default (required)
    text_mapping: "" # No default (optional)
    dimensions: 0 # No default (optional)
```

## Fields

### `api_key`

The API secret key for OpenAI API.

> ⚠️ **CAUTION**
>
> This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Secrets](https://docs.redpanda.com/connect/configuration/secrets/).

**Type**: `string`

### `dimensions`

The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.

Requires version 4.34.0 or later.

**Type**: `int`

### `model`

The name of the OpenAI model to use.

**Type**: `string`

```yaml
# Examples:
model: text-embedding-3-large

# ---

model: text-embedding-3-small

# ---

model: text-embedding-ada-002
```

### `server_address`

The OpenAI API endpoint to which the processor sends requests. Update the default value to use a different OpenAI-compatible service.

**Type**: `string`

**Default**: `https://api.openai.com/v1`

### `text_mapping`

A Bloblang mapping that returns the text you want to generate vector embeddings for. By default, the processor submits the entire payload of each message as a string.

**Type**: `string`

## Examples

### Store embedding vectors in Pinecone

Computes embeddings for some generated data and stores them in [Pinecone](https://docs.redpanda.com/connect/components/outputs/pinecone/).

```yaml
input:
  generate:
    interval: 1s
    mapping: |
      root = {"text": fake("paragraph")}
pipeline:
  processors:
  - openai_embeddings:
      model: text-embedding-3-large
      api_key: "${OPENAI_API_KEY}"
      text_mapping: "root = this.text"
output:
  pinecone:
    host: "${PINECONE_HOST}"
    api_key: "${PINECONE_API_KEY}"
    id: "root = uuid_v4()"
    vector_mapping: "root = this"
```

### Store embedding vectors in CyborgDB

Computes embeddings for some generated data and stores them in [CyborgDB](https://docs.redpanda.com/connect/components/outputs/cyborgdb/).

```yaml
input:
  generate:
    interval: 1s
    mapping: |
      root = {"text": fake("paragraph")}
pipeline:
  processors:
  - openai_embeddings:
      model: text-embedding-3-large
      api_key: "${OPENAI_API_KEY}"
      text_mapping: "root = this.text"
output:
  cyborgdb:
    host: "${CYBORGDB_HOST}"
    api_key: "${CYBORGDB_API_KEY}"
    index_key: "${CYBORGDB_INDEX_KEY}"
    index_name: "my_encrypted_index"
    operation: "upsert"
    id: "root = uuid_v4()"
    vector_mapping: "root = this"
```