> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindcase.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Embeddings API

> Turn texts into embedding vectors with the model you pick (OpenAI, Google Gemini, Cohere, Voyage, Qwen and more) for search, clustering and RAG: one row per text with the vector, its size, the tokens it used, the exact model version, its maker and its exact share of the call's cost. You pay exactly what each call costs at the model's own token rate.

`POST /v1/data/ai/embeddings/run`

**Pricing:** Metered: you pay exactly each call's cost at the selected model's rates (default OpenAI: Text Embedding 3 Small: \$0.02 per 1M input tokens).

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**texts** `string[]` *required*

The texts to embed, one row per text (up to 100,000 characters each).

**model** `string` (default: openai/text-embedding-3-small)

The embedding model. Pick from the list (popular models first). Each model shows its own rate per 1M input tokens, and that is exactly what each call costs.

35 allowed values, for example `openai/text-embedding-3-small` (OpenAI: Text Embedding 3 Small), `openai/text-embedding-3-large` (OpenAI: Text Embedding 3 Large), `google/gemini-embedding-2` (Google: Gemini Embedding 2), `google/gemini-embedding-2-preview` (Google: Gemini Embedding 2 Preview), `cohere/embed-5-fast` (Cohere: Embed 5 Fast), `cohere/embed-5-pro` (Cohere: Embed 5 Pro), `mongodb/voyage-4-lite` (VoyageAI by MongoDB: voyage-4-lite), `mongodb/voyage-4` (VoyageAI by MongoDB: voyage-4), `qwen/qwen3-embedding-8b` (Qwen: Qwen3 Embedding 8B), `amazon/titan-embed-text-v1` (Amazon: Titan Embeddings G1 - Text). Fetch the full list with `GET /v1/data/ai/embeddings?expand=options`.

**dimensions** `integer`

The vector size, for models that support choosing it (OpenAI text-embedding-3, Gemini, Cohere Embed 5, Voyage 4, Qwen3 and others). Leave empty for the model's native size.

Allowed values: `256`, `512`, `768`, `1024`, `1536`, `2048`, `3072`, `4096`.

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/ai/embeddings/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "texts": [
      "Wireless noise-cancelling headphones with 30-hour battery life",
      "Stainless steel insulated water bottle, 750 ml",
      "Organic green tea, 100 bags"
    ],
    "model": "openai/text-embedding-3-small",
    "dimensions": 256
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/ai/embeddings/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "texts": [
        "Wireless noise-cancelling headphones with 30-hour battery life",
        "Stainless steel insulated water bottle, 750 ml",
        "Organic green tea, 100 bags"
    ],
    "model": "openai/text-embedding-3-small",
    "dimensions": 256
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/ai/embeddings/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "texts": [
    "Wireless noise-cancelling headphones with 30-hour battery life",
    "Stainless steel insulated water bottle, 750 ml",
    "Organic green tea, 100 bags"
  ],
  "model": "openai/text-embedding-3-small",
  "dimensions": 256
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one embedding, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `id` | ID | text |
| `text` | Text | text |
| `embedding` | Embedding | array |
| `dimensions` | Dimensions | number |
| `tokens` | Tokens | number |
| `model` | Model | text |
| `provider` | Provider | text |
| `costUsd` | Cost (USD) | number |
| `error` | Error | text |
| `createdAt` | Created At | datetime |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "ai/embeddings",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "dimensions": 256,
      "embedding": [
        0.08013916015625,
        -0.0289154052734375
      ],
      "provider": "OpenAI",
      "error": null,
      "tokens": 13,
      "model": "openai/text-embedding-3-small",
      "id": "gen-emb-1794260970-M0TTmKhSFHNOpCh9qiGR-0",
      "text": "Wireless noise-cancelling headphones with 30-hour battery life",
      "costUsd": 2.62523e-07,
      "createdAt": "2026-11-09T21:49:31Z"
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.