Getting Started with RiskGate

Live regime, anomaly, and sentiment signals for 14 crypto assets — in a single API call. No account required to start.

RiskGate is a market intelligence API built for autonomous agents and crypto platforms. It continuously monitors 14 assets, classifies market regimes, detects anomalies, and aggregates sentiment — then exposes all of it as structured JSON over a REST API.

The design philosophy is headless-first. There is no dashboard to log into, no chart to read. You query an endpoint, get a machine-readable signal, and your agent or platform decides what to do with it. This guide gets you from zero to a working integration in about five minutes.

01 — The demo key

Every request requires an API key in the X-API-Key header. You can start immediately with the shared demo key — no account, no credit card.

Demo API Key
rg_demo_openclaw

Shared key · rate limited per IP

10 calls / day · resets midnight UTC

Responses tagged "tier": "demo"

The demo key is intentionally shared and public. It's enough to explore the data, validate schema compatibility, and decide whether RiskGate fits your use case. Execution agents that run continuously will need a paid key — the limit creates conversion pressure by design.

02 — Your first call

The primary endpoint is /v1/analysis/current. It returns regime classification, anomaly detection, and sentiment in a single call — and counts as 1 API credit. Use this one over the individual endpoints unless you have a specific reason not to.

bash
curl "https://api.riskgate.xyz/v1/analysis/current?asset=BTC" \
  -H "X-API-Key: rg_demo_openclaw"

The asset parameter accepts any of the 14 supported tickers: BTC ETH SOL BNB XRP ADA TRX SUI XTZ AVAX DOGE LINK DOT POL.

A typical response looks like this:

json · example response
{
  "asset": "BTC",
  "regime": "TRENDING_UP",
  "confidence": 0.9177,
  "adx_4h": 33.0055,
  "regime_duration_hours": 44.0,
  "timestamp": "2026-03-21T00:00:00+00:00",
  "anomaly_score": 0,
  "highest_anomaly_severity": "NONE",
  "sentiment_score": 0.23,
  "sentiment_signal": "BEARISH",
  "tier": "demo",
  "upgrade_url": "https://riskgate.xyz/portal",
  "disclaimer": "Signal only. Not financial advice. DYOR."
}

03 — Reading the signal

The response has three layers of intelligence. Understanding each one is prerequisite to building a reliable gate.

Regime

The regime field classifies the current market structure using ADX and EMA alignment across 1h and 4h timeframes. Four possible values:

Value Meaning
TRENDING_UP Directional upward momentum confirmed. ADX above 25, bullish EMA alignment.
TRENDING_DOWN Directional downward momentum. ADX above 25, bearish EMA alignment.
RANGING No clear trend. ADX below 20. Price consolidating within a range.
VOLATILE Elevated volatility without clean directional bias. Widen risk parameters or pause.

The confidence field (0.0–1.0) tells you how certain the model is about the regime classification. A regime with confidence below 0.65 should be treated as uncertain regardless of the label. adx_4h is the raw ADX value — above 25 confirms a trend, below 20 indicates ranging conditions.

regime_duration_hours tells you how long the current regime has been in effect. A regime that has held for 40+ hours carries more weight than one that just flipped.

Anomaly

Anomaly detection runs independently of regime classification. The key field is highest_anomaly_severity, which rolls up all active anomalies into a single severity tier:

Severity Recommended action
NONE No anomalies. Proceed normally.
LOW Minor signal irregularity. Proceed with awareness.
MEDIUM Elevated risk. Apply conservative parameters.
HIGH Pause. Request human approval before proceeding.
CRITICAL Halt immediately. Do not execute. Notify human.

Sentiment

sentiment_signal can be BULLISH, BEARISH, or NEUTRAL. Watch for divergence: when regime is TRENDING_UP but sentiment is BEARISH, that's a potential reversal signal worth surfacing to a human before acting on the trend.

BTC · Live Signal Snapshot Updates every 15 min
Regime
Confidence
Anomaly
Sentiment
ADX 4h
Regime Age

04 — Agent gate pattern

The most common integration pattern is a pre-execution gate: your agent checks RiskGate before taking any significant action, and applies a set of ordered rules to decide whether to proceed, pause, or halt. The order matters — anomaly checks always run before regime logic.

Gate Decision Rules — Apply In Order
  1. If highest_anomaly_severity == "CRITICAL" → HALT. Do not execute. Notify human immediately.
  2. If highest_anomaly_severity == "HIGH" → PAUSE. Surface to human for approval before proceeding.
  3. If confidence < 0.65 → apply conservative defaults regardless of regime.
  4. If regime == "TRENDING_DOWN" and confidence > 0.75 → reduce exposure or pause.
  5. If regime == "VOLATILE" → widen risk parameters or pause. Re-check in 2 hours.
  6. If regime == "TRENDING_UP" and highest_anomaly_severity in ["NONE", "LOW"] and confidence > 0.6 → proceed normally.

Here is a minimal Python implementation of this gate. It handles 5xx errors conservatively — if the API is down, it blocks execution rather than assuming the market is safe.

python · agent gate
import os
import httpx

RISKGATE_API_KEY = os.getenv("RISKGATE_API_KEY", "rg_demo_openclaw")
BASE_URL = "https://api.riskgate.xyz"

def check_gate(asset: str) -> dict:
    """
    Returns {"proceed": bool, "reason": str, "signal": dict | None}
    """
    try:
        r = httpx.get(
            f"{BASE_URL}/v1/analysis/current",
            params={"asset": asset},
            headers={"X-API-Key": RISKGATE_API_KEY},
            timeout=10,
        )
        if r.status_code >= 500:
            return {"proceed": False, "reason": "RiskGate API error — blocking execution", "signal": None}

        signal = r.json()
        severity = signal.get("highest_anomaly_severity", "NONE")
        regime   = signal.get("regime", "RANGING")
        conf     = signal.get("confidence", 0.0)

        if severity == "CRITICAL":
            return {"proceed": False, "reason": f"CRITICAL anomaly on {asset}", "signal": signal}

        if severity == "HIGH":
            return {"proceed": False, "reason": f"HIGH anomaly on {asset} — awaiting approval", "signal": signal}

        if conf < 0.65:
            return {"proceed": False, "reason": f"Low confidence ({conf:.2f}) — applying conservative defaults", "signal": signal}

        if regime == "TRENDING_DOWN" and conf > 0.75:
            return {"proceed": False, "reason": f"Confirmed downtrend on {asset} ({conf:.2f})", "signal": signal}

        if regime == "VOLATILE":
            return {"proceed": False, "reason": f"Volatile regime on {asset} — pausing", "signal": signal}

        if regime == "TRENDING_UP" and severity in ("NONE", "LOW") and conf > 0.6:
            return {"proceed": True, "reason": "Clear signal", "signal": signal}

        # Ranging or uncertain — conservative default
        return {"proceed": False, "reason": f"Uncertain regime ({regime}) — conservative default", "signal": signal}

    except Exception as e:
        return {"proceed": False, "reason": f"Gate check failed: {e}", "signal": None}


# Usage
result = check_gate("BTC")
if result["proceed"]:
    print(f"Gate open: {result['reason']}")
    # proceed with execution
else:
    print(f"Gate closed: {result['reason']}")
    # halt or notify human

05 — Check your remaining credits

You can check how many demo calls you have left for the day with the credits endpoint:

bash
curl "https://api.riskgate.xyz/v1/account/credits" \
  -H "X-API-Key: rg_demo_openclaw"

When the demo limit is reached, the API returns a 429 with an upgrade_url. Your agent should handle this gracefully — halt execution and notify a human rather than retrying or assuming the market is safe.

06 — Monitoring pattern

If your agent monitors rather than executes, the demo key budget comfortably covers BTC, ETH, and SOL across three cycles per day. A reasonable schedule aligned to the 15-minute data refresh:

python · monitoring loop
WATCHLIST = ["BTC", "ETH", "SOL"]

def morning_brief():
    print(f"📊 RiskGate Signal Report — {datetime.utcnow().strftime('%Y-%m-%d %H:%M')} UTC\n")
    for asset in WATCHLIST:
        result = check_gate(asset)
        sig = result.get("signal", {}) or {}
        regime   = sig.get("regime", "—")
        conf     = sig.get("confidence", 0)
        severity = sig.get("highest_anomaly_severity", "—")
        print(f"{asset}: {regime} | Confidence: {conf:.2f} | Anomaly: {severity}")

    print("\n⚠️  Flags: assets with HIGH/CRITICAL anomaly or TRENDING_DOWN + conf > 0.75")
    print("✅  Clear: assets with TRENDING_UP + anomaly NONE/LOW + conf > 0.6")

07 — Going further

The demo key is designed to prove value, not to power production agents. When you're ready to move beyond the daily limit, paid keys start at $49/month with 50,000 credits — enough for continuous monitoring of the full 14-asset watchlist at 15-minute intervals.

For M2M agent auth without embedding a human API key, RiskGate supports OAuth 2.0 Client Credentials. After upgrading, you can generate a client_id and client_secret from the portal and use them to request short-lived JWT access tokens.

The full API reference — including all endpoint schemas, field definitions, and error codes — lives at api.riskgate.xyz/docs.

Ready for production?

Paid keys start at $49/month. No contracts. Cancel any time.

Get a paid key → Browse the docs