Text embeddings
The embeddings API converts text into vectors for semantic search, similarity matching, clustering, ranking and knowledge-base retrieval.
API Path
| Methodology | Path | Returns by |
|---|---|---|
POST | /v1/embeddings | synchronous returns the result embeddings. |
Example request
bash
curl https://moonnexai.com/v1/embeddings \
-H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "moonnexai-embedding",
"input": "MoonNexAI developer documentation"
}'Common field
| field | Annotations |
|---|---|
model | embeddings model name. |
input | individual text or array of text. |
encoding_format | embeddings encoding format, as in API Reference. |
response Processing
| scene | Treatment |
|---|---|
| Single Text | Saves embeddings, original ID, model name and creation time. |
| Batch Text | Tie embeddings and original in the order of input to avoid misalignment. |
| Search Query | Use the same embeddings model on the side and side of the query and the library. |
Access Recommendations
- Saves embeddings-synchronous original ID to facilitate the retrieving and back-checking of operational data.
- The batch is preceded by text cleansing and segmenting, and each paragraph is complete.
- Use the same embeddings model on the side and side of the query and the library to avoid the drift of the similarity result.