@talonic/docs 0.21.11 → 0.21.15

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.
package/dist/index.js CHANGED
@@ -536,7 +536,15 @@ var NAV_SECTIONS = [
536
536
  label: "Run",
537
537
  children: [
538
538
  { id: "post-run", label: "POST /v1/run" },
539
- { id: "get-run-request", label: "Poll a Run" }
539
+ { id: "get-run-request", label: "Poll a Run" },
540
+ { id: "get-run-results", label: "Run Results" }
541
+ ]
542
+ },
543
+ {
544
+ id: "pipelines",
545
+ label: "Pipelines",
546
+ children: [
547
+ { id: "get-pipeline-results", label: "Pipeline Results" }
540
548
  ]
541
549
  },
542
550
  {
@@ -684,7 +692,9 @@ var NAV_SECTIONS = [
684
692
  label: "Usage",
685
693
  children: [
686
694
  { id: "get-usage", label: "Get Usage" },
687
- { id: "document-usage", label: "Document Usage" }
695
+ { id: "document-usage", label: "Document Usage" },
696
+ { id: "pipeline-usage", label: "Pipeline Usage" },
697
+ { id: "run-usage", label: "Run Usage" }
688
698
  ]
689
699
  },
690
700
  {
@@ -2087,6 +2097,279 @@ function ApiReference({ LinkComponent }) {
2087
2097
  /* @__PURE__ */ jsx5("code", { children: "run" }),
2088
2098
  " submission namespace \u2014 frequent polling never burns your daily submission quota."
2089
2099
  ] }),
2100
+ /* @__PURE__ */ jsx5("div", { id: "get-run-results", className: "scroll-mt-6", children: /* @__PURE__ */ jsxs5(
2101
+ EndpointBlock,
2102
+ {
2103
+ method: "GET",
2104
+ path: "/v1/run/:id/results",
2105
+ summary: "Poll this run's own structured rows as JSON \u2014 always the per-document view.",
2106
+ children: [
2107
+ /* @__PURE__ */ jsxs5("p", { className: "text-[15px] text-void-text-secondary leading-relaxed mb-3", children: [
2108
+ "The same governed read behind ",
2109
+ /* @__PURE__ */ jsx5("code", { children: "GET /v1/pipelines/:id/results" }),
2110
+ " (review holdback, demoted-field projection, assembly awareness), scoped ALWAYS to this request's own ",
2111
+ /* @__PURE__ */ jsx5("code", { children: "documents[]" }),
2112
+ ' echo and ALWAYS the per-document view \u2014 "what did MY submitted documents produce", uniform across new/append modes. This is a deliberate divergence from the per-run',
2113
+ " ",
2114
+ /* @__PURE__ */ jsx5("code", { children: "run.completed" }),
2115
+ " webhook, which for an unscoped non-append assembly run delivers COMPOSED rows instead; composed output lives at",
2116
+ " ",
2117
+ /* @__PURE__ */ jsx5("code", { children: "GET /v1/pipelines/:id/results?view=composed" }),
2118
+ ", surfaced here at",
2119
+ " ",
2120
+ /* @__PURE__ */ jsx5("code", { children: "links.composed_results" }),
2121
+ " once a pipeline exists."
2122
+ ] }),
2123
+ /* @__PURE__ */ jsx5(
2124
+ ParamTable,
2125
+ {
2126
+ title: "Query parameters",
2127
+ params: [
2128
+ { name: "document_id", type: "string", description: "Comma-separated document UUIDs (1-100), intersected with this run's own documents echo." },
2129
+ { name: "include", type: "string", description: "Comma-separated subset of cells, provenance, audit." },
2130
+ { name: "limit", type: "integer", description: "Maximum records per page (default 25, max 100)." },
2131
+ { name: "cursor", type: "string", description: "Pagination cursor from a previous response's pagination.next_cursor, keyed on record_id." }
2132
+ ]
2133
+ }
2134
+ ),
2135
+ /* @__PURE__ */ jsxs5(Callout, { type: "warning", children: [
2136
+ "Only ",
2137
+ /* @__PURE__ */ jsx5(InlineCode, { children: "document_id" }),
2138
+ " and ",
2139
+ /* @__PURE__ */ jsx5(InlineCode, { children: "include" }),
2140
+ " filter here \u2014 ",
2141
+ /* @__PURE__ */ jsx5(InlineCode, { children: "run_id" }),
2142
+ ", ",
2143
+ /* @__PURE__ */ jsx5(InlineCode, { children: "view" }),
2144
+ ",",
2145
+ " ",
2146
+ /* @__PURE__ */ jsx5(InlineCode, { children: "since" }),
2147
+ "/",
2148
+ /* @__PURE__ */ jsx5(InlineCode, { children: "until" }),
2149
+ ", and",
2150
+ " ",
2151
+ /* @__PURE__ */ jsx5(InlineCode, { children: "status" }),
2152
+ " are pipeline-route-only and 400 with",
2153
+ " ",
2154
+ /* @__PURE__ */ jsx5(InlineCode, { children: "unsupported_filter" }),
2155
+ " here, since the run IS the scope and its window is already bounded."
2156
+ ] }),
2157
+ /* @__PURE__ */ jsx5(CodeBlock, { title: "Request", language: "bash", children: `curl "https://api.talonic.com/v1/run/a8716d18-978d-4d19-8ca5-8b3784ca857c/results?include=cells" \\
2158
+ -H "Authorization: Bearer $TALONIC_API_KEY"` }),
2159
+ /* @__PURE__ */ jsx5(CodeBlock, { title: "Response", children: `{
2160
+ "run_id": "a8716d18-978d-4d19-8ca5-8b3784ca857c",
2161
+ "pipeline_id": "1a0c681d-ea20-4bb4-8892-01a6d7f834da",
2162
+ "spec_id": "1fc7807e-e1aa-4504-b796-5709986e78ed",
2163
+ "status": "completed",
2164
+ "view": "documents",
2165
+ "generated_at": "2026-07-22T09:41:00.000Z",
2166
+ "columns": [
2167
+ { "field_key": "rechnungsnummer", "display_name": "Rechnungsnummer", "data_type": "string" },
2168
+ { "field_key": "bruttobetrag", "display_name": "Bruttobetrag (EUR)", "data_type": "number" }
2169
+ ],
2170
+ "data": [
2171
+ {
2172
+ "document_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
2173
+ "filename": "invoice-0847.pdf",
2174
+ "run_id": "a8716d18-978d-4d19-8ca5-8b3784ca857c",
2175
+ "pipeline_id": "1a0c681d-ea20-4bb4-8892-01a6d7f834da",
2176
+ "record_id": "pd_c3d4e5f6",
2177
+ "status": "complete",
2178
+ "completed_at": "2026-07-22T09:40:12.000Z",
2179
+ "fields": { "rechnungsnummer": "RE-2026-0847", "bruttobetrag": 1249.90 },
2180
+ "cells": {
2181
+ "rechnungsnummer": { "value": "RE-2026-0847", "status": "filled", "confidence": 0.98, "source": "llm_extraction", "document_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "filename": "invoice-0847.pdf" },
2182
+ "bruttobetrag": { "value": 1249.90, "status": "filled", "confidence": 0.95, "source": "llm_extraction", "document_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "filename": "invoice-0847.pdf" }
2183
+ }
2184
+ }
2185
+ ],
2186
+ "pagination": { "total": 1, "limit": 25, "has_more": false, "next_cursor": null },
2187
+ "pending_review_count": 0,
2188
+ "links": {
2189
+ "self": "/v1/run/a8716d18-978d-4d19-8ca5-8b3784ca857c/results",
2190
+ "run": "/v1/run/a8716d18-978d-4d19-8ca5-8b3784ca857c",
2191
+ "composed_results": "/v1/pipelines/1a0c681d-ea20-4bb4-8892-01a6d7f834da/results"
2192
+ }
2193
+ }` }),
2194
+ /* @__PURE__ */ jsxs5("p", { className: "text-[15px] text-void-text-secondary leading-relaxed my-3", children: [
2195
+ "Two zero-states return ",
2196
+ /* @__PURE__ */ jsx5("code", { children: "200" }),
2197
+ " with an empty ",
2198
+ /* @__PURE__ */ jsx5("code", { children: "data" }),
2199
+ " array and a",
2200
+ " ",
2201
+ /* @__PURE__ */ jsx5("code", { children: "scope_note" }),
2202
+ ", never ",
2203
+ /* @__PURE__ */ jsx5("code", { children: "404" }),
2204
+ ": no compiled pipeline exists yet (still ingesting, or failed before pipeline creation), or the run predates per-request document tracking (an echo-less legacy row). The envelope's",
2205
+ " ",
2206
+ /* @__PURE__ */ jsx5("code", { children: "status" }),
2207
+ " folds the same three-state vocabulary as",
2208
+ " ",
2209
+ /* @__PURE__ */ jsx5("code", { children: "GET /v1/run/:id" }),
2210
+ " and, unlike the pipeline route's own status, it settles even under append mode \u2014 poll this route, not the pipeline route, for append integrations."
2211
+ ] }),
2212
+ /* @__PURE__ */ jsx5(
2213
+ ParamTable,
2214
+ {
2215
+ title: "Errors",
2216
+ params: [
2217
+ { name: "400", type: "bad_request", description: "code is one of invalid_document_ids, invalid_include, unsupported_filter, audit_include_too_broad." },
2218
+ { name: "404", type: "not_found", description: "No run with this id exists for your organization." },
2219
+ { name: "429", type: "rate_limited", description: "Too many requests." }
2220
+ ]
2221
+ }
2222
+ )
2223
+ ]
2224
+ }
2225
+ ) }),
2226
+ /* @__PURE__ */ jsx5(SectionHeading, { id: "pipelines", children: "Pipelines" }),
2227
+ /* @__PURE__ */ jsxs5("p", { className: "text-[15px] text-void-text-secondary leading-relaxed mb-6", children: [
2228
+ "A pipeline is one run of a Spec on the engine (created via ",
2229
+ /* @__PURE__ */ jsx5("code", { children: "POST /v1/pipelines" }),
2230
+ " ",
2231
+ "or compiled implicitly by ",
2232
+ /* @__PURE__ */ jsx5("code", { children: "POST /v1/run" }),
2233
+ "). The endpoint below polls a pipeline's structured rows directly as JSON \u2014 the governed read (review holdback, demoted-field projection, assembly awareness) that previously existed only as the",
2234
+ " ",
2235
+ /* @__PURE__ */ jsx5("code", { children: "run.completed" }),
2236
+ " webhook or a data-product CSV export."
2237
+ ] }),
2238
+ /* @__PURE__ */ jsx5("div", { id: "get-pipeline-results", className: "scroll-mt-6", children: /* @__PURE__ */ jsxs5(
2239
+ EndpointBlock,
2240
+ {
2241
+ method: "GET",
2242
+ path: "/v1/pipelines/:id/results",
2243
+ summary: "Poll a pipeline's structured rows as JSON.",
2244
+ children: [
2245
+ /* @__PURE__ */ jsx5(
2246
+ ParamTable,
2247
+ {
2248
+ title: "Query parameters",
2249
+ params: [
2250
+ { name: "document_id", type: "string", description: "Comma-separated document UUIDs (1-100). Composed rows match on the anchor document." },
2251
+ { name: "run_id", type: "string", description: "Scope to one /v1/run request's own documents (implies view=documents). 404 if it does not belong to this pipeline." },
2252
+ { name: "since", type: "string", description: "ISO 8601 timestamp. Only records with completed_at at or after this bound." },
2253
+ { name: "until", type: "string", description: "ISO 8601 timestamp. Only records with completed_at at or before this bound." },
2254
+ { name: "status", type: "string", description: "Comma-separated subset of complete, partial, error, processing." },
2255
+ { name: "view", type: "string", description: "composed or documents. Defaults to composed when the run has an assembly product set, else documents." },
2256
+ { name: "include", type: "string", description: "Comma-separated subset of cells, provenance, audit." },
2257
+ { name: "limit", type: "integer", description: "Maximum records per page (default 25, max 100)." },
2258
+ { name: "cursor", type: "string", description: "Pagination cursor from a previous response's pagination.next_cursor, keyed on record_id." }
2259
+ ]
2260
+ }
2261
+ ),
2262
+ /* @__PURE__ */ jsx5(CodeBlock, { title: "Request", language: "bash", children: `curl "https://api.talonic.com/v1/pipelines/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results?status=complete,partial&limit=2" \\
2263
+ -H "Authorization: Bearer $TALONIC_API_KEY"` }),
2264
+ /* @__PURE__ */ jsx5(CodeBlock, { title: "Response", children: `{
2265
+ "pipeline_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
2266
+ "spec_id": "sch_uuid_1",
2267
+ "status": "active",
2268
+ "view": "documents",
2269
+ "generated_at": "2026-07-22T09:41:00.000Z",
2270
+ "columns": [
2271
+ { "field_key": "vertragsnummer", "display_name": "Vertragsnummer", "data_type": "string" },
2272
+ { "field_key": "mieter_name", "display_name": "Mieter", "data_type": "string" },
2273
+ { "field_key": "kaution_betrag", "display_name": "Kaution (EUR)", "data_type": "number" }
2274
+ ],
2275
+ "data": [
2276
+ {
2277
+ "document_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
2278
+ "filename": "mietvertrag-muster-gmbh.pdf",
2279
+ "run_id": null,
2280
+ "pipeline_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
2281
+ "record_id": "pd_9f1e2d3c",
2282
+ "status": "complete",
2283
+ "completed_at": "2026-07-22T09:38:11.000Z",
2284
+ "fields": { "vertragsnummer": "MV-2026-0847", "mieter_name": "Muster GmbH", "kaution_betrag": 4500 }
2285
+ },
2286
+ {
2287
+ "document_id": "b7a6c5d4-e3f2-1098-7654-3210fedcba98",
2288
+ "filename": "mietvertrag-beispiel-ag.pdf",
2289
+ "run_id": null,
2290
+ "pipeline_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
2291
+ "record_id": "pd_1a0c681d",
2292
+ "status": "partial",
2293
+ "completed_at": "2026-07-22T09:39:47.000Z",
2294
+ "fields": { "vertragsnummer": "MV-2026-0848", "mieter_name": "Beispiel AG", "kaution_betrag": null }
2295
+ }
2296
+ ],
2297
+ "pagination": { "total": 24, "limit": 2, "has_more": true, "next_cursor": "eyJpZCI6InBkXzFhMGM2ODFkIn0=" },
2298
+ "pending_review_count": 1,
2299
+ "links": {
2300
+ "self": "/v1/pipelines/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results",
2301
+ "pipeline": "/v1/pipelines/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
2302
+ "progress": "/v1/pipelines/a1b2c3d4-e5f6-7890-abcd-ef1234567890/progress"
2303
+ }
2304
+ }` }),
2305
+ /* @__PURE__ */ jsxs5("p", { className: "text-[15px] text-void-text-secondary leading-relaxed my-3", children: [
2306
+ /* @__PURE__ */ jsx5("code", { children: "view=composed" }),
2307
+ " (default when the run has an assembly product set) returns one row per assembled group; ",
2308
+ /* @__PURE__ */ jsx5("code", { children: "view=documents" }),
2309
+ " returns one row per pipeline document. An ",
2310
+ /* @__PURE__ */ jsx5("strong", { children: "anchor-less composed row" }),
2311
+ " (the product record's anchor could not be resolved) serializes",
2312
+ " ",
2313
+ /* @__PURE__ */ jsx5("code", { children: "document_id" }),
2314
+ "/",
2315
+ /* @__PURE__ */ jsx5("code", { children: "filename" }),
2316
+ "/",
2317
+ /* @__PURE__ */ jsx5("code", { children: "run_id: null" }),
2318
+ ",",
2319
+ " ",
2320
+ /* @__PURE__ */ jsx5("code", { children: 'status: "complete"' }),
2321
+ ", and ",
2322
+ /* @__PURE__ */ jsx5("code", { children: "completed_at: null" }),
2323
+ " \u2014 such rows are excluded by any ",
2324
+ /* @__PURE__ */ jsx5("code", { children: "document_id" }),
2325
+ ", ",
2326
+ /* @__PURE__ */ jsx5("code", { children: "status" }),
2327
+ ",",
2328
+ " ",
2329
+ /* @__PURE__ */ jsx5("code", { children: "since" }),
2330
+ ", or ",
2331
+ /* @__PURE__ */ jsx5("code", { children: "until" }),
2332
+ " filter."
2333
+ ] }),
2334
+ /* @__PURE__ */ jsxs5(Callout, { type: "warning", children: [
2335
+ /* @__PURE__ */ jsx5("code", { children: "since" }),
2336
+ "/",
2337
+ /* @__PURE__ */ jsx5("code", { children: "until" }),
2338
+ " filter on ",
2339
+ /* @__PURE__ */ jsx5("code", { children: "completed_at" }),
2340
+ ", which tracks DOCUMENT PROCESSING completion, not value change: a review promotion or assembly recompose never advances it, and a phase rerun nulls it until the document re-processes. Poll unbounded (or by ",
2341
+ /* @__PURE__ */ jsx5("code", { children: "document_id" }),
2342
+ ") to pick up review outcomes \u2014 ",
2343
+ /* @__PURE__ */ jsx5("code", { children: "pending_review_count" }),
2344
+ " is the signal that held values are outstanding. A held field's value is never exposed under any include; with",
2345
+ " ",
2346
+ /* @__PURE__ */ jsx5("code", { children: "include=audit" }),
2347
+ ", every version in a held field's trail serializes",
2348
+ " ",
2349
+ /* @__PURE__ */ jsx5("code", { children: "value: null" }),
2350
+ ". ",
2351
+ /* @__PURE__ */ jsx5("code", { children: "audit" }),
2352
+ " is bounded to",
2353
+ " ",
2354
+ /* @__PURE__ */ jsx5("code", { children: "structure_pipeline.results_api.audit_max_records" }),
2355
+ " (default 20) records per page \u2014 a broader page 400s with ",
2356
+ /* @__PURE__ */ jsx5("code", { children: "audit_include_too_broad" }),
2357
+ "."
2358
+ ] }),
2359
+ /* @__PURE__ */ jsx5(
2360
+ ParamTable,
2361
+ {
2362
+ title: "Errors",
2363
+ params: [
2364
+ { name: "400", type: "bad_request", description: "code is one of invalid_view, invalid_document_ids, invalid_run_id, invalid_time_range, invalid_status, invalid_include, audit_include_too_broad." },
2365
+ { name: "404", type: "not_found", description: "No pipeline with this ID exists for your organization, or run_id does not belong to this pipeline." },
2366
+ { name: "429", type: "rate_limited", description: "Too many requests." }
2367
+ ]
2368
+ }
2369
+ )
2370
+ ]
2371
+ }
2372
+ ) }),
2090
2373
  /* @__PURE__ */ jsx5(SectionHeading, { id: "sources", children: "Inputs" }),
2091
2374
  /* @__PURE__ */ jsx5("p", { className: "text-[15px] text-void-text-secondary leading-relaxed mb-6", children: "Inputs group documents by origin. Each input source has its own API key for programmatic document ingestion." }),
2092
2375
  /* @__PURE__ */ jsx5("div", { id: "list-sources", className: "scroll-mt-6", children: /* @__PURE__ */ jsx5(
@@ -3765,7 +4048,36 @@ function ApiReference({ LinkComponent }) {
3765
4048
  }
3766
4049
  ) }),
3767
4050
  /* @__PURE__ */ jsx5(SectionHeading, { id: "usage", children: "Usage" }),
3768
- /* @__PURE__ */ jsx5("p", { className: "text-[15px] text-void-text-secondary leading-relaxed mb-6", children: "Track API usage, document processing costs, and token consumption." }),
4051
+ /* @__PURE__ */ jsx5("p", { className: "text-[15px] text-void-text-secondary leading-relaxed mb-6", children: "Track API usage, document processing costs, and token consumption. Four endpoints cover aggregate, per-document, per-pipeline, and per-run views." }),
4052
+ /* @__PURE__ */ jsxs5(Callout, { type: "warning", children: [
4053
+ `Model and cost visibility are gated by your organization's "Cost control endpoints" approval. Without it, `,
4054
+ /* @__PURE__ */ jsx5(InlineCode, { children: "GET /v1/usage" }),
4055
+ " ",
4056
+ "and ",
4057
+ /* @__PURE__ */ jsx5(InlineCode, { children: "GET /v1/usage/documents/:id" }),
4058
+ " keep working but redact ",
4059
+ /* @__PURE__ */ jsx5(InlineCode, { children: "model" }),
4060
+ " and every cost field (the response carries ",
4061
+ /* @__PURE__ */ jsx5(InlineCode, { children: '"cost_fields": "redacted"' }),
4062
+ "), while ",
4063
+ /* @__PURE__ */ jsx5(InlineCode, { children: "GET /v1/usage/pipelines/:id" }),
4064
+ " and",
4065
+ " ",
4066
+ /* @__PURE__ */ jsx5(InlineCode, { children: "GET /v1/usage/runs/:id" }),
4067
+ " return ",
4068
+ /* @__PURE__ */ jsx5(InlineCode, { children: "404" }),
4069
+ " ",
4070
+ "-- their existence is not advertised to unapproved organizations. Approved organizations additionally need an API key carrying the",
4071
+ " ",
4072
+ /* @__PURE__ */ jsx5(InlineCode, { children: "usage" }),
4073
+ " scope to call the pipeline and run endpoints; that scope is grantable only through owner+ key management, never via self-serve key creation. Organizations carry the approval by default; shared individual workspaces do not."
4074
+ ] }),
4075
+ /* @__PURE__ */ jsxs5(Callout, { children: [
4076
+ /* @__PURE__ */ jsx5(InlineCode, { children: "cost_estimate_usd" }),
4077
+ " is Talonic's own estimate of the underlying AI provider's charge for the tokens billed on a call -- a different currency from ",
4078
+ /* @__PURE__ */ jsx5(InlineCode, { children: "GET /v1/usage/credits" }),
4079
+ ", which reports your organization's own credit-ledger consumption. The two figures do not reconcile against each other."
4080
+ ] }),
3769
4081
  /* @__PURE__ */ jsx5("div", { id: "get-usage", className: "scroll-mt-6", children: /* @__PURE__ */ jsxs5(
3770
4082
  EndpointBlock,
3771
4083
  {
@@ -3789,17 +4101,24 @@ function ApiReference({ LinkComponent }) {
3789
4101
  "extractions_run": 2104,
3790
4102
  "total_cost_usd": 15.63,
3791
4103
  "period": { "from": "2024-09-01", "to": "2024-09-30" }
3792
- }` })
4104
+ }` }),
4105
+ /* @__PURE__ */ jsxs5(Callout, { type: "warning", children: [
4106
+ 'Without the "Cost control endpoints" org approval, the model and every cost field above are omitted and the response carries',
4107
+ " ",
4108
+ /* @__PURE__ */ jsx5(InlineCode, { children: '"cost_fields": "redacted"' }),
4109
+ ". Token and call counts are unaffected."
4110
+ ] })
3793
4111
  ]
3794
4112
  }
3795
4113
  ) }),
3796
- /* @__PURE__ */ jsx5("div", { id: "document-usage", className: "scroll-mt-6", children: /* @__PURE__ */ jsx5(
4114
+ /* @__PURE__ */ jsx5("div", { id: "document-usage", className: "scroll-mt-6", children: /* @__PURE__ */ jsxs5(
3797
4115
  EndpointBlock,
3798
4116
  {
3799
4117
  method: "GET",
3800
4118
  path: "/v1/usage/documents/:id",
3801
4119
  summary: "Get usage breakdown for a specific document.",
3802
- children: /* @__PURE__ */ jsx5(CodeBlock, { title: "Response", children: `{
4120
+ children: [
4121
+ /* @__PURE__ */ jsx5(CodeBlock, { title: "Response", children: `{
3803
4122
  "document_id": "doc_3j7x9p2q",
3804
4123
  "ocr_cost_usd": 0.006,
3805
4124
  "extraction_cost_usd": 0.012,
@@ -3808,7 +4127,158 @@ function ApiReference({ LinkComponent }) {
3808
4127
  { "type": "document_ai_ocr", "model": "mistral-ocr", "pages": 2, "cost_usd": 0.006 },
3809
4128
  { "type": "extraction", "model": "claude-sonnet", "tokens": 4280, "cost_usd": 0.012 }
3810
4129
  ]
3811
- }` })
4130
+ }` }),
4131
+ /* @__PURE__ */ jsxs5(Callout, { type: "warning", children: [
4132
+ 'Without the "Cost control endpoints" org approval, model and every cost field above are omitted and the response carries',
4133
+ " ",
4134
+ /* @__PURE__ */ jsx5(InlineCode, { children: '"cost_fields": "redacted"' }),
4135
+ "."
4136
+ ] })
4137
+ ]
4138
+ }
4139
+ ) }),
4140
+ /* @__PURE__ */ jsx5("div", { id: "pipeline-usage", className: "scroll-mt-6", children: /* @__PURE__ */ jsxs5(
4141
+ EndpointBlock,
4142
+ {
4143
+ method: "GET",
4144
+ path: "/v1/usage/pipelines/:id",
4145
+ summary: "Get usage for a single pipeline (requires the usage scope).",
4146
+ children: [
4147
+ /* @__PURE__ */ jsx5(
4148
+ ParamTable,
4149
+ {
4150
+ title: "Query parameters",
4151
+ params: [
4152
+ { name: "from", type: "string", description: "ISO 8601 start date (default: last 90 days)." },
4153
+ { name: "to", type: "string", description: "ISO 8601 end date (default: now)." }
4154
+ ]
4155
+ }
4156
+ ),
4157
+ /* @__PURE__ */ jsx5(CodeBlock, { title: "Response", children: `{
4158
+ "pipeline_id": "b3c4d5e6-f7a8-9012-bcde-f34567890123",
4159
+ "period": { "from": "2026-04-22T00:00:00.000Z", "to": "2026-07-21T00:00:00.000Z" },
4160
+ "scope": "pipeline_calls_only",
4161
+ "scope_note": "Calls stamped with this pipeline id in call metadata. The shared ingest OCR leg is excluded.",
4162
+ "totals": {
4163
+ "input_tokens": 428900,
4164
+ "output_tokens": 61240,
4165
+ "cache_read_tokens": 112000,
4166
+ "cache_creation_tokens": 18500,
4167
+ "calls": 96,
4168
+ "cost_estimate_usd": 2.14
4169
+ },
4170
+ "breakdown": [
4171
+ {
4172
+ "operation_type": "extraction",
4173
+ "model": "claude-sonnet-4-20250514",
4174
+ "input_tokens": 402100,
4175
+ "output_tokens": 57980,
4176
+ "cache_read_tokens": 112000,
4177
+ "cache_creation_tokens": 18500,
4178
+ "calls": 84,
4179
+ "cost_estimate_usd": 2.01
4180
+ }
4181
+ ],
4182
+ "documents": [
4183
+ {
4184
+ "document_id": "d4e5f6a7-b8c9-0123-d456-e7f8a9b0c1d2",
4185
+ "filename": "invoice-04521.pdf",
4186
+ "input_tokens": 12480,
4187
+ "output_tokens": 1890,
4188
+ "calls": 3,
4189
+ "cost_estimate_usd": 0.058
4190
+ }
4191
+ ],
4192
+ "links": {
4193
+ "self": "/v1/usage/pipelines/b3c4d5e6-f7a8-9012-bcde-f34567890123",
4194
+ "pipeline": "/v1/pipelines/b3c4d5e6-f7a8-9012-bcde-f34567890123"
4195
+ }
4196
+ }` }),
4197
+ /* @__PURE__ */ jsxs5(Callout, { type: "warning", children: [
4198
+ `Requires your organization's "Cost control endpoints" approval (`,
4199
+ /* @__PURE__ */ jsx5(InlineCode, { children: "404" }),
4200
+ " otherwise -- the route is hidden, not merely forbidden) and an API key carrying the",
4201
+ " ",
4202
+ /* @__PURE__ */ jsx5(InlineCode, { children: "usage" }),
4203
+ " scope (",
4204
+ /* @__PURE__ */ jsx5(InlineCode, { children: "403" }),
4205
+ " ",
4206
+ "otherwise). The ",
4207
+ /* @__PURE__ */ jsx5(InlineCode, { children: "usage" }),
4208
+ " scope is grantable only through owner+ key management."
4209
+ ] })
4210
+ ]
4211
+ }
4212
+ ) }),
4213
+ /* @__PURE__ */ jsx5("div", { id: "run-usage", className: "scroll-mt-6", children: /* @__PURE__ */ jsxs5(
4214
+ EndpointBlock,
4215
+ {
4216
+ method: "GET",
4217
+ path: "/v1/usage/runs/:id",
4218
+ summary: "Get usage for a single /v1/run request (requires the usage scope).",
4219
+ children: [
4220
+ /* @__PURE__ */ jsx5(
4221
+ ParamTable,
4222
+ {
4223
+ title: "Path parameters",
4224
+ params: [
4225
+ { name: "id", type: "string", required: true, description: "The /v1/run request id (run_id from POST /v1/run / GET /v1/run/:id), not a pipeline id." }
4226
+ ]
4227
+ }
4228
+ ),
4229
+ /* @__PURE__ */ jsx5(
4230
+ ParamTable,
4231
+ {
4232
+ title: "Query parameters",
4233
+ params: [
4234
+ { name: "from", type: "string", description: "ISO 8601 start date (default: last 90 days)." },
4235
+ { name: "to", type: "string", description: "ISO 8601 end date (default: now)." }
4236
+ ]
4237
+ }
4238
+ ),
4239
+ /* @__PURE__ */ jsx5(CodeBlock, { title: "Response -- still ingesting", children: `{
4240
+ "run_id": "c4d5e6f7-a8b9-0123-cdef-456789012345",
4241
+ "pipeline_id": null,
4242
+ "period": { "from": "2026-04-22T00:00:00.000Z", "to": "2026-07-21T00:00:00.000Z" },
4243
+ "scope": "run_attributed_calls",
4244
+ "scope_note": "No pipeline exists for this run yet (still ingesting, or failed before pipeline creation) -- no attributable LLM calls.",
4245
+ "totals": {
4246
+ "input_tokens": 0,
4247
+ "output_tokens": 0,
4248
+ "cache_read_tokens": 0,
4249
+ "cache_creation_tokens": 0,
4250
+ "calls": 0,
4251
+ "cost_estimate_usd": 0
4252
+ },
4253
+ "breakdown": [],
4254
+ "documents": [
4255
+ { "document_id": "d4e5f6a7-b8c9-0123-d456-e7f8a9b0c1d2", "input_tokens": 0, "output_tokens": 0, "calls": 0, "cost_estimate_usd": 0 }
4256
+ ],
4257
+ "links": {
4258
+ "self": "/v1/usage/runs/c4d5e6f7-a8b9-0123-cdef-456789012345",
4259
+ "run": "/v1/run/c4d5e6f7-a8b9-0123-cdef-456789012345"
4260
+ }
4261
+ }` }),
4262
+ /* @__PURE__ */ jsxs5(Callout, { type: "warning", children: [
4263
+ "A run still ingesting, or one that failed before a pipeline was created, has a null ",
4264
+ /* @__PURE__ */ jsx5(InlineCode, { children: "pipeline_id" }),
4265
+ " and returns",
4266
+ " ",
4267
+ /* @__PURE__ */ jsx5(InlineCode, { children: "200" }),
4268
+ " with zero totals -- never",
4269
+ " ",
4270
+ /* @__PURE__ */ jsx5(InlineCode, { children: "404" }),
4271
+ " -- since pollers hit this window constantly. A document skipped by dedup or extraction-reuse legitimately shows all-zero counts. Gated identically to the per-pipeline endpoint: ",
4272
+ /* @__PURE__ */ jsx5(InlineCode, { children: "404" }),
4273
+ ` without the org's "Cost control endpoints" approval,`,
4274
+ " ",
4275
+ /* @__PURE__ */ jsx5(InlineCode, { children: "403" }),
4276
+ " without the ",
4277
+ /* @__PURE__ */ jsx5(InlineCode, { children: "usage" }),
4278
+ " ",
4279
+ "scope."
4280
+ ] })
4281
+ ]
3812
4282
  }
3813
4283
  ) }),
3814
4284
  /* @__PURE__ */ jsx5(SectionHeading, { id: "dialects", children: "Dialects" }),
@@ -7456,13 +7926,15 @@ var API_NAV_SECTIONS = [
7456
7926
  ] },
7457
7927
  { id: "run", label: "Run", children: [
7458
7928
  { id: "run-spec", label: "Run a Spec" },
7459
- { id: "poll-spec-run", label: "Poll a Run" }
7929
+ { id: "poll-spec-run", label: "Poll a Run" },
7930
+ { id: "get-run-results", label: "Run Results" }
7460
7931
  ] },
7461
7932
  { id: "pipelines", label: "Pipelines", children: [
7462
7933
  { id: "run-pipeline", label: "Run Pipeline" },
7463
7934
  { id: "list-pipelines", label: "List Pipelines" },
7464
7935
  { id: "get-pipeline", label: "Get Pipeline" },
7465
7936
  { id: "get-pipeline-progress", label: "Pipeline Progress" },
7937
+ { id: "get-pipeline-results", label: "Pipeline Results" },
7466
7938
  { id: "rerun-pipeline", label: "Rerun Pipeline" },
7467
7939
  { id: "create-pipeline-data-product", label: "Create Data Product" },
7468
7940
  { id: "delete-pipeline", label: "Delete Pipeline" }