Embeddings
POST/v1/embeddings
Follows the exact same API spec as OpenAI's Embeddings API https://platform.openai.com/docs/api-reference/embeddings
Request
- application/json
Body
required
- MOD1
- MOD2
Array [
]
ID of the model to use
input
object
required
Input text to embed
oneOf
A single input text
string
An array of input texts
string
The format to return the embeddings in
Possible values: [float, base64]
floatResponses
- 200
- 400
Successful Response
- application/json
- Schema
- Example (from schema)
- Float encoding (default)
- Base64 encoding (default)
Schema
Array [
]
The object type, which is always 'list'
Possible values: [list]
data
object[]
required
The list of embeddings generated
The object type
Possible values: [embedding]
The embedding vector
The index of the embedding in the list
The model used to generate the embeddings
usage
object
required
The number of tokens in the output (always 0)
The number of tokens in the input
The total number of tokens used
Dettaglio dei token (oggetto) oppure null se non disponibile.
Dettaglio dei token (oggetto) oppure null se non disponibile.
{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
0
],
"index": 0
}
],
"model": "string",
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0,
"completion_tokens_details": {},
"prompt_tokens_details": {}
}
}
{
"model": "bge-m3",
"data": {
"embedding": "UMgBvXXHAz0LrEO95qlI...",
"index": "0,",
"object": "embedding"
},
"object": "list",
"usage": {
"completion_tokens": 0,
"prompt_tokens": 44,
"total_tokens": 44,
"completion_tokens_details": null,
"prompt_tokens_details": null
}
}
Bad request Error when passing an invalid or non-existing model name or an invalid enum or an invalid type in a field
- application/json
- Schema
- Example (from schema)
Schema
error
object
required
Error returned as response for invalid or missing model name
{
"error": {
"message": "string",
"type": "string",
"param": "string",
"code": "string"
}
}