---
title: "Creates an embedding vector representing the input text."
method: POST
path: "/openai/v1/embeddings"
tags: ["Embeddings"]
---

# Creates an embedding vector representing the input text.

`POST /openai/v1/embeddings`

## Request body

- CreateEmbeddingRequest
  - `input` union, required — Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model, cannot be an empty string, and any array must be 2048 dimensions or less.
    - string — The string that will be turned into an embedding.
    - string[] — The array of strings that will be turned into an embeddings.
  - `model` union, required — ID of the model to use.
    - string
    - 'nomic-embed-text-v1_5'
  - `encoding_format` 'float' | 'base64' — The format to return the embeddings in. Can only be `float` or `base64`.
  - `user` string, nullable — A unique identifier representing your end-user, which can help us 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` union, required
      - number[] — The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](/docs/guides/embeddings).
      - string — The embedding vector, which is a base64 encoded string. The length of vector depends on the model as listed in the [embedding guide](/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 — The usage information for the request.
    - `prompt_tokens` integer, required — The number of tokens used by the prompt.
    - `total_tokens` integer, required — The total number of tokens used by the request.

## Changes

- **2024-05-22** `0f93f9ac6d4a` — 1 breaking, 2 info
  - the `model` request property type/format changed from `string`/`` to ``/``
  - the endpoint scheme security `api_key` was removed from the API
  - added `subschema #1, subschema #2` to the `model` request property `anyOf` list
- **2024-05-21** `45aff5d28bf6` — 1 warning, 4 info
  - removed the request property `dimensions`
  - api tag `Embeddings` added
  - api tag `openai embeddings` removed
  - the `` request property default value `` was added
  - …1 more
- **2024-05-15** `c28de228634e` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/groq/apis/groqcloud-api/changes/openai/v1/embeddings/post.md)

---

[API](https://skmtc.dev/groq/apis/groqcloud-api.md) · [All operations](https://skmtc.dev/groq/apis/groqcloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/groq/groqcloud-api/revisions/ea91f46f212a/schema)
