-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi-sandbox.yaml
More file actions
1167 lines (1091 loc) · 45.2 KB
/
Copy pathopenapi-sandbox.yaml
File metadata and controls
1167 lines (1091 loc) · 45.2 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
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: OnChainRisk Sandbox API
version: 1.0.0
license:
name: Proprietary
url: https://onchainrisk.io/terms
description: |
**[⬇ Download OpenAPI spec (YAML)](/openapi-sandbox.yaml)** — for codegen tools (openapi-generator, orval, etc.)
---
Sandbox tier for developers to evaluate OnChainRisk integration with real
addresses and real responses, without the compute cost of a full paid
analysis.
## What Sandbox is for
- Auth testing - confirm your API key works
- Response envelope validation - see actual field types and shapes
- Integration testing - wire your client against a real endpoint
- Basic UI prototyping
## What Sandbox is NOT for
- Production monitoring or alerting bots
- Large-scale tracing or attribution
- Any workflow that depends on historical data beyond 7 days
- Graph expansion, cluster analysis, cross-chain tracing
## Authentication
Create a sandbox API key in the dashboard at
https://app.onchainrisk.io/dashboard/api-keys. Free-tier accounts can create
a sandbox key. Key management (create, list, revoke) is dashboard-only
and intentionally not exposed here.
Send your key in the `Authorization` header:
Authorization: Bearer ocr_test_...
New sandbox keys minted by the dashboard use the `ocr_test_*` prefix.
Sandbox keys created before the prefix split remain valid and may
appear with the legacy `ocr_live_*` prefix; either form authenticates
as a sandbox key based on the underlying key tier.
## Rate Limits
Token bucket algorithm.
| Scope | Capacity | Refill |
|---------|----------|--------------|
| Per key | 20 | 10 per min |
| Per IP | 30 | 30 per min |
429 responses include a `Retry-After` header and a body with `bucket`
and `retry_after_seconds`.
## Response Policy
Sandbox responses keep the same core envelope as paid (`address`,
`network`, `riskScore`, `riskLevel`, `addressInfo`, `_sandbox`, etc.),
but many expensive fields are gated:
- gated objects are returned as `null` (e.g. `tokenFlow`, `clusters`, `honeypot`)
- gated arrays are returned as `[]` (e.g. `topCounterparties`, `addressConnections`)
- gated scalars are omitted entirely (e.g. `analysisMode`, `fullAnalysisAvailable`)
- truncated arrays keep only recent items (e.g. `transactionHistory` = last 7 days)
The authoritative list for a given response lives in `_sandbox.gated_fields[]`
and `_sandbox.truncated_fields{}`. Clients should treat these as source of
truth and NOT assume every paid field will be present.
## Sandbox signal (canonical)
A client can detect sandbox mode two ways:
1. Response contains a `_sandbox` root object with `profile: "sandbox"`
2. `GET /api/user/me` returns `key_type: "sandbox"` and `api_mode: "sandbox"`
No other fields are overloaded with sandbox semantics - `plan`, `riskLevel`,
`riskConfidence`, `dataQuality` and other enums keep their existing paid
value vocabularies.
## Validation errors
Address validation runs before any blockchain scan. On failure the API
returns **HTTP 422** with this envelope:
```json
{
"success": false,
"error": {
"message": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"address": "Address format does not match selected network. The address looks like a tron address, but network was set to eth.",
"errorCode": "ADDRESS_NETWORK_MISMATCH",
"detectedFamily": "tron",
"requestedNetwork": "eth"
}
}
}
```
`error.code` is always `VALIDATION_ERROR` for this class. The granular
reason lives in `error.details.errorCode`:
| `errorCode` | When |
|-------------------------------|----------------------------------------------------------------------------------|
| `INVALID_ADDRESS` | empty, wrong format, whitespace-only |
| `UNSUPPORTED_NETWORK` | `network` not in the supported list |
| `COULD_NOT_DETECT_NETWORK` | address format unrecognised AND `network` omitted |
| `INVALID_ADDRESS_CHECKSUM` | decode succeeded, family checksum failed (Tron / BTC-legacy / LTC-legacy). Solana decode failures surface as `INVALID_ADDRESS` because Solana is not checksum-based. |
| `ADDRESS_NETWORK_MISMATCH` | detected address family inconsistent with requested `network` |
`detectedFamily` and `requestedNetwork` are present only when they add
useful diagnostic context; both may be `null` or absent.
contact:
name: OnChainRisk Support
url: https://app.onchainrisk.io/dashboard/support
email: admin@onchainrisk.io
servers:
- url: https://api.onchainrisk.io
description: Production (sandbox requests use the same host)
tags:
- name: Analysis
description: Address risk analysis (sandbox profile)
- name: Graph
description: |
Transaction graph preview (sandbox profile). Limited to depth 1,
last 7 days, capped nodes/edges. Upgrade for full historical graph
expansion via paid `/api/graph/expand`.
- name: Account
description: Current user profile and usage
security:
- ApiKeyAuth: []
paths:
/api/v1/check:
post:
operationId: sandboxCheckAddress
tags: [Analysis]
summary: Analyze a wallet address (sandbox profile)
description: |
Returns a risk summary for the given address. Sandbox profile runs
only cheap modules on the backend: label lookup, balance + tx count,
contract bytecode check, and recent activity in a 7-day window.
Expensive modules (token flow, cross-chain, clustering, graph) are
skipped at compute time and the corresponding response fields are
gated per the policy in the top-level description.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [address, network]
properties:
address:
type: string
example: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
network:
type: string
example: "eth"
responses:
'200':
description: Sandbox analysis response
content:
application/json:
schema:
$ref: '#/components/schemas/SandboxCheckResponse'
'400':
$ref: '#/components/responses/BadRequest'
'403':
$ref: '#/components/responses/SandboxNotSupported'
'422':
$ref: '#/components/responses/ValidationFailed'
'429':
$ref: '#/components/responses/RateLimited'
/api/v1/sandbox/graph/expand:
post:
operationId: sandboxGraphExpand
tags: [Graph]
summary: Sandbox graph preview (depth=1, last 7 days, capped)
description: |
Sandbox graph preview is for **integration testing**. It is limited
to depth 1, recent activity, and capped nodes/edges. Upgrade for
full historical graph expansion via paid `/api/graph/expand`.
Returns a node/edge graph in the same broad shape as paid
`/api/graph/expand` (aggregated counterparty edges with
`from`/`to`/`value`/`valueWei`/`txCount`/`firstTx`/`lastTx`/
`tokenBreakdown`) so a sandbox client can be re-pointed at paid
without rewriting response handling.
### Sandbox limits
- `depth`: max 1 (silently clamped; reported in `_sandbox.truncated_fields.depth`)
- `nodes`: max 20
- `edges`: max 30
- History window: last 7 days only
- Tx fetch cap: 100 per request
- No clusters, no entity expansion, no cross-chain graph, no AI
- **No report persistence**, **no usage row**, **no credit charge**
### Supported networks
EVM family — `eth`, `arbitrum`, `optimism`, `base`, `polygon`,
`avalanche`, `zksync`, `scroll`, `celo`, `cronos`, `moonbeam`,
plus `bsc` and `tron`. **13 networks total** in current
production. Other networks (sol, btc, ltc, ton, cosmos, cardano,
xrp, plus `linea`, `fantom`, `polygon_zkevm`) return **422**
with `details.errorCode = "NETWORK_NOT_SUPPORTED_IN_SANDBOX"` —
no silent fallback to a paid traversal.
> `linea`, `fantom`, `polygon_zkevm` were removed from the
> supported set in audit #46 (2026-05-04) because the upstream
> analyzer returns 503 for these chains. They will return when
> the underlying provider config is fixed.
### Auth
API key only (sandbox `ocr_test_*` or paid `ocr_live_*`). JWT/session
auth is rejected with 401 `API_KEY_REQUIRED`. Paid keys are allowed
so that paid customers can integrate-test against the sandbox shape;
the response is always sandbox-scoped regardless of key type.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [address, network]
properties:
address:
type: string
example: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
network:
type: string
enum:
- eth
- arbitrum
- optimism
- base
- polygon
- avalanche
- zksync
- scroll
- celo
- cronos
- moonbeam
- bsc
- tron
example: "eth"
depth:
type: integer
minimum: 1
maximum: 1
default: 1
description: |
Depth is silently clamped to 1. Higher values are
reported back via `_sandbox.truncated_fields.depth`.
responses:
'200':
description: Sandbox graph preview
content:
application/json:
schema:
$ref: '#/components/schemas/SandboxGraphResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/ValidationFailed'
'429':
$ref: '#/components/responses/RateLimited'
'503':
description: Sandbox graph preview temporarily unavailable
content:
application/json:
schema:
type: object
properties:
success: { type: boolean, example: false }
error: { type: string, example: "Sandbox graph preview temporarily unavailable. Please try again later." }
code: { type: string, example: "SANDBOX_GRAPH_UNAVAILABLE" }
# Note: /api/analyze/estimate is NOT exposed on api.onchainrisk.io. It is an
# internal preflight; direct external calls would 404. Intentionally
# omitted from this spec.
/api/user/me:
get:
operationId: sandboxGetMe
tags: [Account]
summary: Current user profile (with sandbox markers)
responses:
'200':
description: User profile
content:
application/json:
schema:
$ref: '#/components/schemas/UserMeSandbox'
'401':
$ref: '#/components/responses/Unauthorized'
/api/user/usage:
get:
operationId: sandboxGetUsage
tags: [Account]
summary: Current usage and limit status
description: |
Returns current period usage against plan limit plus available credits.
Free tier returns rolling-daily window; paid tiers return monthly.
responses:
'200':
description: Usage info
content:
application/json:
schema:
$ref: '#/components/schemas/UsageInfo'
'401':
$ref: '#/components/responses/Unauthorized'
components:
securitySchemes:
ApiKeyAuth:
type: http
scheme: bearer
bearerFormat: ocr_test_* (legacy keys may still use ocr_live_*)
responses:
Unauthorized:
description: Missing or invalid API key
content:
application/json:
schema:
type: object
properties:
success: { type: boolean, example: false }
error: { type: string, example: "unauthorized" }
BadRequest:
description: Invalid request (e.g. address too large for sandbox)
content:
application/json:
schema:
type: object
properties:
success: { type: boolean, example: false }
error: { type: string, example: "address_too_large_for_sandbox" }
estimated_tx: { type: integer }
upgrade_url: { type: string }
SandboxNotSupported:
description: |
Endpoint not available for sandbox keys. The body is actionable and
machine-readable. `error.code` stays `sandbox_not_supported` for
backward compatibility; `error.reason` carries the finer distinction:
`paid_only` when the endpoint exists but is a paid feature, or
`unsupported` when the path is not part of the sandbox API at all
(e.g. a guessed/nonexistent endpoint shape). No risk or report data is
returned. Sandbox reports are never saved (`_sandbox.reports_saved`
is always `false`); persistent reports and retrieval are a paid plan
feature.
content:
application/json:
schema:
type: object
properties:
success: { type: boolean, example: false }
error:
type: object
properties:
code:
type: string
enum: [sandbox_not_supported]
description: Preserved for backward compatibility.
reason:
type: string
enum: [paid_only, unsupported]
upgrade_required: { type: boolean }
message: { type: string }
endpoint:
type: string
description: "The blocked request, e.g. 'POST /api/v1/check/deep'."
docs_url: { type: string }
upgrade_url: { type: string }
hint: { type: string }
required: [code, reason, upgrade_required, message, endpoint]
_sandbox:
type: object
properties:
allowed_endpoint: { type: string, example: "POST /api/v1/check" }
reports_saved: { type: boolean, example: false }
examples:
paid-only:
summary: A real, paid-only endpoint (reason=paid_only)
value:
success: false
error:
code: "sandbox_not_supported"
reason: "paid_only"
upgrade_required: true
message: "This endpoint is available on paid API plans."
endpoint: "POST /api/v1/check/deep"
docs_url: "https://api.onchainrisk.io/sandbox-docs"
upgrade_url: "https://onchainrisk.io/pricing"
hint: "Sandbox keys can call POST /api/v1/check with { address, network }."
_sandbox:
allowed_endpoint: "POST /api/v1/check"
reports_saved: false
unsupported:
summary: Path not part of the sandbox API — guessed/nonexistent (reason=unsupported)
value:
success: false
error:
code: "sandbox_not_supported"
reason: "unsupported"
upgrade_required: false
message: "This endpoint is not part of the sandbox API."
endpoint: "GET /api/v1/address/0xabc"
docs_url: "https://api.onchainrisk.io/sandbox-docs"
upgrade_url: "https://onchainrisk.io/pricing"
hint: "Sandbox keys can call POST /api/v1/check with { address, network }."
_sandbox:
allowed_endpoint: "POST /api/v1/check"
reports_saved: false
ValidationFailed:
description: |
Address failed validation before any scan was performed. HTTP status
is **422** with envelope `{ success: false, error: ErrorResponse }`.
`error.details.errorCode` carries the granular reason.
content:
application/json:
schema:
type: object
properties:
success: { type: boolean, example: false }
error: { $ref: '#/components/schemas/ErrorResponse' }
examples:
address-network-mismatch:
summary: Tron address submitted with network=eth
value:
success: false
error:
message: "Validation failed"
code: "VALIDATION_ERROR"
details:
address: "Address format does not match selected network. The address looks like a tron address, but network was set to eth."
errorCode: "ADDRESS_NETWORK_MISMATCH"
detectedFamily: "tron"
requestedNetwork: "eth"
invalid-address:
summary: Whitespace-only address
value:
success: false
error:
message: "Validation failed"
code: "VALIDATION_ERROR"
details:
address: "Address is required."
errorCode: "INVALID_ADDRESS"
RateLimited:
description: Rate limit exceeded (token bucket)
headers:
Retry-After:
schema: { type: integer }
description: Seconds until at least 1 token refills
content:
application/json:
schema:
type: object
properties:
success: { type: boolean, example: false }
error: { type: string, example: "rate_limit_exceeded" }
bucket:
type: string
enum: [per_key, per_ip]
retry_after_seconds: { type: integer }
upgrade_url: { type: string }
schemas:
Coverage:
type: object
description: |
Per-chain coverage disclosure block. Present on every report response
regardless of stage — clients should NEVER need to special-case its absence.
Stage taxonomy:
- `ga` — General Availability: full historical depth within stated window.
- `rollout` — Active migration / soak window. Coverage windows may temporarily vary.
- `preview` — Pre-v1: reports may have incomplete depth or gaps.
- `degraded` — Known operational incident; see `warning` and `incident_url`.
**Client integration requirement:** clients integrating OnChainRisk are
REQUIRED to surface the `coverage.disclosure` field to end users when
`stage != ga`. For `stage in [preview, degraded]`, clients MUST surface
the `warning` field prominently.
Sandbox responses use the SAME Coverage schema as paid responses — no
schema drift between the two surfaces. Sandbox does not carry a
sandbox-specific stage; the stage reflects the underlying chain's
canonical maturity from the public coverage matrix.
Canonical per-chain status matrix: see the `matrix_url` link.
required: [stage, window, data_path, as_of, disclosure, matrix_url]
properties:
stage:
type: string
enum: [ga, rollout, preview, degraded]
description: |
Coverage maturity for this chain.
window:
type: [string, 'null']
example: "30d"
description: |
Trailing coverage window (e.g. "30d", "90d"). May be `null` for
chains in `preview` stage where no window is yet committed.
data_path:
type: string
example: "self_hosted_nitro_clickhouse"
description: |
Production data path label (informational; not a user-facing
commitment).
as_of:
type: string
format: date
example: "2026-05-04"
description: ISO date when this coverage status was last verified.
disclosure:
type: string
description: |
Disclosure text appropriate for this stage. Clients SHOULD surface
this to end users when `stage != ga`.
warning:
type: string
description: |
Strong warning text. Present (REQUIRED) when `stage in [preview, degraded]`.
Clients MUST surface this prominently.
incident_url:
type: string
format: uri
description: |
Incident status URL. May be present when `stage = degraded`.
matrix_url:
type: string
format: uri
example: "https://onchainrisk.io/coverage"
served_from:
type: string
enum: [hot, archive, direct_node, direct_api, mixed]
description: |
Optional hybrid read-model disclosure. Which read path served this
report: `hot` (own indexer / hot store), `archive` (replayed from
archive), `direct_node` (point node lookup), `direct_api`
(third-party API fallback, e.g. Moralis), or `mixed` (hot/indexer
data combined with a point lookup such as `eth_getCode` is_contract).
Absent when the producer does not yet emit hybrid disclosure.
historical_completeness:
type: string
enum: [within_window, replayed_from_archive, partial_via_fallback, unknown_before_window]
description: |
Optional hybrid read-model disclosure. Depth completeness of the
served data: `within_window` (full depth within the stated window),
`replayed_from_archive` (archive replay restored depth),
`partial_via_fallback` (a third-party fallback supplied partial
depth), or `unknown_before_window` (the indexer window limited how
far back depth is known). Absent when not emitted by the producer.
fallback_used:
type: boolean
description: |
Optional hybrid read-model disclosure. `true` when a third-party /
direct-API fallback (e.g. Moralis) supplied the analytical data.
A point lookup such as `eth_getCode` / is_contract alone does NOT
set this. Absent when not emitted by the producer.
source_mode:
type: string
description: |
Optional hybrid read-model disclosure. Free-form source label, e.g.
`mixed` (hot indexer + point lookup), `hot:<data_path>`, or
`fallback:moralis`. Informational; not an enum. Absent when not
emitted by the producer.
coverage_window:
type: [string, 'null']
example: "30d"
description: |
Optional alias of `window` — same value, provided for hybrid
read-model consumers that key on `coverage_window`. Does NOT change
the meaning of `window`. Absent when not emitted by the producer.
example:
stage: rollout
window: "30d"
data_path: self_hosted_nitro_clickhouse
as_of: "2026-05-04"
disclosure: "OnChainRisk's multi-chain coverage is in active rollout..."
matrix_url: https://onchainrisk.io/coverage
served_from: hot
historical_completeness: within_window
fallback_used: false
source_mode: "hot:self_hosted_nitro_clickhouse"
coverage_window: "30d"
ErrorResponse:
type: object
description: |
Stable error envelope for validation and business-rule failures.
The shape mirrors the live API response:
```json
{ "success": false, "error": ErrorResponse }
```
Required fields (`code` + `message`) are always populated; `details`
carries structured diagnostic context and is present on validation
failures. Clients should treat unknown fields as additive
(no `additionalProperties: false`).
required: [code, message]
properties:
code:
type: string
description: Outer envelope code. Always `VALIDATION_ERROR` for the validation family.
enum:
- VALIDATION_ERROR
message:
type: string
description: Short, stable human-readable summary.
details:
type: object
description: |
Granular context. For validation failures the shape below is stable;
for other error classes the API may return different keys.
properties:
address:
type: string
description: Human-readable reason specific to the failing address.
errorCode:
type: string
description: |
Granular validation reason. Stable machine-readable code.
- `INVALID_ADDRESS` — empty, wrong format, whitespace-only.
- `UNSUPPORTED_NETWORK` — `network` not in the supported list.
- `COULD_NOT_DETECT_NETWORK` — address format unrecognised and `network` omitted.
- `INVALID_ADDRESS_CHECKSUM` — decode succeeded, family checksum failed (Tron / BTC-legacy / LTC-legacy). Solana decode failures surface as `INVALID_ADDRESS` because Solana is not checksum-based.
- `ADDRESS_NETWORK_MISMATCH` — detected family inconsistent with requested `network`.
enum:
- INVALID_ADDRESS
- UNSUPPORTED_NETWORK
- COULD_NOT_DETECT_NETWORK
- INVALID_ADDRESS_CHECKSUM
- ADDRESS_NETWORK_MISMATCH
detectedFamily:
type: [string, 'null']
description: |
Address family detected from the input. Null when the format
was unrecognisable. ENS names are resolved through a legacy
path and are intentionally not part of the strict family
contract documented here.
requestedNetwork:
type: [string, 'null']
description: Normalized network string from the request, if any.
Counterparty:
type: object
description: |
Wallet counterparty entry (inbound or outbound). In sandbox responses
the containing array is always empty; this schema documents the
shape clients can rely on when upgrading to paid.
properties:
address: { type: string }
label: { type: [string, 'null'] }
value: { type: string, description: "Native-unit value transferred" }
valueUsd: { type: [number, 'null'] }
txCount: { type: integer }
inbound: { type: boolean }
Connection:
type: object
description: Directed value edge used by graph views. Empty in sandbox.
properties:
address: { type: string }
value: { type: string }
direction:
type: string
enum: [in, out]
ContractDeployment:
type: object
description: Contract deployed by the address. Empty in sandbox.
properties:
contractAddress: { type: string }
txHash: { type: string }
blockNumber: { type: integer }
TokenTransfer:
type: object
description: |
ERC20 / SPL / etc. token transfer. Empty in sandbox responses.
properties:
txHash: { type: string }
from: { type: string }
to: { type: string }
tokenAddress: { type: string }
tokenSymbol: { type: [string, 'null'] }
amount: { type: string }
timestamp: { type: integer }
Transaction:
type: object
description: |
Native transaction entry. In sandbox, only the last 7 days are included.
properties:
txHash: { type: string }
from: { type: string }
to: { type: [string, 'null'] }
value: { type: string }
timestamp: { type: integer }
direction:
type: string
enum: [in, out, self]
FlagDetail:
type: object
required: [code, templateKey, defaultEn]
description: |
Localization-friendly flag metadata. Use `code` / `templateKey` for
translation/mapping. `defaultEn` is a display fallback only — it
may include dynamic values and is not stable across releases.
Pattern flags use the `pattern.*` namespace; bot flags would use
`bot.*` (NOT applicable in sandbox — `timing` is null-gated and
thus `botFlagDetails` is not present in sandbox responses).
Schema is identical to the paid /api/v1/check FlagDetail
component (parity-tested).
properties:
code:
type: string
description: Stable machine-readable identifier. Use this for translation/mapping.
example: bulk_collection
templateKey:
type: string
description: Namespaced i18n key. `pattern.<code>` for pattern flags.
example: pattern.bulk_collection
defaultEn:
type: string
description: Current English display fallback. May include dynamic values. Do not use as translation key.
example: "BULK COLLECTION pattern: 24 inbound TXs in 600s"
severity:
type: string
enum: [critical, high, medium, low]
nullable: true
example: medium
description:
type: string
nullable: true
description: Short stable English explanation of the flag meaning.
example: "Many sources sent funds within a short window (bulk collection)."
SandboxCheckResponse:
type: object
description: |
Same core envelope as the paid `/api/v1/check` response, with many
expensive fields returned as `null` or `[]`. The `_sandbox` root block
lists which fields are gated for this response. See the top-level
description "Response Policy" section for details.
properties:
address: { type: string }
network: { type: string }
riskScore: { type: integer, minimum: 0, maximum: 100 }
riskLevel:
type: string
enum: [low, medium, high, unknown]
riskConfidence:
type: string
enum: [high, medium, low]
description: |
Always `"low"` in sandbox - reusing the existing paid enum value
to signal partial-data analysis without adding a new enum value.
dataQuality:
type: string
enum: [full, partial, degraded]
description: Always `"partial"` in sandbox.
riskNote:
type: [string, 'null']
addressInfo:
type: object
properties:
type: { type: string, enum: [eoa, contract, unknown] }
balance: { type: string }
balanceUsd: { type: [number, 'null'] }
nativePriceUsd: { type: [number, 'null'] }
txCount: { type: integer }
firstSeen: { type: [string, 'null'] }
lastSeen: { type: [string, 'null'] }
labels:
type: array
items: { type: string }
usdPrices:
type: [object, 'null']
analysisTime: { type: integer, description: "Milliseconds" }
timestamp: { type: string, format: date-time }
# Truncated arrays - real items, bounded
patternFlags:
type: array
items: { type: string }
maxItems: 5
description: |
Legacy display strings, capped at the top 5 flags in sandbox.
For localization use `code` / `templateKey` from the
index-aligned `patternFlagDetails` array.
patternFlagDetails:
type: array
maxItems: 5
description: |
Localization-friendly metadata for patternFlags. Capped at the
same top 5 items and INDEX-ALIGNED with `patternFlags`
(`patternFlagDetails[i]` corresponds to `patternFlags[i]`).
Use `code` / `templateKey` for translation/mapping.
`defaultEn` is a display fallback only — may include dynamic
values; not stable across releases.
Note: in sandbox `timing` is null-gated, so `botFlagDetails`
(which lives inside `timing` for paid responses) is NOT
present in sandbox.
items:
$ref: '#/components/schemas/FlagDetail'
example:
- code: bulk_collection
templateKey: pattern.bulk_collection
defaultEn: "BULK COLLECTION pattern: 24 inbound TXs in 600s"
severity: medium
description: "Many sources sent funds within a short window (bulk collection)."
- code: ofac_sanctions_match
templateKey: pattern.ofac_sanctions_match
defaultEn: "OFAC/sanctions list match"
severity: critical
description: "Address matches an OFAC/sanctions list."
transactionHistory:
type: array
description: In sandbox, only transactions from the last 7 days.
items: { $ref: '#/components/schemas/Transaction' }
# Gated arrays - always [] in sandbox, but item schema preserved for codegen / typing
topCounterparties:
type: array
items: { $ref: '#/components/schemas/Counterparty' }
description: |
Always `[]` in sandbox responses. Schema preserved so TypeScript /
other generated types remain meaningful when you upgrade to paid.
x-ocr-sandbox-always-empty: true
addressConnections:
type: array
items: { $ref: '#/components/schemas/Connection' }
description: Always `[]` in sandbox responses.
x-ocr-sandbox-always-empty: true
contractDeployments:
type: array
items: { $ref: '#/components/schemas/ContractDeployment' }
description: Always `[]` in sandbox responses.
x-ocr-sandbox-always-empty: true
tokenTransferHistory:
type: array
items: { $ref: '#/components/schemas/TokenTransfer' }
description: Always `[]` in sandbox responses.
x-ocr-sandbox-always-empty: true
# Gated objects - always null in sandbox
crossChain:
type: [object, 'null']
description: Always `null` in sandbox. Populated on paid plans.
x-ocr-sandbox-always-null: true
tokenFlow:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
clusters:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
temporalClusters:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
nftWashTrading:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
exchangeDeposits:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
osintIntelligence:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
railgun:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
defiSwaps:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
contractAnalysis:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
honeypot:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
tokenScore:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
timing:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
fundedBy:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
contractInfo:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
dataCompleteness:
type: [object, 'null']
description: Always `null` in sandbox.
x-ocr-sandbox-always-null: true
# Sandbox marker block
_sandbox:
$ref: '#/components/schemas/SandboxMarker'
SandboxMarker:
type: object
description: |
Present only in responses returned to sandbox API keys. Paid responses
never include this field.
required: [profile, coverage_days, reports_saved, gated_fields, truncated_fields, upgrade_url, docs_url]
properties:
profile:
type: string
enum: [sandbox]
coverage_days:
type: integer
enum: [7]
reports_saved:
type: boolean
enum: [false]
description: Sandbox responses are never persisted as reports.
gated_fields:
type: array
items: { type: string }
description: |
Field names that are gated in this response (null or [] or
omitted). Use this as source of truth, not a hardcoded list.
truncated_fields:
type: object
additionalProperties: { type: string }
description: Map of field name to truncation reason.
upgrade_url: { type: string, format: uri }
docs_url: { type: string, format: uri }
SandboxGraphResponse:
type: object
description: |
Sandbox graph preview response. Aggregated counterparty edges in
the same broad shape as paid `/api/graph/expand`, capped to 20
nodes / 30 edges and windowed to the last 7 days. Integrators can
re-point clients at paid `/api/graph/expand` later without
rewriting response handling.
**Window invariant**: every aggregated edge field
(`txCount`, `value`, `valueWei`, `firstTx`, `lastTx`,
`tokenBreakdown`) reflects ONLY transactions whose timestamp
falls inside the 7-day window. A counterparty whose only
interaction is older than 7 days is absent from the response;
a counterparty with mixed history shows the recent-only slice.
required: [success, data]
properties:
success: { type: boolean, example: true }
data:
type: object
required: [address, network, nodes, edges, _sandbox]
properties:
address: { type: string }
network: { type: string }
nodes:
type: array
maxItems: 20
items: { $ref: '#/components/schemas/SandboxGraphNode' }
edges:
type: array
maxItems: 30