---
title: "Embeddings API (OpenAI-compatible)"
description: "OpenAI-compatible /v1/embeddings with request fields, batch inputs, dimensions and examples."
source: https://lazu.ai/docs/endpoints/embeddings
updated: 2026-10-02
---

# Embeddings

**POST** `/v1/embeddings`

Create vector embeddings with OpenAI-compatible clients. Use the model catalog to discover which models support embeddings and whether they accept custom dimensions.

## Example request

```bash
curl https://api.lazu.ai/v1/embeddings \
  -H "Authorization: Bearer $LAZU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": ["doc one", "doc two"]
  }'
```

## Example response

```json
{
  "object": "list",
  "data": [
    { "object": "embedding", "index": 0, "embedding": [0.0021, -0.013] }
  ],
  "model": "text-embedding-3-small",
  "usage": { "prompt_tokens": 6, "total_tokens": 6 }
}
```

## Request body

- `model` `string` (required) — Embedding model ID from `/api/models/catalog`.
- `input` `string | string[]` (required) — Text input or ordered batch of text inputs. The response preserves order.
- `dimensions` `integer` (optional) — Optional vector dimension for models that support truncation.
- `encoding_format` `string` (optional) — Output encoding format when supported by the upstream provider. One of: `float`, `base64`

## Response

- `object` `string` — Usually `list`.
- `data` `object[]` — One embedding item per input.
- `data[].embedding` `number[] | string` — Vector values or base64-encoded vector depending on
  `encoding_format`.
- `usage.prompt_tokens` `integer` — Input tokens used for embedding.

## Batch guidance

Pass an array for small batches. For large data jobs, chunk client-side so each
request stays within provider body-size and token limits.

## Common models

| Model                    | Dim  | Notes                |
| ------------------------ | ---- | -------------------- |
| `BAAI/bge-m3`            | 1024 | Multilingual         |
| `text-embedding-3-small` | 1536 | OpenAI cheap default |
| `text-embedding-3-large` | 3072 | OpenAI high quality  |
| `gemini-embedding-001`   | 768  | Google default       |

## See also

- [Model catalog](https://lazu.ai/docs/models/catalog)
- [Pricing & lanes](https://lazu.ai/docs/models/pricing)
