services / text-embed
textoperational · 11 ms
Text Embeddings and Rerank
Sentence embeddings (all-MiniLM-L6-v2, 384 dimensions, L2-normalized, multilingual input works best in English) for semantic search, clustering and deduplication, or rerank mode: pass query + documents to get documents sorted by cosine similarity. Runs locally, texts are not stored. Params: texts (1 to 32 strings, max 2000 chars each) for embed mode, or query + documents (up to 64) and top_k for rerank mode.
Run free trial ↗3 free calls per day with the example input. Paid: $0.002 USDC, no limit.
Call it
Input
| Field | Type | Description |
|---|---|---|
| texts | array | |
| query | string | |
| documents | array | |
| top_k | integer | |
| include_embeddings | boolean = false |
Output
| Field | Type | Description |
|---|---|---|
| mode | string | |
| model | object | |
| query | string | |
| results | array |
Example response (data)
{
"mode": "rerank",
"model": {
"name": "sentence-transformers/all-MiniLM-L6-v2",
"quantization": "int8",
"dimensions": 384,
"max_tokens": 256,
"normalized": true,
"similarity": "cosine (dot product of normalized vectors)"
},
"query": "how do AI agents pay for APIs?",
"results": [
{
"index": 0,
"score": 0.495209,
"document": "x402 lets agents pay per call with USDC"
},
{
"index": 1,
"score": 0.005939,
"document": "The cat sat on the mat"
},
{
"index": 2,
"score": -0.050145,
"document": "Weather in Berlin is sunny"
}
]
}