Embeddings
The embeddings creation request.
ID of the model to use. Call /v1/models endpoint to get the list of available models, only text-embeddings-inference model type is supported.
Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (call /v1/models endpoint to get the max_context_length by model) and cannot be an empty string.
The number of dimensions the resulting output embeddings should have.
The format of the output embeddings.
floatPossible values: Successful Response
The type of object returned.
listA unique identifier for the request.
Insufficient budget.
Invalid authentication scheme.
Invalid API key.
Your account has expired. Please contact support to renew your account.
Model {name} not found.
Model has wrong type. Expected: {expected_type}. Actual: {actual_type}.
Token/request limit per minute/day exceeded.
Model is too busy, please try again later.
POST /v1/embeddings HTTP/1.1
Host: albert.api.etalab.gouv.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 106
{
"model": "text",
"input": [
1
],
"dimensions": 1,
"encoding_format": "float",
"ANY_ADDITIONAL_PROPERTY": "anything"
}{
"data": [
{
"embedding": [
1
],
"index": 1,
"object": "text",
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"model": "text",
"object": "list",
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"cost": 0,
"impacts": {
"kWh": 0,
"kgCO2eq": 0,
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"id": "text",
"ANY_ADDITIONAL_PROPERTY": "anything"
}Last updated
Was this helpful?