embed
Endpoint Documentation: /v1/inference/embedding
This endpoint allows you to make a POST request to convert a string into a vector embedding (a List[float]).
Request
- HTTP Method: POST
- URL:
https://api.lamini.ai/v1/inference/embedding
- Headers:
Authorization: Bearer <LAMINI_API_KEY>
Content-Type: application/json
- Example Body (JSON):
Parameters:
prompt
:str
orList[str]
, the string to embedmodel_name
(optional):str
, the name of a base or finetuned model. Default issentence-transformers/all-MiniLM-L6-v2
.
Response
If the web request is successful, you will see a response with an answer to the provided questions like below:
- Success Status Code: 200
- Body (JSON):
Otherwise, the request will return an error code, and the response json will contain specific error details like invalid token or incompatible data.
Example
Request
curl --location 'https://api.lamini.ai/v1/inference/embedding' \
--header 'Authorization: Bearer <LAMINI_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{ "prompt": "How are you? Rate on a scale of 1 to 5." }'