Kronos: BTC/USDT Price Forecast API

This Space provides an API for probabilistic BTC/USDT price forecasting using the Kronos foundation model.

Quick Start (Python)

from gradio_client import Client

client = Client("xianqiu/qlang")

# Fast API call (no plot, recommended)
# hour_idx: which hour to calculate upside probability (1-24, default=24)
result = client.predict(align_to_hour=True, hour_idx=1, api_name="/predict_api")
print(result["upside_probability"])  # Upside prob for hour 1
print(result["upside_probability_all_hours"])  # Upside prob for all 24 hours

# With plot
plot, result = client.predict(align_to_hour=True, hour_idx=24, api_name="/predict")

# Detail API - returns all Monte Carlo sample paths with full OHLCV
result = client.predict(align_to_hour=True, hour_idx=1, api_name="/predict_all")
print(result["all_samples"]["close"])  # All 30 close price prediction paths

API Endpoints

  • /predict_api - Recommended: JSON-only response (faster, no plot)
  • /predict - With plot (for visualization)
  • /predict_all - Returns all Monte Carlo sample paths with full OHLCV (for detailed analysis)
  • /predict_custom - Custom OHLCV data prediction

Parameters

  • align_to_hour: If True, use data up to last completed hour (matches official demo)
  • hour_idx: Which hour to calculate upside probability for (1-24, default=24)
    • hour_idx=1: Upside probability for 1-hour prediction
    • hour_idx=24: Upside probability for 24-hour prediction (default)

Response

  • upside_probability: Upside probability for the specified hour_idx
  • upside_probability_all_hours: Upside probabilities for all 24 hours

Generate 24-hour BTC/USDT price forecast.

Data Mode:

  • Hourly Aligned: Use data up to last completed hour (matches official demo for comparison)
  • Realtime: Use all available data including current incomplete hour

Hour Index:

  • Which hour to calculate upside probability for (1 = first hour, 24 = last hour)

If checked, excludes current incomplete hour for consistency with official demo

1 24

Model: Kronos-mini (4.1M params) | Paper: arXiv:2508.02739