Skip to main content

Embeddings

Embeddings

@toothfairyai/sdk@latest…

Embeddings Management Module Handles embeddings operations for document vectors.

Accessed via client.embeddings.

Methods

MethodHTTPEndpoint
getGETGET /embedding/get
listGETGET /embedding/list
getByDocumentderived
createPOSTPOST /embedder
deleteDELETEDELETE /embedding/delete/{id}

get

Get embeddings for a specific document

async get(documentId?: string)

Endpoint: GET /embedding/get · API service

Example

const result = await client.embeddings.get();

list

List all embeddings in the workspace

async list(limit?: number, offset?: number)

Endpoint: GET /embedding/list · API service

Example

const result = await client.embeddings.list();

getByDocument

Get embeddings by document ID

async getByDocument(documentId: string)

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

const result = await client.embeddings.getByDocument('agent-id');

create

Create embeddings for text

async create(text: string, metadata?: Record<string, any>)

Endpoint: POST /embedder · AI service

The SDK routes this call via its internal embeddings endpoint alias; the canonical API operation is /embedder.

Request fields

FieldTypeRequiredDescription
workspaceidstringyesUnique workspace identifier
contentsarray<object>yesText content to embed

Response fields

FieldTypeDescription
contentsarray<object>Embedding results for each input
workspaceidstringAssociated workspace identifier

Example

const result = await client.embeddings.create('…');

delete

Delete embeddings for a document

async delete(documentId: string): Promise<

Endpoint: DELETE /embedding/delete/{id}

Field-level schema not available in the API spec for this endpoint.

Example

const result = await client.embeddings.delete('agent-id');