Skip to content
DocsEmbeddings API
Embeddings

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.

Python
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))
Providers
ProviderExample modelsHow VectorAxis calls it
OpenAItext-embedding-3-small, text-embedding-3-largeOpenAI’s own embeddings API.
Azure OpenAIyour deployment name as the modelThe deployment’s embeddings endpoint.
Mistralmistral-embed, codestral-embedMistral’s embeddings API (OpenAI-compatible).
Google Geminigemini-embedding-001Gemini’s OpenAI-compatible endpoint.
Together, Fireworks, DeepInfra, Nebius, NVIDIA NIMopen models such as BGE, Qwen3-Embedding, E5Each host’s OpenAI-compatible endpoint.
Cohereembed-v4.0Cohere’s own Embed API, translated. Cohere’s API is also available as is: see Cohere.
Voyage AIvoyage-3.5, voyage-code-3Voyage’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.

The request

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.

Bash
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.

What VectorAxis adds
How it applies to embeddings
Budgets & limitsThe 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.
GuardrailsInput 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.
CachingExact-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.
CostInput 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.
LogsEvery 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 & errors429 and 5xx are retried with backoff, honouring Retry-After. The provider’s own errors come back unchanged, so your SDK raises its usual exceptions.
Not supported (yet)
  • 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.
NVIDIA Inception Program member

VectorAxis is built by GK Labs, a member of NVIDIA Inception.