embedding-ada-v2
Отправить синхронный запрос используя модель text-embedding-ada-002
Создание векторов
POST https://gptunnel.ru/v1/embeddings
Синхронный запрос к модели text-embedding-ada-002
Headers
Name
Type
Description
Authorization*
string
API ключ
Request Body
Name
Type
Description
model*
string
ID модели
input*
string
Контент
useWalletBalance
bool
Использовать личный счет
{
	"object": "list",
	"data": [
		{
			"object": "embedding",
			"index": 0,
			"embedding": [
				-0.007021796,
				"A LOT OF NUMBERS",
				-0.017013576,
				-0.000082575396,
				-0.023988336
			]
		}
	],
	"model": "text-embedding-ada-002-v2",
	"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
  }
}Пример запроса
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-ada-002",
     input: "Your text string goes here",
  },
})
request.then((result) => {
  console.log(result)
}).catch((error) => {
  console.error(error)
})curl --request POST \
  --url https://gptunnel.ru/v1/embeddings \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
      "model": "text-embedding-ada-002",
      "input": "Your text string goes here"
}'Пример ответа
{
	"object": "list",
	"data": [
		{
			"object": "embedding",
			"index": 0,
			"embedding": [
				-0.007021796,
				"A LOT OF NUMBERS",
				-0.017013576,
				-0.000082575396,
				-0.023988336
			]
		}
	],
	"model": "text-embedding-ada-002-v2",
	"usage": {
		"prompt_tokens": 5,
		"total_tokens": 5,
		"prompt_cost": 0.00045,
		"completion_cost": 0,
		"total_cost": 0.00045
	}
}Last updated