# Embeddings

> POST /v1/embeddings: the OpenAI Embeddings API through ACOG, for embedding models on OpenAI, Azure OpenAI and OpenAI-compatible connections.

Product: AI Cost Optimizer Gateway (ACOG). Web version: https://tessarac.com/docs/acog/api/embeddings. Last updated: 2026-10-16.

```http
POST https://gateway.acog.tessarac.com/v1/embeddings
```

The OpenAI [Embeddings API](https://platform.openai.com/docs/api-reference/embeddings). ACOG routes by `model` like any other request.

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.acog.tessarac.com/v1",
    api_key=os.environ["ACOG_API_KEY"],
)
result = client.embeddings.create(model="text-embedding-3-small", input=["first text", "second text"])
print(len(result.data[0].embedding))
```

## Which connections can serve embeddings

Embeddings are served only by connections that speak the OpenAI API: Direct OpenAI, Azure OpenAI (with a deployment named after the embedding model) and custom OpenAI-compatible endpoints that implement `/v1/embeddings`.

If your default connection cannot embed (for example it is an Anthropic connection) and an OpenAI-compatible connection declares the model, that connection serves the request. If no connection that declares the model can embed, the request is refused with `422 embeddings_unsupported_shape`.

## Governance

API keys, model access rules, budgets and rate limits apply to embeddings as to any other request. Data loss prevention and prompt injection screening do not run on embeddings requests.
