Embeddings

Turn text into vectors for search, clustering and retrieval.

POSThttps://your-instance.com/v1/embeddings

Returns a vector per input. Pass an array to embed a batch in one call, which is markedly faster than looping — the vectors come back in the order you sent them.

  • modelstringrequired

    Embedding model to use.

  • inputstring | string[]required

    Text to embed. An array embeds a batch in one request.

  • dimensionsinteger

    Truncate the output vector. Only some models support this.

  • encoding_formatstringdefault: "float"

    Either "float" or "base64".

curl https://your-instance.com/v1/embeddings \
  -H "Authorization: Bearer $CLAWROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": ["first document", "second document"]
  }'

Gemini format

POSThttps://your-instance.com/v1beta/models/{model}:embedContent

Gemini's native embedding call, for clients using that SDK. There is also an engines-style route, POST /v1/engines/{model}/embeddings, kept for older OpenAI clients.