API Live

Build with
FolioForecast

Portfolio and retirement calculator APIs for AI agents, developer workflows, and fintech apps. Use REST, GPT Actions, or MCP to calculate scenario output from user-supplied inputs.

Explore the API Safe AI Setup View Pricing
No subscription required Usage-based pricing Limited-scope keys
Quick Start

Getting Started — Connect Your AI Safely

FolioForecast is a calculation engine. Your AI can request the math and explain scenario output. Pick your path below and start with limited, revocable access.

Your AI explains. We calculate.

  Create Limited-Scope Agent Key
One calculator engine. Three safe connection paths.

The FolioForecast API powers Portfolio Optimization, Retirement Planning, and Budget surplus support. Pick your integration path — the math is the same, only the wiring differs.

ChatGPT — via Custom GPT

Uses OpenAI Actions (OpenAPI) when supported by your ChatGPT plan. Import our spec and use a scoped key in the Action auth field. See the ChatGPT tab below.

claude.ai — Custom Connector new

No install. Paste our connector URL into claude.ai or the Claude mobile app, sign in with Clerk, and Claude can call our tools through OAuth. See the Claude tab below.

Claude Desktop / Cursor / Windsurf — local MCP

For users who prefer a local install. Uses the Model Context Protocol over stdio with a limited-scope agent key. See the Claude tab below.

Try our pre-built GPTs

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 limited demo access for health, search, metadata, and basic optimization. Usage, crisis scenarios, optimize comparison, saved data, and authenticated MCP tools require a key. With a key: pay-as-you-go at $0.10/unit, or subscribe for $0.05/unit + 10 free units/month.

Portfolio Optimizer Budget Planner Retirement Planner

Want to build your own? Follow the steps below to create a custom GPT with your own API key.

1

Get your 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.

2

Open ChatGPT and create a Custom GPT

In ChatGPT, click your profile picture → My GPTsCreate a GPT. This creates a version of ChatGPT that knows how to talk to FolioForecast.

3

Add the FolioForecast action

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.

4

Add these instructions

In the Instructions field of your Custom GPT, paste this (or write your own):

You are a portfolio calculator assistant 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 scenario outputs from the user's inputs.
3. Explain assumptions, risk metrics, and trade-offs in plain English.
4. Do not tell the user what to buy or sell.

FolioForecast is a calculator, not an advisor.
Always remind users the results are math, not advice.
5

Try it out

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.

Path A — claude.ai web & mobile (no install) OAuth

Connect once and Claude can call your portfolio, budget, and retirement tools right inside any claude.ai chat — no downloads, no command line. Works in a web browser and the Claude mobile app. Takes about two minutes.

Before you start You’ll need two free things, both take a minute each:
  • A Claude.ai account on a paid plan (Pro, Max, Team, or Enterprise — custom connectors aren’t available on the free tier).
  • A FolioForecast account. If you don’t have one, Claude will prompt you to create one during step 2 — email + password, no credit card.
1

Copy the connector URL

This is the only thing Claude needs. Click Copy to put it on your clipboard:

https://www.folioforecast.com/mcp
2

Add FolioForecast to Claude

Open claude.ai/settings/connectors (Claude now calls this the Customize → Connectors page — the old URL redirects there). Scroll to the bottom and click Add custom connector.

In the pop-up:

  • Name: type anything you’ll recognise — FolioForecast works.
  • URL: paste the address from Step 1.
  • Click the black Add button.

Claude will send you over to a FolioForecast page that says “Allow access to your account?” Sign in with your FolioForecast email and password if prompted, then click the green Allow button. You’ll pop right back into Claude.

3

Try it out

Open a new chat on claude.ai and ask something like:

Using FolioForecast, optimize a portfolio of AAPL.US, MSFT.US, GOOGL.US,
and AMZN.US against SPY.US for maximum Sharpe ratio. Show me the weights.

The first time Claude calls one of our tools it will ask your permission — click Allow. It then runs the math and explains the results in plain English. More ideas to try: “Run a Monte Carlo retirement projection,” “Stress-test my portfolio against the 2008 crisis,” or “Search for dividend ETFs.”

If something doesn’t go right
  • “A server with this URL already exists.” Claude has already connected before — scroll to the bottom of your Connectors list. FolioForecast will be there with a Configure or Disconnect button.
  • “Could not load authentication.” Refresh the page. If it keeps happening, please email [email protected] with a screenshot.
  • Claude says it doesn’t have the tool. You probably still have the old chat open — MCP connectors only attach to new chats. Start a fresh conversation and try again.
  • You want to disconnect. Remove it from the Claude side (Customize → Connectors → the menu on the FolioForecast row) or from our side (Hub → Settings → Connected apps). Either removes both.
How your data is handled. Claude connects using the industry-standard OAuth protocol — you share no password with Claude, and no raw API key ever leaves our servers. Every call counts against your FolioForecast usage meter (the same free and paid tiers as any other account). You can revoke the connection any time from Hub → Settings → Connected apps and Claude immediately loses access.

Path B — Claude Desktop / Cursor / Windsurf (local install)

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.

1

Get your API key

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_.

2

Install the MCP server

Two runtimes, same tools. Pick whichever ecosystem you already have.

Node — works today npm live

Requires Node 18 or newer. Installs globally as folioforecast-mcp.

npm install -g @folioforecast/mcp-server
Python — coming with v0.1 PyPI rolling out

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.

3

Configure Claude Desktop

Open Claude Desktop → Settings (gear icon) → DeveloperEdit 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).

4

Try it out

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).

Not seeing the tools in Claude? Quit Claude Desktop completely (Cmd+Q on Mac / right-click tray icon on Windows) and relaunch — just closing the window doesn’t reload MCP servers. Still stuck? Check Settings → Developer → Open MCP Logs for the folioforecast server’s output.

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.

1

Get your API key

Open your FolioForecast dashboard. Under Settings → API Keys, click Create Key. Copy the key that starts with ff_live_.

2

Install the SDK

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.

3

Run your first optimization

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().

4

Run it

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.

No package install? No problem. The SDK is a convenience wrapper, not a requirement. You can call the API directly with httpx, requests, or curl against https://www.folioforecast.com/api/v1. See the OpenAPI spec for the full request/response shapes.
Use Cases

What You Can Build

The FolioForecast API gives you the same professional-grade optimization engine that powers our web app — accessible via simple REST calls.

AI Portfolio Agents

Let LLM-powered agents optimize portfolios on behalf of users. Provide tickers and constraints, get back optimal weights and metrics.

Robo-Advisor Backends

Power automated portfolio management with Mean-Variance, CVaR, Risk Parity, and robust optimization methods — no quant team required.

Custom Dashboards

Embed optimization results, stress tests, and efficient frontier data into your own app or internal tools.

Endpoints

Core API Surface

Four endpoints cover the full optimization workflow. All return structured JSON, including predictable error responses.

POST /api/v1/optimize
Run portfolio optimization. Keyless demo supports documented basic methods and ticker limits. API keys unlock the full method set. Returns weights, metrics, explanation metadata, warnings, and efficient frontier data.
1–3 compute units
GET /api/v1/search?q=
Search 100,000+ tickers across US, UK, and global exchanges. Returns symbol, name, exchange, and asset type.
Free (0 units)
POST /api/v1/crisis-scenarios
Stress-test a portfolio against historical crises (2008 GFC, COVID crash, dot-com, etc.). Requires an API key. Returns drawdowns, recovery times, and relative performance.
3 compute units
POST /api/v1/asset-metadata
Look up sector, industry, asset class, and market classification for a list of tickers. Demo access is available within documented limits.
0.1 units per ticker
Try it now — this endpoint is live
# 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:

  OpenAPI Spec (YAML)   OpenAPI Spec (JSON)
Authentication

API Keys

Each API key is scoped to a single environment and tied to a billing account.

Key Format

Production keys start with ff_live_ followed by 32 hex characters. Sandbox keys use ff_test_ — same format, no billing.

How to Authenticate

Pass your key via the X-API-Key header on every request. Alternatively, use Authorization: Bearer ff_live_....

Rate Limits

Limits are per API key, not per IP. Responses include X-RateLimit-Remaining and Retry-After headers.

Security

Keys are SHA-256 hashed at rest — we never store your raw key. Rotate keys anytime from your dashboard. HTTPS required on all calls.

Usage-Based Pricing

Pay for What You Use

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.

Pay-as-You-Go
$0.10 /unit
No free units — pay from unit 1
API access only
  • All endpoints
  • 10 req/min
  • Sandbox + production
  • Email support
Enterprise
Custom
Volume pricing
Dedicated infrastructure
  • All endpoints
  • Custom rate limits
  • SLA guarantee
  • Dedicated support

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.

Get Started

Set Up API Access

Create a free account, add a payment method, and generate your API key — all in under 2 minutes.

1

Sign Up

Create a free FolioForecast account (takes 30 seconds)

2

Add Payment

Add a payment method via Stripe (only charged for usage)

3

Get Your Key

Generate an API key and start making calls

Get API Access

Developer FAQ

When will the API endpoints go live?
All API endpoints are live. Limited demo calls are available without a key for health, search, metadata, and basic optimization. Sign up for a free account, add a payment method, and generate your API key — then start calling authenticated endpoints like /optimize, /search, /crisis-scenarios, and /asset-metadata right away. Subscribers get even better rates. See the OpenAPI spec for full details.
Do I need a paid subscription to use the API?
No! Any FolioForecast account can use the API. Just create a free account, add a payment method, and you're ready to go at $0.10/unit pay-as-you-go. Subscribers (Individual $8/mo) get half-price rates ($0.05/unit) plus 10 free compute units per month.
What counts as a compute unit?
Each endpoint has a fixed cost. Ticker search is free (0 units). A basic optimization is 1 unit. Robust optimization is 3 units (more compute-intensive). Crisis scenario analysis is 3 units. Asset metadata is 0.1 units per ticker. These costs are shown on each endpoint card above.
What programming languages are supported?
The API is a standard REST API that returns JSON — any language that can make HTTP requests works. Official first-party clients:
  • Node / TypeScriptnpm install -g @folioforecast/mcp-server ships an MCP server for Claude Desktop, Cursor, and Windsurf.
  • Pythonpip install folioforecast ships a synchronous SDK and a Python MCP server (python -m folioforecast.mcp). v0.1 rolling out to PyPI.
For anything else — Go, Rust, Ruby, Java, Elixir, plain curl — import our OpenAPI spec into your code generator of choice.
Is there a sandbox environment?
Yes. Sandbox API keys (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.

Ready to Integrate?

The API is live. Create a free account, add a payment method, and start building in minutes — no subscription required.

Get API Access See Subscription Plans