JANUS
Janus API

The Janus engine,
from your code.

The same analysis you see in the Analytics console, over HTTPS: a full narrative for any portfolio, answers to questions about its strategy, and a risk profile with an AI read. Requests and responses are JSON.

Base URLhttps://ai.momentocapital.com/api/v1
Formatapplication/json
AuthX-API-Key
01Quickstart

Your first request

  1. Get a key. Keys are issued by Momento Capital. Write to info@momentocapital.com. Every key starts with janus_.
  2. Pick a portfolio. Use the portfolio ID you see in the Analytics console, e.g. mc_val_1.
  3. Ask a question.
$ curl -X POST https://ai.momentocapital.com/api/v1/analyst/chat \
    -H "X-API-Key: janus_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{"portfolio_id": "mc_val_1", "question": "What are the main risk factors?"}'

The answer comes back as Markdown in answer_markdown, ready to render.

02Authentication

Send your key with every request

Every endpoint requires an API key. Pass it in one of three ways; the header is recommended.

MethodExample
Header (recommended)X-API-Key: janus_your_key_here
Bearer tokenAuthorization: Bearer janus_your_key_here
Query string?api_key=janus_your_key_here
Keep your key secret. It is shown only once, when it is issued. Don't put it in front-end code or in URLs that get logged; call the API from your server. If a key leaks, ask us to revoke it and we'll issue a new one.
03Endpoint

POST/analyst/analyze

A full narrative for one portfolio over a date range: performance against SPY and QQQ, current holdings and how the strategy behaved, written up by Janus.

Request body

FieldTypeDescription
portfolio_idrequiredstringPortfolio ID, e.g. mc_val_1.
start_daterequiredstringStart of the window, YYYY-MM-DD.
end_daterequiredstringEnd of the window, YYYY-MM-DD. Must not be before start_date.

Example

curl -X POST https://ai.momentocapital.com/api/v1/analyst/analyze \
  -H "X-API-Key: janus_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "portfolio_id": "mc_val_1",
    "start_date": "2025-01-01",
    "end_date": "2025-12-31"
  }'

Response 200

{
  "portfolio_id": "mc_val_1",
  "start_date": "2025-01-01",
  "end_date": "2025-12-31",
  "analysis_markdown": "## Summary\n…",
  "source": "ai"
}

source is "ai" when the narrative was written by the model, or "fallback" when the model was unavailable and a standard template summary was returned instead.

04Endpoint

POST/analyst/chat

Ask Janus anything about a portfolio's strategy and get an analyst-grade answer. Choose the tone: quantitative for statistical detail, or finance for investor-ready language.

Request body

FieldTypeDescription
portfolio_idrequiredstringPortfolio ID.
questionrequiredstringYour question, in plain language.
analyst_profilestring"quantitative" (default) or "finance".

Example

curl -X POST https://ai.momentocapital.com/api/v1/analyst/chat \
  -H "X-API-Key: janus_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "portfolio_id": "mc_val_1",
    "question": "What are the main risk factors in this strategy?",
    "analyst_profile": "finance"
  }'

Response 200

{
  "portfolio_id": "mc_val_1",
  "question": "What are the main risk factors in this strategy?",
  "analyst_profile": "finance",
  "answer_markdown": "**Concentration**: 41% of gross exposure in Information Technology…",
  "source": "ai"
}

If the model is unavailable, source is "fallback" and the answer only restates the strategy and your question. Retry after a moment.

05Endpoint

POST/analyst/risk

A risk profile for one portfolio over a date range (drawdown, volatility, VaR, CVaR, CAGR, Calmar and the shape of the return distribution) plus a narrative that puts the numbers in context.

Request body

FieldTypeDescription
portfolio_idrequiredstringPortfolio ID.
start_daterequiredstringStart of the window, YYYY-MM-DD.
end_daterequiredstringEnd of the window, YYYY-MM-DD.

Example

curl -X POST https://ai.momentocapital.com/api/v1/analyst/risk \
  -H "X-API-Key: janus_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "portfolio_id": "mc_val_1",
    "start_date": "2025-01-01",
    "end_date": "2025-12-31"
  }'

Response 200

{
  "portfolio_id": "mc_val_1",
  "start_date": "2025-01-01",
  "end_date": "2025-12-31",
  "risk_metrics": {
    "max_drawdown_pct": -10.42,
    "volatility_ann_pct": 19.85,
    "var_95_pct": 1.97,
    "cvar_95_pct": -2.61,
    "cagr_pct": 43.6,
    "calmar_ratio": 4.18,
    "skewness": -0.1842,
    "kurtosis": 1.2207,
    "n_observations": 251
  },
  "risk_narrative": "## Risk profile\n…",
  "source": "ai"
}

Risk metrics

FieldMeaning
max_drawdown_pctWorst peak-to-trough fall in the window, in % (negative).
volatility_ann_pctAnnualized volatility of daily returns, in %.
var_95_pctOne-day Value at Risk at 95% (parametric), as a positive loss in %.
cvar_95_pctAverage daily return on the worst 5% of days (historical expected shortfall), in % (negative).
cagr_pctCompound annual growth rate, in %. null for windows shorter than one year, which are not annualized.
calmar_ratioCAGR divided by the absolute max drawdown. null when CAGR is not available or there was no drawdown.
skewness, kurtosisShape of the daily return distribution (kurtosis is excess kurtosis).
n_observationsNumber of daily values used.
06Errors

When something goes wrong

Errors return a JSON body with an error message. Authentication errors also include a code.

HTTPCodeMeaning
400—A required field is missing, a date is not YYYY-MM-DD, or start_date is after end_date.
401MISSING_API_KEYNo API key was sent.
401INVALID_API_KEYThe key doesn't exist or has been revoked.
404—No data for that portfolio and date range.
500—Something failed on our side. Retry; if it persists, contact us.
// 401
{
  "error": "Invalid or revoked API key.",
  "code": "INVALID_API_KEY"
}

Responses that involve the AI model can take several seconds. Use a generous client timeout (60–120 s).

07Coming soon

More of the console, over the API

These tools are live in the Analytics console today and are on the way to the API.

01

Compare

Metrics, equity curves and year-by-year track records for several strategies at once.

02

Outlook

Scenarios, volatility and market regime from past data, with a short AI read.

03

Discover

Rank every portfolio by Sharpe, return, drawdown or any other metric.

Want early access, or need something else? info@momentocapital.com