Skip to content

Embed API (Cohere Compatible)

Generate vector embeddings for semantic search and RAG applications with AWS Bedrock embedding models through a Cohere-compatible interface.

This is an alternate route to the OpenAI-compatible Embeddings API: both are served by the same embedding backends and models, so anything supported there is supported here.

Route Prefix Configuration

By default, all Cohere-compatible routes are prefixed with /cohere. This means the Embed API is available at /cohere/v2/embed instead of /v2/embed. You can customize this prefix using the COHERE_ROUTES_PREFIX configuration variable documented in Operations Configuration.

The curl examples below use a $BASE variable that must include this prefix — set it to your scheme and host followed by COHERE_ROUTES_PREFIX:

export BASE="https://your-host/cohere"  # <scheme>://<host> + COHERE_ROUTES_PREFIX

Quick Start: Available Endpoints

Endpoint Method What It Does Powered By MCP Tool
/v2/embed POST Transform texts and images into semantic float vectors AWS Bedrock Embedding Models cohere_embed
/v1/embed POST Legacy v1 embed for older SDKs and integrations AWS Bedrock Embedding Models cohere_embed_v1

Example request:

curl -X POST "$BASE/v2/embed" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "cohere.embed-multilingual-v3",
    "input_type": "search_document",
    "texts": ["Hello world", "Bonjour le monde"]
  }'

Example response:

{
  "response_type": "embeddings_by_type",
  "id": "0f1b3c6e8d9a4b5c8e7f6a5b4c3d2e1f",
  "embeddings": {"float": [[0.012, -0.034, ...], [0.041, 0.007, ...]]},
  "texts": ["Hello world", "Bonjour le monde"],
  "meta": {
    "api_version": {"version": "2"},
    "billed_units": {"input_tokens": 8}
  }
}

Find compatible models: Call /search_models with mcp_tool=cohere_embed to discover model IDs that support embeddings — every Bedrock embedding model works, not just Cohere ones.

Feature Compatibility

Feature Status Notes
Input
texts Full support
images (data URIs) Multimodal models only; URLs and S3 URIs also accepted
inputs (fused text + image) Use texts or images instead
Model Parameters
input_type Applied to Cohere models; no equivalent on other providers
output_dimension Some models support dimension reduction
truncate, max_tokens Cohere models only
embedding_types Only float embeddings are returned
priority Accepted but ignored — not applicable on AWS Bedrock
Extra model-specific params Extra fields are forwarded as additional model request parameters
Output
images metadata array Image dimensions are not echoed in the response
Usage tracking
billed_units.input_tokens Estimated on some models

Legend:

  • Supported — Fully compatible with the Cohere API
  • Available on Select Models — Check your model's capabilities
  • Unsupported — Not available in this implementation
  • Extra Feature — Enhanced capability beyond the Cohere API

Cohere v1 Embed API (Legacy)

The legacy /v1/embed endpoint is also available for older Cohere SDKs (cohere.Client) and third-party integrations that predate the v2 API. It shares the same AWS Bedrock backend and model support as /v2/embed; new clients should prefer the v2 endpoint.

Differences from the v2 endpoint:

Feature Status Notes
Default response shape Legacy embeddings_floats: a plain list of float vectors
embedding_types ["float"] switches to the embeddings_by_type shape; other types return 400
input_type Optional — forwarded to Cohere models when provided; the backend defaults to search_document otherwise
meta.api_version.version Reported as "1"

Example request:

curl -X POST "$BASE/v1/embed" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "cohere.embed-multilingual-v3",
    "input_type": "search_document",
    "texts": ["Hello world", "Bonjour le monde"]
  }'

Example response:

{
  "response_type": "embeddings_floats",
  "id": "0f1b3c6e8d9a4b5c8e7f6a5b4c3d2e1f",
  "embeddings": [[0.012, -0.034, ...], [0.041, 0.007, ...]],
  "texts": ["Hello world", "Bonjour le monde"],
  "meta": {
    "api_version": {"version": "1"},
    "billed_units": {"input_tokens": 8}
  }
}

Notes

  • Requests are billed through AWS Bedrock (per token), not in Cohere search units; billed_units.input_tokens reports the Bedrock-metered input tokens.
  • When both texts and images are provided, embeddings are returned in request order: all texts first, then all images.
  • Guardrail and performance headers available on the OpenAI-compatible Embeddings API work on this route too.