@talonic/docs 0.20.33 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/dist/content.js +6141 -3760
  2. package/dist/seo.js +762 -213
  3. package/openapi.json +762 -213
  4. package/package.json +1 -1
package/openapi.json CHANGED
@@ -172,6 +172,14 @@
172
172
  {
173
173
  "name": "Webhooks",
174
174
  "description": "Outbound HMAC-signed event webhooks — configure endpoints and read the event catalog, delivery format, signature scheme, and retry policy."
175
+ },
176
+ {
177
+ "name": "Events",
178
+ "description": "The tenant event feed — the timeline of everything that happened (extractions, run completions, review verdicts, delivery outcomes). The same rows webhooks fan out from, so missed webhook deliveries can be reconciled against this feed."
179
+ },
180
+ {
181
+ "name": "Provenance",
182
+ "description": "Document-level provenance — deterministic (subject, predicate, object) claims synthesized from captured fields and spans, each carrying its evidence quote and grounded flag."
175
183
  }
176
184
  ],
177
185
  "paths": {
@@ -368,6 +376,9 @@
368
376
  "401": {
369
377
  "$ref": "#/components/responses/Unauthorized"
370
378
  },
379
+ "402": {
380
+ "$ref": "#/components/responses/InsufficientCredits"
381
+ },
371
382
  "403": {
372
383
  "$ref": "#/components/responses/Forbidden"
373
384
  },
@@ -6105,6 +6116,42 @@
6105
6116
  }
6106
6117
  }
6107
6118
  },
6119
+ "/v1/reference-data/{id}/csv": {
6120
+ "get": {
6121
+ "operationId": "downloadReferenceDataCsv",
6122
+ "summary": "Download a reference dataset as CSV",
6123
+ "description": "Returns the full dataset as a CSV file attachment.",
6124
+ "tags": [
6125
+ "Reference Data"
6126
+ ],
6127
+ "parameters": [
6128
+ {
6129
+ "$ref": "#/components/parameters/ResourceId"
6130
+ }
6131
+ ],
6132
+ "responses": {
6133
+ "200": {
6134
+ "description": "CSV file (returned as an attachment via Content-Disposition).",
6135
+ "content": {
6136
+ "text/csv": {
6137
+ "schema": {
6138
+ "type": "string"
6139
+ }
6140
+ }
6141
+ }
6142
+ },
6143
+ "401": {
6144
+ "$ref": "#/components/responses/Unauthorized"
6145
+ },
6146
+ "404": {
6147
+ "$ref": "#/components/responses/NotFound"
6148
+ },
6149
+ "429": {
6150
+ "$ref": "#/components/responses/RateLimitExceeded"
6151
+ }
6152
+ }
6153
+ }
6154
+ },
6108
6155
  "/v1/usage": {
6109
6156
  "get": {
6110
6157
  "operationId": "getUsage",
@@ -7094,7 +7141,7 @@
7094
7141
  "post": {
7095
7142
  "operationId": "nshotOverride",
7096
7143
  "summary": "Override an N-Shot value",
7097
- "description": "Manually override the N-Shot selected value for a document-field pair.",
7144
+ "description": "Override an N-Shot cell for a document-field pair by selecting a specific shot's value.",
7098
7145
  "tags": [
7099
7146
  "N-Shot"
7100
7147
  ],
@@ -7120,7 +7167,7 @@
7120
7167
  "required": [
7121
7168
  "document_id",
7122
7169
  "field_name",
7123
- "value"
7170
+ "selected_shot"
7124
7171
  ],
7125
7172
  "properties": {
7126
7173
  "document_id": {
@@ -7132,8 +7179,14 @@
7132
7179
  "type": "string",
7133
7180
  "example": "invoice_number"
7134
7181
  },
7135
- "value": {
7136
- "description": "The override value to apply."
7182
+ "selected_shot": {
7183
+ "type": "integer",
7184
+ "description": "Shot number (index) whose value should become the cell value.",
7185
+ "example": 2
7186
+ },
7187
+ "reason": {
7188
+ "type": "string",
7189
+ "description": "Optional human-readable reason for the override, stored in the audit trail."
7137
7190
  }
7138
7191
  }
7139
7192
  }
@@ -7142,16 +7195,12 @@
7142
7195
  },
7143
7196
  "responses": {
7144
7197
  "200": {
7145
- "description": "Override applied.",
7198
+ "description": "The full updated comparison object, including the applied `override`.",
7146
7199
  "content": {
7147
7200
  "application/json": {
7148
7201
  "schema": {
7149
7202
  "type": "object",
7150
- "properties": {
7151
- "success": {
7152
- "type": "boolean"
7153
- }
7154
- }
7203
+ "additionalProperties": true
7155
7204
  }
7156
7205
  }
7157
7206
  }
@@ -7175,7 +7224,7 @@
7175
7224
  "post": {
7176
7225
  "operationId": "nshotJudgeDecision",
7177
7226
  "summary": "Submit a judge decision for N-Shot",
7178
- "description": "Submit an AI or human judge decision on which N-Shot candidate is correct.",
7227
+ "description": "Accept or decline the LLM judge's recommendation for an N-Shot cell. Accepting applies the judge's recommended shot as an override.\n",
7179
7228
  "tags": [
7180
7229
  "N-Shot"
7181
7230
  ],
@@ -7201,7 +7250,7 @@
7201
7250
  "required": [
7202
7251
  "document_id",
7203
7252
  "field_name",
7204
- "decision"
7253
+ "accepted"
7205
7254
  ],
7206
7255
  "properties": {
7207
7256
  "document_id": {
@@ -7213,9 +7262,9 @@
7213
7262
  "type": "string",
7214
7263
  "example": "invoice_number"
7215
7264
  },
7216
- "decision": {
7217
- "type": "string",
7218
- "description": "The judge's selected value or verdict."
7265
+ "accepted": {
7266
+ "type": "boolean",
7267
+ "description": "Whether the judge recommendation is accepted (true) or declined (false)."
7219
7268
  }
7220
7269
  }
7221
7270
  }
@@ -7224,16 +7273,12 @@
7224
7273
  },
7225
7274
  "responses": {
7226
7275
  "200": {
7227
- "description": "Judge decision recorded.",
7276
+ "description": "The full updated comparison object, including the recorded `judgement` (and `override` when accepted).",
7228
7277
  "content": {
7229
7278
  "application/json": {
7230
7279
  "schema": {
7231
7280
  "type": "object",
7232
- "properties": {
7233
- "success": {
7234
- "type": "boolean"
7235
- }
7236
- }
7281
+ "additionalProperties": true
7237
7282
  }
7238
7283
  }
7239
7284
  }
@@ -9353,17 +9398,102 @@
9353
9398
  }
9354
9399
  }
9355
9400
  },
9401
+ "/v1/billing/packs": {
9402
+ "get": {
9403
+ "operationId": "getBillingPacks",
9404
+ "summary": "List purchasable credit packs",
9405
+ "description": "The self-serve credit-purchase catalog: flat prepaid packs\n(1,000 credits = 1 EUR, no volume bonuses). Buy via the checkout URL\nfrom `GET /v1/billing/upgrade-link`.\n",
9406
+ "tags": [
9407
+ "Billing"
9408
+ ],
9409
+ "responses": {
9410
+ "200": {
9411
+ "description": "Credit pack catalog.",
9412
+ "content": {
9413
+ "application/json": {
9414
+ "schema": {
9415
+ "type": "object",
9416
+ "required": [
9417
+ "currency",
9418
+ "packs"
9419
+ ],
9420
+ "properties": {
9421
+ "currency": {
9422
+ "type": "string",
9423
+ "example": "EUR"
9424
+ },
9425
+ "packs": {
9426
+ "type": "array",
9427
+ "items": {
9428
+ "type": "object",
9429
+ "required": [
9430
+ "key",
9431
+ "eur",
9432
+ "credits"
9433
+ ],
9434
+ "properties": {
9435
+ "key": {
9436
+ "type": "string",
9437
+ "example": "50"
9438
+ },
9439
+ "lookupKey": {
9440
+ "type": "string",
9441
+ "example": "credits_pack_50"
9442
+ },
9443
+ "eur": {
9444
+ "type": "number",
9445
+ "example": 50
9446
+ },
9447
+ "credits": {
9448
+ "type": "integer",
9449
+ "example": 50000
9450
+ }
9451
+ }
9452
+ }
9453
+ }
9454
+ }
9455
+ }
9456
+ }
9457
+ }
9458
+ },
9459
+ "401": {
9460
+ "$ref": "#/components/responses/Unauthorized"
9461
+ },
9462
+ "429": {
9463
+ "$ref": "#/components/responses/RateLimitExceeded"
9464
+ }
9465
+ }
9466
+ }
9467
+ },
9356
9468
  "/v1/billing/upgrade-link": {
9357
9469
  "get": {
9358
9470
  "operationId": "getBillingUpgradeLink",
9359
- "summary": "Get an upgrade link",
9360
- "description": "Returns a URL the agent can hand to a human to upgrade the plan or add\npayment. When a hosted billing portal exists this is a portal session\nURL; until then it is a deep link into the dashboard billing settings\n(`provider: \"dashboard\"`). A human must complete the upgrade.\n",
9471
+ "summary": "Get a buy-credits link",
9472
+ "description": "Returns a URL the agent hands to a human to buy prepaid credits. With\nbilling configured this is a real Stripe hosted-Checkout session\n(`provider: \"stripe\"`) for the selected pack; credits are available\nseconds after the human completes payment. Falls back to a dashboard\nbilling deep link (`provider: \"dashboard\"`) on deployments without\nStripe. A human must complete the payment either way.\n",
9361
9473
  "tags": [
9362
9474
  "Billing"
9363
9475
  ],
9476
+ "parameters": [
9477
+ {
9478
+ "name": "pack",
9479
+ "in": "query",
9480
+ "required": false,
9481
+ "schema": {
9482
+ "type": "string",
9483
+ "enum": [
9484
+ "10",
9485
+ "50",
9486
+ "250",
9487
+ "1000"
9488
+ ],
9489
+ "default": "50"
9490
+ },
9491
+ "description": "Credit pack to check out (see `GET /v1/billing/packs`)."
9492
+ }
9493
+ ],
9364
9494
  "responses": {
9365
9495
  "200": {
9366
- "description": "Upgrade link.",
9496
+ "description": "Buy-credits link.",
9367
9497
  "content": {
9368
9498
  "application/json": {
9369
9499
  "schema": {
@@ -9377,16 +9507,20 @@
9377
9507
  "url": {
9378
9508
  "type": "string",
9379
9509
  "format": "uri",
9380
- "example": "https://app.talonic.com/settings/billing?upgrade=1"
9510
+ "example": "https://checkout.stripe.com/c/pay/cs_test_..."
9381
9511
  },
9382
9512
  "provider": {
9383
9513
  "type": "string",
9384
- "description": "'dashboard' (deep link) or 'stripe' (portal session) once a portal exists.",
9385
- "example": "dashboard"
9514
+ "description": "'stripe' (hosted Checkout session) or 'dashboard' (deep link fallback).",
9515
+ "example": "stripe"
9386
9516
  },
9387
9517
  "requires_human": {
9388
9518
  "type": "boolean"
9389
9519
  },
9520
+ "pack": {
9521
+ "type": "object",
9522
+ "description": "The selected pack (stripe provider only)."
9523
+ },
9390
9524
  "message": {
9391
9525
  "type": "string"
9392
9526
  }
@@ -9408,34 +9542,57 @@
9408
9542
  "get": {
9409
9543
  "operationId": "getCreditsBalance",
9410
9544
  "summary": "Get credit balance",
9411
- "description": "Returns the current credit balance for the authenticated customer.",
9545
+ "description": "Returns the enriched credit balance for the authenticated customer:\ncredit balance with EUR conversion, 30-day burn rate, projected runway,\nand API tier info.\n",
9412
9546
  "tags": [
9413
9547
  "Credits"
9414
9548
  ],
9415
9549
  "responses": {
9416
9550
  "200": {
9417
- "description": "Credit balance.",
9551
+ "description": "Enriched credit balance.",
9418
9552
  "content": {
9419
9553
  "application/json": {
9420
9554
  "schema": {
9421
9555
  "type": "object",
9422
9556
  "required": [
9423
- "balance",
9424
- "currency"
9557
+ "balance_credits",
9558
+ "balance_eur",
9559
+ "burn_rate_30d_credits",
9560
+ "projected_runway_days",
9561
+ "tier",
9562
+ "tier_resets_at"
9425
9563
  ],
9426
9564
  "properties": {
9427
- "balance": {
9565
+ "balance_credits": {
9566
+ "type": "integer",
9567
+ "description": "Current credit balance.",
9568
+ "example": 4200
9569
+ },
9570
+ "balance_eur": {
9428
9571
  "type": "number",
9429
- "format": "float"
9572
+ "format": "float",
9573
+ "description": "Balance converted to EUR at the published credits-per-EUR rate.",
9574
+ "example": 42
9430
9575
  },
9431
- "currency": {
9576
+ "burn_rate_30d_credits": {
9577
+ "type": "integer",
9578
+ "description": "Credits consumed over the last 30 days.",
9579
+ "example": 1500
9580
+ },
9581
+ "projected_runway_days": {
9582
+ "type": "integer",
9583
+ "description": "Projected days until the balance is exhausted at the 30-day burn rate. -1 when there is no recent consumption.",
9584
+ "example": 84
9585
+ },
9586
+ "tier": {
9432
9587
  "type": "string",
9433
- "example": "USD"
9588
+ "description": "API tier of the organization.",
9589
+ "example": "free"
9434
9590
  },
9435
- "updated_at": {
9591
+ "tier_resets_at": {
9436
9592
  "type": "string",
9437
9593
  "format": "date-time",
9438
- "example": "2026-04-25T14:30:00.000Z"
9594
+ "description": "Start of the next monthly tier period (1st of next month, UTC).",
9595
+ "example": "2026-05-01T00:00:00.000Z"
9439
9596
  }
9440
9597
  }
9441
9598
  }
@@ -9455,19 +9612,31 @@
9455
9612
  "get": {
9456
9613
  "operationId": "getCreditsHistory",
9457
9614
  "summary": "Get credit history",
9458
- "description": "Returns credit transaction history (purchases, deductions, adjustments).",
9615
+ "description": "Returns credit transaction history (purchases, consumption, adjustments, bonuses), most recent first, with page/limit pagination.",
9459
9616
  "tags": [
9460
9617
  "Credits"
9461
9618
  ],
9462
9619
  "parameters": [
9463
9620
  {
9464
- "$ref": "#/components/parameters/Limit"
9465
- },
9466
- {
9467
- "$ref": "#/components/parameters/Cursor"
9621
+ "name": "page",
9622
+ "in": "query",
9623
+ "schema": {
9624
+ "type": "integer",
9625
+ "minimum": 1,
9626
+ "default": 1
9627
+ },
9628
+ "description": "Page number (1-based)."
9468
9629
  },
9469
9630
  {
9470
- "$ref": "#/components/parameters/Order"
9631
+ "name": "limit",
9632
+ "in": "query",
9633
+ "schema": {
9634
+ "type": "integer",
9635
+ "minimum": 1,
9636
+ "maximum": 100,
9637
+ "default": 20
9638
+ },
9639
+ "description": "Items per page (max 100)."
9471
9640
  }
9472
9641
  ],
9473
9642
  "responses": {
@@ -9476,48 +9645,79 @@
9476
9645
  "content": {
9477
9646
  "application/json": {
9478
9647
  "schema": {
9479
- "allOf": [
9480
- {
9481
- "$ref": "#/components/schemas/PaginatedResponse"
9482
- },
9483
- {
9484
- "type": "object",
9485
- "properties": {
9486
- "data": {
9487
- "type": "array",
9488
- "items": {
9648
+ "type": "object",
9649
+ "required": [
9650
+ "items",
9651
+ "total",
9652
+ "page",
9653
+ "limit"
9654
+ ],
9655
+ "properties": {
9656
+ "items": {
9657
+ "type": "array",
9658
+ "items": {
9659
+ "type": "object",
9660
+ "properties": {
9661
+ "id": {
9662
+ "type": "string",
9663
+ "format": "uuid",
9664
+ "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
9665
+ },
9666
+ "customer_id": {
9667
+ "type": "string",
9668
+ "format": "uuid"
9669
+ },
9670
+ "user_id": {
9671
+ "type": [
9672
+ "string",
9673
+ "null"
9674
+ ],
9675
+ "format": "uuid"
9676
+ },
9677
+ "amount": {
9678
+ "type": "integer",
9679
+ "description": "Credit amount. Positive = credit, negative = debit."
9680
+ },
9681
+ "type": {
9682
+ "type": "string",
9683
+ "description": "Transaction type: purchase, consumption, adjustment, bonus."
9684
+ },
9685
+ "description": {
9686
+ "type": [
9687
+ "string",
9688
+ "null"
9689
+ ]
9690
+ },
9691
+ "operation_type": {
9692
+ "type": [
9693
+ "string",
9694
+ "null"
9695
+ ],
9696
+ "description": "Pipeline stage that consumed credits, if applicable."
9697
+ },
9698
+ "metadata": {
9489
9699
  "type": "object",
9490
- "properties": {
9491
- "id": {
9492
- "type": "string",
9493
- "format": "uuid",
9494
- "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
9495
- },
9496
- "type": {
9497
- "type": "string",
9498
- "description": "Transaction type: purchase, deduction, adjustment, refund."
9499
- },
9500
- "amount": {
9501
- "type": "number",
9502
- "format": "float"
9503
- },
9504
- "description": {
9505
- "type": [
9506
- "string",
9507
- "null"
9508
- ]
9509
- },
9510
- "created_at": {
9511
- "type": "string",
9512
- "format": "date-time",
9513
- "example": "2026-04-25T14:30:00.000Z"
9514
- }
9515
- }
9700
+ "additionalProperties": true
9701
+ },
9702
+ "created_at": {
9703
+ "type": "string",
9704
+ "format": "date-time",
9705
+ "example": "2026-04-25T14:30:00.000Z"
9516
9706
  }
9517
9707
  }
9518
9708
  }
9709
+ },
9710
+ "total": {
9711
+ "type": "integer",
9712
+ "description": "Total number of transactions."
9713
+ },
9714
+ "page": {
9715
+ "type": "integer"
9716
+ },
9717
+ "limit": {
9718
+ "type": "integer"
9519
9719
  }
9520
- ]
9720
+ }
9521
9721
  }
9522
9722
  }
9523
9723
  }
@@ -9534,60 +9734,73 @@
9534
9734
  "/v1/credits/usage": {
9535
9735
  "get": {
9536
9736
  "operationId": "getCreditsUsage",
9537
- "summary": "Get credit usage summary",
9538
- "description": "Returns aggregate credit usage broken down by feature.",
9737
+ "summary": "Get usage statistics",
9738
+ "description": "Returns aggregated API usage stats grouped by operation type and model over the given period.",
9539
9739
  "tags": [
9540
9740
  "Credits"
9541
9741
  ],
9542
9742
  "parameters": [
9543
9743
  {
9544
- "name": "from",
9545
- "in": "query",
9546
- "schema": {
9547
- "type": "string",
9548
- "format": "date-time"
9549
- },
9550
- "description": "Start of the period (ISO 8601)."
9551
- },
9552
- {
9553
- "name": "to",
9744
+ "name": "days",
9554
9745
  "in": "query",
9555
9746
  "schema": {
9556
- "type": "string",
9557
- "format": "date-time"
9747
+ "type": "integer",
9748
+ "default": 30
9558
9749
  },
9559
- "description": "End of the period (ISO 8601)."
9750
+ "description": "Reporting window in days."
9560
9751
  }
9561
9752
  ],
9562
9753
  "responses": {
9563
9754
  "200": {
9564
- "description": "Credit usage summary.",
9755
+ "description": "Aggregated usage stats.",
9565
9756
  "content": {
9566
9757
  "application/json": {
9567
9758
  "schema": {
9568
9759
  "type": "object",
9760
+ "required": [
9761
+ "stats",
9762
+ "period_days"
9763
+ ],
9569
9764
  "properties": {
9570
- "total_used": {
9571
- "type": "number",
9572
- "format": "float"
9573
- },
9574
- "breakdown": {
9765
+ "stats": {
9575
9766
  "type": "array",
9576
9767
  "items": {
9577
9768
  "type": "object",
9578
9769
  "properties": {
9579
- "feature": {
9770
+ "operation_type": {
9580
9771
  "type": "string"
9581
9772
  },
9582
- "credits_used": {
9583
- "type": "number",
9584
- "format": "float"
9773
+ "model": {
9774
+ "type": "string"
9585
9775
  },
9586
9776
  "call_count": {
9587
9777
  "type": "integer"
9778
+ },
9779
+ "total_input_tokens": {
9780
+ "type": "string",
9781
+ "description": "Summed input tokens (serialized as a string)."
9782
+ },
9783
+ "total_output_tokens": {
9784
+ "type": "string",
9785
+ "description": "Summed output tokens (serialized as a string)."
9786
+ },
9787
+ "total_cache_read_tokens": {
9788
+ "type": "string",
9789
+ "description": "Summed cache-read tokens (serialized as a string)."
9790
+ },
9791
+ "total_cost_usd": {
9792
+ "type": [
9793
+ "string",
9794
+ "null"
9795
+ ],
9796
+ "description": "Estimated total cost in USD (serialized as a string)."
9588
9797
  }
9589
9798
  }
9590
9799
  }
9800
+ },
9801
+ "period_days": {
9802
+ "type": "integer",
9803
+ "example": 30
9591
9804
  }
9592
9805
  }
9593
9806
  }
@@ -9606,56 +9819,53 @@
9606
9819
  "/v1/credits/usage/daily": {
9607
9820
  "get": {
9608
9821
  "operationId": "getCreditsUsageDaily",
9609
- "summary": "Get daily credit usage",
9610
- "description": "Returns per-day credit usage for the specified period (default last 30 days).",
9822
+ "summary": "Get daily usage breakdown",
9823
+ "description": "Returns per-day API usage for the specified period (default last 30 days) as a JSON array.",
9611
9824
  "tags": [
9612
9825
  "Credits"
9613
9826
  ],
9614
9827
  "parameters": [
9615
9828
  {
9616
- "name": "from",
9617
- "in": "query",
9618
- "schema": {
9619
- "type": "string",
9620
- "format": "date-time"
9621
- },
9622
- "description": "Start of the period (ISO 8601)."
9623
- },
9624
- {
9625
- "name": "to",
9829
+ "name": "days",
9626
9830
  "in": "query",
9627
9831
  "schema": {
9628
- "type": "string",
9629
- "format": "date-time"
9832
+ "type": "integer",
9833
+ "default": 30
9630
9834
  },
9631
- "description": "End of the period (ISO 8601)."
9835
+ "description": "Reporting window in days."
9632
9836
  }
9633
9837
  ],
9634
9838
  "responses": {
9635
9839
  "200": {
9636
- "description": "Daily credit usage.",
9840
+ "description": "Daily usage breakdown.",
9637
9841
  "content": {
9638
9842
  "application/json": {
9639
9843
  "schema": {
9640
- "type": "object",
9641
- "properties": {
9642
- "data": {
9643
- "type": "array",
9644
- "items": {
9645
- "type": "object",
9646
- "properties": {
9647
- "date": {
9648
- "type": "string",
9649
- "format": "date"
9650
- },
9651
- "credits_used": {
9652
- "type": "number",
9653
- "format": "float"
9654
- },
9655
- "call_count": {
9656
- "type": "integer"
9657
- }
9658
- }
9844
+ "type": "array",
9845
+ "items": {
9846
+ "type": "object",
9847
+ "properties": {
9848
+ "date": {
9849
+ "type": "string",
9850
+ "format": "date"
9851
+ },
9852
+ "calls": {
9853
+ "type": "integer"
9854
+ },
9855
+ "input_tokens": {
9856
+ "type": "string",
9857
+ "description": "Summed input tokens for the day (serialized as a string)."
9858
+ },
9859
+ "output_tokens": {
9860
+ "type": "string",
9861
+ "description": "Summed output tokens for the day (serialized as a string)."
9862
+ },
9863
+ "cost_usd": {
9864
+ "type": [
9865
+ "string",
9866
+ "null"
9867
+ ],
9868
+ "description": "Estimated cost in USD for the day (serialized as a string)."
9659
9869
  }
9660
9870
  }
9661
9871
  }
@@ -9676,19 +9886,31 @@
9676
9886
  "get": {
9677
9887
  "operationId": "getCreditsUsageLog",
9678
9888
  "summary": "Get credit usage log",
9679
- "description": "Returns a detailed per-request usage log with model, tokens, and cost.",
9889
+ "description": "Returns a detailed per-request usage log with model, tokens, and cost, most recent first, with page/limit pagination.",
9680
9890
  "tags": [
9681
9891
  "Credits"
9682
9892
  ],
9683
9893
  "parameters": [
9684
9894
  {
9685
- "$ref": "#/components/parameters/Limit"
9686
- },
9687
- {
9688
- "$ref": "#/components/parameters/Cursor"
9895
+ "name": "page",
9896
+ "in": "query",
9897
+ "schema": {
9898
+ "type": "integer",
9899
+ "minimum": 1,
9900
+ "default": 1
9901
+ },
9902
+ "description": "Page number (1-based)."
9689
9903
  },
9690
9904
  {
9691
- "$ref": "#/components/parameters/Order"
9905
+ "name": "limit",
9906
+ "in": "query",
9907
+ "schema": {
9908
+ "type": "integer",
9909
+ "minimum": 1,
9910
+ "maximum": 100,
9911
+ "default": 20
9912
+ },
9913
+ "description": "Items per page (max 100)."
9692
9914
  }
9693
9915
  ],
9694
9916
  "responses": {
@@ -9697,48 +9919,75 @@
9697
9919
  "content": {
9698
9920
  "application/json": {
9699
9921
  "schema": {
9700
- "allOf": [
9701
- {
9702
- "$ref": "#/components/schemas/PaginatedResponse"
9703
- },
9704
- {
9705
- "type": "object",
9706
- "properties": {
9707
- "data": {
9708
- "type": "array",
9709
- "items": {
9710
- "type": "object",
9711
- "properties": {
9712
- "id": {
9713
- "type": "string"
9714
- },
9715
- "operation_type": {
9716
- "type": "string"
9717
- },
9718
- "model": {
9719
- "type": "string"
9720
- },
9721
- "input_tokens": {
9722
- "type": "integer"
9723
- },
9724
- "output_tokens": {
9725
- "type": "integer"
9726
- },
9727
- "cost_credits": {
9728
- "type": "number",
9729
- "format": "float"
9730
- },
9731
- "created_at": {
9732
- "type": "string",
9733
- "format": "date-time",
9734
- "example": "2026-04-25T14:30:00.000Z"
9735
- }
9736
- }
9922
+ "type": "object",
9923
+ "required": [
9924
+ "items",
9925
+ "total",
9926
+ "page",
9927
+ "limit"
9928
+ ],
9929
+ "properties": {
9930
+ "items": {
9931
+ "type": "array",
9932
+ "items": {
9933
+ "type": "object",
9934
+ "properties": {
9935
+ "id": {
9936
+ "type": "string",
9937
+ "format": "uuid"
9938
+ },
9939
+ "customer_id": {
9940
+ "type": "string",
9941
+ "format": "uuid"
9942
+ },
9943
+ "model": {
9944
+ "type": "string"
9945
+ },
9946
+ "input_tokens": {
9947
+ "type": "integer"
9948
+ },
9949
+ "output_tokens": {
9950
+ "type": "integer"
9951
+ },
9952
+ "cache_read_tokens": {
9953
+ "type": "integer"
9954
+ },
9955
+ "cost_estimate_usd": {
9956
+ "type": [
9957
+ "string",
9958
+ "null"
9959
+ ],
9960
+ "description": "Estimated cost in USD (serialized as a string)."
9961
+ },
9962
+ "operation_type": {
9963
+ "type": "string"
9964
+ },
9965
+ "document_id": {
9966
+ "type": [
9967
+ "string",
9968
+ "null"
9969
+ ],
9970
+ "format": "uuid"
9971
+ },
9972
+ "created_at": {
9973
+ "type": "string",
9974
+ "format": "date-time",
9975
+ "example": "2026-04-25T14:30:00.000Z"
9737
9976
  }
9738
9977
  }
9739
9978
  }
9979
+ },
9980
+ "total": {
9981
+ "type": "integer",
9982
+ "description": "Total number of log entries."
9983
+ },
9984
+ "page": {
9985
+ "type": "integer"
9986
+ },
9987
+ "limit": {
9988
+ "type": "integer"
9740
9989
  }
9741
- ]
9990
+ }
9742
9991
  }
9743
9992
  }
9744
9993
  }
@@ -11445,7 +11694,7 @@
11445
11694
  "get": {
11446
11695
  "operationId": "getReviewStats",
11447
11696
  "summary": "Get review queue statistics",
11448
- "description": "Returns aggregate statistics about the review queue (pending, approved, rejected counts).",
11697
+ "description": "Returns aggregate review queue counts grouped by status.",
11449
11698
  "tags": [
11450
11699
  "Review"
11451
11700
  ],
@@ -11456,18 +11705,27 @@
11456
11705
  "application/json": {
11457
11706
  "schema": {
11458
11707
  "type": "object",
11708
+ "required": [
11709
+ "total",
11710
+ "by_status"
11711
+ ],
11459
11712
  "properties": {
11460
- "pending": {
11461
- "type": "integer"
11462
- },
11463
- "approved": {
11464
- "type": "integer"
11465
- },
11466
- "rejected": {
11467
- "type": "integer"
11468
- },
11469
11713
  "total": {
11470
- "type": "integer"
11714
+ "type": "integer",
11715
+ "description": "Total number of review records.",
11716
+ "example": 42
11717
+ },
11718
+ "by_status": {
11719
+ "type": "object",
11720
+ "description": "Count of review records per status (e.g. pending, approved, rejected).",
11721
+ "additionalProperties": {
11722
+ "type": "integer"
11723
+ },
11724
+ "example": {
11725
+ "pending": 12,
11726
+ "approved": 25,
11727
+ "rejected": 5
11728
+ }
11471
11729
  }
11472
11730
  }
11473
11731
  }
@@ -12789,12 +13047,12 @@
12789
13047
  "description": "Filter by value layer"
12790
13048
  },
12791
13049
  {
12792
- "name": "source_type",
13050
+ "name": "kind",
12793
13051
  "in": "query",
12794
13052
  "schema": {
12795
13053
  "type": "string"
12796
13054
  },
12797
- "description": "Filter by source type (e.g. extraction, job, resolution)"
13055
+ "description": "Filter by source kind (e.g. structuring_run, resolution_run, data_product)"
12798
13056
  },
12799
13057
  {
12800
13058
  "$ref": "#/components/parameters/Limit"
@@ -12911,14 +13169,34 @@
12911
13169
  "field_key": {
12912
13170
  "type": "string"
12913
13171
  },
12914
- "field_type": {
13172
+ "display_name": {
12915
13173
  "type": "string"
12916
13174
  },
12917
- "ordinal": {
13175
+ "data_type": {
13176
+ "type": "string"
13177
+ },
13178
+ "position": {
12918
13179
  "type": "integer"
13180
+ },
13181
+ "is_required": {
13182
+ "type": "boolean"
13183
+ },
13184
+ "is_hidden": {
13185
+ "type": "boolean"
12919
13186
  }
12920
13187
  }
12921
13188
  }
13189
+ },
13190
+ "links": {
13191
+ "type": "object",
13192
+ "properties": {
13193
+ "self": {
13194
+ "type": "string"
13195
+ },
13196
+ "record_set": {
13197
+ "type": "string"
13198
+ }
13199
+ }
12922
13200
  }
12923
13201
  }
12924
13202
  }
@@ -12956,6 +13234,7 @@
12956
13234
  "in": "query",
12957
13235
  "schema": {
12958
13236
  "type": "integer",
13237
+ "minimum": 1,
12959
13238
  "default": 1
12960
13239
  }
12961
13240
  },
@@ -12964,9 +13243,21 @@
12964
13243
  "in": "query",
12965
13244
  "schema": {
12966
13245
  "type": "integer",
12967
- "default": 50,
12968
- "maximum": 200
13246
+ "minimum": 1,
13247
+ "maximum": 100,
13248
+ "default": 20
12969
13249
  }
13250
+ },
13251
+ {
13252
+ "name": "include",
13253
+ "in": "query",
13254
+ "schema": {
13255
+ "type": "string",
13256
+ "enum": [
13257
+ "values"
13258
+ ]
13259
+ },
13260
+ "description": "Pass `include=values` to attach each record's latest-version cell values keyed by field key. A cell held for review (`pending_approval`) reports its status with a null value.\n"
12970
13261
  }
12971
13262
  ],
12972
13263
  "responses": {
@@ -12981,7 +13272,58 @@
12981
13272
  "type": "array",
12982
13273
  "items": {
12983
13274
  "type": "object",
12984
- "description": "Record with source_record_id and ordinal"
13275
+ "properties": {
13276
+ "id": {
13277
+ "type": "string",
13278
+ "format": "uuid"
13279
+ },
13280
+ "document_id": {
13281
+ "type": [
13282
+ "string",
13283
+ "null"
13284
+ ],
13285
+ "format": "uuid"
13286
+ },
13287
+ "ordinal": {
13288
+ "type": "integer"
13289
+ },
13290
+ "record_key": {
13291
+ "type": [
13292
+ "string",
13293
+ "null"
13294
+ ]
13295
+ },
13296
+ "status": {
13297
+ "type": "string"
13298
+ },
13299
+ "confidence": {
13300
+ "type": [
13301
+ "number",
13302
+ "null"
13303
+ ]
13304
+ },
13305
+ "values": {
13306
+ "type": "object",
13307
+ "description": "Only present with `include=values`. Map of field key to the record's latest cell value.\n",
13308
+ "additionalProperties": {
13309
+ "type": "object",
13310
+ "properties": {
13311
+ "value": {
13312
+ "description": "Cell value. Null when the cell is held for review."
13313
+ },
13314
+ "status": {
13315
+ "type": "string"
13316
+ },
13317
+ "confidence": {
13318
+ "type": [
13319
+ "number",
13320
+ "null"
13321
+ ]
13322
+ }
13323
+ }
13324
+ }
13325
+ }
13326
+ }
12985
13327
  }
12986
13328
  },
12987
13329
  "pagination": {
@@ -13000,6 +13342,17 @@
13000
13342
  "type": "boolean"
13001
13343
  }
13002
13344
  }
13345
+ },
13346
+ "links": {
13347
+ "type": "object",
13348
+ "properties": {
13349
+ "self": {
13350
+ "type": "string"
13351
+ },
13352
+ "record_set": {
13353
+ "type": "string"
13354
+ }
13355
+ }
13003
13356
  }
13004
13357
  }
13005
13358
  }
@@ -13041,14 +13394,52 @@
13041
13394
  "schema": {
13042
13395
  "type": "object",
13043
13396
  "properties": {
13044
- "data": {
13045
- "type": "array",
13046
- "items": {
13047
- "type": "object"
13048
- }
13397
+ "record_set_id": {
13398
+ "type": "string",
13399
+ "format": "uuid"
13400
+ },
13401
+ "name": {
13402
+ "type": "string"
13049
13403
  },
13050
13404
  "total": {
13051
13405
  "type": "integer"
13406
+ },
13407
+ "records": {
13408
+ "type": "array",
13409
+ "items": {
13410
+ "type": "object",
13411
+ "properties": {
13412
+ "id": {
13413
+ "type": "string",
13414
+ "format": "uuid"
13415
+ },
13416
+ "document_id": {
13417
+ "type": [
13418
+ "string",
13419
+ "null"
13420
+ ],
13421
+ "format": "uuid"
13422
+ },
13423
+ "ordinal": {
13424
+ "type": "integer"
13425
+ },
13426
+ "record_key": {
13427
+ "type": [
13428
+ "string",
13429
+ "null"
13430
+ ]
13431
+ },
13432
+ "status": {
13433
+ "type": "string"
13434
+ },
13435
+ "confidence": {
13436
+ "type": [
13437
+ "number",
13438
+ "null"
13439
+ ]
13440
+ }
13441
+ }
13442
+ }
13052
13443
  }
13053
13444
  }
13054
13445
  }
@@ -17051,6 +17442,99 @@
17051
17442
  }
17052
17443
  }
17053
17444
  },
17445
+ "/v1/events": {
17446
+ "get": {
17447
+ "tags": [
17448
+ "Events"
17449
+ ],
17450
+ "summary": "List tenant events",
17451
+ "description": "Newest-first feed of platform events (document.extracted, run.*.completed/failed, result.flagged/approved/rejected, delivery.item.*, case.resolved). Alias of /v1/delivery/events at the API root.\n",
17452
+ "operationId": "listEvents",
17453
+ "security": [
17454
+ {
17455
+ "BearerAuth": []
17456
+ }
17457
+ ],
17458
+ "parameters": [
17459
+ {
17460
+ "name": "event_type",
17461
+ "in": "query",
17462
+ "required": false,
17463
+ "schema": {
17464
+ "type": "string"
17465
+ },
17466
+ "description": "Filter by event type, e.g. document.extracted"
17467
+ },
17468
+ {
17469
+ "name": "limit",
17470
+ "in": "query",
17471
+ "required": false,
17472
+ "schema": {
17473
+ "type": "integer",
17474
+ "default": 50,
17475
+ "maximum": 200
17476
+ }
17477
+ },
17478
+ {
17479
+ "name": "offset",
17480
+ "in": "query",
17481
+ "required": false,
17482
+ "schema": {
17483
+ "type": "integer",
17484
+ "default": 0
17485
+ }
17486
+ }
17487
+ ],
17488
+ "responses": {
17489
+ "200": {
17490
+ "description": "{ data: [{ id, event_type, payload, created_at }], total, limit, offset }"
17491
+ }
17492
+ }
17493
+ }
17494
+ },
17495
+ "/v1/documents/{id}/claims": {
17496
+ "get": {
17497
+ "tags": [
17498
+ "Provenance"
17499
+ ],
17500
+ "summary": "List a document's provenance claims",
17501
+ "description": "Deterministic atomic (subject, predicate, object) claims synthesized from the document's captured fields + provenance spans (no LLM). Each claim carries its evidence quote, grounded flag, and confidence. Field-level span detail lives on GET /v1/field-reviews/{docId}/{fieldKey}.\n",
17502
+ "operationId": "listDocumentClaims",
17503
+ "security": [
17504
+ {
17505
+ "BearerAuth": []
17506
+ }
17507
+ ],
17508
+ "parameters": [
17509
+ {
17510
+ "name": "id",
17511
+ "in": "path",
17512
+ "required": true,
17513
+ "schema": {
17514
+ "type": "string",
17515
+ "format": "uuid"
17516
+ }
17517
+ },
17518
+ {
17519
+ "name": "grounded",
17520
+ "in": "query",
17521
+ "required": false,
17522
+ "schema": {
17523
+ "type": "boolean"
17524
+ },
17525
+ "description": "true = only span-backed claims"
17526
+ }
17527
+ ],
17528
+ "responses": {
17529
+ "200": {
17530
+ "description": "{ data: [{ subject, predicate, object, qualifier, evidence, segment_id, grounded, confidence, origin }], total }"
17531
+ },
17532
+ "404": {
17533
+ "description": "Document not found or not owned by the caller."
17534
+ }
17535
+ }
17536
+ }
17537
+ },
17054
17538
  "/v1/webhooks/events": {
17055
17539
  "get": {
17056
17540
  "tags": [
@@ -18217,7 +18701,7 @@
18217
18701
  "statusCode": 429,
18218
18702
  "code": "QUOTA_EXCEEDED",
18219
18703
  "error": "Too Many Requests",
18220
- "message": "Daily extract request limit (50) reached. Resets at midnight UTC.",
18704
+ "message": "Daily extract request ceiling reached. Resets at midnight UTC. Spend is governed by credits, not this abuse ceiling.",
18221
18705
  "retryable": true,
18222
18706
  "timestamp": "2026-04-25T23:45:00.000Z",
18223
18707
  "path": "/v1/extract"
@@ -18225,6 +18709,48 @@
18225
18709
  }
18226
18710
  }
18227
18711
  },
18712
+ "InsufficientCredits": {
18713
+ "description": "Insufficient credits (402). The body is the agent-actionable contract:\n`buy_credits_url` is where a human completes a purchase (see also\n`GET /v1/billing/upgrade-link` for a direct Stripe Checkout link), and\n`pricing_url` is the machine-readable rate catalog. Free workspaces\nreceive 5,000 credits monthly; purchased credits top up the same\nbalance.\n",
18714
+ "content": {
18715
+ "application/json": {
18716
+ "schema": {
18717
+ "type": "object",
18718
+ "required": [
18719
+ "error",
18720
+ "message",
18721
+ "required_credits",
18722
+ "balance_credits"
18723
+ ],
18724
+ "properties": {
18725
+ "error": {
18726
+ "type": "string",
18727
+ "example": "insufficient_credits"
18728
+ },
18729
+ "message": {
18730
+ "type": "string"
18731
+ },
18732
+ "required_credits": {
18733
+ "type": "integer",
18734
+ "example": 100
18735
+ },
18736
+ "balance_credits": {
18737
+ "type": "integer",
18738
+ "example": 0
18739
+ },
18740
+ "buy_credits_url": {
18741
+ "type": "string",
18742
+ "format": "uri",
18743
+ "example": "https://app.talonic.com/settings/billing?buy=1"
18744
+ },
18745
+ "pricing_url": {
18746
+ "type": "string",
18747
+ "example": "/v1/pricing"
18748
+ }
18749
+ }
18750
+ }
18751
+ }
18752
+ }
18753
+ },
18228
18754
  "InternalServerError": {
18229
18755
  "description": "An unexpected error occurred.",
18230
18756
  "content": {
@@ -24235,15 +24761,21 @@
24235
24761
  "product"
24236
24762
  ]
24237
24763
  },
24238
- "source_type": {
24239
- "type": "string"
24764
+ "kind": {
24765
+ "type": "string",
24766
+ "description": "Source kind (e.g. structuring_run, resolution_run, data_product)."
24240
24767
  },
24241
24768
  "source_id": {
24242
- "type": "string",
24243
- "format": "uuid"
24769
+ "type": [
24770
+ "string",
24771
+ "null"
24772
+ ],
24773
+ "format": "uuid",
24774
+ "description": "Owning run/product ID where applicable."
24244
24775
  },
24245
24776
  "status": {
24246
- "type": "string"
24777
+ "type": "string",
24778
+ "description": "Lifecycle state (e.g. active)."
24247
24779
  },
24248
24780
  "record_count": {
24249
24781
  "type": "integer"
@@ -24254,6 +24786,23 @@
24254
24786
  "created_at": {
24255
24787
  "type": "string",
24256
24788
  "format": "date-time"
24789
+ },
24790
+ "links": {
24791
+ "type": "object",
24792
+ "properties": {
24793
+ "self": {
24794
+ "type": "string"
24795
+ },
24796
+ "fields": {
24797
+ "type": "string"
24798
+ },
24799
+ "records": {
24800
+ "type": "string"
24801
+ },
24802
+ "export": {
24803
+ "type": "string"
24804
+ }
24805
+ }
24257
24806
  }
24258
24807
  }
24259
24808
  }