---
title: "Create embeddings"
method: POST
path: "/api/{workspaceID}/v1/embeddings"
tags: ["Embeddings"]
---

# Create embeddings

`POST /api/{workspaceID}/v1/embeddings`

Generates embeddings for the given input text. Supports single strings or arrays of strings.
Response includes token usage and cost information.

## Path parameters

- `workspaceID` string, required

## Request body

- EmbeddingRequest
  - `input` union, required — Text or array of texts to embed
    - string
    - string[]
  - `model` string, required — Embedding model ID. Supported models: - `google/gemini-embedding-2` - `intfloat/multilingual-e5-large` - `google/gemini-embedding-001` - `openai/text-embedding-3-small` - `openai/text-embedding-3-large` - `openai/text-embedding-ada-002`
  - `dimensions` number — Output dimensions (model-dependent)
  - `encoding_format` string — Encoding format for embeddings
  - `user` string — End-user identifier

## Response `200`

Successful response

- EmbeddingResponse
  - `object` 'list'
  - `data` object[]
    - `object` 'embedding'
    - `embedding` number[]
    - `index` integer
  - `model` string — Model ID used
  - `usage` object
    - `prompt_tokens` integer
    - `total_tokens` integer
    - `total_cost_toman` number — Total cost in Tomans
    - `total_cost` number — Total cost in USD

## Other responses

- `400` — Bad request
- `401` — Missing authentication
- `402` — Payment required - insufficient balance
- `503` — Service unavailable (feature disabled)

---

[API](https://skmtc.dev/liara-cloud/apis/ai-embeddings.md) · [All operations](https://skmtc.dev/liara-cloud/apis/ai-embeddings/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/liara-cloud/ai-embeddings/revisions/0ff85eabd6e8/schema)
