Skip to content
API referenceCreate embeddings in Cohere's format

Create embeddings in Cohere's format

POST/v2/embed

Create embeddings in Cohere's format.

Compatible with Cohere's Embed API (v2): the Cohere SDK works with its base URL set to the gateway. The body is forwarded to Cohere as sent and Cohere's answer is returned in its own format. Only a Cohere credential is accepted here; any other provider's key is a 422 (use POST /v1/embeddings for those).

Authenticate with a Cohere virtual key or with x-provider: cohere and x-api-key. The key's checks, the plan's limits and the organization's approved-provider policy (403) apply. INPUT guardrails run over texts and the text items of inputs; a REDACT changes what is embedded and a BLOCK is a 422. x-cache-mode: simple serves an identical earlier request from the cache; semantic is not used. You are charged for Cohere's billed input tokens at the model's input rate (x-operation-cost-usd). Without x-retry-count a failed call is retried up to 3 times on 429 and 5xx. Cohere's own errors are returned unchanged. A request without model is a 400.

Compatible with the Cohere Embed API (v2). The request and response bodies are the provider's own format, passed through by the gateway: see the Cohere Embed API (v2) reference for every field. The credentials and headers below are what VectorAxis adds.

Authorization

  • AuthorizationBearer <slug>.<secret>

    A virtual key's API key (vk-....<secret>), as Authorization: Bearer. What the OpenAI SDK sends from its api_key. Used by the inference endpoints.

  • orx-virtual-keyheader

    A virtual key's API key in the x-virtual-key header, for clients that keep Authorization for something else.

  • orx-api-keyheader

    Direct credentials: the provider's own API key in x-api-key, with the provider named in x-provider (for example openai). On /v1/messages a virtual key is accepted in x-api-key too, which is what the Claude SDK sends.

Headers

  • x-providerstring

    With direct credentials: the provider x-api-key belongs to, for example openai or anthropic (case and dashes are normalised). Not used with a virtual key.

  • x-cache-modestring

    Turns on the response cache for this request: simple (exact match) or semantic (a similar earlier request). Without it nothing is read from or written to the cache. The outcome is in the x-cache-status response header.

  • x-cache-ttlinteger<int32>

    How long, in seconds, a response stored by this request stays in the cache. When the organization has a cache TTL set, this can shorten it but not extend it.

  • x-cache-force-refreshboolean

    true skips the cache lookup, calls the provider and replaces the stored response (x-cache-status: REFRESH).

  • x-retry-countinteger<int32>

    How many times to retry a failed provider call, 0 to 5. Without the header, chat completions, Claude Messages and prompt completions do not retry, and the other endpoints retry up to 3 times. Retries back off exponentially from 1 second and honour a numeric Retry-After. The number made is in the x-retry-count response header.

  • x-retry-status-codesstring

    Comma-separated provider status codes to retry on. Default 429,500,502,503,504,529.

  • x-guardrailstring

    A guardrail slug (gr-...) to apply to this request, in addition to any the virtual key carries. A BLOCK is a 422 with x-guardrail-status: BLOCK.

  • x-request-timeout-msinteger<int32>

    How long to wait for the provider, in milliseconds, before giving up (at most 3600000, one hour).

Responses

200application/json
NVIDIA Inception Program member

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