Skip to content

POST /v1/embeddings

Generate vector embeddings for text.

Request

POST https://api.chris.hellotopia.io/v1/embeddings
Authorization: Bearer <api_key>
Content-Type: application/json
Field Type Notes
model string embed/nomic-embed-text
input string or array of strings Texts to embed. Batch by passing an array.

Example

curl https://api.chris.hellotopia.io/v1/embeddings \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "embed/nomic-embed-text",
    "input": ["The quick brown fox", "jumps over the lazy dog"]
  }'
from openai import OpenAI
client = OpenAI(base_url="https://api.chris.hellotopia.io/v1", api_key="sk-...")

resp = client.embeddings.create(
    model="embed/nomic-embed-text",
    input=["The quick brown fox", "jumps over the lazy dog"],
)
vectors = [d.embedding for d in resp.data]
print(len(vectors), len(vectors[0]))   # 2 768

Response

{
  "object": "list",
  "data": [
    {"object": "embedding", "index": 0, "embedding": [0.013, -0.042, ...]},
    {"object": "embedding", "index": 1, "embedding": [0.007, -0.051, ...]}
  ],
  "model": "embed/nomic-embed-text",
  "usage": {"prompt_tokens": 13, "total_tokens": 13}
}

Vector dimension: 768.

Notes

  • Normalize vectors yourself if your downstream (e.g. cosine similarity) requires it — nomic-embed-text outputs unnormalized.
  • Batch up to a few hundred strings per call; for very large corpora, chunk and parallelize.
  • For RAG: embed your corpus once, store vectors in your own DB (pgvector, Qdrant, etc.). The gateway does not provide storage.