canonical: https://jentic.com/apis/portfoliooptimizer.io/portfoliooptimizer

# Portfolio Optimizer

Portfolio Optimizer is a quantitative finance API offering 158 endpoints for analyzing and optimizing investment portfolios. It covers modern portfolio theory (mean-variance optimization, maximum Sharpe ratio, minimum variance), risk analysis (Value-at-Risk, Conditional VaR), asset correlation and covariance matrix estimation, hierarchical clustering, Monte Carlo simulation, factor models (Fama-French), and capital market assumptions. The API supports up to 100 assets and 2500 data points per authenticated request.

## For AI agents

Optimize investment portfolios using mean-variance analysis, calculate Value-at-Risk, estimate covariance matrices, run Monte Carlo simulations, and compute risk-adjusted returns across up to 100 assets.

## Scope

Does not handle trade execution, market data sourcing, or accounting - use for quantitative portfolio analysis and optimization only.

## Capabilities

- Optimize portfolios for minimum variance, maximum Sharpe ratio, or target return on the efficient frontier
- Calculate empirical, Gaussian, and Cornish-Fisher Value-at-Risk and Conditional VaR
- Estimate asset covariance and correlation matrices with shrinkage and denoising methods
- Run Monte Carlo return simulations with bootstrap and Gaussian models
- Apply hierarchical clustering and FTCA for asset grouping and diversification analysis
- Retrieve Fama-French factor model data for US, developed, and emerging markets
- Compute capital market assumptions averaged from leading financial institutions

## Use cases

### Mean-Variance Portfolio Optimization

Compute optimal asset weights using modern portfolio theory. The API provides minimum variance, maximum return, maximum Sharpe ratio, and mean-variance efficient portfolio optimizations. Each supports diversified variants, resampling-based methods for robustness, and subset resampling for large universes. Input asset returns and constraints, receive optimal weights.

Example prompt: Submit 5 asset return series to the `/portfolio/optimization/maximum-sharpe-ratio` endpoint and retrieve the optimal weight allocation

### Portfolio Risk Measurement

Quantify portfolio downside risk using multiple Value-at-Risk methodologies. The API offers empirical, Gaussian, Cornish-Fisher (with corrections), and historical VaR calculations, plus Conditional VaR variants. Each accepts portfolio weights and return data, returning risk metrics at configurable confidence levels.

Example prompt: Calculate the 95% Cornish-Fisher Value-at-Risk for a portfolio of 3 assets using `/portfolio/analysis/value-at-risk/cornish-fisher` with their historical returns

### Covariance Matrix Estimation

Estimate robust covariance and correlation matrices from asset return data using standard sample estimation, shrinkage methods, exponential weighting, and denoising techniques. The API supports up to 100 assets and provides both historical and forecast covariance matrices for use in downstream optimization.

Example prompt: Submit 10 asset return series to the covariance matrix estimation endpoint with Ledoit-Wolf shrinkage and retrieve the estimated matrix

### Monte Carlo Return Simulation

Generate simulated return scenarios for stress testing and scenario analysis. The API offers bootstrap simulations (sampling from historical returns) and Gaussian simulations (parametric generation from mean and covariance). Results feed into optimization and risk analysis endpoints for comprehensive portfolio evaluation.

Example prompt: Run a Gaussian Monte Carlo simulation of 1000 scenarios for 4 assets using `/assets/returns/simulation/monte-carlo/gaussian` with their mean returns and covariance matrix

### AI Agent Quantitative Analysis via Jentic

AI agents use Jentic to discover Portfolio Optimizer operations by intent, such as 'optimize portfolio for maximum Sharpe ratio' or 'calculate Value-at-Risk'. Jentic returns the operation schema with required input formats (arrays of asset returns, weight vectors), then handles X-API-Key injection for authenticated access to higher rate limits.

Example prompt: Search Jentic for 'optimize portfolio for minimum variance', load the operation schema, and execute with 5 asset return series to get optimal weights

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/portfolio/optimization/maximum-sharpe-ratio` | Find the portfolio with the highest risk-adjusted return |
| POST | `/portfolio/optimization/minimum-variance` | Compute the minimum risk portfolio |
| POST | `/portfolio/analysis/value-at-risk/cornish-fisher` | Calculate Cornish-Fisher VaR |
| POST | `/portfolio/optimization/mean-variance-efficient` | Find an efficient frontier portfolio for a target return |
| POST | `/assets/returns/simulation/monte-carlo/gaussian` | Run Gaussian Monte Carlo return simulations |
| POST | `/assets/clustering/hierarchical` | Hierarchical clustering of assets |
| GET | `/factors/models/fama-french/us` | Retrieve U.S. Fama-French factor data |
| GET | `/markets/capital-assumptions/usd` | Get USD capital market assumptions |

## Key resources

- **Portfolio Optimization** — Mean-variance, minimum variance, maximum Sharpe ratio, and diversified optimization methods
- **Portfolio Analysis** — Value-at-Risk, Conditional VaR, Sharpe ratio, and performance analytics
- **Assets** — Return calculation, correlation and covariance matrices, clustering, volatility estimation, and Monte Carlo simulation
- **Factors** — Fama-French risk model data and factor residualization
- **Market Indicators** — AIAE forecasts, capital market assumptions, and macro indicators

## Why Jentic

- **Setup:** Wiring Portfolio Optimizer by hand means learning its X-API-Key header auth and choosing between the default and EU-west-1 hosts yourself. Through Jentic you install once, import Portfolio Optimizer from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** Portfolio Optimizer takes its portfolios and asset data in the request body, so you limit the agent to the operations it needs, such as maximum-Sharpe-ratio optimization or value-at-risk analysis. Other computations are available only if you add them.
- **Credential handling:** Your Portfolio Optimizer API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'optimize a portfolio for maximum Sharpe ratio' or 'compute value at risk', and Jentic returns the matching Portfolio Optimizer operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Global Predictions API** — Economic forecasting and portfolio recommendations based on macroeconomic knowledge graphs
- **Polygon.io API** — Real-time and historical market data for price feeds into optimization models
- **Alpaca Trading API** — Commission-free trading to execute the portfolio allocations that optimization produces

## FAQ

### What authentication does the Portfolio Optimizer API use?

The API uses an optional X-API-Key header for authenticated access. Anonymous users get limited access (1 request per second, 20 assets, 500 data points). Authenticated users get 10,000 requests per 24 hours, 100 assets, 2,500 data points, and 2.5 seconds execution time. Through Jentic, the API key is stored encrypted and injected automatically.

### Can I compute the efficient frontier with the Portfolio Optimizer API?

Yes. The `/portfolio/optimization/mean-variance-efficient` endpoint finds a portfolio on the efficient frontier for a given target return. Use it repeatedly with different target returns to trace the full frontier. Diversified and resampling-based variants improve robustness for real-world asset data with estimation error.

### What are the rate limits for the Portfolio Optimizer API?

Anonymous users are limited to 1 request per second (shared across all anonymous users), 1 second execution time, 20 assets, and 500 data points. Authenticated users with an API key get 10,000 requests per 24 hours with concurrent access, 2.5 seconds execution time, 100 assets, and 2,500 data points. Rate limit details are returned in x-ratelimit-* response headers.

### How do I calculate Value-at-Risk through the Portfolio Optimizer API with Jentic?

Install the SDK with pip install jentic, then search for 'calculate portfolio Value-at-Risk'. Jentic returns the VaR operation schema (empirical, Gaussian, or Cornish-Fisher variants). Submit portfolio weights and historical asset returns to receive the VaR estimate at your chosen confidence level.

### Is the Portfolio Optimizer API free to use?

Yes, with limitations. Anonymous access is free but restricted to a subset of endpoints, 20 assets, and 1 request per second. Full access requires an API key obtained through a small monthly contribution. Contact portfoliooptimizer.io for pricing details.

### What optimization methods are available beyond mean-variance?

The API offers hierarchical risk parity, inverse volatility weighting, equal risk contribution, maximum diversification, and multiple risk-based optimization objectives including minimum tracking error and maximum Ulcer ratio. It also supports resampling-based variants of each method for improved out-of-sample robustness.

### Can I limit what my agent is allowed to do with the Portfolio Optimizer API?

Yes. Because you run Jentic One yourself, you decide which Portfolio Optimizer operations the agent can call, so you can allow only the ones it needs, such as maximum-Sharpe-ratio optimization or value-at-risk analysis, and leave the other computations unavailable unless you add them. Portfolios and asset return data are passed in the request body, so the agent works only with the inputs you provide to those permitted operations. Your API key is held by your own Jentic One instance and injected at execution time, so the agent scopes access under your rules rather than handling the credential itself.
