Text Embedding V4 (Aliyun) API
A general-purpose Alibaba embedding model with 1,536 dimensions.
- Model:
text-embedding-v4 - Provider: Alibaba
- Type: embedding
POST /v1/embeddings
text-embedding-v4: Text embeddings, required fields, nested response schema and a fictional example.
Basic request
Required parameters: model, input
Available parameters: model, input, encoding_format
Request parameters
| Parameter | Type | Required | Description |
|---|
model | string | Yes | Exact model identifier shown on this page. Options: text-embedding-v4 |
input | array | Yes | Input texts; a single string is also accepted. |
encoding_format | string | No | Embedding encoding; the example uses float. Options: float |
## Usage and response conventions
- Follow required fields and the nested schema. Optional settings without a documented numeric default use the current model default.
- Context, output budgets and media constraints differ by model. Unverified limits are not universal guarantees.
- An absent value differs from a reported zero. Read status, content and usage as actually returned.
- Replace example.invalid addresses with readable media you are authorized to use.
- Save generated files promptly; result links need not remain available indefinitely.
## Reference
Terminology: [Embeddings](https://developers.openai.com/api/reference/resources/embeddings/methods/create). Use this page's platform base URL and exact model identifier for requests. Reviewed: 2026-11-07.
## Complete nested field reference
Array elements use []. Required flags apply only when the enclosing object or content-block variant is used. Response fields can be absent or null as described; false does not imply a fabricated zero.
### Request headers
| Field path | Type | Required in its object | Meaning |
|---|---|---|---|
| `Content-Type` | string | Yes | JSON request-body content type. |
### Request body
| Field path | Type | Required in its object | Meaning |
|---|---|---|---|
| `model` | string | Yes | Exact model identifier shown on this page. Values: text-embedding-v4 |
| `input` | array[string] | Yes | Input texts; a single string is also accepted. |
| `encoding_format` | string | No | Embedding encoding; the example uses float. Values: float |
### Response 200
| Field path | Type | Required in its object | Meaning |
|---|---|---|---|
| `object` | string | No | List object type. |
| `model` | string | No | Exact model identifier shown on this page. |
| `data` | array[object] | No | Embeddings in input order. |
| `data[].object` | string | No | List object type. |
| `data[].index` | integer | No | Input index. |
| `data[].embedding` | array[number] | No | Float vector; the example does not represent its real dimension. |
| `usage` | object | No | Reported text usage. |
| `usage.prompt_tokens` | integer | No | Input tokens. |
| `usage.total_tokens` | integer | No | Total tokens. |
### Error response structure
| Field path | Type | Required in its object | Meaning |
|---|---|---|---|
| `error` | object | No | Error details for this request. |
| `error.message` | string | No | Message content or a readable error explanation, according to its enclosing object. |
| `error.type` | string | No | Type discriminator; use the values documented for the enclosing object. |
| `error.code` | string | No | Error code; it may be empty. |
Request example
curl --request POST https://api.router.ai/v1/embeddings \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"model": "text-embedding-v4",
"input": [
"A fictional blue paper boat."
],
"encoding_format": "float"
}'
Endpoint reference: Text Embeddings