Документация
Хост · TreVmS
TreVmS Data API — read-oriented HTTP-шлюз к барам, метрикам, Market Context, ML-инференсу на бар (GMM-HSMM, AMPPS) и калибровке GUARD (FUSE → latest + bins). Данные из platform stores (market.bars / features / predictions / ultimate.context / guard); пути /market-state/* сохранены для совместимости. Аутентификация — X-API-Key. Ответы JSON; списки — limit/offset.
Передавайте личный ключ в каждом запросе: X-API-Key: <key>. Ключ выдаётся во вкладке Docs → Access после подписки Full API. Health (/health, /health/ready) без ключа. Неверный/отсутствующий ключ → 401. Превышение лимита → 429 с Retry-After.
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/inference/latest?symbol=ETHUSDT&timeframe=5m" # platform: market.bars + predictions.values (gmm_hsmm|ampps)
Liveness и readiness. API-ключ не нужен.
| Метод | Путь | Описание |
|---|---|---|
| GET | /health | Liveness процесса |
| GET | /health/ready | Postgres + читаемость platform stores |
auth · нет
curl https://TreVmS/health
auth · нет
curl https://TreVmS/health/ready
OHLCV и ML-инференс. Источник — platform Postgres (market.bars, predictions.values). Пути /api/v1/market-state/* без изменений. Нужен X-API-Key. Сырые семейства — тариф Full API.
| Метод | Путь | Описание |
|---|---|---|
| GET | /api/v1/market-state/symbols | Discovery пар (symbol, timeframe) |
| GET | /api/v1/market-state/bars | История OHLCV |
| GET | /api/v1/market-state/bars/latest | Последний бар |
| GET | /api/v1/market-state/inference/latest | Последний closed-бар + payloads всех семейств моделей |
| GET | /api/v1/market-state/inference/history | Временной ряд одного семейства моделей |
| GET | /api/v1/market-state/inference/versions | Отслеживание раскатки model_version |
auth · X-API-Key
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/symbols"
auth · X-API-Key · query · symbol, timeframe, since?, until?, limit?, offset?
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/bars?symbol=ETHUSDT&timeframe=5m&limit=100"
auth · X-API-Key · query · symbol, timeframe
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/bars/latest?symbol=ETHUSDT&timeframe=5m"
auth · X-API-Key · Full API · query · symbol, timeframe
curl -H "X-API-Key: $KEY" \
"https://TreVmS/api/v1/market-state/inference/latest?symbol=ETHUSDT&timeframe=5m"
# → { hmm, forecast } from predictions.values (families gmm_hsmm, ampps)auth · X-API-Key · Full API · query · symbol, timeframe, family=hsmm|gmm_hsmm|ampps|thrust, limit?
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/inference/history?symbol=ETHUSDT&timeframe=15m&family=ampps&limit=20" # family=hsmm|gmm_hsmm|ampps|thrust → ultimate.outputs
auth · X-API-Key · query · symbol, timeframe, family
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/inference/versions?symbol=ETHUSDT&timeframe=5m&family=ampps"
Активные инструменты, готовность по символу и badges watchlist. Readiness — platform bars + predictions (с lookback).
| Метод | Путь | Описание |
|---|---|---|
| GET | /api/v1/market-state/instruments/active | Инструменты со свежими барами и ready-моделями |
| GET | /api/v1/market-state/instruments/{symbol}/{timeframe}/status | Статус готовности одного инструмента |
| GET | /api/v1/market-state/watchlist | Строки watchlist (ML badge при tier ≥ indicators) |
auth · X-API-Key
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/instruments/active"
auth · X-API-Key
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/instruments/ETHUSDT/5m/status"
auth · X-API-Key · query · timeframe?
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/watchlist?timeframe=5m"
Каталог и серии для оверлеев Chart. Series требует тариф Indicators или выше. Auth: X-API-Key или Bearer-сессия.
| Метод | Путь | Описание |
|---|---|---|
| GET | /api/v1/market-state/indicators/catalog | Каталог индикаторов (locked по тарифу) |
| GET | /api/v1/market-state/indicators/series | Временной ряд индикатора |
auth · X-API-Key или Bearer
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/indicators/catalog"
auth · tier ≥ indicators · query · symbol, timeframe, key, limit?
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/indicators/series?symbol=ETHUSDT&timeframe=5m&key=hmm_confidence&limit=200"
Каталог и серии датчиков (OI, funding, CVD, RSI, …) из features.values и vendor_index.
| Метод | Путь | Описание |
|---|---|---|
| GET | /api/v1/market-state/metrics/catalog | Каталог метрик |
| GET | /api/v1/market-state/metrics/latest | Последний снимок метрик |
auth · X-API-Key
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/metrics/catalog"
auth · X-API-Key · query · symbol, timeframe
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/market-state/metrics/latest?symbol=ETHUSDT&timeframe=5m"
Собранный контекст C_t из Regime / Volatility / Conditions. Store: ultimate.context. Не обученное ADUL-семейство — fingerprint + observed|inferred JSON.
| Метод | Путь | Описание |
|---|---|---|
| GET | /api/v1/context/latest | Последний снимок MarketContext |
| GET | /api/v1/context/history | История MarketContext |
| GET | /api/v1/context/reconstruct | Реконструкция C_t на timestamp |
auth · X-API-Key · Full API · query · symbol, timeframe
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/context/latest?symbol=ETHUSDT&timeframe=5m"
auth · X-API-Key · Full API · query · symbol, timeframe, limit?, from?, to?
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/context/history?symbol=ETHUSDT&timeframe=5m&limit=100"
auth · X-API-Key · Full API · query · symbol, timeframe, ts
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/context/reconstruct?symbol=ETHUSDT&timeframe=5m&ts=2026-08-01T12:00:00Z"
FUSE(MODEL) → GUARD: агрегированная калибровка. Не event log прогнозов. В проде только FUSE(HSMM). Схема guard.latest + guard.calibration_stats. Заменяет Reality / Validation.
| Метод | Путь | Описание |
|---|---|---|
| GET | /api/v1/guard/latest | Актуальная калиброванная уверенность |
| GET | /api/v1/guard/stats | Бин-кривая калибровки |
| GET | /api/v1/guard/health | Heartbeat джоба GUARD |
auth · X-API-Key · Full API · query · symbol?, timeframe?, model?, output?
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/guard/latest?symbol=ETHUSDT&timeframe=5m&model=hsmm"
auth · X-API-Key · Full API · query · symbol, timeframe?, model?, output?, horizon?
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/guard/stats?symbol=ETHUSDT&timeframe=15m&output=map&horizon=0"
auth · X-API-Key · Full API
curl -H "X-API-Key: $KEY" \ "https://TreVmS/api/v1/guard/health"
Датасеты, Event Explorer (условные распределения + EvidenceObject), Research Presets и обзор Trade-альф. Bearer auth. Горизонты — целые кратные бару датасета. Decision может отказать в сделке при недостаточном evidence. См. docs/research/PIPELINE_RU.md.
| Метод | Путь | Описание |
|---|---|---|
| POST | /api/v1/datasets | Создать датасет (view/snapshot) |
| POST | /api/v1/research/events | Events + integrity + evidence |
| POST | /api/v1/research/objects/from-events | Сохранить Research Preset из events |
| DELETE | /api/v1/research/objects/{id} | Удалить Research Preset |
| GET | /api/v1/research/alphas | Список Trade-альф (вид Research) |
auth · Bearer
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"instruments":["ETHUSDT"],"range":{"from":"...","to":"..."},"timeframe":"15m","kind":"view"}' \
"https://TreVmS/api/v1/datasets"auth · Bearer
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"dataset_id":9,"query":"hurst_exponent > 0.7","integrity":true}' \
"https://TreVmS/api/v1/research/events"auth · Bearer
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"name":"H>0.7 · 1d","dataset_id":9,"query":"hurst_exponent > 0.7","horizon":"1d"}' \
"https://TreVmS/api/v1/research/objects/from-events"auth · Bearer · владелец или admin
curl -X DELETE -H "Authorization: Bearer $TOKEN" \ "https://TreVmS/api/v1/research/objects/12"
auth · Bearer
curl -H "Authorization: Bearer $TOKEN" \ "https://TreVmS/api/v1/research/alphas"
Ошибки: { "error": { "code", "message", "request_id" } }. Коды: invalid_query (400), unauthorized (401), payment_required (402), not_found (404), rate_limited (429), database_unavailable (503). Списки: { "data": [...], "page": { "limit", "offset", "count" } }. В каждом ответе — X-Request-Id.