Skip to content

Text embeddings ​

The embeddings API converts text into vectors for semantic search, similarity matching, clustering, ranking and knowledge-base retrieval.

API Path ​

MethodologyPathReturns by
POST/v1/embeddingssynchronous 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 ​

fieldAnnotations
modelembeddings model name.
inputindividual text or array of text.
encoding_formatembeddings encoding format, as in API Reference.

response Processing ​

sceneTreatment
Single TextSaves embeddings, original ID, model name and creation time.
Batch TextTie embeddings and original in the order of input to avoid misalignment.
Search QueryUse 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.

Relevant Pages ​