Embeddings API
Turn text into vectors for search, retrieval and clustering through one endpoint, POST /v1/embeddings, in OpenAI’s format. The provider is the one your virtual key holds, so switching from OpenAI to Cohere or Voyage AI is a change of key and model, not of code.
from openai import OpenAI
client = OpenAI(
api_key="vk-1a2b3c4d5e6f7a8b.Xk3pQ9vN2mR7tY1wZ8bC4dF6gH0jK5lM3nP7qS9uV2w", # your virtual key
base_url="https://api.vectoraxis.ai/v1",
)
result = client.embeddings.create(
model="text-embedding-3-small",
input=["What is our refund policy?", "Refunds are issued within 14 days."],
)
print(len(result.data), len(result.data[0].embedding))| Provider | Example models | How VectorAxis calls it |
|---|---|---|
| OpenAI | text-embedding-3-small, text-embedding-3-large | OpenAI’s own embeddings API. |
| Azure OpenAI | your deployment name as the model | The deployment’s embeddings endpoint. |
| Mistral | mistral-embed, codestral-embed | Mistral’s embeddings API (OpenAI-compatible). |
| Google Gemini | gemini-embedding-001 | Gemini’s OpenAI-compatible endpoint. |
| Together, Fireworks, DeepInfra, Nebius, NVIDIA NIM | open models such as BGE, Qwen3-Embedding, E5 | Each host’s OpenAI-compatible endpoint. |
| Cohere | embed-v4.0 | Cohere’s own Embed API, translated. Cohere’s API is also available as is: see Cohere. |
| Voyage AI | voyage-3.5, voyage-code-3 | Voyage’s own API, which is this same path and shape: see Voyage AI. |
Other OpenAI-compatible providers work the same way: if the provider serves embeddings, the call goes through; if it does not, you get the provider’s own error. Anthropic and Vertex AI keys have no embeddings here and are refused with a 422. Embeddings take platform keys as well as your own provider keys.
OpenAI’s fields: model, input (a string or a list of strings), dimensions, encoding_format (float or base64) and user. For Cohere and Voyage AI, which embed a search query differently from the documents it searches, add input_type: Cohere’s search_query / search_document / classification / clustering, Voyage’s query / document. OpenAI-compatible providers ignore it.
curl https://api.vectoraxis.ai/v1/embeddings \
-H "Authorization: Bearer vk-1a2b3c4d5e6f7a8b.Xk3pQ9vN2mR7tY1wZ8bC4dF6gH0jK5lM3nP7qS9uV2w" \
-H "Content-Type: application/json" \
-d '{ "model": "text-embedding-3-small", "input": "What is our refund policy?" }'With direct credentials instead of a virtual key, send x-provider and x-api-key.
| How it applies to embeddings | |
|---|---|
| Budgets & limits | The key’s credit limit, expiry, requests-per-minute, per-day and tokens-per-minute limits apply, and your plan’s workspace request limit. A model allowlist on the key applies too. |
| Guardrails | Input guardrails (the key’s and any in x-guardrail) run over every text before it is embedded. BLOCK stops the call; REDACT masks the text, so what gets embedded is the redacted text. |
| Caching | Exact-match caching with x-cache-mode: simple, as on chat: a repeated request is answered from the cache, with no provider call and nothing charged to the key; it is logged at $0, with what it would have cost as the saving. x-cache-ttl and x-cache-force-refresh work as on chat, and x-cache-status says what happened. See Caching. |
| Cost | Input tokens at the model’s input rate; embeddings have no output charge. The cost is on the log entry and in the x-operation-cost-usd response header. |
| Logs | Every call is a log entry with operation embedding: provider, model, tokens, cost, duration and cache status (HIT, MISS, REFRESH, BYPASS or DISABLED). With request bodies stored, the entry keeps the texts sent and the answer with each vector replaced by its length. See Request logs. |
| Retries & errors | 429 and 5xx are retried with backoff, honouring Retry-After. The provider’s own errors come back unchanged, so your SDK raises its usual exceptions. |
- Semantic caching, fallback and routing configs. x-cache-mode: semantic is answered with BYPASS, and x-fallback-* and x-config do not apply to embeddings.
- Vertex AI and AWS Bedrock embeddings, and Voyage AI’s rerank and multimodal endpoints.