text-embedding-3-small
Отправить синхронный запрос используя модель text-embedding-3-small
Создание векторов
POST
https://gptunnel.ru/v1/embeddings
Синхронный запрос к модели text-embedding-3-small
Headers
Name
Type
Description
Authorization*
string
API ключ
Request Body
Name
Type
Description
model*
string
ID модели
input*
string
Контент
useWalletBalance
bool
Использовать личный счет
dimensions
number
Кол-во измерений
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
-0.007021796,
"A LOT OF NUMBERS",
-0.017013576,
-0.000082575396,
-0.023988336
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 5,
"total_tokens": 5,
"prompt_cost": 0.00045,
"completion_cost": 0,
"total_cost": 0.00045
}
}
Пример запроса
import axios from 'axios'
const request = axios({
method: 'POST',
url: 'https://gptunnel.ru/v1/embeddings',
headers: {
// use your API key here
Authorization: 'YOUR_API_KEY',
},
data: {
model: "text-embedding-3-small",
input: "Your text string goes here",
dimensions: 1024,
},
})
request.then((result) => {
console.log(result)
}).catch((error) => {
console.error(error)
})
Пример ответа
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
-0.007021796,
"A LOT OF NUMBERS",
-0.017013576,
-0.000082575396,
-0.023988336
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 5,
"total_tokens": 5,
"prompt_cost": 0.00045,
"completion_cost": 0,
"total_cost": 0.00045
}
}
Last updated