Перейти до основного вмісту
POST
/
openai
/
embeddings
Creates an embedding vector representing the input text.
curl --request POST \
  --url https://api.acedata.cloud/openai/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "text-embedding-3-small",
  "input": "<string>",
  "encoding_format": "float",
  "dimensions": 2
}
'
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.0023064255,
        -0.009327292,
        0.015271,
        0.001234
      ]
    }
  ],
  "model": "text-embedding-3-small",
  "usage": {
    "prompt_tokens": 9,
    "total_tokens": 9
  },
  "created": 1714500000
}

Авторизації

Authorization
string
header
обов'язково

Заголовки

accept
enum<string>

Specifies the format of the response from the server.

Доступні опції:
application/json

Тіло

application/json
model
enum<string>
обов'язково

ID of the embedding model to use (e.g., text-embedding-3-small, text-embedding-3-large).

Доступні опції:
text-embedding-3-small,
text-embedding-3-large,
text-embedding-ada-002
input
string
обов'язково

Input to embed: a single string, an array of strings, or token arrays.

encoding_format
enum<string>
за замовчуванням:float

Format of the returned embeddings.

Доступні опції:
float,
base64
dimensions
integer

Optional output embedding size when supported by the model.

Необхідний діапазон: x >= 1

Відповідь

Embeddings created successfully.

object
enum<string>
обов'язково

Type of the returned object.

Доступні опції:
list
data
object[]
обов'язково
model
string
обов'язково

Model used to generate the embeddings.

usage
object
обов'язково
created
integer
обов'язково

Unix timestamp (seconds) when the embeddings were created.