Embedders
Embedder management.
Methods on this page are called through client.embedders.
client.embedders.create
client.embedders.create(request: EmbeddersCreateRequest, requestOptions?: ProviderApiKeyOptions): Promise<EmbedderResponseShape>Creates a new embedder configuration for vectorizing content. Embedders represent connections to different embedding API services (like OpenAI, vLLM, etc.) and include all the necessary configuration to use them with memory spaces. DUPLICATE DETECTION: Returns HTTP 409 Conflict (ALREADY_EXISTS) if another embedder exists with identical {ownerId, providerType, endpointUrl, apiPath, modelIdentifier, dimensionality, distributionType, credentialsFingerprint} after URL canonicalization. Uniqueness is enforced per-owner, allowing different users to have identical configurations. Credentials are hashed (SHA-256) for uniqueness while remaining encrypted. The apiPath field defaults to '/v2/embed' for Cohere, '/embed' for TEI, and '/embeddings' for other providers when omitted. Requires CREATE_EMBEDDER_OWN permission (or CREATE_EMBEDDER_ANY for admin users).
HTTP: POST /v1/embedders
Parameters
| Parameter | Type | Description |
|---|---|---|
request | EmbeddersCreateRequest | Creation request. Known modelIdentifier values fill provider, endpoint, dimensionality, and modality defaults. |
requestOptions | ProviderApiKeyOptions optional | Provider API key plus per-call signal, timeout, or headers. |
Returns: Promise<EmbedderResponseShape>
Example
const embedder = await client.embedders.create(
{
displayName: "Doc Embedder",
modelIdentifier: "text-embedding-3-small",
labels: { env: "docs" },
},
{ apiKey: "sk-..." },
);client.embedders.delete
client.embedders.delete(id: string, requestOptions?: RequestOptions): Promise<void>Permanently deletes an embedder configuration. This operation cannot be undone and removes the embedder record and securely deletes stored credentials. IMPORTANT: This does NOT invalidate or delete embeddings previously created with this embedder - existing embeddings remain accessible. CONFLICT: Returns HTTP 409 Conflict if the embedder is still referenced by a space. Requires DELETE_EMBEDDER_OWN permission for embedders you own (or DELETE_EMBEDDER_ANY for admin users).
HTTP: DELETE /v1/embedders/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the embedder to delete |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<void>
Example
await client.embedders.delete("your-embedder-id");client.embedders.get
client.embedders.get(id: string, requestOptions?: RequestOptions): Promise<EmbedderResponseShape>Retrieves the details of a specific embedder configuration by its unique identifier. Requires READ_EMBEDDER_OWN permission for embedders you own (or READ_EMBEDDER_ANY for admin users to view any user's embedders). This is a read-only operation with no side effects.
HTTP: GET /v1/embedders/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the embedder to retrieve |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<EmbedderResponseShape>
Example
const fetchedEmbedder = await client.embedders.get("your-embedder-id");
console.log(fetchedEmbedder.displayName);client.embedders.list
client.embedders.list(options?: EmbeddersListOptions, requestOptions?: RequestOptions): Promise<Array<EmbedderResponseShape>>Retrieves a list of embedder configurations accessible to the caller, with optional filtering. LABEL FILTERS: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production). PERMISSION-BASED FILTERING: With LIST_EMBEDDER_OWN permission, you can only see your own embedders (ownerId filter is ignored if set to another user). With LIST_EMBEDDER_ANY permission, you can see all embedders or filter by any ownerId. This is a read-only operation with no side effects.
HTTP: GET /v1/embedders
Parameters
| Parameter | Type | Description |
|---|---|---|
options | EmbeddersListOptions optional | Optional query parameters. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<Array<EmbedderResponseShape>>
Example
for (const emb of await client.embedders.list()) {
console.log(emb.embedderId, emb.displayName);
}client.embedders.update
client.embedders.update(id: string, request: UpdateEmbedderRequest, requestOptions?: RequestOptions): Promise<EmbedderResponseShape>Updates an existing embedder configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated. IMPORTANT: providerType is IMMUTABLE after creation and cannot be changed. CRITICAL: Returns HTTP 412 Precondition Failed (FAILED_PRECONDITION) if attempting to update core fields (dimensionality, distributionType, modelIdentifier) while the embedder is actively referenced by spaces or ingestion jobs. DUPLICATE DETECTION: Returns HTTP 409 Conflict (ALREADY_EXISTS) if the update would create a duplicate embedder with the same provider, endpoint, model, dimensionality, distribution, and credentials for this owner. Requires UPDATE_EMBEDDER_OWN permission for embedders you own (or UPDATE_EMBEDDER_ANY for admin users).
HTTP: PUT /v1/embedders/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the embedder to update |
request | UpdateEmbedderRequest | Request body. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<EmbedderResponseShape>
Example
const updatedEmbedder = await client.embedders.update("your-embedder-id", {
displayName: "Doc Embedder (updated)",
mergeLabels: { version: "2" },
});
console.log(updatedEmbedder.embedderId);Data Models
Enum Values
DistributionType
DENSE, SPARSE
Interfaces
EmbedderCreationRequest
Request body for creating a new Embedder. An Embedder represents a configuration for vectorizing content.
| Field | Type | Required | Description |
|---|---|---|---|
displayName | string | yes | User-facing name of the embedder |
description | string | null | no | Description of the embedder |
providerType | ProviderType | yes | Type of embedding provider |
endpointUrl | string | yes | API endpoint URL |
apiPath | string | null | no | API path for embeddings request (defaults: Cohere /v2/embed, TEI /embed, others /embeddings) |
modelIdentifier | string | yes | Model identifier |
dimensionality | number | yes | Output vector dimensions |
distributionType | DistributionType | yes | Type of embedding distribution (DENSE or SPARSE) |
maxSequenceLength | number | null | no | Maximum input sequence length |
supportedModalities | Array<Modality> | null | no | Supported content modalities (defaults to TEXT if not provided) |
credentials | EndpointAuthentication | null | no | Structured credential payload describing how to authenticate with the provider. Required for SaaS providers; optional for local or proxy providers. |
labels | Record<string, string> | null | no | User-defined labels for categorization |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
ownerId | string | null | no | Optional owner ID. If not provided, derived from the authentication context. Requires CREATE_EMBEDDER_ANY permission if specified. |
embedderId | string | null | no | Optional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use. |
EmbedderResponse
Embedder configuration information
| Field | Type | Required | Description |
|---|---|---|---|
embedderId | string | yes | Unique identifier of the embedder |
displayName | string | yes | User-facing name of the embedder |
description | string | null | no | Description of the embedder |
providerType | ProviderType | yes | Type of embedding provider |
endpointUrl | string | yes | API endpoint URL |
apiPath | string | null | no | API path for embeddings request |
modelIdentifier | string | yes | Model identifier |
dimensionality | number | yes | Output vector dimensions |
distributionType | DistributionType | yes | Type of embedding distribution (DENSE or SPARSE) |
maxSequenceLength | number | null | no | Maximum input sequence length |
supportedModalities | Array<Modality> | yes | Supported content modalities |
credentials | EndpointAuthentication | null | no | Structured credential payload used for upstream authentication |
labels | Record<string, string> | yes | User-defined labels for categorization |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
ownerId | string | yes | Owner ID of the embedder |
createdAt | number | yes | Creation timestamp (milliseconds since epoch) |
updatedAt | number | yes | Last update timestamp (milliseconds since epoch) |
createdById | string | yes | ID of the user who created the embedder |
updatedById | string | yes | ID of the user who last updated the embedder |
ListEmbeddersResponse
Response containing a list of embedders
| Field | Type | Required | Description |
|---|---|---|---|
embedders | Array<EmbedderResponse> | yes | List of embedder configurations |
UpdateEmbedderRequest
Request body for updating an existing Embedder. Only fields that should be updated need to be included. supportedModalities is creation-time only and cannot be changed here.
| Field | Type | Required | Description |
|---|---|---|---|
displayName | string | null | no | User-facing name of the embedder |
description | string | null | no | Description of the embedder |
endpointUrl | string | null | no | API endpoint URL |
apiPath | string | null | no | API path for embeddings request |
modelIdentifier | string | null | no | Model identifier |
dimensionality | number | null | no | Output vector dimensions |
distributionType | DistributionType | null | no | Type of embedding distribution (DENSE or SPARSE) |
maxSequenceLength | number | null | no | Maximum input sequence length |
credentials | EndpointAuthentication | null | no | Structured credential payload describing how to authenticate with the provider |
replaceLabels | Record<string, string> | null | no | Replace all existing labels with these (mutually exclusive with mergeLabels) |
mergeLabels | Record<string, string> | null | no | Merge these labels with existing ones (mutually exclusive with replaceLabels) |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
Response Shapes
Response shape types model values returned by the SDK after forward-compatible unknown enum strings are coerced to null.
EmbedderResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
embedderId | string | yes | Unique identifier of the embedder |
displayName | string | yes | User-facing name of the embedder |
description | string | null | no | Description of the embedder |
providerType | ProviderType | null | yes | Type of embedding provider |
endpointUrl | string | yes | API endpoint URL |
apiPath | string | null | no | API path for embeddings request |
modelIdentifier | string | yes | Model identifier |
dimensionality | number | yes | Output vector dimensions |
distributionType | DistributionType | null | yes | Type of embedding distribution (DENSE or SPARSE) |
maxSequenceLength | number | null | no | Maximum input sequence length |
supportedModalities | Array<Modality | null> | yes | Supported content modalities |
credentials | EndpointAuthenticationResponseShape | null | no | Structured credential payload used for upstream authentication |
labels | Record<string, string> | yes | User-defined labels for categorization |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
ownerId | string | yes | Owner ID of the embedder |
createdAt | number | yes | Creation timestamp (milliseconds since epoch) |
updatedAt | number | yes | Last update timestamp (milliseconds since epoch) |
createdById | string | yes | ID of the user who created the embedder |
updatedById | string | yes | ID of the user who last updated the embedder |
ListEmbeddersResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
embedders | Array<EmbedderResponseShape> | yes | List of embedder configurations |