Ключі провайдерів, ліміти й паузи
Збережіть API-ключ провайдера моделей, перевірте, що він працює, задайте його ліміти й на якийсь час виведіть його з роботи.
Підключення провайдера — це API-ключ провайдера моделей, збережений у Slen. Виклик моделі доходить до провайдера через підключення. Операції цієї сторінки зберігають ключ, перевіряють його, обмежують, ставлять на паузу й повідомляють, як він поводився. Консоль показує ті самі підключення на екрані Підключення.
Секрет
Ключ провайдера записується і ніколи не читається назад. Жодна відповідь його не несе: підключення показує secret_configured і, у secret_last_four, останні чотири символи ключа.
Надішліть ключ у api_key, коли створюєте підключення. Щоб замінити його, надішліть новий api_key в оновленні. Створення підключення не звертається до провайдера, тому запустіть перевірку, щоб дізнатися, чи працює ключ.
Проєкт і організація
Підключення належить одному проєкту або всій організації. У підключення організації project_id дорівнює null, і через нього може надсилати виклики будь-який проєкт.
API-ключ діє у своєму проєкті.
Він отримує список підключень свого проєкту та організації і читає їх.
Він створює підключення у своєму проєкті. Скажіть про це значенням
projectуscope: запит, який не називає проєкт, просить підключення організації і відповідає403з кодомproject_access_restricted.Він не може змінити підключення організації. Запис у таке підключення — оновлення, увімкнення, вимкнення, видалення, перевірка, ліміти, пауза — відповідає тим самим
403.
Підключення іншого проєкту або підключення, якого не існує, відповідає 404 з кодом provider_connection_not_found.
Статус і стан
Підключення має два стани.
status зберігається: active, disabled або invalid_credentials. Виклики приймає лише підключення зі статусом active. Ви задаєте disabled і active, вимикаючи й вмикаючи підключення або передаючи status в оновленні. Slen ставить invalid_credentials, коли провайдер відхиляє ключ активного підключення, і знову ставить active, коли збережено новий ключ або перевірка пройшла успішно. Вимкнене підключення залишається disabled, хай що покаже перевірка і хай який ключ буде збережено: повернути його в роботу може лише ваш власний запит — увімкнення або оновлення зі status, що дорівнює active.
health_status обчислюється для кожної відповіді. Це перше відповідне зі значень: disabled, invalid_credentials, cooldown, degraded, healthy. degraded каже, що надто багато недавніх спроб через підключення завершилися невдачею, а error_rate — це частка таких спроб.
Видалення
Видалене підключення зберігається. Воно отримує deleted_at, стає disabled і виходить з усіх пулів, у яких було. Список його не показує, якщо не надіслати include_deleted=1. Увімкнення видаленого підключення відновлює його, але не його місце в пулах. Повернути видалене підключення можна лише ввімкненням: status в оновленні видалення не скасовує.
Видалення останнього ввімкненого підключення пулу відхиляється: 409 з кодом connection_in_use.
Перевірка
Перевірка запитує в провайдера список його моделей зі збереженим ключем, що не коштує токенів. Результат записується в підключення: last_health_check_at, last_health_latency_ms і статус invalid_credentials, коли відхилено ключ підключення, яке не вимкнене.
Коли провайдер відповідає, що для ключа вичерпано ліміт запитів, ok однаково дорівнює true: ключ дійсний, а решту каже rate_limited.
Перевірка приймає шість викликів за хвилину від одного API-ключа. Наступний виклик відповідає 429 з кодом rate_limit_exceeded.
Ліміти й пауза
Рядок лімітів стосується однієї моделі. Рядок без model — це значення за замовчуванням для всього підключення. Оновлення записує кожен рядок, який називає тіло, і залишає інші рядки як є. Рядок записується цілком: ліміт, якого рядок не називає, очищається, а рядок, що не називає жодного ліміту, видаляється.
Пауза виводить підключення з роботи на duration_seconds. Друга пауза може зробити поточну довшою, але не коротшою. Поки триває пауза, cooldown_until каже, коли вона закінчиться. Зняття завершує всі поточні паузи підключення, зокрема й ті, які почав сам Slen.
Операції
Описи операцій і полів подано англійською.
Список підключень до провайдерів
GET /v1/provider-connections
- Дозвіл:
management:read
Mutations on this group are audited.
Параметри
| Параметр | Опис |
|---|---|
limit необовʼязковоquery | Page size (default 30).
|
cursor необовʼязковоquery | The |
provider необовʼязковоquery |
|
environment необовʼязковоquery |
|
status необовʼязковоquery |
|
include_deleted необовʼязковоquery |
|
project необовʼязковоquery |
|
Відповіді
One cursor page of connections
{
"data": [
{
"provider_connection_id": "74438200973594624",
"organization_id": "74438200973594624",
"project_id": "74438200973594624",
"provider": "openai",
"name": "string",
"environment": "production",
"region": "string",
"provider_organization_id": "74438200973594624",
"provider_project_id": "74438200973594624",
"status": "active",
"health_status": "healthy",
"cooldown_until": "2026-10-02T09:30:00Z",
"error_rate": "string",
"secret_last_four": "string",
"secret_configured": true,
"last_health_check_at": "2026-10-02T09:30:00Z",
"last_health_latency_ms": 1,
"deleted_at": "2026-10-02T09:30:00Z",
"created_at": "2026-10-02T09:30:00Z",
"updated_at": "2026-10-02T09:30:00Z"
}
],
"meta": {
"limit": 1,
"next_cursor": "string"
}
}Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 422 | Validation failure or a semantically impossible request. Field-level validation from the framework answers |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Створити підключення до провайдера
POST /v1/provider-connections
- Дозвіл:
management:write
The secret is never returned by any endpoint — only secret_last_four and secret_configured.
The connection belongs to the caller's organization. A project_id outside it or out of the caller's reach, or an organization_id other than the caller's, answers 404 (project_not_found / organization_not_found) and stores nothing — the same answer as an id that does not exist.
scope names the side instead of a raw id: project is the active project, organization (also the default without scope and project_id) is no project and needs a caller that reaches every project (403 project_access_restricted). scope together with project_id is 422.
Тіло запиту
{
"organization_id": "74438200973594624",
"project_id": "74438200973594624",
"scope": "organization",
"provider": "openai",
"name": "string",
"api_key": "string",
"secret": "string",
"environment": "production",
"region": "string",
"provider_organization_id": "74438200973594624",
"provider_project_id": "74438200973594624"
}Відповіді
The created connection
{
"data": {
"provider_connection_id": "74438200973594624",
"organization_id": "74438200973594624",
"project_id": "74438200973594624",
"provider": "openai",
"name": "string",
"environment": "production",
"region": "string",
"provider_organization_id": "74438200973594624",
"provider_project_id": "74438200973594624",
"status": "active",
"health_status": "healthy",
"cooldown_until": "2026-10-02T09:30:00Z",
"error_rate": "string",
"secret_last_four": "string",
"secret_configured": true,
"last_health_check_at": "2026-10-02T09:30:00Z",
"last_health_latency_ms": 1,
"deleted_at": "2026-10-02T09:30:00Z",
"created_at": "2026-10-02T09:30:00Z",
"updated_at": "2026-10-02T09:30:00Z"
}
}Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. | |
| 422 | Validation failure or a semantically impossible request. Field-level validation from the framework answers |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Одне підключення
GET /v1/provider-connections/{id}
- Дозвіл:
management:read
Параметри
| Параметр | Опис |
|---|---|
id обовʼязковоpath | Snowflake identifier, as a string.
|
Відповіді
The connection
{
"data": {
"provider_connection_id": "74438200973594624",
"organization_id": "74438200973594624",
"project_id": "74438200973594624",
"provider": "openai",
"name": "string",
"environment": "production",
"region": "string",
"provider_organization_id": "74438200973594624",
"provider_project_id": "74438200973594624",
"status": "active",
"health_status": "healthy",
"cooldown_until": "2026-10-02T09:30:00Z",
"error_rate": "string",
"secret_last_four": "string",
"secret_configured": true,
"last_health_check_at": "2026-10-02T09:30:00Z",
"last_health_latency_ms": 1,
"deleted_at": "2026-10-02T09:30:00Z",
"created_at": "2026-10-02T09:30:00Z",
"updated_at": "2026-10-02T09:30:00Z"
}
}Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Змінити підключення або його секрет
PATCH /v1/provider-connections/{id}
- Дозвіл:
management:write
A new key (api_key) lifts the auth_error pause and an invalid_credentials verdict back to active; it never switches on a disabled or deleted connection.
A connection of no project (the organization's) is written only by a caller that reaches every project; an API key or a member of selected projects hears 403 project_access_restricted.
Параметри
| Параметр | Опис |
|---|---|
id обовʼязковоpath | Snowflake identifier, as a string.
|
Тіло запиту
{
"name": "string",
"status": "active",
"api_key": "string",
"secret": "string",
"environment": "production",
"region": "string",
"provider_organization_id": "74438200973594624",
"provider_project_id": "74438200973594624"
}Відповіді
The updated connection
{
"data": {
"provider_connection_id": "74438200973594624",
"organization_id": "74438200973594624",
"project_id": "74438200973594624",
"provider": "openai",
"name": "string",
"environment": "production",
"region": "string",
"provider_organization_id": "74438200973594624",
"provider_project_id": "74438200973594624",
"status": "active",
"health_status": "healthy",
"cooldown_until": "2026-10-02T09:30:00Z",
"error_rate": "string",
"secret_last_four": "string",
"secret_configured": true,
"last_health_check_at": "2026-10-02T09:30:00Z",
"last_health_latency_ms": 1,
"deleted_at": "2026-10-02T09:30:00Z",
"created_at": "2026-10-02T09:30:00Z",
"updated_at": "2026-10-02T09:30:00Z"
}
}Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. | |
| 422 | Validation failure or a semantically impossible request. Field-level validation from the framework answers |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Видалити підключення
DELETE /v1/provider-connections/{id}
- Дозвіл:
management:write
A connection of no project (the organization's) is written only by a caller that reaches every project; an API key or a member of selected projects hears 403 project_access_restricted.
Параметри
| Параметр | Опис |
|---|---|
id обовʼязковоpath | Snowflake identifier, as a string.
|
Відповіді
Deleted
Без тіла
Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. | |
| 409 | State conflict: idempotency clash, stale draft, illegal transition; the last owner of an organization ( |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Знову ввімкнути підключення
POST /v1/provider-connections/{id}/enable
- Дозвіл:
management:write
A connection of no project (the organization's) is written only by a caller that reaches every project; an API key or a member of selected projects hears 403 project_access_restricted.
Параметри
| Параметр | Опис |
|---|---|
id обовʼязковоpath | Snowflake identifier, as a string.
|
Відповіді
The enabled connection
{
"data": {
"provider_connection_id": "74438200973594624",
"organization_id": "74438200973594624",
"project_id": "74438200973594624",
"provider": "openai",
"name": "string",
"environment": "production",
"region": "string",
"provider_organization_id": "74438200973594624",
"provider_project_id": "74438200973594624",
"status": "active",
"health_status": "healthy",
"cooldown_until": "2026-10-02T09:30:00Z",
"error_rate": "string",
"secret_last_four": "string",
"secret_configured": true,
"last_health_check_at": "2026-10-02T09:30:00Z",
"last_health_latency_ms": 1,
"deleted_at": "2026-10-02T09:30:00Z",
"created_at": "2026-10-02T09:30:00Z",
"updated_at": "2026-10-02T09:30:00Z"
}
}Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Вимкнути підключення, не видаляючи його
POST /v1/provider-connections/{id}/disable
- Дозвіл:
management:write
A connection of no project (the organization's) is written only by a caller that reaches every project; an API key or a member of selected projects hears 403 project_access_restricted.
Параметри
| Параметр | Опис |
|---|---|
id обовʼязковоpath | Snowflake identifier, as a string.
|
Відповіді
The disabled connection
{
"data": {
"provider_connection_id": "74438200973594624",
"organization_id": "74438200973594624",
"project_id": "74438200973594624",
"provider": "openai",
"name": "string",
"environment": "production",
"region": "string",
"provider_organization_id": "74438200973594624",
"provider_project_id": "74438200973594624",
"status": "active",
"health_status": "healthy",
"cooldown_until": "2026-10-02T09:30:00Z",
"error_rate": "string",
"secret_last_four": "string",
"secret_configured": true,
"last_health_check_at": "2026-10-02T09:30:00Z",
"last_health_latency_ms": 1,
"deleted_at": "2026-10-02T09:30:00Z",
"created_at": "2026-10-02T09:30:00Z",
"updated_at": "2026-10-02T09:30:00Z"
}
}Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Перевірити підключення в провайдера
POST /v1/provider-connections/{id}/test
- Дозвіл:
management:write
Tighter bucket than the rest of the plane (6/min per key): this call leaves our network.
The verdict is stored. A refused key marks an active connection invalid_credentials (it leaves pool selection); a later good answer, or a new key (PATCH with api_key), lifts it back to active. A disabled or deleted connection keeps its status whatever the answer. A disabled connection is switched back on only by an explicit action — POST /v1/provider-connections/{id}/enable or status in PATCH; a deleted one only by enable, which clears its deletion.
A connection of no project (the organization's) is written only by a caller that reaches every project; an API key or a member of selected projects hears 403 project_access_restricted.
Параметри
| Параметр | Опис |
|---|---|
id обовʼязковоpath | Snowflake identifier, as a string.
|
Відповіді
The verification result
{
"data": {
"ok": true,
"latency_ms": 1,
"checked_at": "2026-10-02T09:30:00Z",
"error_code": "string",
"rate_limited": true
}
}Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. | |
| 429 | Rate limited for this API key |
Заголовки
X-Request-IdRetry-After429
Тіло кожної помилки — конверт помилки.
Ліміти частоти запитів підключення
GET /v1/provider-connections/{id}/limits
- Дозвіл:
management:read
Параметри
| Параметр | Опис |
|---|---|
id обовʼязковоpath | Snowflake identifier, as a string.
|
Відповіді
One row per model, plus the connection-wide default
{
"data": [
{
"model": "gpt-4o-mini",
"rpm": 1,
"tpm": 1,
"input_tpm": 1,
"output_tpm": 1,
"max_concurrency": 1,
"daily_quota": 1,
"source": "manual"
}
]
}Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Задати ліміти частоти для моделі підключення
PUT /v1/provider-connections/{id}/limits
- Дозвіл:
management:write
Writes the rows it names and leaves the others as they are: each item of limits is the row of one model (empty or null — the connection-wide row), and that row's six values are replaced as a whole — a value left out is no longer limited. An item whose six values are all empty removes its row. A row the body does not name keeps what it had, so this is not a replacement of the connection's limits: to drop a row, name it with no values. A written row becomes source: manual. Items are applied in order, so a model named twice ends with its last item. The answer is every row the connection has after the write.
A connection of no project (the organization's) is written only by a caller that reaches every project; an API key or a member of selected projects hears 403 project_access_restricted.
Параметри
| Параметр | Опис |
|---|---|
id обовʼязковоpath | Snowflake identifier, as a string.
|
Тіло запиту
{
"limits": [
{
"model": "gpt-4o-mini",
"rpm": 1,
"tpm": 1,
"input_tpm": 1,
"output_tpm": 1,
"max_concurrency": 1,
"daily_quota": 1
}
]
}Відповіді
The stored limits
{
"data": [
{
"model": "gpt-4o-mini",
"rpm": 1,
"tpm": 1,
"input_tpm": 1,
"output_tpm": 1,
"max_concurrency": 1,
"daily_quota": 1,
"source": "manual"
}
]
}Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. | |
| 422 | Validation failure or a semantically impossible request. Field-level validation from the framework answers |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Поставити підключення на паузу
POST /v1/provider-connections/{id}/cooldown
- Дозвіл:
management:write
A connection of no project (the organization's) is written only by a caller that reaches every project; an API key or a member of selected projects hears 403 project_access_restricted.
Параметри
| Параметр | Опис |
|---|---|
id обовʼязковоpath | Snowflake identifier, as a string.
|
Тіло запиту
{
"duration_seconds": 1,
"reason": "rate_limit"
}Відповіді
The cooldown in force
{
"data": {
"connection_id": "74438200973594624",
"reason": "rate_limit",
"source": "headers",
"starts_at": "2026-10-02T09:30:00Z",
"expires_at": "2026-10-02T09:30:00Z",
"retry_after_seconds": 1
}
}Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. | |
| 422 | Validation failure or a semantically impossible request. Field-level validation from the framework answers |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Зняти паузу достроково
DELETE /v1/provider-connections/{id}/cooldown
- Дозвіл:
management:write
A connection of no project (the organization's) is written only by a caller that reaches every project; an API key or a member of selected projects hears 403 project_access_restricted.
Параметри
| Параметр | Опис |
|---|---|
id обовʼязковоpath | Snowflake identifier, as a string.
|
Відповіді
Released
Без тіла
Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Навантаження, збої та затримка підключення
GET /v1/provider-connections/{id}/analytics
- Дозвіл:
read
Параметри
| Параметр | Опис |
|---|---|
id обовʼязковоpath | Snowflake identifier, as a string.
|
from необовʼязковоquery | Start of the window an analytics answer covers — a date the server can parse, ISO-8601 recommended (a value without an offset is read as UTC). Unlike the lists, each end is optional on its own and the window is never refused, only fitted (
|
to необовʼязковоquery | End of the window an analytics answer covers; now when absent. See
|
Відповіді
Connection analytics for the window
{
"data": {
"connection_id": "74438200973594624",
"window": {
"from": "2026-10-02T09:30:00Z",
"to": "2026-10-02T09:30:00Z"
},
"requests": 1,
"succeeded": 1,
"success_rate": "string",
"rate_limited_count": 1,
"timeout_count": 1,
"provider_error_count": 1,
"uncertain_count": 1,
"avg_latency_ms": 1,
"p95_latency_ms": 1,
"cost": "0.02700000",
"successful_failovers": 1,
"cooldown_seconds": 1
}
}Помилки
| Статус | Коди | Коли |
|---|---|---|
| 401 | No credential, or one that is not valid | |
| 403 | Authenticated, but not allowed: scope ( | |
| 404 | No such resource for this tenant. Somebody else's resource — and a resource of a project the caller does not reach — answers the same way on purpose: the two must not be distinguishable. | |
| 422 | Validation failure or a semantically impossible request. Field-level validation from the framework answers |
Заголовки
X-Request-Id
Тіло кожної помилки — конверт помилки.
Приклади
Отримати список підключень
Два фільтри звужують список до активних підключень одного провайдера.
curl "https://api.slen.ai/api/v1/provider-connections?provider=openai&status=active" \
-H "Authorization: Bearer $SLEN_API_KEY"Зберегти ключ провайдера
scope поміщає підключення в проєкт ключа. Відповідь показує останні чотири символи ключа провайдера і більше нічого з нього.
curl https://api.slen.ai/api/v1/provider-connections \
-H "Authorization: Bearer $SLEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"scope": "project",
"provider": "openai",
"name": "OpenAI production",
"api_key": "sk-proj-4f9a...c81d"
}'{
"data": {
"provider_connection_id": "74438912450035712",
"organization_id": "74438200973594112",
"project_id": "74438200973594624",
"provider": "openai",
"name": "OpenAI production",
"environment": "production",
"region": null,
"provider_organization_id": null,
"provider_project_id": null,
"status": "active",
"health_status": "healthy",
"cooldown_until": null,
"error_rate": null,
"secret_last_four": "c81d",
"secret_configured": true,
"last_health_check_at": null,
"last_health_latency_ms": null,
"deleted_at": null,
"created_at": "2026-10-02T08:12:30+00:00",
"updated_at": "2026-10-02T08:12:30+00:00"
}
}Прочитати підключення
Відповідь — це підключення в тому самому вигляді, що й у відповіді вище.
curl https://api.slen.ai/api/v1/provider-connections/74438912450035712 \
-H "Authorization: Bearer $SLEN_API_KEY"Замінити ключ
Новий ключ замінює збережений. Підключення в invalid_credentials знову стає active.
curl -X PATCH https://api.slen.ai/api/v1/provider-connections/74438912450035712 \
-H "Authorization: Bearer $SLEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"api_key": "sk-proj-77b2...e0a4"
}'Видалити підключення
Відповідь не має тіла.
curl -X DELETE https://api.slen.ai/api/v1/provider-connections/74438912450035712 \
-H "Authorization: Bearer $SLEN_API_KEY"204 No Content
Увімкнути підключення
Запит не має тіла. Відповідь — це підключення, у якого status дорівнює active.
curl -X POST https://api.slen.ai/api/v1/provider-connections/74438912450035712/enable \
-H "Authorization: Bearer $SLEN_API_KEY"Вимкнути підключення
Відповідь — це підключення, у якого status і health_status дорівнюють disabled.
curl -X POST https://api.slen.ai/api/v1/provider-connections/74438912450035712/disable \
-H "Authorization: Bearer $SLEN_API_KEY"Перевірити підключення
Провайдер прийняв ключ і відповів за 184 мілісекунди.
curl -X POST https://api.slen.ai/api/v1/provider-connections/74438912450035712/test \
-H "Authorization: Bearer $SLEN_API_KEY"{
"data": {
"ok": true,
"latency_ms": 184,
"checked_at": "2026-10-02T08:13:05+00:00",
"error_code": null,
"rate_limited": false
}
}Прочитати ліміти
Відповідь — це список рядків у тому вигляді, який показує наступний приклад.
curl https://api.slen.ai/api/v1/provider-connections/74438912450035712/limits \
-H "Authorization: Bearer $SLEN_API_KEY"Задати ліміти
У першому рядку немає model: це значення за замовчуванням для підключення. Другий рядок обмежує одну модель.
curl -X PUT https://api.slen.ai/api/v1/provider-connections/74438912450035712/limits \
-H "Authorization: Bearer $SLEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"limits": [
{
"rpm": 500,
"tpm": 200000,
"max_concurrency": 20
},
{
"model": "gpt-4o-mini",
"rpm": 300
}
]
}'{
"data": [
{
"model": null,
"rpm": 500,
"tpm": 200000,
"input_tpm": null,
"output_tpm": null,
"max_concurrency": 20,
"daily_quota": null,
"source": "manual"
},
{
"model": "gpt-4o-mini",
"rpm": 300,
"tpm": null,
"input_tpm": null,
"output_tpm": null,
"max_concurrency": null,
"daily_quota": null,
"source": "manual"
}
]
}Поставити на паузу
Підключення виведено з роботи на десять хвилин. Без reason пауза — manual.
curl https://api.slen.ai/api/v1/provider-connections/74438912450035712/cooldown \
-H "Authorization: Bearer $SLEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"duration_seconds": 600
}'{
"data": {
"connection_id": "74438912450035712",
"reason": "manual",
"source": "manual",
"starts_at": "2026-10-02T09:00:00+00:00",
"expires_at": "2026-10-02T09:10:00+00:00",
"retry_after_seconds": 600
}
}Зняти з паузи
Відповідь не має тіла.
curl -X DELETE https://api.slen.ai/api/v1/provider-connections/74438912450035712/cooldown \
-H "Authorization: Bearer $SLEN_API_KEY"204 No Content
Прочитати, як поводилося підключення
Вікно дотримується правил звіту: сім днів без from і to і не більше 31 дня.
curl "https://api.slen.ai/api/v1/provider-connections/74438912450035712/analytics?from=2026-09-25T00%3A00%3A00Z&to=2026-10-02T00%3A00%3A00Z" \
-H "Authorization: Bearer $SLEN_API_KEY"Що читати далі
Підключення — ті самі підключення в консолі.
Автентифікація — що доступно ключу в його проєкті та в його організації.
Аналітика — як звіт читає своє вікно.
Моделі — каталог із провайдером кожної моделі.
Коди помилок — кожен код API — що він означає і що робити.
Пули провайдерів — об’єднайте підключення й розставте їх на випадок збою.
Зібрано з openapi b070e1f, sdk contract 5cc7055, php ae4a53b, node 84bc62d