Quickstart
Create a key and make your first request in a few minutes.
Using Python? Start with the Python SDK quickstart for installation, a complete request and its response.
Discover pricing models
GET /v1/pricing/models is public, requires no API key and consumes no Compute Units. It lists every model with its method, supported operations, Greeks, dividend support and usage guidance.
curl --fail-with-body "https://api.morphiqlabs.com/v1/pricing/models"Read the pricing model guide for canonical selectors and per-Greek availability. Pricing requests still use the authenticated operations below.
1. Create an API key
- Create a free account with your email address and enter the code we send you.
- Choose Set up Free plan, then Create API key.
- Copy the secret key when it is shown. It is displayed once and cannot be recovered; your account lists only the key’s public ID afterwards. If you lose the secret, revoke the key and create another.
A new key can take a few minutes to be enabled; until then, requests with it are refused.
2. How to use your API key
Your key authenticates requests and associates their Compute Unit usage with your account. Use the secret key shown when you create it. The public key ID in your account and the email verification code cannot authenticate API requests.
Send the secret in the Authorization header
Add this HTTP header to every request to a protected /v1/ endpoint at https://api.morphiqlabs.com:
Authorization: Bearer <your-secret-key>Replace <your-secret-key> with the complete secret, without the angle brackets or surrounding quotes. Keep Bearer followed by one space. Send requests over HTTPS; put the key in the header, never in the URL or JSON request body.
In an API client with a Bearer Token authentication option, paste only the secret into its token field. The client adds Bearer for you. Do not add a second Authorization header.
A valid key must also permit the requested operation and representation. If a key is restricted to JSON, sending Protobuf with it is refused with 403 not_entitled before calculation or charging. Changing the encoding does not change the CU price. Restricted keys are operator-managed; the self-service key screen does not currently configure per-key transport permissions. MCP access is not publicly available.
Load the key for the command-line examples
In a Bash or Zsh terminal, run the commands below, paste your secret at the prompt, and press Enter. The input is hidden and is not entered as a shell-history command.
{
printf 'Paste your secret API key: '
IFS= read -r -s MORPHIQ_API_KEY && export MORPHIQ_API_KEY
printf '\n'
}The examples read MORPHIQ_API_KEY from this terminal session. Run them in the same terminal; a new terminal needs its own setup. Keep the double quotes around "Authorization: Bearer $MORPHIQ_API_KEY" so the shell substitutes the stored value.
For an application, load the secret from your server’s environment or secret manager and set the same header on each request. Keep it out of browser and mobile-app code. When you finish a terminal session, run unset MORPHIQ_API_KEY to remove the variable. See key storage and rotation.
If your key is refused
- Confirm you used the secret, not the key ID or email code, and copied it without extra whitespace.
- Check that the key is active in your account. Newly created keys can take a few minutes to work; if your account says API access is not enabled, requests cannot succeed until it is enabled.
- For
401, check the header and key. For403, check the response’scodefor an account or plan restriction. See the error table for other responses. - If the secret is lost or exposed, revoke the key and create a replacement. Never send a secret key to support; send the
request_idinstead.
3. Make a request
After loading your secret key, copy this request into the same terminal. It prices a European call option using your account’s allowance.
curl --fail-with-body https://api.morphiqlabs.com/v1/price \
--header "Authorization: Bearer $MORPHIQ_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"exercise_style":"european","pricing_model":"auto","option_type":"call","spot":100,"strike":100,"time_to_expiry_years":1,"risk_free_rate":0.05,"dividend_yield":0,"volatility":0.2}'A successful request returns 200 OK with the option price in result.price.
Successful responses have a result and metadata. Errors are RFC 9457 problem documents with code, detail and metadata. Quote the request_id when you contact support; execution identity and billing fields describe the operation that actually ran.
4. Pricing operations
Modern agent clients can use the optional MCP transport on an enabled test service. MCP is not enabled on the public service.
Use public GET /v1/pricing/models discovery. See the model guide for compiled capabilities, algorithm pins, units and the distinction from account entitlement.
For American contracts, read the American model migration guide before changing models. The beta policy replaces BS2002 with QdFp and retains existing API keys when their bindings migrate. QdFp accepts price and IV only; its Greeks and analytics requests return 422 unsupported_operation for explicit QdFp selection. Legacy BS2002 entitlements do not enable QdFp, and Black–Scholes finite difference (cash dividends) price and IV are enabled; standard-five, all-ten and analytics return 422 unsupported_operation. Model discovery is public and identical for all callers. Computation uses the normal API-key and usage-accounting path.
Single pricing endpoints operate on one contract. Synchronous batches accept BSM and BS1993 only, with up to 100 contracts per request (or your lower account limit). European and American options are supported; pricing_model: "auto" picks the model for the exercise style. Field definitions are in the API reference; CU weights per contract are on the usage page.
Price an option POST /v1/price
curl --fail-with-body https://api.morphiqlabs.com/v1/price \
--header "Authorization: Bearer $MORPHIQ_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"exercise_style":"european","pricing_model":"auto","option_type":"call","spot":100,"strike":100,"time_to_expiry_years":1,"risk_free_rate":0.05,"dividend_yield":0,"volatility":0.2}'Solve implied volatility POST /v1/implied-volatility
curl --fail-with-body https://api.morphiqlabs.com/v1/implied-volatility \
--header "Authorization: Bearer $MORPHIQ_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"exercise_style":"european","pricing_model":"auto","option_type":"call","spot":100,"strike":100,"time_to_expiry_years":1,"risk_free_rate":0.05,"dividend_yield":0,"market_price":10.45}'Compute all ten Greeks POST /v1/greeks
curl --fail-with-body https://api.morphiqlabs.com/v1/greeks \
--header "Authorization: Bearer $MORPHIQ_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"exercise_style":"european","pricing_model":"auto","option_type":"call","spot":100,"strike":100,"time_to_expiry_years":1,"risk_free_rate":0.05,"dividend_yield":0,"volatility":0.2}'Price, Greeks and implied volatility in one call POST /v1/analytics
curl --fail-with-body https://api.morphiqlabs.com/v1/analytics \
--header "Authorization: Bearer $MORPHIQ_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"exercise_style":"european","pricing_model":"auto","option_type":"call","spot":100,"strike":100,"time_to_expiry_years":1,"risk_free_rate":0.05,"dividend_yield":0,"volatility":0.2,"market_price":10.45}'Compute limits and timeouts
Append :batch to price, implied-volatility, greeks/standard, greeks or analytics and wrap inputs in {"requests": [...]}. Matching gRPC methods, MCP tools and batch cost quotes use the same policy. BSM and BS1993 may be mixed; Auto is accepted when it resolves to BSM or BS1993. QdFp or cash-dividend items reject the entire batch with 422 unsupported_operation before reservation or execution. Results preserve input order with zero-based indexes and per-item success/error outcomes. An item whose inputs are refused before execution is reported in place with its problem and is not quoted or charged; the other items still compute. If every item is refused, nothing is reserved and the charge is zero. The charge is the sum of per-contract CUs for the items that execute, with one aggregate receipt and one ceiling for the batch. The ten-second compute deadline includes queue time; cancellation after execution starts does not undo the charge. There is no asynchronous job or polling workflow.
curl --fail-with-body "$MORPHIQ_API_BASE_URL/v1/price:batch" \
--header "Authorization: Bearer $MORPHIQ_API_KEY" \
--header "Content-Type: application/json" \
--header "x-morphiq-max-cu: 2" \
--data '{
"requests": [
{
"exercise_style": "european",
"pricing_model": "auto",
"option_type": "call",
"spot": 100,
"strike": 100,
"time_to_expiry_years": 1,
"risk_free_rate": 0.05,
"dividend_yield": 0,
"volatility": 0.2
},
{
"exercise_style": "european",
"pricing_model": "auto",
"option_type": "call",
"spot": 100,
"strike": 100,
"time_to_expiry_years": 1,
"risk_free_rate": 0.05,
"dividend_yield": 0,
"volatility": 0.2
}
]
}'Every numerical request, including a single European price, uses bounded compute capacity. If the single-request pool is full, the service returns 503 compute_capacity_exhausted without charging CUs.
The service allows up to 10 seconds for compute, including waiting for a worker. This is a deadline, not a completion guarantee. Allow additional time for transport; the Python SDK defaults to 30 seconds. A compute timeout after execution starts retains the committed CU charge, so do not automatically retry it.
Regime analysis POST /v1/regime
Send at least 512 finite, positive prices, oldest to newest, using the same API key. The API makes no sampling-interval assumption. This JSON-only operation analyzes one window; it has no :batch form. It is priced at 100 CU; your account’s signed schedule determines the effective charge. Check your account’s cost quote before execution.
This example uses Python 3 to create synthetic prices, then submits them. Replace the example prices with your own history. Do not send cadence or already-computed returns.
python3 - <<'PY' > regime-request.json
import json, math
prices = [
round(100 * math.exp(0.0004 * i + 0.018 * math.sin(i * 0.27)), 4)
for i in range(512)
]
print(json.dumps({"prices": prices}))
PY
curl --fail-with-body 'https://api.morphiqlabs.com/v1/regime' \
--header "Authorization: Bearer $MORPHIQ_API_KEY" \
--header 'Content-Type: application/json' \
--data-binary @regime-request.jsonRead the regime guide for cropping, direction and volatility labels, uncalibrated scores, applicability and errors.
5. Free plan limits
| Monthly allowance | 1,000,000 CU per UTC calendar month, no rollover; requests stop at the allowance |
|---|---|
| Capacity | Best effort: requests may be refused with 503 under load |
| Sustained rate | 5 requests per second (bursts up to 10) |
| Concurrent requests | 1 |
| Single-request size | 8 KiB |
| Batch request size | 1 MiB |
| Contracts per batch | 100 · BSM/BS1993 only |
| Active API keys | 1 |
Your account page shows your plan and limits.
6. Errors
Errors are RFC 9457 problem documents (application/problem+json) with a machine-readable code, a detail and, where it applies, the field. Requests that fail before computation are not charged; metadata.cu_charged reports any charge. The error reference lists every code.
| Status | Meaning |
|---|---|
400 | Malformed or unsupported request: check code, model/operation support, batch eligibility and regime input fields. |
401 | The secret key is missing, expired, revoked or not recognized. Check the Authorization header and key status in your account. |
402 | The monthly CU allowance is spent. It resets at the start of the next UTC month. |
403 | Check code: forbidden means the account is suspended or closed; not_entitled means the plan does not include the operation. |
409 | Check code: cost_limit_exceeded means the quote exceeded your X-MorphIQ-Max-CU ceiling; funding_expired means the reservation expired. No CUs were committed. |
413 | The request body is larger than your plan allows. |
422 | The inputs are invalid or cannot be priced; the error names the field. |
429 | Rate or concurrency limit reached. Retry after a short, randomized delay. |
503 | Capacity is temporarily unavailable. Retry with exponential backoff. Exception: rollout_unavailable means the operation is not enabled for the account; do not retry it. |
7. Keep your key safe
- Call the API from your server or scripts. Never put a key in browser code, a mobile app or a public repository.
- Load the key from an environment variable or a secret manager, not from source code, and keep it out of logs.
- To rotate a key on the Free plan, revoke the old key in your account, then create a new one.
- If a key may have leaked, revoke it at once from your account and tell us at support@morphiqlabs.com.
8. Support
Email support@morphiqlabs.com from your account email, with the request_id of any request in question. Use of the API is subject to the terms of service and the market-data policy.