---
title: "Creates embeddings for the given input text."
method: POST
path: "/openai/{region}/v1/embeddings"
tags: ["Embeddings"]
---

# Creates embeddings for the given input text.

`POST /openai/{region}/v1/embeddings`

## Request

- Base URL: `https://api.langdock.com`
- URL: `https://api.langdock.com/openai/{region}/v1/embeddings`
- Auth: HTTP bearer

## Path parameters

- `region` 'eu' | 'us', required

## Request body

- CreateEmbeddingRequest
  - `input` union, required: Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of tokens, e.g. `["text1", "text2"]`. Each input must not exceed 8192 tokens in length.
    - string
    - string[]
    - number[]
    - array[]
      - number[]
  - `model` union, required: ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see OpenAI's [Model overview](https://platform.openai.com/docs/models/overview) for descriptions of them.
    - string
    - 'text-embedding-ada-002' | 'text-embedding-3-small' | 'text-embedding-3-large'
  - `encoding_format` 'float' | 'base64': The format to return the embeddings in. Can be either `float` or `base64`.
  - `dimensions` integer: The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.
  - `user` string: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

## Response `200`

OK

- CreateEmbeddingResponse
  - `data` Embedding[], required: The list of embeddings generated by the model.
    - `index` integer, required: The index of the embedding in the list of embeddings.
    - `embedding` number[], required: The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings).
    - `object` 'embedding', required: The object type, which is always "embedding".
  - `model` string, required: The name of the model used to generate the embedding.
  - `object` 'list', required: The object type, which is always "list".
  - `usage` object, required
    - `prompt_tokens` integer, required: The number of tokens used for the prompt(s).
    - `total_tokens` integer, required: The total number of tokens used by the request.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `429`: Rate Limit Exceeded
- `500`: Internal Server Error

## Changes

- **2026-11-03** `c62bf90b4013`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/langdock/apis/langdock-api/changes/openai/:region/v1/embeddings/post.md)

---

[API](https://skmtc.dev/langdock/apis/langdock-api.md) - [All operations](https://skmtc.dev/langdock/apis/langdock-api/llms.txt) - [OpenAPI document](https://skmtc.dev/langdock/apis/langdock-api/revisions/c62bf90b4013?raw)
