Skip to content

Embeddings API

Embeddings are numerical representations of text that capture semantic meaning. They are essential for tasks like document search, recommendation systems, and clustering. Siraya Model Router provides a unified API to access state-of-the-art embedding models from multiple providers (OpenAI, Jina, Voyage AI, etc.).

Base URL

https://llm.siraya.ai/v1/embeddings

How to Generate Embeddings

Basic Request (Python)

import requests

url = "https://llm.siraya.ai/v1/embeddings"
headers = {
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
}
data = {
    "model": "skylark-embedding-vision-251215",
    "input": "Hello world"
}

response = requests.post(url, headers=headers, json=data)
embeddings = response.json()["data"][0]["embedding"]
curl https://llm.siraya.ai/v1/embeddings \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "skylark-embedding-vision-251215",
    "input": "Hello world"
  }'

Best Practices

  • Normalization: Most models return normalized embeddings. Use cosine similarity for comparing vectors.
  • Caching: Since embeddings are deterministic for a given model and input, caching results can save significant costs.