Skip to main content

Embeddings

POST https://gateway.primex.work/v1/embeddings

OpenAI-compatible embeddings for RAG, semantic search, and codebase indexing.

Request

curl https://gateway.primex.work/v1/embeddings \
-H "Authorization: Bearer prx-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-3-small",
"input": "Primex is a metered AI gateway."
}'

Models

ModelDimensions contextPrice (per 1M tokens)
text-embedding-3-large8191$0.143
text-embedding-3-small8191$0.022
Cohere-embed-v3-multilingual512$0.10
text-embedding-ada-0028191$0.11 (legacy)

text-embedding-3-small is the recommended default — cheaper and better than the legacy ada-002. Use Cohere-embed-v3-multilingual for non-English corpora.

Response

{
"object": "list",
"data": [{"object": "embedding", "index": 0, "embedding": [0.0021, -0.017,]}],
"model": "text-embedding-3-small",
"usage": {"prompt_tokens": 8, "total_tokens": 8}
}