Text-to-Embedding
Text-to-Embedding converts text into vector representations for semantic search and similarity. The API returns embedding vectors along with a task ID to track processing.
Endpoint for requesting text to embedding inference
application/jsonPossible values: Input text(s) to generate embeddings for. Can be a single string or array of strings (max 2048 items). Each input limited to 8192 tokens, total request limited to 300k tokens.
This is a sample text for embedding generation.["First text for embedding","Second text for embedding","Third text"]The embedding model to use. Available models can be retrieved via the GET /api/v1/client/models endpoint.
Bge_M3_FP16If true, the embedding result will be returned directly in the response instead of only download url. Optional parameter.
falseExample: falseID of the inference request.
Unauthorized user.
Unauthorized user.
POST /api/v1/client/txt2embedding HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: application/json
Content-Type: application/json
Content-Length: 115
{
"input": "This is a sample text for embedding generation.",
"model": "Bge_M3_FP16",
"return_result_in_response": false
}{
"data": {
"request_id": "c08a339c-73e5-4d67-a4d5-231302fbff9a"
}
}Endpoint for calculating price for text to embedding inference
application/jsonPossible values: Input text(s) to generate embeddings for. Can be a single string or array of strings (max 2048 items). Each input limited to 8192 tokens, total request limited to 300k tokens.
This is a sample text for embedding generation.["First text for embedding","Second text for embedding"]The embedding model to use. Available models can be retrieved via the GET /api/v1/client/models endpoint.
Bge_M3_FP16Calculated price for txt2embedding inference.
Unauthorized user.
Unauthorized user.
POST /api/v1/client/txt2embedding/price-calculation HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: application/json
Content-Type: application/json
Content-Length: 81
{
"input": "This is a sample text for embedding generation.",
"model": "Bge_M3_FP16"
}{
"data": {
"price": 0.0003
}
}Last updated