API Reference
CAP Computation Primitives
Base URL
https://api.abel.aiAuth Header
Authorization: Bearer sk-...predict()
Forecast a variable using its causal Markov blanket. More robust than statistical models because it only uses causally relevant predictors.
Parameters
| Name | Type | Description |
|---|---|---|
| target | string | Variable to predict (e.g. "BTCUSD_close") |
| horizon | int | Prediction steps ahead (1-30) |
Example
client.predict("BTCUSD_close", horizon=48)Response
{ "value": 63420, "ci_lower": 61800, "ci_upper": 65100,
"mb_variables": ["ETHUSD_close", "DXY", "SP500"] }explain()
Extract the minimal causal explanation set for a variable — its parents, children, and cross-domain causal chains.
Parameters
| Name | Type | Description |
|---|---|---|
| variable | string | Variable to explain |
| depth | int | Chain depth (1-5, default 2) |
| cross_domain | bool | Include cross-domain chains (default true) |
Example
client.explain("BTCUSD_close", depth=2, cross_domain=True)Response
{ "parents": [{ "name": "DXY", "influence": "MODERATE_NEGATIVE" }],
"cross_domain_chains": ["Fed_Rate → DXY → BTC"] }intervene()
Compute P(Y|do(X=x)) — the causal effect of intervening on X. Uses do-calculus, not correlation.
Parameters
| Name | Type | Description |
|---|---|---|
| treatment | string | Variable to intervene on |
| outcome | string | Variable to measure effect on |
| treatment_value | float | Intervention magnitude |
Example
client.intervene("Fed_Funds_Rate", "BTCUSD_close", treatment_value=0.5)Response
{ "effect": -0.042, "ci": [-0.021, -0.068],
"causal_chain": "Fed →[τ=5h]→ DXY →[τ=2h]→ BTC" }discover()
Learn causal structure from data. Automatically selects the best algorithm from 39 options based on data characteristics.
Parameters
| Name | Type | Description |
|---|---|---|
| data | base64 | CSV data (base64 encoded) |
| query | string | Analysis goal in natural language |
Example
client.discover(data=my_csv, query="What causes customer churn?")Response
{ "graph": { "nodes": [...], "edges": [...] },
"algorithm_used": "PC", "confidence": 0.87 }counterfactual()
What would have happened if…? Computes P(Y_{x'} | X=x, Y=y) using structural causal models.
Parameters
| Name | Type | Description |
|---|---|---|
| intervene_node | string | Variable that would have been different |
| observe_node | string | Variable to observe counterfactual outcome |
| intervene_value | float | Counterfactual value |
Example
client.counterfactual("NVDA_close", "AMD_close", intervene_value=0.01)Response
{ "counterfactual_value": 0.008, "actual_value": 0.012,
"difference": -0.004 }validate()
Test whether a causal graph is consistent with new data. Bootstrap confidence intervals and edge stability.
Parameters
| Name | Type | Description |
|---|---|---|
| graph_id | string | Graph to validate |
| test_data | base64 | New data to test against |
Example
client.validate(graph_id="g-123", test_data=new_csv)Response
{ "consistent": true, "edge_stability": 0.91,
"unstable_edges": [] }detect-regime()
Detect whether the causal structure has changed — G_t ≠ G_{t-1}. Identifies structural breaks and regime shifts in the underlying causal graph.
Parameters
| Name | Type | Description |
|---|---|---|
| graph_id | string | Graph to monitor for regime changes |
| window | int | Lookback window in time steps (default 30) |
Example
client.detect_regime(graph_id="g-123", window=30)Response
{ "regime_changed": true, "change_point": "2026-02-14",
"changed_edges": [{ "from": "DXY", "to": "BTC", "old_weight": -0.42, "new_weight": -0.11 }],
"confidence": 0.93 }check-reflexivity()
Test whether Abel's own output has become a causal variable in the graph — Soros-style reflexivity detection. Guards against self-fulfilling predictions.
Parameters
| Name | Type | Description |
|---|---|---|
| graph_id | string | Graph to check |
| output_variable | string | Abel's prediction variable to test |
Example
client.check_reflexivity(graph_id="g-123", output_variable="BTCUSD_prediction")Response
{ "reflexive": false, "feedback_strength": 0.02,
"threshold": 0.15, "safe": true }