OpenAI · Embeddings
Creates an embedding for the provided input.#
/v1/embeddingsGenerates embeddings for the given input text or array of texts and returns an EmbeddingResponse containing the generated embeddings.
This endpoint implements the OpenAI embeddings API specification. For complete reference, please see the official OpenAI documentation: https://platform.openai.com/docs/api-reference/embeddings/create
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 IF of the model used for embeddings. If not specified, the default model will be used. |
inputrequired | object | Input text to embed. Can be a string or an array (of strings, integers, or arrays of integers). |
encoding_format | string | The format to return the embeddings in. Can be either "float" or "base64". Defaults to "float". |
dimensions | object (int32) | The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. |
user | string | A unique identifier representing your end-user, which can help OpenAI monitor and detect abuse. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 400 | Bad Request | |
| 500 | application/json | Internal Server Error |
| 404 | Not Found |
curl -X POST "$LMKIT_ONE_URL/v1/embeddings" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "string",
"input": {},
"encoding_format": "string",
"dimensions": "string",
"user": "string"
}'