> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.empiriolabs.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.empiriolabs.ai/_mcp/server.

# Text Embedding v4

> Multilingual text embedding with selectable output dimensions (64–2048). Up to 8,192 tokens per input.

![Text Embedding v4](https://media.empiriolabs.ai/model-logos/qwen.png)

[Alibaba Cloud](/providers/alibaba) · Embeddings

`POST /v1/embeddings`

Multilingual text embedding with selectable output dimensions (64–2048). Up to 8,192 tokens per input.

## At a glance

| Field               | Value                                                       |
| ------------------- | ----------------------------------------------------------- |
| Model id            | `text-embedding-v4`                                         |
| Model release date  | 2025-06-04                                                  |
| Input modalities    | Text                                                        |
| Output modalities   | Embedding                                                   |
| Context window      | 8K                                                          |
| Weight precision    | -                                                           |
| Region              | Singapore                                                   |
| Features            | custom dimensions, sparse vectors, task instructions, batch |
| Native inference    | No                                                          |
| New                 | No                                                          |
| Supported endpoints | `POST /v1/embeddings`                                       |

## Pricing

| Charge | Spec                 | Rate   |
| ------ | -------------------- | ------ |
| Input  | per 1M prompt tokens | \$0.07 |

## Example request

```bash
curl https://api.empiriolabs.ai/v1/embeddings \
  -H 'Authorization: Bearer $EMPIRIOLABS_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"model": "text-embedding-v4", "input": "Embed this sentence into a vector."}'
```

## Parameters

| Parameter         | Type   | Required | Default   | Description                                                                                                                           |
| ----------------- | ------ | -------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `input`           | string | yes      | -         | Text or array of up to 2,048 texts to embed, 8,192 tokens each.                                                                       |
| `dimensions`      | number | no       | `1024`    | Vector dimension. Higher = more semantic info, more storage cost. · Allowed: `2048`, `1536`, `1024`, `768`, `512`, `256`, `128`, `64` |
| `encoding_format` | enum   | no       | `"float"` | Embedding output format: float (default array of floats) or base64. · Allowed: `float`, `base64`                                      |
| `user`            | string | no       | -         | Optional identifier for the end user making the request.                                                                              |

## Notes

**Output dimensions** (selectable per request)

* 64, 128, 256, 512, 768, 1024 (default), 1536, 2048
* Higher dimensions retain more semantic detail at higher storage cost

**Batch**

* Up to 2,048 inputs per request, 8,192 tokens each

**Languages**

* 100+ natural languages including Chinese, English, Spanish, French, Japanese, Korean, German, Russian, plus most common programming languages

---

*Machine-readable schema:* `GET https://api.empiriolabs.ai/v1/models/text-embedding-v4`.