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 predictionhour_idx=24: Upside probability for 24-hour prediction (default)
Response
upside_probability: Upside probability for the specifiedhour_idxupside_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
Fast API endpoint - Returns JSON only, no plot generation.
Use this for programmatic access when you don't need the chart.
1 24
Detail API endpoint - Returns all Monte Carlo sample paths with full OHLCV data.
Use this for detailed analysis when you need all individual prediction paths, not just summary statistics (mean/min/max).
Response includes:
predictions: Summary statistics for close price (mean, min, max)upside_probability_all_hours: Upside probabilities for all 24 hoursall_samples.open: All open price prediction paths (pred-1, pred-2, ..., pred-N)all_samples.high: All high price prediction pathsall_samples.low: All low price prediction pathsall_samples.close: All close price prediction pathsall_samples.volume: All volume prediction paths
1 24
Provide your own OHLCV data for prediction.
Input Format:
{
"timestamps": ["2024-01-01T00:00:00", "2024-01-01T01:00:00", ...],
"open": [100.0, 101.0, ...],
"high": [101.0, 102.0, ...],
"low": [99.0, 100.0, ...],
"close": [100.5, 101.5, ...],
"volume": [1000.0, 1100.0, ...],
"amount": [100000.0, 110000.0, ...]
}
1 48
1 100
0.1 2
0.1 1
1 48
Model: Kronos-mini (4.1M params) | Paper: arXiv:2508.02739