Guides · architecture

QuantLib as a service: hosted API vs self-hosting (and where ORE fits)

There are three ways to get QuantLib-grade fixed-income and risk analytics: self-host the QuantLib library (Python or C++), self-host ORE — the Open Source Risk Engine, the portfolio-and-risk layer built on top of QuantLib — or call a hosted API such as Quant-Box. The deciding question is not which is "best"; it is who maintains the infrastructure, and how much coverage you actually need.

01The three routes

1 · Self-host QuantLib. The reference open-source library for quantitative finance: instruments, term structures, models, pricing engines. Free, and you control everything — which also means you build (or pip-install) it, assemble the day counts, calendars, schedules and curves yourself, track version upgrades, and write the serving layer if anything other than one script needs the numbers.

2 · Self-host ORE. The Open Source Risk Engine wraps QuantLib in a portfolio-level application: trade and market data input, NPV and cash-flow reports, sensitivities, XVA, scenario generation, market risk. Also free, and considerably more complete than any hosted calculator — at the price of a heavyweight deployment, XML configuration and a real learning curve.

3 · Call a hosted API. Quant-Box exposes five QuantLib-backed endpoints over HTTPS — option pricing with greeks, implied volatility, bond pricing with duration/convexity/BPV, curve bootstrapping, VaR/ES — with the conventions written into every response. Nobody on your side builds or upgrades anything. In exchange you accept a deliberately narrow scope and a dependency on a third party.

02An honest comparison

QuantLib, self-hostedORE, self-hostedQuant-Box, hosted API
CostFree, open sourceFree, open sourceFree tier 500 calls/month, paid above
CoverageThe full library: every instrument, model and engine QuantLib shipsPortfolio analytics on top of QuantLib: sensitivities, XVA, scenarios, market risk5 endpoints: bonds, curves, VaR/ES, options + greeks, implied vol — and nothing else
Getting startedC++ toolchain or Python wheels; you assemble day counts, calendars and curves yourselfHeavier: engine deployment, XML configuration, steep learning curveOne POST with an API key
Ongoing burdenVersion upgrades, serving layer, an in-house API if other teams consume the numbersThe same, over a larger surfaceNone on your side; QuantLib upgrades (1.43 today) handled server-side
ConventionsYours to choose — maximum flexibility, and the classic source of silent errorsConfigured per portfolio and market setupFixed, and spelled out in every response
Your dataNever leaves your infrastructureNever leaves your infrastructureSent to the API over TLS; processed, nothing stored beyond the request — but it does transit a third party
Best fitQuant teams, exotics, bespoke modelsXVA, IMM, regulated risk infrastructureFintechs, prop shops, crypto desks that need correct numbers this week

None of the three is wrong. QuantLib self-hosted is the most powerful and the most work; ORE is the most complete risk platform and the heaviest deployment; a hosted API is the fastest to a correct number and the least flexible.

03Time to first number

The concrete difference the hosted route buys. A 5% annual-coupon bond issued 2024-07-01, maturing 2029-07-01, settling 2026-10-15, at a flat 4% yield:

python
import requests

r = requests.post("https://quantbox.dev/v1/bonds/price",
    headers={"X-API-Key": KEY},
    json={"coupon_rate": 0.05, "issue_date": "2024-07-01",
          "maturity_date": "2029-07-01", "settlement_date": "2026-10-15",
          "yield_rate": 0.04})
print(r.json()["clean_price"])   # 102.4892
response (abridged)
{
  "clean_price": 102.4892,
  "dirty_price": 103.9413,
  "accrued": 1.4521,
  "ytm": 0.04,
  "modified_duration": 2.4748,
  "convexity": 8.7012,
  "bpv": -0.0257,
  "conventions": {
    "prices": "per 100 of face value (market quote convention)",
    "settlement": "as provided (settlementDays=0, no implicit T+2)",
    "ytm": "compounded annual, act/act",
    "calendar": "TARGET, unadjusted schedule"
  }
}

Self-hosted, the same number means installing QuantLib, then constructing the schedule, day counter, calendar and yield term structure by hand — a fine afternoon if bond pricing is your job, a detour if it is not. The full walkthroughs: price a bond from a yield or a curve and bootstrap a yield curve over HTTP.

04Verdict by use case

If you areChoose
A regulated desk with data-residency or vendor-risk requirementsSelf-host. No third-party call to defend to compliance; QuantLib or ORE depending on scope.
A fintech, prop shop or crypto desk that needs correct bond / option / VaR numbers this weekA hosted API. One POST, conventions stated, no build to own.
A bank needing XVA, IMM or regulatory scenario runsORE. That is what it exists for; no hosted calculator at this scope, Quant-Box included.
A quant team building bespoke models or pricing exoticsQuantLib directly. You need the whole library, not five endpoints.

05When NOT to use Quant-Box

Being explicit about the boundary is cheaper than a disappointed integration:

XVA. No CVA, DVA, FVA or collateral simulation. That is ORE territory.

Complex exotics. Options are vanilla European (analytic) or American (binomial). No barriers, baskets, Asians or other path-dependent payoffs.

Volatility surface calibration. Implied vol is a single-price inversion. There is no SABR, SVI or Heston calibration.

Market data. Quant-Box supplies no quotes, curves or fixings — every number is computed from inputs you send. If you expect data with your analytics, you need a data vendor first.

Hard data-residency rules. Nothing is stored beyond the request and inputs are anonymous numbers, but the call itself crosses your boundary. If that is disqualifying, self-host — that is the honest answer.

And the structural one: a hosted API is a dependency. If quantbox.dev is unreachable, so are your numbers. Uptime matters to us for obvious reasons, but a bank's core risk system should not hang off anyone's hosted calculator — including this one.

If the hosted route fits your case, the free tier is enough to evaluate seriously: sign up with an email, get a key instantly, run the bond example above.

Get a free API key

500 calls/month free · no credit card · full schemas in /docs

Related: Price an option in 5 lines of Python · Back out implied volatility from an option price · Price a bond from a yield or a curve · Bootstrap a yield curve over HTTP