Embeddings and rerank
Vectors for search, and ordering documents by relevance.
Embeddings
POST /v1/embeddings, compatible with the OpenAI SDKs. Pass one string or a list in input; each comes back as a vector in data, in the same order. Add "encoding_format": "base64" to get each vector as base64-encoded float32 instead of a list of numbers, as in the OpenAI API.
curl https://api.ewest.ai/v1/embeddings \
-H "Authorization: Bearer $EWEST_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "ewest/gemini-embedding", "input": ["How do I reset my password?", "Billing questions"]}'
# → {"data": [{"embedding": [0.012, -0.034, …], "index": 0}, …], "usage": {…}}Rerank
POST /v1/rerank takes a query and a list of documents (strings) and returns results ordered by relevance_score, each with the index of the document. Use top_n to keep only the best matches.
curl https://api.ewest.ai/v1/rerank \
-H "Authorization: Bearer $EWEST_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "ewest/semantic-ranker", "query": "How do I get a refund?", "top_n": 2,
"documents": ["Refunds are issued within 5 days.", "Our office is in Yerevan.", "Contact support to cancel an order."]}'
# → {"results": [{"index": 0, "relevance_score": 0.91}, {"index": 2, "relevance_score": 0.42}]}