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
- 422
- 500
- 503
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), or the body is not valid JSON. 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 body has no query string.
The embedding model failed to convert the text, for example because the gRPC service or the model server is unreachable (Internal server error). The API server log records the cause.
The gRPC service lacks the package or the model files that the provider needs (Provider unavailable, with the reason in details.error).