Authentication
All API requests require a valid API key passed via the X-API-Key header or as a Bearer token:
X-API-Key: mr_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Generate keys in the API Keys tab .
Send a message to the MardRisk AI financial assistant. Supports Q&A, financial analysis, and agentic execution.
cURL
Python
JS/TS
curl -X POST https://mardrisk.ai/api/chat \
-H "X-API-Key: mr_live_...your_key..." \
-H "Content-Type: application/json" \
-d '{
"message": "What is the current exchange rate for USD/AMD?",
"mode": "regular"
}'
import httpx
resp = httpx.post(
"https://mardrisk.ai/api/chat",
headers={"X-API-Key": "mr_live_...your_key..."},
json={"message": "What is the USD/AMD rate?", "mode": "regular"},
)
print(resp.json())
const resp = await fetch("https://mardrisk.ai/api/chat", {
method: "POST",
headers: { "X-API-Key": "mr_live_...your_key...", "Content-Type": "application/json" },
body: JSON.stringify({ message: "What is the USD/AMD rate?", mode: "regular" }),
});
const data = await resp.json();
console.log(data);
Agentic mode — triggers autonomous analysis: Monte Carlo simulation, live web search, financial forecasting.
cURL
Python
JS/TS
curl -X POST https://mardrisk.ai/api/chat \
-H "X-API-Key: mr_live_...your_key..." \
-H "Content-Type: application/json" \
-d '{
"message": "Run a Monte Carlo simulation on a $500K portfolio with 60/30/10 stocks/bonds/crypto allocation",
"mode": "simulation"
}'
resp = httpx.post(
"https://mardrisk.ai/api/chat",
headers={"X-API-Key": "mr_live_...your_key..."},
json={"message": "Simulate a 70/30 portfolio over 10 years", "mode": "simulation"},
)
print(resp.json())
const resp = await fetch("https://mardrisk.ai/api/chat", {
method: "POST",
headers: { "X-API-Key": "mr_live_...your_key...", "Content-Type": "application/json" },
body: JSON.stringify({ message: "Simulate a 70/30 portfolio over 10 years", mode: "simulation" }),
});
const data = await resp.json();
Get system status and available finance data sources.
curl -H "X-API-Key: mr_live_...your_key..." https://mardrisk.ai/api/finance/status
Aggregated market data — indices, forex, crypto, commodities.
curl -H "X-API-Key: mr_live_...your_key..." https://mardrisk.ai/api/finance/market-data
AI-powered price forecast for any ticker symbol (stocks, crypto, indices).
curl -X POST https://mardrisk.ai/api/finance/forecast \
-H "X-API-Key: mr_live_...your_key..." \
-H "Content-Type: application/json" \
-d '{"symbol": "AAPL", "horizon_days": 30}'
List community posts with optional tag filtering and pagination.
curl "https://mardrisk.ai/api/community/posts?page=1&tags=stocks,mutual_funds" \
-H "X-API-Key: mr_live_...your_key..."
Create a new discussion post in the community.
curl -X POST https://mardrisk.ai/api/community/posts \
-H "X-API-Key: mr_live_...your_key..." \
-H "Content-Type: application/json" \
-d '{"title": "Market Analysis", "content": "Thoughts on Q3 earnings?", "tags": "stocks,analysis"}'
Get the current authenticated user's profile.
curl -H "X-API-Key: mr_live_...your_key..." https://mardrisk.ai/api/auth/me
Calculate a financial risk score based on income, debt, assets, and market conditions.
curl -X POST https://mardrisk.ai/api/finance/risk-score \
-H "X-API-Key: mr_live_...your_key..." \
-H "Content-Type: application/json" \
-d '{"income": 50000, "debt": 15000, "savings": 20000}'