🚢
API Docs
  • С чего начать?
  • Стоимость запросов
  • Интеграция чат-ботов
  • Токенизация
  • API - Ассистенты
    • Assistant API
    • Чат с ассистентом
  • API - Общие запросы
    • Запрос баланса
  • API - OpenAI -ChatGPT
    • Список моделей
    • Запрос чату
  • API - OpenAI - Embedding
    • embedding-ada-v2
    • text-embedding-3-small
    • text-embedding-3-large
  • Moderation
    • text-moderation
  • RAG DATABASE
    • List of RAGs
    • List of files
    • Add file to RAG
    • Delete file from RAG
  • FaceSwap 2.0
    • /create
    • /result
  • Background Remover
    • /create
    • /result
  • API -Midjourney
    • /imagine
    • /result
    • /upsample
    • /variation
    • /outpaint
    • /pan
    • /upscale
    • /inpaint
    • /reroll
Powered by GitBook
On this page
  • Запрос списка моделей
  • Пример запроса
  • Пример ответа
  1. API - OpenAI -ChatGPT

Список моделей

Получить список доступных моделей и цены на них

PreviousЗапрос балансаNextЗапрос чату

Last updated 9 months ago

Чтобы отправлять авторизованные запросы нужно получить API ключ, как это сделать написано в разделе

Запрос списка моделей

GET https://gptunnel.ru/v1/models

Возвращает список всех доступных LLM моделей

Headers

Name
Type
Description

Authorization*

string

API ключ

{
	"object": "list",
	"data": [
		{
			"id": "gpt-4o",
			"object": "model",
			"created": 1685584800,
			"title": "GPT 4o Vision 128K",
			"max_capacity": 4096,
			"cost_context": "1.3500",
			"cost_completion": "2.7000"
		},
		{
			"id": "gpt-4o-mini",
			"object": "model",
			"created": 1685584800,
			"title": "GPT 4o Mini",
			"max_capacity": 4096,
			"cost_context": "0.1200",
			"cost_completion": "0.4800"
		},
		{
			"id": "text-embedding-ada-002",
			"object": "model",
			"created": 1690848600,
			"title": "Embedding ada V2",
			"max_capacity": 8191,
			"cost_context": "0.0500",
			"cost_completion": "0.0000"
		},
		{
			"id": "text-embedding-3-small",
			"object": "model",
			"created": 1714435800,
			"title": "Embedding ada V3 Small",
			"max_capacity": 8191,
			"cost_context": "0.0200",
			"cost_completion": "0.0000"
		},
		{
			"id": "text-embedding-3-large",
			"object": "model",
			"created": 1714435800,
			"title": "Embedding ada V3 Large",
			"max_capacity": 8191,
			"cost_context": "0.0700",
			"cost_completion": "0.0000"
		},
		{
			"id": "text-moderation-007",
			"object": "model",
			"created": 1690848600,
			"title": "Text moderation model",
			"max_capacity": 8191,
			"cost_context": "0.0100",
			"cost_completion": "0.0000"
		},
		{
			"id": "gpt-4-turbo",
			"object": "model",
			"created": 1685581200,
			"title": "GPT 4",
			"max_capacity": 4096,
			"cost_context": "2.7000",
			"cost_completion": "5.4000"
		},
		{
			"id": "gpt-4",
			"object": "model",
			"created": 1690848600,
			"title": "GPT 4",
			"max_capacity": 4096,
			"cost_context": "2.7000",
			"cost_completion": "5.4000"
		},
		{
			"id": "gpt-3.5-turbo",
			"object": "model",
			"created": 1685584800,
			"title": "GPT 3.5 Turbo",
			"max_capacity": 4096,
			"cost_context": "0.5000",
			"cost_completion": "0.9000"
		}
	]
}
{
  "error": {
    "message": "Unauthorized",
    "type": "unauthorized_request_error",
    "param": null,
    "code": null,
  }
}

Пример запроса

import axios from 'axios'

const request = axios({
  method: 'GET',
  url: 'https://gptunnel.ru/v1/models',
  headers: {
    // use your API key here
    Authorization: 'YOUR_API_KEY',
  },
})

request.then((result) => {
  console.log(result)
}).catch((error) => {
  console.error(error)
})
curl --request GET \
  --url https://gptunnel.ru/v1/models \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \

Пример ответа

{
	"object": "list",
	"data": [
		{
			"id": "gpt-4o",
			"object": "model",
			"created": 1685584800,
			"title": "GPT 4o Vision 128K",
			"max_capacity": 4096,
			"cost_context": "1.3500",
			"cost_completion": "2.7000"
		},
		{
			"id": "gpt-4o-mini",
			"object": "model",
			"created": 1685584800,
			"title": "GPT 4o Mini",
			"max_capacity": 4096,
			"cost_context": "0.1200",
			"cost_completion": "0.4800"
		},
		{
			"id": "text-embedding-ada-002",
			"object": "model",
			"created": 1690848600,
			"title": "Embedding ada V2",
			"max_capacity": 8191,
			"cost_context": "0.0500",
			"cost_completion": "0.0000"
		},
		{
			"id": "text-embedding-3-small",
			"object": "model",
			"created": 1714435800,
			"title": "Embedding ada V3 Small",
			"max_capacity": 8191,
			"cost_context": "0.0200",
			"cost_completion": "0.0000"
		},
		{
			"id": "text-embedding-3-large",
			"object": "model",
			"created": 1714435800,
			"title": "Embedding ada V3 Large",
			"max_capacity": 8191,
			"cost_context": "0.0700",
			"cost_completion": "0.0000"
		},
		{
			"id": "text-moderation-007",
			"object": "model",
			"created": 1690848600,
			"title": "Text moderation model",
			"max_capacity": 8191,
			"cost_context": "0.0100",
			"cost_completion": "0.0000"
		},
		{
			"id": "gpt-4-turbo",
			"object": "model",
			"created": 1685581200,
			"title": "GPT 4",
			"max_capacity": 4096,
			"cost_context": "2.7000",
			"cost_completion": "5.4000"
		},
		{
			"id": "gpt-4",
			"object": "model",
			"created": 1690848600,
			"title": "GPT 4",
			"max_capacity": 4096,
			"cost_context": "2.7000",
			"cost_completion": "5.4000"
		},
		{
			"id": "gpt-3.5-turbo",
			"object": "model",
			"created": 1685584800,
			"title": "GPT 3.5 Turbo",
			"max_capacity": 4096,
			"cost_context": "0.5000",
			"cost_completion": "0.9000"
		}
	]
}

С чего начать?