---
title: "Embeddings LLM"
method: POST
path: "/v1/embeddings"
tags: ["Embeddings"]
---

# Embeddings LLM

`POST /v1/embeddings`

## Request

- Base URL: `https://apipie.ai`
- URL: `https://apipie.ai/v1/embeddings`
- Auth: API key in header `Authorization`

Generate embeddings for the given input text using the specified model.

The `model` field in the request body specifies the model to use. Check the /models route for complete list of embedding models. You can specify the encoding format (`float` or `np`) and the dimensions (up to 1536) of the output embedding vector.

## Request body

- EmbeddingRequest
  - `model` string, required: Model to use for generating embeddings.
  - `input` string, required: Input text to generate embeddings for.
  - `encoding_format` 'float' | 'np': Format of the output encoding. Only supported by OpenAI
  - `dimensions` integer: Number of dimensions for the embedding vector. Maximum value is 384-1536 check the models route for max_tokens per model. Only supported by OpenAI

## Response `200`

Embedding vector generated successfully

- EmbeddingResponse
  - `object` string
  - `data` object[]
    - `object` string
    - `index` integer
    - `embedding` object
      - `object` string
      - `index` integer
      - `embedding` number[]
  - `provider` string
  - `model` string
  - `usage` object
    - `prompt_tokens` integer
    - `total_tokens` integer
    - `prompt_characters` integer
    - `cost` string
    - `latency_ms` integer

---

[API](https://skmtc.dev/apipie/apis/introduction.md) · [All operations](https://skmtc.dev/apipie/apis/introduction/llms.txt) · [OpenAPI document](https://skmtc.dev/apipie/apis/introduction/revisions/f8386be4eb3f?raw)
