docs: add Subscription API section (EN+RU)

ospab 2026-05-17 21:58:10 +03:00
parent cd3d7d8dae
commit 64efa677ac
2 changed files with 98 additions and 2 deletions

@ -238,4 +238,52 @@ The API is designed to be compatible with panel architectures like **3x-ui** and
--- ---
[← Configuration](Configuration) | [Protocol Design →](Protocol-Design) ## Subscription API
### Get Client Configuration
```
GET /api/subscribe/{access_key}
```
Returns a ready-to-use client configuration for the given access key. **No Bearer token required** -- the access key itself authenticates the request.
**Default response** (`Accept: application/json`):
```json
{
"ok": true,
"data": {
"mode": "client",
"server": "example.com:50000",
"access_key": "c8a6fde902b4e23910cde882b7cf1612",
"socks5_bind": "127.0.0.1:1088",
"tun": {"enable": false, "dns": "1.1.1.1"},
"turn": {"enabled": false},
"mux": {"enabled": false, "sessions": 1},
"debug": false
}
}
```
**Share link response** (`Accept: text/plain`):
```
ostp://c8a6fde902b4e23910cde882b7cf1612@example.com:50000
```
### Examples
```bash
# Get client config JSON
curl -s http://127.0.0.1:9090/api/subscribe/c8a6fde902b4e23910cde882b7cf1612 | jq
# Get share link
curl -s -H "Accept: text/plain" \
http://127.0.0.1:9090/api/subscribe/c8a6fde902b4e23910cde882b7cf1612
# Use with sub-store / NekoBox
# Set subscription URL to: http://your-server:9090/api/subscribe/{key}
```
---
[<- Configuration](Configuration) | [Protocol Design ->](Protocol-Design)

@ -238,4 +238,52 @@ API спроектирован для совместимости с архите
--- ---
[← Конфигурация](Configuration_ru) | [Протокол →](Protocol-Design_ru) ## API подписки
### Получение конфигурации клиента
```
GET /api/subscribe/{access_key}
```
Возвращает готовую конфигурацию клиента для данного ключа доступа. **Токен Bearer не требуется** -- сам ключ доступа выступает аутентификацией.
**Ответ по умолчанию** (`Accept: application/json`):
```json
{
"ok": true,
"data": {
"mode": "client",
"server": "example.com:50000",
"access_key": "c8a6fde902b4e23910cde882b7cf1612",
"socks5_bind": "127.0.0.1:1088",
"tun": {"enable": false, "dns": "1.1.1.1"},
"turn": {"enabled": false},
"mux": {"enabled": false, "sessions": 1},
"debug": false
}
}
```
**Ответ в виде ссылки** (`Accept: text/plain`):
```
ostp://c8a6fde902b4e23910cde882b7cf1612@example.com:50000
```
### Примеры
```bash
# Получить конфиг клиента
curl -s http://127.0.0.1:9090/api/subscribe/c8a6fde902b4e23910cde882b7cf1612 | jq
# Получить share-ссылку
curl -s -H "Accept: text/plain" \
http://127.0.0.1:9090/api/subscribe/c8a6fde902b4e23910cde882b7cf1612
# Использование с sub-store / NekoBox
# Укажите URL подписки: http://your-server:9090/api/subscribe/{key}
```
---
[<- Конфигурация](Configuration_ru) | [Протокол ->](Protocol-Design_ru)