v1

latestOpenAPI 3.1.02026-07-2616299271.2 KB
OpenAI Compatible

Create an Embedding

Creates an embedding vector representing the input text.

post/v1/embeddings

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".