@talonic/docs 0.20.1 → 0.20.2

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 (2) hide show
  1. package/dist/content.js +73 -27
  2. package/package.json +1 -1
package/dist/content.js CHANGED
@@ -4441,10 +4441,11 @@ var sections17 = [
4441
4441
  params: [
4442
4442
  { name: "extract", type: "scope", description: "Submit documents for extraction (`POST /v1/extract`, `POST /v1/documents/:id/re-extract`)." },
4443
4443
  { name: "read", type: "scope", description: "Read operations \u2014 list and retrieve documents, extractions, schemas, jobs, sources, and other resources." },
4444
- { name: "write", type: "scope", description: "Write operations \u2014 create, update, and delete schemas, sources, jobs, delivery bindings, and other resources." }
4444
+ { name: "write", type: "scope", description: "Write operations \u2014 create, update, and delete schemas, sources, jobs, delivery bindings, and other resources." },
4445
+ { name: "billing", type: "scope", description: "Billing operations \u2014 trigger credit top-ups (`POST /v1/billing/topup`). Not included by default; add explicitly when creating the key." }
4445
4446
  ]
4446
4447
  },
4447
- { type: "paragraph", text: "If a request requires a scope your key does not carry, the API returns `403` with error code `insufficient_scope` and lists the required scopes in the response body." },
4448
+ { type: "paragraph", text: "New keys default to `extract`, `read`, and `write`. The `billing` scope must be added explicitly. If a request requires a scope your key does not carry, the API returns `403` with error code `insufficient_scope` and lists the required scopes in the response body." },
4448
4449
  { type: "callout", text: "Keep your API key secret. Do not expose it in client-side code or version control. If a key is compromised, revoke it immediately from the dashboard." }
4449
4450
  ],
4450
4451
  related: [
@@ -4454,7 +4455,7 @@ var sections17 = [
4454
4455
  faq: [
4455
4456
  { question: "How do I authenticate with the Talonic API?", answer: "Include a Bearer token in the Authorization header of every request. API keys use the tlnc_ prefix." },
4456
4457
  { question: "Where do I get an API key?", answer: "Create and manage API keys from Settings \u2192 API Keys in the Talonic dashboard." },
4457
- { question: "What scopes are available?", answer: "Three scopes: extract (submit documents), read (list/retrieve resources), and write (create/update/delete resources). New keys get all three by default." }
4458
+ { question: "What scopes are available?", answer: "Four scopes: extract (submit documents), read (list/retrieve resources), write (create/update/delete resources), and billing (trigger credit top-ups). New keys get extract, read, and write by default; billing must be added explicitly." }
4458
4459
  ],
4459
4460
  mentions: ["Bearer token", "API key", "Authorization header", "scopes", "extract", "read", "write"]
4460
4461
  },
@@ -4481,9 +4482,9 @@ var sections17 = [
4481
4482
  parentSlug: "overview",
4482
4483
  title: "Quick Start",
4483
4484
  seoTitle: "API Quick Start Guide \u2014 Talonic Docs",
4484
- description: "Get started with the Talonic API in under 60 seconds. Extract structured data from a document with a single curl command using sync mode.",
4485
+ description: "Three modes, one API. Auto-detect extraction, schema-driven extraction, and document filtering \u2014 all with per-cell confidence and cost transparency.",
4485
4486
  content: [
4486
- { type: "paragraph", text: "Extract structured data from a document in a single API call. This guide uses **sync mode** (documents \u22645 pages return results immediately)." },
4487
+ { type: "paragraph", text: "Three modes. One API. Auto-detect what's in the document. Send your own schema and get exactly that shape. Or skip the document entirely and query data you already ingested. Plus per-cell provenance, confidence scores, and cost transparency on every call." },
4487
4488
  { type: "heading", level: 3, id: "prerequisites", text: "Prerequisites" },
4488
4489
  { type: "list", items: [
4489
4490
  "A Talonic account \u2014 sign up at [app.talonic.com](https://app.talonic.com)",
@@ -4491,15 +4492,42 @@ var sections17 = [
4491
4492
  "A PDF or image file to extract (e.g. an invoice)"
4492
4493
  ] },
4493
4494
  { type: "code", language: "bash", title: "Set your API key", code: `export TALONIC_API_KEY="tlnc_live_..."` },
4494
- { type: "heading", level: 3, id: "step-1-extract", text: "1. Extract a document" },
4495
- { type: "paragraph", text: "Send a file with an inline schema describing the fields you want:" },
4496
- { type: "code", language: "bash", title: "curl \u2014 extract an invoice", code: `curl -X POST https://api.talonic.com/v1/extract \\
4495
+ { type: "heading", level: 2, id: "mode-1-auto-detect", text: "Mode 1 \u2014 Auto-detect extract" },
4496
+ { type: "paragraph", text: "Send a document with no schema. Talonic discovers every field automatically." },
4497
+ { type: "code", language: "bash", title: "curl \u2014 auto-detect all fields", code: `curl -X POST https://api.talonic.com/v1/extract \\
4498
+ -H "Authorization: Bearer $TALONIC_API_KEY" \\
4499
+ -F "file=@invoice.pdf"` },
4500
+ { type: "paragraph", text: "Returns every field the AI discovers \u2014 vendor, dates, amounts, line items, addresses \u2014 with per-field confidence scores. Use this when you don't know the document structure upfront." },
4501
+ { type: "heading", level: 2, id: "mode-2-schema-extract", text: "Mode 2 \u2014 Schema-driven extract" },
4502
+ { type: "paragraph", text: "Send a document AND the shape you want. Get exactly those fields back." },
4503
+ { type: "code", language: "bash", title: "curl \u2014 extract with inline schema", code: `curl -X POST https://api.talonic.com/v1/extract \\
4497
4504
  -H "Authorization: Bearer $TALONIC_API_KEY" \\
4498
4505
  -F "file=@invoice.pdf" \\
4499
4506
  -F 'schema={"vendor_name":"string","invoice_number":"string","total_amount":"number","due_date":"date"}'` },
4500
- { type: "heading", level: 3, id: "step-1-response", text: "Response (200 OK)" },
4501
- { type: "paragraph", text: "For documents \u22645 pages, you get the extracted data immediately:" },
4502
- { type: "code", language: "json", title: "Sync response", code: `{
4507
+ { type: "paragraph", text: "The response contains exactly the four fields you asked for \u2014 nothing more. Save the schema with `POST /v1/schemas` for reuse across future extractions." },
4508
+ { type: "heading", level: 2, id: "mode-3-filter", text: "Mode 3 \u2014 Query ingested data" },
4509
+ { type: "paragraph", text: "Don't send a document. Query data you already extracted \u2014 across all documents in your workspace." },
4510
+ { type: "code", language: "bash", title: "curl \u2014 filter previously extracted documents", code: `curl -X POST https://api.talonic.com/v1/documents/filter \\
4511
+ -H "Authorization: Bearer $TALONIC_API_KEY" \\
4512
+ -H "Content-Type: application/json" \\
4513
+ -d '{
4514
+ "conditions": [
4515
+ { "fieldId": "vendor_name", "operator": "eq", "value": "Acme GmbH" }
4516
+ ],
4517
+ "limit": 50
4518
+ }'` },
4519
+ { type: "paragraph", text: "Returns all documents matching your filter \u2014 no re-extraction, no AI cost. Ingest once, query forever." },
4520
+ { type: "heading", level: 2, id: "cost-transparency", text: "Cost on every call" },
4521
+ { type: "paragraph", text: "Every synchronous extraction response includes cost headers so you can track spend per call:" },
4522
+ { type: "code", language: "bash", title: "Cost headers", code: `X-Talonic-Cost-Credits: 12
4523
+ X-Talonic-Cost-EUR: 0.012
4524
+ X-Talonic-Balance-Credits: 64918
4525
+ X-Talonic-Cells-Resolved-Registry: 3
4526
+ X-Talonic-Cells-Resolved-AI: 5` },
4527
+ { type: "paragraph", text: "Fields resolved from the registry (`X-Talonic-Cells-Resolved-Registry`) cost nothing. Only AI-resolved fields consume credits." },
4528
+ { type: "heading", level: 2, id: "example-response", text: "Example response" },
4529
+ { type: "paragraph", text: "A synchronous extraction returns structured data with confidence scores:" },
4530
+ { type: "code", language: "json", title: "Response (200 OK)", code: `{
4503
4531
  "extraction_id": "d1a2b3c4-5678-9abc-def0-1234567890ab",
4504
4532
  "request_id": "req_x7y8z9a0b1c2d3e4",
4505
4533
  "status": "complete",
@@ -4507,7 +4535,6 @@ var sections17 = [
4507
4535
  "id": "f0e1d2c3-b4a5-9687-8765-432109876543",
4508
4536
  "filename": "invoice.pdf",
4509
4537
  "pages": 2,
4510
- "size_bytes": 184320,
4511
4538
  "type_detected": "Invoice"
4512
4539
  },
4513
4540
  "data": {
@@ -4528,35 +4555,29 @@ var sections17 = [
4528
4555
  "processing": {
4529
4556
  "duration_ms": 1840,
4530
4557
  "pages_processed": 2
4531
- },
4532
- "links": {
4533
- "self": "/v1/extractions/d1a2b3c4-5678-9abc-def0-1234567890ab",
4534
- "document": "/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543"
4535
4558
  }
4536
4559
  }` },
4537
- { type: "heading", level: 3, id: "step-2-verify", text: "2. Verify it worked" },
4538
- { type: "paragraph", text: "Retrieve the extraction by ID to confirm the data is persisted:" },
4539
- { type: "code", language: "bash", title: "Verify extraction", code: `curl https://api.talonic.com/v1/extractions/d1a2b3c4-5678-9abc-def0-1234567890ab \\
4540
- -H "Authorization: Bearer $TALONIC_API_KEY"` },
4541
- { type: "paragraph", text: "You should see the same `data` object. The extraction is now stored and queryable across your workspace." },
4542
4560
  { type: "heading", level: 3, id: "next-steps", text: "Next steps" },
4543
4561
  { type: "list", items: [
4544
4562
  "**Reuse schemas** \u2014 save your schema with `POST /v1/schemas`, then pass `schema_id` on future extractions.",
4545
4563
  "**Large documents** \u2014 files >5 pages return `202 Accepted` with a `poll_url`. See [Processing Modes](extract-processing-mode).",
4546
4564
  "**Webhooks** \u2014 receive results via `extraction.complete` events instead of polling. See [Webhook Events](webhook-events).",
4547
- "**Batch mode** \u2014 process at 50% cost with `processing_mode=batch`. See [Batches](batches)."
4565
+ "**Batch mode** \u2014 process at 50% cost with `processing_mode=batch`. See [Batches](batches).",
4566
+ "**Credits** \u2014 check your balance anytime with `GET /v1/credits/balance`. See [Credits](credits-balance)."
4548
4567
  ] }
4549
4568
  ],
4550
4569
  related: [
4551
4570
  { label: "POST /v1/extract", slug: "post-extract" },
4571
+ { label: "Filter Documents", slug: "filter-documents" },
4552
4572
  { label: "Schema Formats", slug: "extract-schemas" },
4553
4573
  { label: "Processing Modes", slug: "extract-processing-mode" }
4554
4574
  ],
4555
4575
  faq: [
4556
- { question: "How do I get started with the Talonic API?", answer: "Set your TALONIC_API_KEY environment variable, then send a file with an inline schema to POST /v1/extract. Documents \u22645 pages return results immediately in sync mode." },
4557
- { question: "Do I need to create a schema first?", answer: "No. You can pass an inline schema as a JSON object on your first extraction. Save it with POST /v1/schemas later for reuse." }
4576
+ { question: "How do I get started with the Talonic API?", answer: "Three modes: (1) send a file with no schema for auto-detect, (2) send a file with a schema for exact extraction, (3) POST /v1/documents/filter to query already-ingested data." },
4577
+ { question: "Do I need to create a schema first?", answer: "No. Mode 1 auto-detects all fields. Mode 2 accepts an inline schema. Save it with POST /v1/schemas later for reuse." },
4578
+ { question: "Can I query previously extracted data without re-extracting?", answer: "Yes. POST /v1/documents/filter lets you search across all previously extracted documents by field values. No AI cost \u2014 ingest once, query forever." }
4558
4579
  ],
4559
- mentions: ["curl", "quick start", "sync mode", "TALONIC_API_KEY"]
4580
+ mentions: ["curl", "quick start", "sync mode", "three modes", "auto-detect", "filter", "query", "cost headers"]
4560
4581
  },
4561
4582
  {
4562
4583
  slug: "pagination",
@@ -4851,9 +4872,34 @@ var sections18 = [
4851
4872
  { name: "400", type: "invalid_options", description: "The options field is not valid JSON." },
4852
4873
  { name: "401", type: "unauthorized", description: "Missing or invalid API key." },
4853
4874
  { name: "422", type: "extraction_failed", description: "Extraction completed but produced no usable output. Check the document quality or schema definition." },
4854
- { name: "429", type: "rate_limited", description: "Too many requests. Retry after the period indicated in the Retry-After header." }
4875
+ { name: "429", type: "rate_limited", description: "Too many requests. Check X-RateLimit-Reset for when the window resets." }
4855
4876
  ]
4856
- }
4877
+ },
4878
+ { type: "heading", level: 2, id: "post-extract-cost-headers", text: "Cost Headers" },
4879
+ { type: "paragraph", text: "Synchronous 200 responses include cost transparency headers so you can track spend per call without a separate API round-trip:" },
4880
+ {
4881
+ type: "param-table",
4882
+ title: "Cost response headers",
4883
+ params: [
4884
+ { name: "X-Talonic-Cost-Credits", type: "integer", description: "Credits consumed by this extraction." },
4885
+ { name: "X-Talonic-Cost-EUR", type: "number", description: "EUR cost of this extraction." },
4886
+ { name: "X-Talonic-Balance-Credits", type: "integer", description: "Remaining credit balance after this call." },
4887
+ { name: "X-Talonic-Cells-Resolved-Registry", type: "integer", description: "Fields resolved from the registry (no AI cost)." },
4888
+ { name: "X-Talonic-Cells-Resolved-AI", type: "integer", description: "Fields resolved by the AI model." }
4889
+ ]
4890
+ },
4891
+ {
4892
+ type: "code",
4893
+ language: "bash",
4894
+ title: "Cost headers on a sync response",
4895
+ code: `HTTP/1.1 200 OK
4896
+ X-Talonic-Cost-Credits: 12
4897
+ X-Talonic-Cost-EUR: 0.012
4898
+ X-Talonic-Balance-Credits: 64918
4899
+ X-Talonic-Cells-Resolved-Registry: 3
4900
+ X-Talonic-Cells-Resolved-AI: 5`
4901
+ },
4902
+ { type: "callout", text: "Cost headers are only present on synchronous (200) responses. For async (202) extractions, check the credits balance endpoint or listen for the `extraction.complete` webhook which includes cost data." }
4857
4903
  ],
4858
4904
  related: [
4859
4905
  { label: "Schema Formats", slug: "extract-schemas" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talonic/docs",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "Talonic documentation components — API Reference & Platform Guide",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,