Embeddings

Create embeddings

Changed on

Creates an embedding vector representing the input text.

post/embeddings

Request

  • Base URL
    https://api.openai.com/v1
  • URL
    https://api.openai.com/v1/embeddings
  • Auth
    HTTP bearer

Request body

encoding_format'float' | 'base64'

The format to return the embeddings in. Can be either float or base64.

dimensionsinteger

The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.

userstring

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

Example request

{
  "input": "This is a test.",
  "encoding_format": "float",
  "user": "user-1234"
}

Response

OK

modelstring required

The name of the model used to generate the embedding.

object'list' required

The object type, which is always "list".

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • breaking

      response property data/items/embedding list-of-types was widened by adding types string to media type application/json of response 200