Cohere
Cohere’s embed models, known for multilingual search, through VectorAxis in either of two ways: Cohere’s own Embed API, unchanged, for the Cohere SDK, or OpenAI’s format on /v1/embeddings. Both take a Cohere virtual key (create one in Bring your own key mode with your Cohere API key).
Point the Cohere SDK at VectorAxis and use the virtual key as its API key. The request and the answer are Cohere’s, as documented in Cohere’s Embed API reference: texts, images and inputs, input_type, every embedding_types value, output_dimension, truncate.
import cohere
co = cohere.ClientV2(
api_key="vk-1a2b3c4d5e6f7a8b.Xk3pQ9vN2mR7tY1wZ8bC4dF6gH0jK5lM3nP7qS9uV2w", # a Cohere virtual key
base_url="https://api.vectoraxis.ai", # the SDK appends /v2/embed
)
response = co.embed(
model="embed-v4.0",
texts=["What is our refund policy?"],
input_type="search_query",
embedding_types=["float"],
)A key for another provider is refused here with a 422; use /v1/embeddings for those.
With the OpenAI SDK, a Cohere key works like any other. VectorAxis translates the call to Cohere’s Embed API and the answer back to OpenAI’s shape:
| OpenAI field | Sent to Cohere as |
|---|---|
| input | texts (a string becomes one text; token arrays are refused with a 400) |
| dimensions | output_dimension |
| input_type (an extra field) | input_type; search_document when you send none, since Cohere requires one |
| encoding_format | float vectors from Cohere; base64 is built in OpenAI’s format by VectorAxis |
client.embeddings.create(
model="embed-v4.0",
input=["What is our refund policy?"],
extra_body={"input_type": "search_query"},
)Each call is priced on the input tokens Cohere bills, at the model’s rate, and logged with operation embedding, like every other provider. Image tokens are not priced yet: an embedding of images logs the cost of its text only. Both endpoints take x-cache-mode: simple for the exact-match cache; a call in Cohere’s format and one in OpenAI’s are cached separately.