{"openapi":"3.1.0","info":{"title":"CAPM & Beta API","version":"1.0.0","description":"Live capital-asset-pricing-model and systematic-risk analytics that quants and portfolio managers run on an asset against a market benchmark, computed on demand from the two series you pass in — no key, no cache, nothing stored. The beta endpoint regresses an asset's returns on the market's and returns the beta, the alpha (per period and annualised), the correlation and the R-squared, so you see how strongly the asset tracks the market and how much it amplifies it. The capm endpoint returns the CAPM expected return — risk-free rate plus beta times the market risk premium — and Jensen's alpha, the excess over what beta says the asset should earn; it also has a direct mode where you pass beta, market return and risk-free rate with no series. The treynor endpoint returns the Treynor ratio, the reward per unit of systematic (market) risk. This measures risk relative to a market — systematic risk — which is fundamentally different from single-series total-risk tools: it needs two series and answers how an asset moves with, and is priced against, the market. Works for any asset against any benchmark: stocks, funds, crypto, FX or a whole portfolio. Computed locally and deterministically, so it is instant and private. Ideal for portfolio analytics, factor and risk dashboards, fund fact-sheets and back-tests. Rates are fractions (0.02 = 2%). Live, nothing stored. 3 compute endpoints. For single-series Sharpe/volatility/drawdown use a risk-metrics API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/capm-api","description":"oanor gateway"}],"tags":[{"name":"CAPM"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/beta":{"get":{"operationId":"get_v1_beta","tags":["CAPM"],"summary":"Beta, alpha, correlation, R-squared","description":"","parameters":[{"name":"asset","in":"query","required":true,"description":"Asset price series (or returns with as=returns)","schema":{"type":"string"},"example":"100,103,101,106,104,109"},{"name":"market","in":"query","required":true,"description":"Market benchmark series","schema":{"type":"string"},"example":"200,202,201,204,203,206"},{"name":"as","in":"query","required":false,"description":"prices (default) or returns","schema":{"type":"string"},"example":"prices"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"beta":3.414164,"source":"CAPM","r_squared":0.999179,"correlation":0.99959,"observations":5,"interpretation":"more volatile than the market","alpha_annualised":-0.636076,"alpha_per_period":-0.00252411,"periods_per_year":252,"asset_return_annualised":4.500542,"market_return_annualised":1.504503},"meta":{"timestamp":"2026-06-11T07:49:25.094Z","request_id":"041f72df-b606-4612-83ad-a3300b51cc73"},"status":"ok","message":"Beta computed","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/capm":{"get":{"operationId":"get_v1_capm","tags":["CAPM"],"summary":"CAPM expected return + Jensen alpha","description":"","parameters":[{"name":"asset","in":"query","required":false,"description":"Asset series (series mode)","schema":{"type":"string"},"example":"100,103,101,106,104,109"},{"name":"market","in":"query","required":false,"description":"Market series (series mode)","schema":{"type":"string"},"example":"200,202,201,204,203,206"},{"name":"beta","in":"query","required":false,"description":"Beta (direct mode)","schema":{"type":"string"},"example":"1.2"},{"name":"market_return","in":"query","required":false,"description":"Market return (direct mode, fraction)","schema":{"type":"string"},"example":"0.08"},{"name":"risk_free","in":"query","required":false,"description":"Annual risk-free rate (fraction)","schema":{"type":"string"},"example":"0.02"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"beta":1.2,"mode":"direct","note":"Expected return = risk_free + beta x (market_return - risk_free). All rates as fractions (0.08 = 8%).","source":"CAPM","risk_free":0.02,"market_return":0.08,"market_risk_premium":0.06,"capm_expected_return":0.092},"meta":{"timestamp":"2026-06-11T07:49:25.206Z","request_id":"416dc418-e510-44c3-8b09-2aa345e6ca77"},"status":"ok","message":"CAPM computed","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/treynor":{"get":{"operationId":"get_v1_treynor","tags":["CAPM"],"summary":"Treynor ratio — reward per systematic risk","description":"","parameters":[{"name":"asset","in":"query","required":true,"description":"Asset price series","schema":{"type":"string"},"example":"100,103,101,106,104,109"},{"name":"market","in":"query","required":true,"description":"Market benchmark series","schema":{"type":"string"},"example":"200,202,201,204,203,206"},{"name":"risk_free","in":"query","required":false,"description":"Annual risk-free rate (fraction)","schema":{"type":"string"},"example":"0.02"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"beta":3.414164,"note":"Treynor = (asset return - risk_free) / beta, i.e. reward per unit of systematic (market) risk. Higher is better.","source":"CAPM","risk_free":0.02,"observations":5,"excess_return":4.480542,"jensens_alpha":-0.587792,"treynor_ratio":1.31234,"periods_per_year":252,"asset_return_annualised":4.500542},"meta":{"timestamp":"2026-06-11T07:49:25.301Z","request_id":"ff12339e-1c5a-469b-b056-93782ed6ad39"},"status":"ok","message":"Treynor ratio computed","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"asset & market = price series (default) or returns (as=returns), comma-separated oldest first, equal length. risk_free & periods_per_year optional; rates are fractions (0.02 = 2%).","source":"Computed in-process from caller-supplied asset & market series (no upstream)","service":"capm-api","endpoints":{"GET /v1/beta":"Beta, alpha, correlation, R-squared (asset=100,102,...&market=200,201,...).","GET /v1/capm":"CAPM expected return + Jensen's alpha; or direct mode (beta=1.2&market_return=0.08&risk_free=0.02).","GET /v1/meta":"This document.","GET /v1/treynor":"Treynor ratio — reward per unit of systematic risk (asset=...&market=...&risk_free=0.02)."},"description":"Live CAPM and systematic-risk (beta) analytics computed on demand from an asset and a market-benchmark series. The beta endpoint regresses asset returns on the market and returns beta, alpha, correlation and R-squared; the capm endpoint returns the CAPM expected return (risk-free + beta x market risk premium) and Jensen's alpha; the treynor endpoint returns the Treynor ratio (reward per unit of systematic risk). This measures risk relative to a market, distinct from single-series total-risk tools — it needs two series. Computed locally, nothing stored. Works for stocks, funds, crypto, FX or portfolios.","upstream_status":"ok"},"meta":{"timestamp":"2026-06-11T07:49:25.425Z","request_id":"2dd7c6ee-6cdd-431e-89ab-69da70dc8821"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":4800,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":720,"monthly_call_quota":92000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2080,"monthly_call_quota":480000,"rps_limit":18,"hard_limit":true},{"slug":"business","name":"Business","price_cents_month":4750,"monthly_call_quota":2950000,"rps_limit":45,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/capm-api"}