Embeddings
Creates embeddings from the input text, PDF, HTML, EML, MBOX, MS Office document or image.#
/lmkit/v1/embeddingsProcesses the provided content to produce dense vector representations (embeddings) using the specified or default embeddings model. Optional parameters, such as model choice, can be provided. Returns an array of float vectors, one per input item, matching the dimensionality of the chosen model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/ for status and results.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
model | string | The identifier of the language model to be used for embedding generation. If not provided, the default model is used. |
inputrequired | string[] | The input data for embedding generation. Can be one or more plain text strings or base64-encoded files, according to the specified input format. |
input_format | The format of the input data. Acceptable values are 'PlainText' or 'Base64EncodedFile'. In 'Base64EncodedFile' mode, supported types include HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF. Defaults to 'PlainText'. | |
embedding_mode | The embedding mode. 'Passage' (default) embeds input as documents for storage and indexing. 'Query' embeds input as search queries, automatically applying a model-specific instruction prefix for models that support asymmetric embeddings (e.g., Qwen3 Embedding, Nomic Embed, BGE v1.5). Only applicable when input_format is 'PlainText'. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 400 | Bad Request | |
| 404 | Not Found | |
| 500 | application/json | Internal Server Error |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/embeddings" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "",
"input": [
"string"
],
"input_format": "PlainText",
"embedding_mode": "Passage"
}'