Embed a text with an embedding model
POST/embedding-models/:embedding_model_id/query
Converts one text into a vector with the embedding model and returns the vector. Client applications use this operation to test an embedding model. The vector has size numbers, one for each dimension of the embedding model. Foundation4 embeds the text as given, with no prefix or instruction. The first request for an embedding model on each API server instance loads the model.
Permissions. Read and execute on the embedding model.
Request
Responses
- 200
- 400
- 401
- 404
- 500
The text was converted. The body is a JSON array of numbers whose length equals the size of the embedding model.
The API server cannot load the embedding model, for example because the model files are missing (Invalid parameter). details.error holds the reason.
The authentication headers are missing or invalid, or the API key is inactive or expired. Errors lists the messages.
No embedding model with this identifier exists, or the key lacks read and execute permission on the embedding model (Embedding model not found). details.id holds the identifier.
The embedding model failed to convert the text, for example because the gRPC service or the model server is unreachable (Internal error). details.error holds the cause.