logo

Embeddings and Rerank

Embeddings

OpenAI-compatible embedding requests use POST /v1/embeddings.

curl https://llmoxy.com/v1/embeddings \
  -H "Authorization: Bearer <LLMOXY_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": ["first document", "second document"],
    "encoding_format": "float"
  }'

Common fields:

FieldDescription
modelRequired. Embedding model ID.
inputString or array of strings.
encoding_formatCan be float or base64 when supported by upstream.
dimensionsSupported models can specify output dimensions.
userOptional tracking identifier.

Gemini-style embedding requests can use:

POST /v1/engines/{model}/embeddings

Rerank

Use POST /v1/rerank to call Jina, Cohere, and other rerank models.

curl https://llmoxy.com/v1/rerank \
  -H "Authorization: Bearer <LLMOXY_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jina-reranker-v2-base-multilingual",
    "query": "What is LLMoxy?",
    "documents": [
      "LLMoxy is an LLM gateway.",
      "A database stores rows."
    ],
    "top_n": 1,
    "return_documents": true
  }'

Common fields:

FieldDescription
modelRequired. Rerank model ID.
queryQuery text.
documentsArray of strings or document objects.
top_nMaximum number of ranked results to return.
return_documentsWhether to include original documents in the response.