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

{% hint style="info" %}
Чтобы отправлять авторизованные запросы нужно получить API ключ, как это сделать написано в разделе [**С чего начать?**](https://docs.gptunnel.ru/)
{% endhint %}

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

<mark style="color:blue;">`GET`</mark> `https://gptunnel.ru/v1/models`

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

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | string | API ключ    |

{% tabs %}
{% tab title="200: OK Успешный ответ" %}
{% code fullWidth="false" %}

```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"
		}
	]
}
```

{% endcode %}
{% endtab %}

{% tab title="401: Unauthorized Ошибка авторизации" %}

```json
{
  "error": {
    "message": "Unauthorized",
    "type": "unauthorized_request_error",
    "param": null,
    "code": null,
  }
}
```

{% endtab %}
{% endtabs %}

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

{% tabs %}
{% tab title="NodeJS" %}

```typescript
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)
})
```

{% endtab %}

{% tab title="Curl" %}

```bash
curl --request GET \
  --url https://gptunnel.ru/v1/models \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
```

{% endtab %}
{% endtabs %}

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

```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"
		}
	]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gptunnel.ru/api-chatgpt/chat-completions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
