Get started
Price your first swap against the hosted API in 5 minutes. No JAX install, no local engine, no AWS account.
Get an API key
Self-service signup isn’t live yet (it’s on the v1.3 roadmap). For now, email keys@numeraire.dev with your company name and a one-line use case. Keys arrive within one business day.
Each human approver in a workflow (e.g. CSA 4-eyes) needs their own key —
we map the key to a principal string and bind it to created_by /
approved_by server-side.
Install the client
pip install numeraire-clientOr pin the exact tag for reproducible builds:
pip install "numeraire-client @ git+https://github.com/numeraire-dev/numeraire-client@v1.26.1"Configure your key
import numeraire as nm
nm.configure(api_key="sk_live_...")Or drop it once in ~/.numeraire/credentials (INI) and skip the
configure(...) call entirely:
[default]
api_key = sk_live_...Price an OIS
This script builds a 5-year USD SOFR receiver, prices it on a hardcoded flat OIS curve, and prints the NPV. The market data is baked in so you don’t need anything beyond the API key.
import numeraire as nm
from numeraire import (
OIS, BusDayAdjustTypes, CalendarTypes, CurrencyTypes, Date,
DayCountTypes, DirectionTypes, FrequencyTypes, PricingModel,
RequestTypes, StubTypes,
)
from numeraire.curves import OISCurve
# (1) Build a hardcoded SOFR curve from 5 market helpers.
val = Date(2024, 1, 2)
spot = val.add_days(2)
helpers = [
OIS(spot, spot.add_tenor(t), r, 1.0, CurrencyTypes.USD, "SOFR",
fixed_frequency=FrequencyTypes.ANNUAL,
float_frequency=FrequencyTypes.ANNUAL,
fixed_day_count=DayCountTypes.ACT_360,
float_day_count=DayCountTypes.ACT_360,
calendar=CalendarTypes.NYC,
convention=BusDayAdjustTypes.MODIFIED_FOLLOWING,
stub=StubTypes.SHORT_BACK)
for t, r in [("1Y", 0.045), ("2Y", 0.046), ("3Y", 0.044),
("5Y", 0.042), ("10Y", 0.040)]
]
model = PricingModel(
curves={"USD.OIS": OISCurve(helpers, val, CurrencyTypes.USD)},
valuation_date=val,
)
# (2) Build a 5Y receiver-fixed swap on 1M notional at 4.3%.
swap = OIS(spot, spot.add_tenor("5Y"), 0.043, 1_000_000.0,
CurrencyTypes.USD, "SOFR",
fixed_frequency=FrequencyTypes.ANNUAL,
float_frequency=FrequencyTypes.ANNUAL,
fixed_day_count=DayCountTypes.ACT_360,
float_day_count=DayCountTypes.ACT_360,
calendar=CalendarTypes.NYC,
convention=BusDayAdjustTypes.MODIFIED_FOLLOWING,
stub=StubTypes.SHORT_BACK)
position = swap.position(quantity=1, direction=DirectionTypes.REC)
# (3) Configure + price.
nm.configure(api_key="sk_live_...") # ← your key here
result = position.calculate(model, requests=[RequestTypes.VALUE])
print(f"NPV: {result.value.amount:,.2f} {result.value.currency}")
print(f"correlation_id: {result.correlation_ids[0]}")Run it:
python first_swap.py
# NPV: 4,472.81 USD
# correlation_id: c86b967c82b2419cWhat happens next
- Got a real number? You’re done — you have a live integration. Head to Tutorials for batched pricing, risk arrays, and multi-currency examples.
- Got an error? The client maps server errors to typed exceptions —
AuthError(401/403),ValidationError(422),RateLimitError(429). See Error handling for the full taxonomy. - Stuck? Email keys@numeraire.dev
with the
correlation_idfrom the response — we can trace any call.