Embeddings
Embeddings
@toothfairyai/sdk@latest…Embeddings Management Module Handles embeddings operations for document vectors.
Accessed via client.embeddings.
Methods
| Method | HTTP | Endpoint |
|---|---|---|
get | GET | GET /embedding/get |
list | GET | GET /embedding/list |
getByDocument | — | derived |
create | POST | POST /embedder |
delete | DELETE | DELETE /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
embeddingsendpoint alias; the canonical API operation is/embedder.
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
workspaceid | string | yes | Unique workspace identifier |
contents | array<object> | yes | Text content to embed |
Response fields
| Field | Type | Description |
|---|---|---|
contents | array<object> | Embedding results for each input |
workspaceid | string | Associated 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');