text-embedding-3-small
Создание векторов
POST
https://gptunnel.ru/v1/embeddings Синхронный запрос к модели text-embedding-3-small.
Headers
| Параметр | Тип | Описание |
|---|---|---|
Authorization* | string | API ключ |
Request Body
| Параметр | Тип | Описание |
|---|---|---|
model* | string | ID модели (text-embedding-3-small) |
input* | string | Текст для векторизации |
dimensions | number | Количество измерений |
useWalletBalance | bool | Использовать личный счёт |
Пример запроса
import axios from 'axios'
const response = await axios({ method: 'POST', url: 'https://gptunnel.ru/v1/embeddings', headers: { Authorization: 'YOUR_API_KEY', }, data: { model: 'text-embedding-3-small', input: 'Your text string goes here', dimensions: 1024, },})
console.log(response.data)import requests
response = requests.post( 'https://gptunnel.ru/v1/embeddings', headers={'Authorization': 'YOUR_API_KEY'}, json={ 'model': 'text-embedding-3-small', 'input': 'Your text string goes here', 'dimensions': 1024, },)
print(response.json())curl -X POST https://gptunnel.ru/v1/embeddings \ -H 'Authorization: YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "model": "text-embedding-3-small", "input": "Your text string goes here", "dimensions": 1024 }'Пример ответа
{ "object": "list", "data": [ { "object": "embedding", "index": 0, "embedding": [-0.007021, "...", -0.023988] } ], "model": "text-embedding-3-small", "usage": { "prompt_tokens": 5, "total_tokens": 5, "prompt_cost": 0.00045, "completion_cost": 0, "total_cost": 0.00045 }}Ошибки
{ "error": { "message": "The model 'gpt-5' does not exist", "type": "invalid_request_error", "param": null, "code": "model_not_found" }}{ "error": { "message": "'model' is a required property", "type": "invalid_request_error", "param": null, "code": null }}{ "error": { "message": "Organization balance is too low to use API", "type": "insufficient_balance_error", "param": null, "code": null }}{ "error": { "message": "Unauthorized", "type": "unauthorized_request_error", "param": null, "code": null }}