Programmatic portfolio optimization for AI agents, robo-advisors, and fintech apps. One API call to optimize, search, or stress-test any portfolio.
FolioForecast is a calculation engine. Your AI does the thinking — we do the math. Pick your path below and you'll be running portfolio optimizations in minutes.
Your AI analyzes. We calculate.
The FolioForecast API powers Portfolio, Budget, and Retirement tools. Pick your integration path — the math is the same, only the wiring differs.
Uses OpenAI Actions (OpenAPI). No install, no config — open a pre-built GPT or import our spec into your own. See the ChatGPT tab below.
No install. Paste our connector URL into claude.ai or the Claude mobile app, sign in with Clerk, and Claude can call our tools directly. See the Claude tab below.
For power users who prefer a local install. Uses the Model Context Protocol over stdio — same tools, same math, faster round-trip. See the Claude tab below.
Each GPT comes pre-configured with the right API schema and instructions. You'll need your own API key for full access — the GPT will ask for it or help you create one.
Without a key you get 10 demo calls/day. With a key: pay-as-you-go at $0.10/unit, or subscribe for $0.05/unit + 10 free units/month.
Want to build your own? Follow the steps below to create a custom GPT with your own API key.
Click the button above to go to your FolioForecast dashboard.
Under Settings → API Keys, click Create Key.
Copy the key that starts with ff_live_ — you'll need it in a moment.
In ChatGPT, click your profile picture → My GPTs → Create a GPT. This creates a version of ChatGPT that knows how to talk to FolioForecast.
In the GPT editor, go to the Configure tab → scroll to Actions → click Create new action. Under Import from URL, paste this OpenAPI spec URL:
https://www.folioforecast.com/api/v1/openapi.json
Then click Authentication → choose API Key → set the header name to X-API-Key → paste your key.
In the Instructions field of your Custom GPT, paste this (or write your own):
You are a portfolio analyst powered by FolioForecast. When a user asks about investing or portfolios: 1. Use /api/v1/search to find the right ticker symbols. 2. Use /api/v1/optimize to calculate optimal portfolio weights. 3. Explain the results in plain English — what to buy, how much, and why. FolioForecast is a calculator, not an advisor. Always remind users the results are math, not advice.
Save your GPT and ask it something like: "Optimize a portfolio of AAPL, MSFT, GOOGL, and AMZN for maximum risk-adjusted return." ChatGPT will call FolioForecast, get the math, and explain the results to you.
There are two ways to connect Claude to FolioForecast — both use the same tool surface
(optimize_portfolio, search_tickers, stress_test,
and 16 more). Pick whichever matches your workflow.
Uses our hosted Custom Connector. Sign in with your FolioForecast account and Claude can call your portfolio, budget, and retirement tools from any claude.ai chat. Works on desktop browsers, the Claude mobile app, and claude.com.
This is the only thing Claude needs to find us:
https://www.folioforecast.com/mcp
In claude.ai → Settings → Connectors, click Add custom connector and paste the URL above. Claude will redirect you to FolioForecast to sign in — your Clerk login works as-is, no new password.
First connect? We create a dedicated API key for you behind the scenes (tier: starter — same free credits as any new account) and link Claude to it. You can revoke the connection any time from the FolioForecast dashboard.
Open a new chat in claude.ai and ask:
Using FolioForecast, optimize a portfolio of AAPL.US, MSFT.US, GOOGL.US, AMZN.US against SPY.US for maximum Sharpe ratio. Show the weights and metrics.
Claude will prompt you to approve FolioForecast the first time a tool is called,
then run optimize_portfolio and explain the results.
For power users who want the tools running on their own machine (faster, runs offline for everything except market data). Works with Claude Desktop, Claude Code, Cursor, and Windsurf.
Click Get Your Free API Key above to open your FolioForecast dashboard.
Under Settings → API Keys, click Create Key.
Copy the key that starts with ff_live_.
Two runtimes, same tools. Pick whichever ecosystem you already have.
Requires Node 18 or newer. Installs globally as folioforecast-mcp.
npm install -g @folioforecast/mcp-server
Requires Python 3.10 or newer. Same tool surface as the Node server.
pip install "folioforecast[mcp]"
The Python package is in the repo and tagged v0.1.0. PyPI upload is imminent — watch the GitHub release for the green light.
New to the terminal? On Mac, search for “Terminal” in Spotlight. On Windows, search for “Command Prompt” or “PowerShell.” Paste the command and press Enter.
Open Claude Desktop → Settings (gear icon) → Developer → Edit Config. Paste one of the snippets below into the JSON file that opens, using the runtime you just installed.
Node runtime
{
"mcpServers": {
"folioforecast": {
"command": "folioforecast-mcp",
"env": {
"FOLIOFORECAST_API_KEY": "ff_live_YOUR_KEY_HERE"
}
}
}
}
Python runtime
{
"mcpServers": {
"folioforecast": {
"command": "python",
"args": ["-m", "folioforecast.mcp"],
"env": {
"FOLIOFORECAST_API_KEY": "ff_live_YOUR_KEY_HERE"
}
}
}
}
Save the file and restart Claude Desktop. You should see the FolioForecast tools appear in the attachment menu (the paperclip icon).
Open a new chat in Claude Desktop (not claude.ai in your browser — that doesn’t load MCP servers) and ask:
Optimize a portfolio of AAPL.US, MSFT.US, GOOGL.US, and AMZN.US for maximum Sharpe ratio. Use SPY.US as the benchmark and show me the weights and metrics.
Claude will call optimize_portfolio, get the math back from our engine, and explain the results in plain English.
Tip: tickers work best in SYMBOL.EXCHANGE format (e.g. AAPL.US, VOD.LSE).
The folioforecast Python SDK wraps the same HTTP API in a clean synchronous client.
Zero heavy dependencies — just httpx. Python 3.10 or newer. Ideal for scripts,
notebooks, cron jobs, and backtests.
Open your FolioForecast dashboard.
Under Settings → API Keys, click Create Key.
Copy the key that starts with ff_live_.
Open your terminal and run:
pip install folioforecast
v0.1.0 is in the repo; PyPI publish is imminent. Until then you can install directly from source:
# Interim — install from the repo
git clone https://github.com/shadow6-actual/V6_EODHD_POpt.git
cd V6_EODHD_POpt/python-sdk
pip install -e .
New to Python? Grab it free from python.org, then open Terminal (Mac) or PowerShell (Windows) to run the command above.
Create a new file (e.g. my_portfolio.py) and paste this:
import folioforecast as ff client = ff.Client(api_key="ff_live_YOUR_KEY_HERE") # Ask FolioForecast to calculate the optimal mix result = client.optimize( tickers=["AAPL.US", "MSFT.US", "GOOGL.US", "AMZN.US"], goal="max_sharpe", ) print(result.weights) # {'AAPL.US': 0.30, 'MSFT.US': 0.25, ...} print(result.metrics) # {'sharpe': 1.42, 'volatility': 0.18, ...}
Ticker format: use SYMBOL.EXCHANGE (e.g. AAPL.US, VOD.LSE,
SAP.XETRA). The SDK also exposes search_tickers(),
stress_test(), asset_metadata(), and usage().
In your terminal:
python my_portfolio.py
That’s it. FolioForecast does the heavy math — your code just sends tickers and gets back optimal weights and metrics.
httpx, requests, or curl against
https://www.folioforecast.com/api/v1. See the
OpenAPI spec
for the full request/response shapes.
The FolioForecast API gives you the same professional-grade optimization engine that powers our web app — accessible via simple REST calls.
Let LLM-powered agents optimize portfolios on behalf of users. Provide tickers and constraints, get back optimal weights and metrics.
Power automated portfolio management with Mean-Variance, CVaR, Risk Parity, and robust optimization methods — no quant team required.
Embed optimization results, stress tests, and efficient frontier data into your own app or internal tools.
Four endpoints cover the full optimization workflow. All return JSON.
# Health check — no authentication required curl https://www.folioforecast.com/api/v1/health # Response { "status": "ok", "version": "v1", "api": "FolioForecast Agent API", "auth": "API key (X-API-Key header)", "billing": "Usage-based per compute unit ($0.05 subscriber / $0.10 pay-as-you-go)", "rate_limiting": "Per API key, tier-based RPM limits. See X-RateLimit-* headers.", "docs": "https://www.folioforecast.com/developers", "openapi_spec": "https://www.folioforecast.com/api/v1/openapi.yaml", "key_format": "ff_live_<32-char-hex>", "optimization_goals": ["equal_weight", "max_sharpe", "min_volatility", ...], "endpoints": { ... } }
Building an AI agent? Import our OpenAPI spec directly:
Each API key is scoped to a single environment and tied to a billing account.
Production keys start with ff_live_ followed by 32 hex characters.
Sandbox keys use ff_test_ — same format, no billing.
Pass your key via the X-API-Key header on every request.
Alternatively, use Authorization: Bearer ff_live_....
Limits are per API key, not per IP. Responses include
X-RateLimit-Remaining and Retry-After headers.
Keys are SHA-256 hashed at rest — we never store your raw key. Rotate keys anytime from your dashboard. HTTPS required on all calls.
Every API call costs compute units. Subscribers get 10 free units/month and half-price rates. No subscription? No problem — just sign up and add a payment method.
Subscribe to Individual ($8/mo) or Advisor (waitlist) to unlock half-price API rates + 10 free units + full web app. Need volume? Contact us for enterprise pricing.
Create a free account, add a payment method, and generate your API key — all in under 2 minutes.
Create a free FolioForecast account (takes 30 seconds)
Add a payment method via Stripe (only charged for usage)
Generate an API key and start making calls
/optimize, /search, /crisis-scenarios, and /asset-metadata
right away. Subscribers get even better rates. See the OpenAPI spec for full details.
npm install -g @folioforecast/mcp-server ships an MCP server for Claude Desktop, Cursor, and Windsurf.pip install folioforecast ships a synchronous SDK and a Python MCP server (python -m folioforecast.mcp). v0.1 rolling out to PyPI.curl — import our
OpenAPI spec into your code generator of choice.
ff_test_*) hit the same endpoints but don't incur billing. Use them for
development and testing. Switch to production keys (ff_live_*) when you're ready to go live.
The API is live. Create a free account, add a payment method, and start building in minutes — no subscription required.