Theme
Create Embeddings
POST
https://www.kkiai.com/v1/embeddings
Get a vector representation of the given input that machine learning models and algorithms can easily use.
Related guide: Embeddings
Create an embedding vector that represents the input text.
Request Parameters
Authorization
Add the Authorization parameter in the Header with the value of Token concatenated after Bearer
Example: Authorization: Bearer ********************
Header Parameters
| Parameter Name | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter Name | Type | Required | Description |
|---|---|---|---|
model | string | Required | The ID of the model to use. You can use the List models API to see all available models, or see our Models overview to learn about their descriptions. |
input | string | Required | Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. The length of each input must not exceed 8192 tokens. |
Request Example
json
{
"model": "text-embedding-3-large",
"input": "Artificial intelligence helps developers build smarter applications."
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/v1/embeddings' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "text-embedding-3-large",
"input": "Artificial intelligence helps developers build smarter applications."
}'Response
🟢200 Create embeddings
Response Body
| Parameter Name | Type | Required | Description |
|---|---|---|---|
object | string | Required | |
data | array[object] | Required | |
└ object | string | Optional | |
└ embedding | array[number] | Optional | |
└ index | integer | Optional | |
model | string | Required | |
usage | object | Required | |
└ prompt_tokens | integer | Required | |
└ total_tokens | integer | Required |
Response Example
json
{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
0.0023064255,
-0.009327292,
.... (1536 floats total for ada-002)
-0.0028842222
],
"index": 0
}
],
"model": "text-embedding-ada-002",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}