Base URL & how it fits together.
All requests go to one versioned base path. The surface is deliberately small: submit a job, poll it, fetch the result.
https://asymmetrycomputing.com/api/prism - Upload your own data with
PUT /v1/datasets/{name}. Skip this step to run on demo data. - Submit the job with
POST /v1/jobsand keep the returnedjob_id. - Poll
GET /v1/jobs/{id}untilstatusiscompleted. - Fetch
GET /v1/jobs/{id}/resultand, if you need them, the weights fromGET /v1/jobs/{id}/weights.
An API key on every request.
Pass your key in the X-API-Key header. Every route needs it except /v1/access-requests.
X-API-Key: YOUR_API_KEYNo key yet? Request a free trial key on the API page. Keys are approved by hand and emailed. Keep the key on your server; the integration guide explains why.
Every endpoint.
- GET/v1/capabilitiesTask types and limits for your key
- POST/v1/access-requestsRequest a trial key · no key
- PUT/v1/datasets/{name}Upload a dataset
- GET/v1/datasetsList your datasets
- POST/v1/jobsSubmit a job
- GET/v1/jobs/{id}Job status
- GET/v1/jobs/{id}/resultFull result and run record
- GET/v1/jobs/{id}/weightsOptimized weights as
.npz
GET/v1/capabilities
Returns the supported task types and the current limits for your key. Call it before you submit a job to see what your key can do.
curl https://asymmetrycomputing.com/api/prism/v1/capabilities \
-H "X-API-Key: $KEY" POST/v1/access-requests
Request a trial key. No API key required. The endpoint files the request and returns a tracking ID; keys are approved by hand and emailed.
{
"name": "Jane Doe",
"email": "jane@fund.example",
"company": "Example Capital",
"use_case": "Testing book_rebalance on a 10k-account taxable book"
}{
"request_id": "req_8f2a1c90",
"status": "pending_review"
}PUT/v1/datasets/{name}
Upload a dataset as the raw request body: a .npz archive that matches the schema of the task you will run (see book_rebalance or portfolio). Trial keys are capped at 200 MB per dataset.
curl -X PUT https://asymmetrycomputing.com/api/prism/v1/datasets/my_book \
-H "X-API-Key: $KEY" \
-H "Content-Type: application/octet-stream" \
--data-binary @my_book.npz GET/v1/datasets
List the datasets uploaded under your key.
curl https://asymmetrycomputing.com/api/prism/v1/datasets \
-H "X-API-Key: $KEY" GET/v1/jobs/{id}
Poll the job status: queued, running, completed or failed.
{ "job_id": "job_a91fe0", "status": "running" }GET/v1/jobs/{id}/result
Fetch the full result once the job is completed: a summary of the book (turnover, positions, per-segment breakdown), an optional independent-validation block, and the run record, whose fields are listed in the reference issued with your key. The values below are illustrative and abridged.
{
"job_id": "job_a91fe0",
"status": "completed",
"summary": {
"n_accounts": 10000,
"n_names": 1000,
"turnover": 0.083,
"positions": 9639,
"segments": [
{ "profile": "taxable", "accounts": 6400, "turnover": 0.091 },
{ "profile": "tax_deferred", "accounts": 3600, "turnover": 0.068 }
]
},
"validation": {
"reference": "independent open-source reference, 1e-9 tolerance",
"sample_size": 50,
"max_weight_error_pct": 0.00025,
"gate_pct": 0.05,
"passed": true
},
"record": { "…": "…" }
}GET/v1/jobs/{id}/weights
Download the optimized weights as a .npz archive: one row per account and one column per name, in the order of the input dataset.
curl https://asymmetrycomputing.com/api/prism/v1/jobs/job_a91fe0/weights \
-H "X-API-Key: $KEY" -o weights.npz POST /v1/jobs
Every job is asynchronous: submit it, get a job_id back at once, then poll. There are two task types: book_rebalance for books of accounts and portfolio for a single portfolio.
{ "job_id": "job_a91fe0", "status": "queued" }Rebalance a whole book of accounts.
The book-scale task. Use it to rebalance thousands of accounts against a target model in one call.
{
"task": "book_rebalance",
"source": "demo | stress_demo | dataset",
"n_accounts": 25000,
"n_names": 1000,
"dataset_id": "my_book",
"precision": "<profile>",
"validate_sample": 50,
"position_max": 0.08
}| Field | Type | Notes |
|---|---|---|
| source | string | demo, stress_demo or dataset; see below |
| n_accounts | int | Required for demo and stress_demo |
| n_names | int | ≤ 1,000 |
| dataset_id | string | Required when source is dataset |
| precision | string | Quality profile for the run |
| validate_ | int | Accounts to validate independently in the job, against an independent reference |
| position_max | float | Per-name position cap, as a weight fraction |
Source: demo
Real price history, with synthesized accounts and holdings layered on top. The quickest way to smoke-test the endpoint and see the shape of a result.
Source: stress_demo
A full-difficulty, realistic book: multi-lot HIFO cost basis built from real price history, sparse model holdings, concentrated legacy positions, a mix of taxable and tax-deferred accounts, wash-sale blocks, and different position caps per account. This is the most demanding test mode.
Source: dataset, .npz schema
Upload your own book with PUT /v1/datasets/{name}, then reference it by dataset_id.
| Key | Required | Notes |
|---|---|---|
| prices | Yes | Price history |
| W_cur | No | Current weights per account |
| gain_frac | No | Unrealized gain as a fraction of position value |
| is_ | No | Short-term or long-term lot flag |
| wash_blocked | No | Positions currently blocked by a wash sale |
| profile | No | Account profile: taxable, deferred or mixed |
| w_index | No | Target model or index weights |
Optimize a single portfolio.
For one portfolio rather than a book: a standard allocation problem over an asset universe.
{
"task": "portfolio",
"source": "demo | dataset",
"n_assets": 5000,
"dataset_id": "my_universe"
}| Key | Shape | Required | Notes |
|---|---|---|---|
| risk_model | — | Yes | Your risk inputs. Accepted forms and shapes are documented in the authenticated reference issued with your key. |
| mu | (n,) | No | Expected returns |
| w_current | (n,) | No | Current portfolio weights |
Trial-tier limits.
| Limit | Value |
|---|---|
| Accounts per job | 25,000 |
| Assets per job | 20,000 |
| Jobs per day | 10 |
| Total jobs (trial key lifetime) | 40 |
| Dataset upload size | 200 MB |
Need more? A production key removes these caps. Talk to us about pricing.
Error semantics
| Status | Meaning |
|---|---|
| 401 | Invalid or missing API key |
| 403 | The request exceeds your key’s limits (accounts, assets or dataset size) |
| 429 | Quota reached (jobs per day or the lifetime job cap) |
| 500 | Generic failure. |