-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevelopers.html
More file actions
620 lines (603 loc) · 42.9 KB
/
Copy pathdevelopers.html
File metadata and controls
620 lines (603 loc) · 42.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
<!doctype html>
<html lang="en" data-page="developers">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Developers | Canli Capital</title>
<meta name="description" content="A read API over the Canli Capital paper record, and a free keyed API that runs your numbers through the same validation arithmetic. Each response states its limits." />
<link rel="canonical" href="https://canlicapital.com/developers" />
<meta name="author" content="Arhan Canli" />
<meta name="canli:sources" content="validation_api_limits.json validation_api_manifest.json" />
<meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Canli Capital" />
<meta property="og:title" content="Developers" />
<meta property="og:description" content="A read API over the Canli Capital paper record, and a free keyed API that runs your numbers through the same validation arithmetic. Each response states its limits." />
<meta property="og:url" content="https://canlicapital.com/developers" />
<meta property="og:image" content="https://canlicapital.com/og.png" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Developers" />
<meta name="twitter:description" content="A read API over the Canli Capital paper record, and a free keyed API that runs your numbers through the same validation arithmetic. Each response states its limits." />
<meta name="twitter:image" content="https://canlicapital.com/og.png" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..100,400..700&family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500;600&display=swap" />
<link rel="stylesheet" media="print" onload="this.media='all'" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..100,400..700&family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500;600&display=swap" />
<noscript><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..100,400..700&family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500;600&display=swap" /></noscript>
<link rel="stylesheet" href="/css/product-shell.css" />
<link rel="stylesheet" href="/css/developers.css" />
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebAPI","name":"Canli Capital public read API","description":"A read API over the Canli Capital paper record, and a free keyed API that runs your numbers through the same validation arithmetic. Each response states its limits.","documentation":"https://canlicapital.com/developers","url":"https://canlicapital.com/api/v1","provider":{"@id":"https://canlicapital.com/#organization"},"termsOfService":"https://canlicapital.com/methodology"}</script>
</head>
<body class="dev-page">
<a class="dev-skip" href="#content">Skip to content</a>
<header class="cc-shell" id="nav" data-product-shell="v3">
<a class="cc-shell__brand" href="/" aria-label="Canli Capital, home">
<span class="cc-shell__mark" aria-hidden="true"><i></i></span>
<span>Canli Capital</span>
</a>
<a class="cc-shell__status" href="/measurements/alpaca-broker-reconciliation" aria-label="Current record status">
<span class="status-dot" aria-hidden="true"></span>
<span>Public paper record</span>
</a>
<nav class="cc-shell__primary" aria-label="Primary navigation">
<a class="cc-shell__link" href="https://app.canlicapital.com/dashboard" rel="noreferrer">Live</a>
<a class="cc-shell__link" href="/research">Research</a>
<a class="cc-shell__link" href="/trials">Trials</a>
<a class="cc-shell__link" href="/systems">Systems</a>
<a class="cc-shell__link" href="/methodology">Methodology</a>
<a class="cc-shell__link" href="/developers" aria-current="page" data-current="true">Developers</a>
<a class="cc-shell__link" href="/verify">Verify</a>
</nav>
<details class="cc-shell__index">
<summary><span class="cc-shell__index-wide">More</span><span class="cc-shell__index-compact">Menu</span></summary>
<div class="cc-shell__panel">
<div>
<span class="cc-shell__panel-label">Core</span>
<nav aria-label="Core routes"><a class="cc-shell__panel-link" href="https://app.canlicapital.com/dashboard" rel="noreferrer">Live</a>
<a class="cc-shell__panel-link" href="/research">Research</a>
<a class="cc-shell__panel-link" href="/trials">Trials</a>
<a class="cc-shell__panel-link" href="/systems">Systems</a>
<a class="cc-shell__panel-link" href="/methodology">Methodology</a>
<a class="cc-shell__panel-link" href="/developers" aria-current="page" data-current="true">Developers</a>
<a class="cc-shell__panel-link" href="/verify">Verify</a></nav>
</div>
<div>
<span class="cc-shell__panel-label">Institution</span>
<nav aria-label="Institution routes"><a class="cc-shell__panel-link" href="/progress">Corrections</a>
<a class="cc-shell__panel-link" href="/performance">Performance</a>
<a class="cc-shell__panel-link" href="/founder">Founder</a>
<a class="cc-shell__panel-link" href="/open">Open data</a>
<a class="cc-shell__panel-link" href="/measurements">Measurements</a></nav>
</div>
<div>
<span class="cc-shell__panel-label">Tools</span>
<nav aria-label="Tools"><a class="cc-shell__panel-link" href="/tools">All tools</a>
<a class="cc-shell__panel-link" href="/how-to-validate-a-backtest">How to validate a backtest</a></nav>
</div>
<div>
<span class="cc-shell__panel-label">Reproducible code</span>
<nav aria-label="Source code"><a class="cc-shell__panel-link" href="/engineering">Engineering hub</a>
<a class="cc-shell__panel-link" href="/notes">Engineering notes</a>
<a class="cc-shell__panel-link" href="/standards/paper-evidence">Evidence standard</a>
<a class="cc-shell__panel-link" href="https://github.com/arhancanli/alphac" rel="noreferrer">alphac (engine)</a>
<a class="cc-shell__panel-link" href="https://github.com/arhancanli/canli-pit-lake" rel="noreferrer">canli-pit-lake</a>
<a class="cc-shell__panel-link" href="https://github.com/arhancanli/canli-backtest" rel="noreferrer">canli-backtest</a></nav>
</div>
<p>Observed, simulated, model-estimated and planned claims remain visibly separate.</p>
</div>
</details>
<a class="cc-shell__source" href="/engineering" title="Open-source engineering: the engine, the data layer and the backtester"><svg viewBox="0 0 16 16" width="15" height="15" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg><span>Source</span></a>
<a class="cc-shell__cta" href="https://app.canlicapital.com/dashboard">Enter live record <span aria-hidden="true">↗</span></a>
</header>
<main id="content" tabindex="-1">
<section class="dev-hero">
<p class="dev-kicker"><span>Public API</span><span aria-hidden="true"> · </span><span>v1</span></p>
<h1>Every response says what it cannot be used to claim.</h1>
<p class="dev-lead">The read endpoints need no key: static JSON, regenerated on each publish.
The validation endpoints take a free key and run your numbers through the same arithmetic this
record is held to, then hand back a receipt you can cite. An API is the easiest place on a
site to lose a claim boundary, because nobody reads one by eye, so the boundary is part of
the envelope rather than part of the documentation. The same <a href="/open">honesty pledge</a>
that governs the published record governs every response here.</p>
<div class="dev-downloads">
<a class="dev-button dev-button--primary" href="/api/v1">Discovery document</a>
<a class="dev-button" href="/api/v1/openapi">OpenAPI document</a>
<a class="dev-button" href="/standards/paper-evidence">The record standard</a>
<a class="dev-button" href="/tools">Run the same arithmetic in a browser calculator</a>
</div>
</section>
<section class="dev-section dev-quickstart" id="quickstart">
<h2>Quickstart</h2>
<p class="dev-note">Three steps, in the order you need them. Every block below is copy-ready,
and the key you get in step one drops straight into the rest.</p>
<ol class="dev-steps">
<li class="dev-step">
<h3>1. Get a key</h3>
<p class="dev-note">No signup, no email.
<a href="/api/v1/validate/status"><code>GET /api/v1/validate/status</code></a> is the
one-line check that the service is up before you start.</p>
<button type="button" class="dev-button dev-button--primary" id="dev-get-key-button">Get a free key</button>
<div class="dev-key-result" id="dev-key-result" role="status" aria-live="polite" hidden></div>
<p class="dev-key-error" id="dev-key-error" hidden role="alert"></p>
<p class="dev-note">Or from a terminal, in the language you have open:</p>
<div class="dev-snippets">
<div class="dev-snippet"><p class="dev-snippet-label">curl</p><pre class="dev-code"><code>curl -X POST https://canlicapital.com/api/v1/keys \
-H "Content-Type: application/json" \
-d '{"label":"quickstart-curl"}'</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">Python</p><pre class="dev-code"><code>import json
import urllib.request
body = {"label":"quickstart-python"}
req = urllib.request.Request("https://canlicapital.com/api/v1/keys", data=json.dumps(body).encode("utf-8"), method="POST")
req.add_header("Content-Type", "application/json")
with urllib.request.urlopen(req) as response:
print(response.read().decode("utf-8"))</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">JavaScript</p><pre class="dev-code"><code>const body = {"label":"quickstart-js"};
const response = await fetch("https://canlicapital.com/api/v1/keys", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
});
console.log(await response.json());</code></pre></div>
</div>
<p class="dev-note">The key is returned once. Only its hash is kept, so store it now.</p>
</li>
<li class="dev-step">
<h3>2. Validate your own numbers</h3>
<p class="dev-note">Probabilistic and deflated Sharpe from the seven contract inputs, or from a return series plus the trials behind it.</p>
<div class="dev-mode">
<p class="dev-note"><strong>Mode 1: the seven contract inputs</strong></p>
<div class="dev-snippets">
<div class="dev-snippet"><p class="dev-snippet-label">curl</p><pre class="dev-code"><code>curl -X POST https://canlicapital.com/api/v1/validate/deflated-sharpe \
-H "Authorization: Bearer $CANLI_KEY" \
-H "Content-Type: application/json" \
-d '{"observed_sharpe_annualized":1.5,"observations":730,"periods_per_year":365,"skew":-0.5,"non_excess_kurtosis":5,"effective_independent_trials":229,"cross_trial_sharpe_sd_annualized":0.57}'</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">Python</p><pre class="dev-code"><code>import json
import urllib.request
body = {"observed_sharpe_annualized":1.5,"observations":730,"periods_per_year":365,"skew":-0.5,"non_excess_kurtosis":5,"effective_independent_trials":229,"cross_trial_sharpe_sd_annualized":0.57}
req = urllib.request.Request("https://canlicapital.com/api/v1/validate/deflated-sharpe", data=json.dumps(body).encode("utf-8"), method="POST")
req.add_header("Content-Type", "application/json")
req.add_header("Authorization", "Bearer $CANLI_KEY")
with urllib.request.urlopen(req) as response:
print(response.read().decode("utf-8"))</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">JavaScript</p><pre class="dev-code"><code>const body = {"observed_sharpe_annualized":1.5,"observations":730,"periods_per_year":365,"skew":-0.5,"non_excess_kurtosis":5,"effective_independent_trials":229,"cross_trial_sharpe_sd_annualized":0.57};
const response = await fetch("https://canlicapital.com/api/v1/validate/deflated-sharpe", {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer $CANLI_KEY" },
body: JSON.stringify(body),
});
console.log(await response.json());</code></pre></div>
</div>
</div>
<div class="dev-mode">
<p class="dev-note"><strong>Mode 2: a return series plus the trials behind it</strong></p>
<div class="dev-snippets">
<div class="dev-snippet"><p class="dev-snippet-label">curl</p><pre class="dev-code"><code>curl -X POST https://canlicapital.com/api/v1/validate/deflated-sharpe \
-H "Authorization: Bearer $CANLI_KEY" \
-H "Content-Type: application/json" \
-d '{"returns":[0.004,-0.002,0.007,0.001,-0.003,0.005,0.002,-0.001],"periods_per_year":252,"effective_independent_trials":30,"cross_trial_sharpe_sd_annualized":0.5}'</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">Python</p><pre class="dev-code"><code>import json
import urllib.request
body = {"returns":[0.004,-0.002,0.007,0.001,-0.003,0.005,0.002,-0.001],"periods_per_year":252,"effective_independent_trials":30,"cross_trial_sharpe_sd_annualized":0.5}
req = urllib.request.Request("https://canlicapital.com/api/v1/validate/deflated-sharpe", data=json.dumps(body).encode("utf-8"), method="POST")
req.add_header("Content-Type", "application/json")
req.add_header("Authorization", "Bearer $CANLI_KEY")
with urllib.request.urlopen(req) as response:
print(response.read().decode("utf-8"))</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">JavaScript</p><pre class="dev-code"><code>const body = {"returns":[0.004,-0.002,0.007,0.001,-0.003,0.005,0.002,-0.001],"periods_per_year":252,"effective_independent_trials":30,"cross_trial_sharpe_sd_annualized":0.5};
const response = await fetch("https://canlicapital.com/api/v1/validate/deflated-sharpe", {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer $CANLI_KEY" },
body: JSON.stringify(body),
});
console.log(await response.json());</code></pre></div>
</div>
</div>
<p class="dev-note">The other three validators are documented <a href="#validation">below</a>.</p>
</li>
<li class="dev-step">
<h3>3. Fetch the receipt</h3>
<p class="dev-note">Every verdict carries <code>receipt.url</code>. It is immutable and
cacheable forever, so anyone, not only the caller, can fetch and recompute it.</p>
<pre class="dev-code"><code>curl https://canlicapital.com/api/v1/receipts/{id}</code></pre>
<p class="dev-note">Its response carries <code>badge_url</code> and <code>embed_markdown</code>:
a badge showing only the formula version and the receipt id prefix, never a pass or fail
mark. Drop the embed straight into a README:</p>
<pre class="dev-code"><code>[](https://canlicapital.com/api/v1/receipts/{id})</code></pre>
</li>
</ol>
</section>
<script>(function () {
"use strict";
function replaceKeyInSnippets(key) {
var blocks = document.querySelectorAll("pre.dev-code");
for (var i = 0; i < blocks.length; i++) {
var target = blocks[i].querySelector("code") || blocks[i];
target.textContent = target.textContent.replace(/\$CANLI_KEY/g, function () { return key; });
}
}
function el(tag, className, text) {
var node = document.createElement(tag);
if (className) node.className = className;
if (text) node.textContent = text;
return node;
}
function showKeyResult(data) {
var box = document.getElementById("dev-key-result");
if (!box || !data || !data.key) return;
box.innerHTML = "";
var value = el("p", "dev-key-value");
value.appendChild(el("code", "", data.key));
var copyButton = el("button", "dev-button", "Copy");
copyButton.type = "button";
copyButton.addEventListener("click", function () {
if (!(navigator.clipboard && navigator.clipboard.writeText)) return;
navigator.clipboard.writeText(data.key).then(function () {
copyButton.textContent = "Copied";
window.setTimeout(function () { copyButton.textContent = "Copy"; }, 1800);
});
});
box.appendChild(value);
box.appendChild(copyButton);
box.appendChild(el("p", "dev-key-note", data.note || "Store this key now. It cannot be shown again."));
box.appendChild(el("p", "dev-key-remaining", "Keys remaining today: " + data.keys_remaining_today));
box.hidden = false;
replaceKeyInSnippets(data.key);
}
function showKeyError(message) {
var box = document.getElementById("dev-key-error");
if (!box) return;
box.textContent = message || "The key service is unavailable. Use the curl command below.";
box.hidden = false;
}
function wire() {
var button = document.getElementById("dev-get-key-button");
if (!button) return;
var restLabel = button.textContent;
var busyLabel = "Requesting key…";
button.addEventListener("click", function () {
button.disabled = true;
button.setAttribute("aria-busy", "true");
button.textContent = busyLabel;
var errorBox = document.getElementById("dev-key-error");
if (errorBox) errorBox.hidden = true;
fetch("/api/v1/keys", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ label: "developers-page" }),
}).then(function (response) {
return response.json().then(function (payload) {
return { status: response.status, payload: payload };
});
}).then(function (result) {
button.disabled = false;
button.removeAttribute("aria-busy");
button.textContent = restLabel;
if (result.status === 201) {
showKeyResult(result.payload && result.payload.data);
} else {
var message = result.payload && result.payload.error && result.payload.error.message;
showKeyError(message);
}
}).catch(function () {
button.disabled = false;
button.removeAttribute("aria-busy");
button.textContent = restLabel;
showKeyError("Could not reach the key service. Use the curl command below.");
});
});
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", wire);
} else {
wire();
}
})();</script>
<section class="dev-section" id="ai-assistant">
<h2>From your AI assistant</h2>
<p class="dev-note">This API is also an MCP server, so a coding assistant can call the
routes on this page as tools instead of writing requests by hand. Every tool it exposes
returns the full envelope, the same way every route on this page does, so the assistant
sees what a number cannot be used to claim, not only the number.</p>
<div class="dev-snippet"><p class="dev-snippet-label">Claude Code</p><pre class="dev-code"><code>claude mcp add canli -- npx -y canli-validation-mcp</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">Claude Desktop</p><pre class="dev-code"><code>{
"mcpServers": {
"canli": {
"command": "npx",
"args": ["-y", "canli-validation-mcp"]
}
}
}</code></pre></div>
<p class="dev-note"><a href="https://www.npmjs.com/package/canli-validation-mcp" rel="noreferrer">canli-validation-mcp on npm</a>, with the full tool list and what each one does not establish.</p>
</section>
<section class="dev-section">
<h2>Read endpoints, no key</h2>
<table class="dev-table">
<thead><tr><th>Path</th><th>What it returns</th></tr></thead>
<tbody>
<tr><td><a href="/api/v1/chain/head"><code>GET /api/v1/chain/head</code></a></td><td>The head of the signed append-only transparency chain, and the public key needed to verify it.</td></tr>
<tr><td><a href="/api/v1/record"><code>GET /api/v1/record</code></a></td><td>The full record as an instance of the canli.paper-evidence.v0 open standard, including what it does not establish.</td></tr>
<tr><td><a href="/api/v1/research"><code>GET /api/v1/research</code></a></td><td>Every published research document and topic, including failures and feasibility nulls.</td></tr>
<tr><td><a href="/api/v1/sleeves"><code>GET /api/v1/sleeves</code></a></td><td>Per-sleeve state. Note that the research curves are not on a common date grid and cannot be combined.</td></tr>
<tr><td><a href="/api/v1/status"><code>GET /api/v1/status</code></a></td><td>Current state of the paper record: capital kind, period, observation count, validation status and broker reconciliation.</td></tr>
<tr><td><a href="/api/v1/trials/summary"><code>GET /api/v1/trials/summary</code></a></td><td>The trial union used as the multiple-testing denominator, plus the kill counts.</td></tr>
</tbody>
</table>
</section>
<section class="dev-section" id="validation">
<h2>Validation endpoints, free key</h2>
<p class="dev-note">Send your own numbers; get back the arithmetic this house runs on itself.
Nothing you send is stored. Each verdict returns a receipt anyone can recompute.</p>
<table class="dev-table">
<thead><tr><th>Route</th><th>What it does</th></tr></thead>
<tbody>
<tr><td><code>POST /api/v1/keys</code></td><td>Issue a free key. Returned once; only its hash is stored.</td></tr>
<tr><td><code>POST /api/v1/validate/deflated-sharpe</code></td><td>Probabilistic and deflated Sharpe from the seven contract inputs, or from a return series plus the trials behind it.</td></tr>
<tr><td><code>POST /api/v1/validate/overfitting</code></td><td>Probability of backtest overfitting by CSCV over the returns of every variant tried.</td></tr>
<tr><td><code>POST /api/v1/validate/paper-evidence</code></td><td>Conformance of a performance record against the canli.paper-evidence.v0 standard.</td></tr>
<tr><td><code>POST /api/v1/validate/breadth</code></td><td>Book Sharpe ceiling from per-sleeve quality and average pairwise correlation, and the sleeves a target needs. (book: the set of sleeves run together)</td></tr>
<tr><td><code>GET /api/v1/validate/status</code></td><td>Service and store status with the quota constants in force.</td></tr>
<tr><td><code>GET /api/v1/receipts/{id}</code></td><td>A stored verdict by content-hash id. Immutable.</td></tr>
<tr><td><code>GET /api/v1/receipts/{id}/badge.svg</code></td><td>An embeddable SVG badge for a receipt: the formula version and the receipt id prefix only, never a pass or fail mark.</td></tr>
</tbody>
</table>
<h3>First, issue a key</h3>
<div class="dev-snippets">
<div class="dev-snippet"><p class="dev-snippet-label">curl</p><pre class="dev-code"><code>curl -X POST https://canlicapital.com/api/v1/keys \
-H "Content-Type: application/json" \
-d '{"label":"quickstart-curl"}'</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">Python</p><pre class="dev-code"><code>import json
import urllib.request
body = {"label":"quickstart-python"}
req = urllib.request.Request("https://canlicapital.com/api/v1/keys", data=json.dumps(body).encode("utf-8"), method="POST")
req.add_header("Content-Type", "application/json")
with urllib.request.urlopen(req) as response:
print(response.read().decode("utf-8"))</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">JavaScript</p><pre class="dev-code"><code>const body = {"label":"quickstart-js"};
const response = await fetch("https://canlicapital.com/api/v1/keys", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
});
console.log(await response.json());</code></pre></div>
</div>
<p class="dev-note">The key is returned once. Only its hash is kept.</p>
<h3>Then validate</h3>
<article class="dev-endpoint" id="api-deflated-sharpe"><h4><code>POST /api/v1/validate/deflated-sharpe</code></h4><p>Probabilistic and deflated Sharpe from the seven contract inputs, or from a return series plus the trials behind it.</p><div class="dev-mode">
<p class="dev-note"><strong>Mode 1: the seven contract inputs</strong></p>
<div class="dev-snippets">
<div class="dev-snippet"><p class="dev-snippet-label">curl</p><pre class="dev-code"><code>curl -X POST https://canlicapital.com/api/v1/validate/deflated-sharpe \
-H "Authorization: Bearer $CANLI_KEY" \
-H "Content-Type: application/json" \
-d '{"observed_sharpe_annualized":1.5,"observations":730,"periods_per_year":365,"skew":-0.5,"non_excess_kurtosis":5,"effective_independent_trials":229,"cross_trial_sharpe_sd_annualized":0.57}'</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">Python</p><pre class="dev-code"><code>import json
import urllib.request
body = {"observed_sharpe_annualized":1.5,"observations":730,"periods_per_year":365,"skew":-0.5,"non_excess_kurtosis":5,"effective_independent_trials":229,"cross_trial_sharpe_sd_annualized":0.57}
req = urllib.request.Request("https://canlicapital.com/api/v1/validate/deflated-sharpe", data=json.dumps(body).encode("utf-8"), method="POST")
req.add_header("Content-Type", "application/json")
req.add_header("Authorization", "Bearer $CANLI_KEY")
with urllib.request.urlopen(req) as response:
print(response.read().decode("utf-8"))</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">JavaScript</p><pre class="dev-code"><code>const body = {"observed_sharpe_annualized":1.5,"observations":730,"periods_per_year":365,"skew":-0.5,"non_excess_kurtosis":5,"effective_independent_trials":229,"cross_trial_sharpe_sd_annualized":0.57};
const response = await fetch("https://canlicapital.com/api/v1/validate/deflated-sharpe", {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer $CANLI_KEY" },
body: JSON.stringify(body),
});
console.log(await response.json());</code></pre></div>
</div>
</div>
<div class="dev-mode">
<p class="dev-note"><strong>Mode 2: a return series plus the trials behind it</strong></p>
<div class="dev-snippets">
<div class="dev-snippet"><p class="dev-snippet-label">curl</p><pre class="dev-code"><code>curl -X POST https://canlicapital.com/api/v1/validate/deflated-sharpe \
-H "Authorization: Bearer $CANLI_KEY" \
-H "Content-Type: application/json" \
-d '{"returns":[0.004,-0.002,0.007,0.001,-0.003,0.005,0.002,-0.001],"periods_per_year":252,"effective_independent_trials":30,"cross_trial_sharpe_sd_annualized":0.5}'</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">Python</p><pre class="dev-code"><code>import json
import urllib.request
body = {"returns":[0.004,-0.002,0.007,0.001,-0.003,0.005,0.002,-0.001],"periods_per_year":252,"effective_independent_trials":30,"cross_trial_sharpe_sd_annualized":0.5}
req = urllib.request.Request("https://canlicapital.com/api/v1/validate/deflated-sharpe", data=json.dumps(body).encode("utf-8"), method="POST")
req.add_header("Content-Type", "application/json")
req.add_header("Authorization", "Bearer $CANLI_KEY")
with urllib.request.urlopen(req) as response:
print(response.read().decode("utf-8"))</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">JavaScript</p><pre class="dev-code"><code>const body = {"returns":[0.004,-0.002,0.007,0.001,-0.003,0.005,0.002,-0.001],"periods_per_year":252,"effective_independent_trials":30,"cross_trial_sharpe_sd_annualized":0.5};
const response = await fetch("https://canlicapital.com/api/v1/validate/deflated-sharpe", {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer $CANLI_KEY" },
body: JSON.stringify(body),
});
console.log(await response.json());</code></pre></div>
</div>
</div><p class="dev-note"><a href="/tools/deflated-sharpe">Try it in the browser, no key required</a></p></article>
<article class="dev-endpoint" id="api-overfitting"><h4><code>POST /api/v1/validate/overfitting</code></h4><p>Probability of backtest overfitting by CSCV over the returns of every variant tried.</p><div class="dev-snippets">
<div class="dev-snippet"><p class="dev-snippet-label">curl</p><pre class="dev-code"><code>curl -X POST https://canlicapital.com/api/v1/validate/overfitting \
-H "Authorization: Bearer $CANLI_KEY" \
-H "Content-Type: application/json" \
-d '{"matrix":[[0.01,0.002,-0.004],[-0.003,0.001,0.006],[0.004,-0.002,0.001],[0.002,0.003,-0.001]],"n_splits":4}'</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">Python</p><pre class="dev-code"><code>import json
import urllib.request
body = {"matrix":[[0.01,0.002,-0.004],[-0.003,0.001,0.006],[0.004,-0.002,0.001],[0.002,0.003,-0.001]],"n_splits":4}
req = urllib.request.Request("https://canlicapital.com/api/v1/validate/overfitting", data=json.dumps(body).encode("utf-8"), method="POST")
req.add_header("Content-Type", "application/json")
req.add_header("Authorization", "Bearer $CANLI_KEY")
with urllib.request.urlopen(req) as response:
print(response.read().decode("utf-8"))</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">JavaScript</p><pre class="dev-code"><code>const body = {"matrix":[[0.01,0.002,-0.004],[-0.003,0.001,0.006],[0.004,-0.002,0.001],[0.002,0.003,-0.001]],"n_splits":4};
const response = await fetch("https://canlicapital.com/api/v1/validate/overfitting", {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer $CANLI_KEY" },
body: JSON.stringify(body),
});
console.log(await response.json());</code></pre></div>
</div><p class="dev-note"><a href="/tools/backtest-overfitting">Try it in the browser, no key required</a></p></article>
<article class="dev-endpoint" id="api-paper-evidence"><h4><code>POST /api/v1/validate/paper-evidence</code></h4><p>Conformance of a performance record against the canli.paper-evidence.v0 standard.</p><div class="dev-snippets">
<div class="dev-snippet"><p class="dev-snippet-label">curl</p><pre class="dev-code"><code>curl -X POST https://canlicapital.com/api/v1/validate/paper-evidence \
-H "Authorization: Bearer $CANLI_KEY" \
-H "Content-Type: application/json" \
-d '{"record":{"schema":"canli.paper-evidence.v0"}}'</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">Python</p><pre class="dev-code"><code>import json
import urllib.request
body = {"record":{"schema":"canli.paper-evidence.v0"}}
req = urllib.request.Request("https://canlicapital.com/api/v1/validate/paper-evidence", data=json.dumps(body).encode("utf-8"), method="POST")
req.add_header("Content-Type", "application/json")
req.add_header("Authorization", "Bearer $CANLI_KEY")
with urllib.request.urlopen(req) as response:
print(response.read().decode("utf-8"))</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">JavaScript</p><pre class="dev-code"><code>const body = {"record":{"schema":"canli.paper-evidence.v0"}};
const response = await fetch("https://canlicapital.com/api/v1/validate/paper-evidence", {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer $CANLI_KEY" },
body: JSON.stringify(body),
});
console.log(await response.json());</code></pre></div>
</div></article>
<article class="dev-endpoint" id="api-breadth"><h4><code>POST /api/v1/validate/breadth</code></h4><p>Book Sharpe ceiling from per-sleeve quality and average pairwise correlation, and the sleeves a target needs.</p><div class="dev-snippets">
<div class="dev-snippet"><p class="dev-snippet-label">curl</p><pre class="dev-code"><code>curl -X POST https://canlicapital.com/api/v1/validate/breadth \
-H "Authorization: Bearer $CANLI_KEY" \
-H "Content-Type: application/json" \
-d '{"sleeve_sharpe":0.5,"average_pairwise_correlation":0.05,"sleeves":4,"target":1.5}'</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">Python</p><pre class="dev-code"><code>import json
import urllib.request
body = {"sleeve_sharpe":0.5,"average_pairwise_correlation":0.05,"sleeves":4,"target":1.5}
req = urllib.request.Request("https://canlicapital.com/api/v1/validate/breadth", data=json.dumps(body).encode("utf-8"), method="POST")
req.add_header("Content-Type", "application/json")
req.add_header("Authorization", "Bearer $CANLI_KEY")
with urllib.request.urlopen(req) as response:
print(response.read().decode("utf-8"))</code></pre></div>
<div class="dev-snippet"><p class="dev-snippet-label">JavaScript</p><pre class="dev-code"><code>const body = {"sleeve_sharpe":0.5,"average_pairwise_correlation":0.05,"sleeves":4,"target":1.5};
const response = await fetch("https://canlicapital.com/api/v1/validate/breadth", {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer $CANLI_KEY" },
body: JSON.stringify(body),
});
console.log(await response.json());</code></pre></div>
</div><p class="dev-note"><a href="/tools/breadth">Try it in the browser, no key required</a></p></article>
<h3>Then cite the receipt</h3>
<p class="dev-note">Every verdict carries <code>receipt.url</code>. <code>GET /api/v1/receipts/{id}</code>
returns the stored output, the input hash, and the content hash of every core and contract that
computed it. The id is the first twenty-four hex characters of the content hash over the canonical
JSON of endpoint, input hash, output and bindings, so a third party can check it without trusting
this server.</p>
</section>
<section class="dev-section" id="quotas">
<h2>Quotas, public and enforced from one source</h2>
<table class="dev-table">
<thead><tr><th>Limit</th><th>Value</th></tr></thead>
<tbody>
<tr><td>Validations per key per UTC day</td><td>1000</td></tr>
<tr><td>Keys per client per UTC day</td><td>5</td></tr>
<tr><td>Request body, bytes</td><td>1048576</td></tr>
<tr><td>Observations per series or rows per matrix</td><td>20000</td></tr>
<tr><td>Variants per matrix</td><td>200</td></tr>
<tr><td>CSCV combinations evaluated</td><td>2000</td></tr>
</tbody>
</table>
<p class="dev-note">Every response carries <code>X-RateLimit-Limit</code>, <code>X-RateLimit-Remaining</code>
and <code>X-RateLimit-Reset</code>. A 429 carries <code>Retry-After</code>.</p>
<h3>What happens to a key after you have it</h3>
<ul class="dev-list">
<li>Keys do not expire once issued.</li>
<li>There is no self-serve revoke or rotate endpoint in v1. If a key is compromised or simply unwanted, issue a new key and stop using the old one; the old one keeps working until someone revokes it by hand on the server side.</li>
<li>"Client", for the daily key-issuance quota, means the request's IP address hashed together with a salt that rotates every UTC day, not a stored account. A shared office or NAT IP address draws from the same pool of 5 keys a day as every other request behind it.</li>
</ul>
</section>
<section class="dev-section" id="not-established">
<h2>What a verdict does not establish</h2>
<ul class="dev-list">
<li>This verdict is about the series exactly as submitted. The service never saw the data source, its costs, survivorship, or any lookahead in how the series was built.</li>
<li>A deflated Sharpe or overfitting probability above or below any threshold is not admission to anything and is not a forecast.</li>
<li>The receipt is content-hashed and reproducible from the open-source core it names. It is not signed.</li>
<li>Quotas: 1000 validations per key per UTC day, 5 keys per client per UTC day, 1048576 bytes per request, 20000 observations per series, 200 variants per matrix.</li>
</ul>
</section>
<section class="dev-section">
<h2>The envelope</h2>
<p class="dev-note">Every response has the same shape. The two fields worth reading first are
the two an API usually omits.</p>
<div class="dev-grid">
<article><h3><code>claim_class</code></h3><p>What kind of claim this is: observed, model
estimated, a published document, a cryptographic record. Merging these is how a simulated
figure acquires the authority of a measured one.</p></article>
<article><h3><code>limits</code></h3><p>What this response cannot be used to say. The build
refuses to emit an endpoint that declares none.</p></article>
<article><h3><code>sources</code></h3><p>Every artifact the response was built from, with its
content hash and a URL, so a consumer can recompute rather than trust.</p></article>
<article><h3><code>generated_at</code></h3><p>The freshness of every figure inside. These are
snapshots, not a stream.</p></article>
</div>
</section>
<section class="dev-section dev-section--tail">
<h2>Limits of the whole API</h2>
<ul class="dev-list">
<li>Read only. There is no write path and no authentication, because there is nothing to authenticate to.</li>
<li>Regenerated on each publish. Treat generated_at as the freshness of every figure inside.</li>
<li>Paper execution only. Nothing here represents funded performance.</li>
<li>Sleeve research curves are decimated for display and are <strong>not on a common date
grid</strong>. They cannot be combined into a composite by a consumer, and the composite is
published separately for that reason.</li>
</ul>
<p class="dev-note">Found a problem?
<a href="https://github.com/arhancanli/alphac/issues/new?template=external-review.yml" rel="noreferrer">The governed review route</a>
is the fastest way to get it fixed and recorded.</p>
</section>
</main>
<footer class="cc-footer" id="footer" data-product-shell="v3">
<div class="cc-footer__lead">
<a class="cc-footer__brand" href="/">Canli Capital</a>
<p>Build the claim. Publish the evidence. Keep the failures.</p>
</div>
<div class="cc-footer__routes">
<nav aria-label="Portfolio and research">
<span>Research system</span>
<a href="https://app.canlicapital.com/dashboard">Live record</a>
<a href="/systems">ALPHAC systems</a>
<a href="/research">Research papers</a>
<a href="/trials">Trial union</a>
</nav>
<nav aria-label="Evidence and verification">
<span>Evidence</span>
<a href="/methodology">Methodology</a>
<a href="/costs">What costs are charged</a>
<a href="/verify">Verify record</a>
<a href="/measurements">Measurements</a>
<a href="/open">Open data</a>
</nav>
<nav aria-label="Institution and authorship">
<span>Institution</span>
<a href="/progress">Corrections</a>
<a href="/performance">Performance</a>
<a href="/founder">Arhan Canli</a>
</nav>
<nav aria-label="Calculators">
<span>Run it yourself</span>
<a href="/tools">All calculators</a>
<a href="/tools/deflated-sharpe">Deflated Sharpe calculator</a>
<a href="/tools/backtest-overfitting">Backtest overfitting calculator</a>
<a href="/tools/selection-risk">Selection Risk Lab</a>
<a href="/tools/breadth">Breadth Lab</a>
<a href="/tools/execution">Execution Reality Lab</a>
<a href="/tools/trial-accounting">Trial accounting</a>
<a href="/tools/evidence-chain">Evidence chain</a>
</nav>
<nav aria-label="Open source">
<span>Source code</span>
<a href="/developers">Developers</a>
<a href="/engineering">Engineering</a>
<a href="/notes">Engineering notes</a>
<a href="/standards/paper-evidence">Evidence standard</a>
<a href="https://github.com/arhancanli/alphac" rel="noreferrer">alphac engine</a>
<a href="https://github.com/arhancanli/canli-pit-lake" rel="noreferrer">canli-pit-lake</a>
<a href="https://github.com/arhancanli/canli-backtest" rel="noreferrer">canli-backtest</a>
</nav>
</div>
<div class="cc-footer__boundary">
<p>Research and paper execution only. No managed capital, copy trading, investment advice or promised return.</p>
<p>Engineered independently by Arhan Canli in Dubai since July 2024. The public paper
record begins 2026-08-07; the years before it are engineering, not track record.</p>
<span>Copyright Arhan Canli</span>
</div>
</footer>
</body>
</html>