@hunt-labs/bytekit-mcp 0.3.6 → 0.3.7

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/CHANGELOG.md CHANGED
@@ -10,6 +10,74 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.3.7] - 2026-09-14
14
+
15
+ ### Added
16
+
17
+ - `scrape_url` accepts an optional `solve_challenge` boolean (#4450): attempt to clear a
18
+ Cloudflare challenge; success is not guaranteed. Billed as a normal browser render. The
19
+ parameter is forwarded to `POST /v1/scrape` only when set; omitting it sends no key.
20
+
21
+ ### Changed
22
+
23
+ - Refreshed the bundled documentation snapshot after `solve_challenge` was published on
24
+ `POST /v1/scrape`: the API reference page for that operation and the TypeScript SDK scrape
25
+ page list the new option. This refresh itself changes no tool, schema or transport.
26
+ - The TypeScript SDK changelog entry for #4447 is inside the bundled body of the `changelog`
27
+ page.
28
+ - The Python SDK changelog entry for #4448 is past the cut, so a client reading the bundled
29
+ `changelog` page does not see it.
30
+ - Refreshed the bundled documentation snapshot after `credits_scrape` was published on
31
+ `GET /v1/usage` (#4452): the API reference page for that operation lists the new field. This
32
+ refresh itself changes no tool, schema or transport.
33
+ - The TypeScript SDK changelog entry for #4452 is inside the bundled body of the `changelog`
34
+ page.
35
+ - The Python SDK changelog entry for #4452 is past the cut, so a client reading the bundled
36
+ `changelog` page does not see it.
37
+ - Refreshed the bundled documentation snapshot after `empty_extraction` was documented on the
38
+ `POST /v1/schema` response (#4455). This refresh itself changes no tool, schema or transport.
39
+ - Refreshed the bundled documentation snapshot after `GET /v1/logs` `billing_multiplier` was
40
+ redocumented as the bandwidth factor derived from the settled bytes, in place of the row's
41
+ persisted credit count (#4469). This refresh itself changes no tool, schema or transport.
42
+ - The TypeScript SDK changelog entry for #4469 is inside the bundled body of the `changelog`
43
+ page.
44
+ - Refreshed the bundled documentation snapshot after the `POST /v1/schema` `validated`
45
+ description recorded the explicitly-nullable exception to the all-null miss (#4490). This
46
+ refresh itself changes no tool, schema or transport.
47
+ - The TypeScript SDK changelog entry for #4490 is inside the bundled body of the `changelog`
48
+ page.
49
+ - The TypeScript SDK changelog entry for #4455 is inside the bundled body of the `changelog`
50
+ page.
51
+ - Refreshed the bundled documentation snapshot after an inline `POST /v1/scrape` failure started
52
+ carrying a persisted `sc_` id (#4454): the bundled `api/scrape/createscrape` and
53
+ `sdk/python/scrape` pages no longer say `id: null`. This refresh itself changes no tool, schema
54
+ or transport.
55
+ - The TypeScript SDK changelog entry for #4454 is inside the bundled body of the `changelog`
56
+ page.
57
+ - The Python SDK changelog entry for #4454 is past the cut, so a client reading the bundled
58
+ `changelog` page does not see it.
59
+ - Refreshed the bundled documentation snapshot after the internal `GET /v1/logs` feed started
60
+ listing search requests and webhook deliveries (#4460). Only the bundled `changelog` page
61
+ moved; this refresh itself changes no tool, schema or transport.
62
+ - The TypeScript SDK changelog entry for #4460 is inside the bundled body of the `changelog`
63
+ page.
64
+ - Refreshed the bundled documentation snapshot after the generated `sdk/python/scrape` reference
65
+ stopped listing request fields the OpenAPI spec marks `x-internal: true` (#4515): that page
66
+ loses its `x_internal_scrape_path` bullet. The field remains a live internal control in the
67
+ spec and in the generated model, and the API reference page for `POST /v1/scrape` still lists
68
+ it. This refresh itself changes no tool, schema or transport.
69
+ - The MCP server changelog entry for #4515 is past the cut, so a client reading the bundled
70
+ `changelog` page does not see it; the only other bundled bytes that move are in that page's
71
+ truncation notice, which reports the full size of the page it truncates.
72
+ - Refreshed the bundled documentation snapshot after the internal `GET /v1/bulk` operation
73
+ became cursor-paginated and lost its 100-job cap (#4508): the bundled `api/bulk/listbulk`
74
+ page now documents the `{ data, next_cursor, has_more }` page envelope and the `limit` /
75
+ `cursor` query parameters in place of a bare array, and both that page's title and the
76
+ `api/bulk` index card drop the wrong "in-flight" wording — the operation has always returned
77
+ jobs of every status. This refresh itself changes no tool, schema or transport.
78
+ - The TypeScript SDK changelog entry for #4508 is inside the bundled body of the `changelog`
79
+ page.
80
+
13
81
  ## [0.3.6] - 2026-09-12
14
82
 
15
83
  ### Changed
@@ -17,7 +17,7 @@
17
17
  "api/bulk": {
18
18
  "title": "Bulk",
19
19
  "section": "API Reference",
20
- "body": "# Bulk\n\nBulk API — endpoints, requests, and responses.\n\nThe **Bulk** API. 5 endpoints:\n\n- [List in-flight bulk jobs](https://bytekit.com/docs/api/bulk/listbulk) — GET /v1/bulk\n- [Create mixed bulk job](https://bytekit.com/docs/api/bulk/createbulk) — POST /v1/bulk\n- [Get bulk job status](https://bytekit.com/docs/api/bulk/getbulk) — GET /v1/bulk/:id\n- [Cancel a bulk job](https://bytekit.com/docs/api/bulk/deletebulk) — DELETE /v1/bulk/:id\n- [List bulk job items](https://bytekit.com/docs/api/bulk/listbulkscreenshots) — GET /v1/bulk/:id/screenshots"
20
+ "body": "# Bulk\n\nBulk API — endpoints, requests, and responses.\n\nThe **Bulk** API. 5 endpoints:\n\n- [List bulk jobs](https://bytekit.com/docs/api/bulk/listbulk) — GET /v1/bulk\n- [Create mixed bulk job](https://bytekit.com/docs/api/bulk/createbulk) — POST /v1/bulk\n- [Get bulk job status](https://bytekit.com/docs/api/bulk/getbulk) — GET /v1/bulk/:id\n- [Cancel a bulk job](https://bytekit.com/docs/api/bulk/deletebulk) — DELETE /v1/bulk/:id\n- [List bulk job items](https://bytekit.com/docs/api/bulk/listbulkscreenshots) — GET /v1/bulk/:id/screenshots"
21
21
  },
22
22
  "api/bulk/createbulk": {
23
23
  "title": "Create mixed bulk job",
@@ -35,9 +35,9 @@
35
35
  "body": "# Get bulk job status\n\n**GET** `/v1/bulk/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `estimated_credits`\n- `webhook_url`\n\n### 202 — Bulk job still processing. `routes/bulk.ts` ends the poll handler with\n`status: isTerminal ? 200 : 202` over an identical body, so this is the\nSAME envelope the 200 documents — only the status code and the reachable\n`status` values differ. Keep polling until you get a 200 (issue #3533).\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `estimated_credits`\n- `webhook_url`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
36
36
  },
37
37
  "api/bulk/listbulk": {
38
- "title": "List in-flight bulk jobs",
38
+ "title": "List bulk jobs",
39
39
  "section": "API Reference",
40
- "body": "# List in-flight bulk jobs\n\nReturns the caller's bulk jobs, most recent first. Optionally filter\nto a single status; when omitted, jobs of every status are returned.\n\n**GET** `/v1/bulk`\n\n## Parameters\n\n- `status` (query, string)\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `estimated_credits`\n- `webhook_url`\n\n### 422 — Validation error. Returned when `status` is not one of the documented values.\n- `status`\n- `error`"
40
+ "body": "# List bulk jobs\n\nReturns the caller's bulk jobs, most recent first, one cursor-paginated\npage at a time. Optionally filter to a single status; when omitted, jobs\nof every status are returned. `status` narrows the set and the cursor\naddresses a position inside that already-ordered, already-filtered set,\nso the two can be combined in one request. Follow `next_cursor` while\n`has_more` is true.\n\n**GET** `/v1/bulk`\n\n## Parameters\n\n- `limit` (query, integer)\n- `cursor` (query, string) — Pagination cursor from a previous response.\n- `status` (query, string)\n\n## Responses\n\n### 200 — Successful response.\n- `next_cursor`\n- `has_more`\n- `data`\n\n### 422 — Validation error. Returned when `status` is not one of the documented values, or when `cursor` is not a cursor this endpoint issued.\n- `status`\n- `error`"
41
41
  },
42
42
  "api/bulk/listbulkscreenshots": {
43
43
  "title": "List bulk job items",
@@ -162,7 +162,7 @@
162
162
  "api/scrape/createscrape": {
163
163
  "title": "Scrape a URL",
164
164
  "section": "API Reference",
165
- "body": "# Scrape a URL\n\nFetches and processes a URL, returning content in one or more formats wrapped in a ScrapeEnvelope.\n\n**The response shape is decided by your request, not by how we route it.** In precedence order:\n\n1. `async: true` → **202** with a `ScrapeQueuedEnvelope` receipt, returned immediately. Poll `GET /v1/scrape/{id}` for the result.\n2. Otherwise, a request that needs a full page render — today that is `delay_ms > 0` — is **held open** until the render reaches a terminal state, then returns **200** with the content envelope (`success` or `failed`). If the render is still running when the hold window expires (28 seconds by default), the request returns the **202** receipt instead and the job continues in the background.\n3. Otherwise the request is served by the fast HTTP path and returns **200** with the content envelope, typically in under a second.\n\n**A failed fetch is a result, not a transport error.** An unreachable host, a refused connection, or a target whose bot protection defeats every proxy tier all come back on the same **200** as a `failed` envelope — never a 5xx. Narrow on the envelope's `status` before reading the body. A failure the fast path decides inline happens before any job row exists, so its envelope carries `id: null` and there is nothing to poll; a failure a held render reaches carries that render's real `id`. Either way the request transfers no billable bytes and is charged nothing.\n\nSo a 202 means one of exactly two things: you asked for one with `async: true`, or the hold window expired. `wait_for_selector` and `wait_until` are `ScreenshotRequest` options, not `ScrapeRequest` options — sending either to this endpoint returns `422 validation_error`, so neither can produce a 202 here.\n\n**POST** `/v1/scrape`\n\n## Request Body\n\n- `url` (required)\n- `formats`\n- `country`\n- `delay_ms`\n- `timeout_ms`\n- `async`\n- `webhook_url`\n- `events`\n- `markdown_mode`\n- `markdown_query`\n- `markdown_links`\n- `markdown_images`\n- `with_links_summary`\n- `with_images_summary`\n- `markdown_compact`\n- `markdown_filter_images`\n- `markdown_include_media`\n- `markdown_include_warnings`\n- `markdown_include_stats`\n- `token_budget`\n- `token_encoding`\n- `mobile`\n- `remove_base64_images`\n- `include_tags`\n- `exclude_tags`\n- `cache_ttl`\n- `custom`\n- `clean_markdown`\n- `x_internal_scrape_path`\n\n## Responses\n\n### 200 — Scrape reached a terminal state and the body is that terminal envelope: `success` carrying content, or `failed` carrying the error envelope. Returned by the fast HTTP path in one round trip, and by a browser-path request without `async: true` once its render reaches a terminal state inside the hold window. A held render that ends in failure answers 200 with the same `failed` envelope `GET /v1/scrape/{id}` returns — narrow on `status` before reading the body. A definitive upstream outcome is a result, not a transport error: an unreachable host, a refused connection, or a target whose bot protection defeats every proxy tier all answer 200 with the `failed` envelope, never a 5xx. An inline failure ends before any job row exists, so its envelope carries `id: null` and there is nothing to poll; `error.http_status` is present only when a real upstream HTTP status is known.\n- `schema_version`\n- `status`\n- `id`\n- `url`\n- `final_url`\n- `content_type`\n- `content_length`\n- `status_code`\n- `retrieved_at`\n- `formats`\n- `metadata`\n- `tables`\n- `warnings`\n- `stats`\n- `markdown_tokens`\n- `billing`\n- `custom`\n- `cache`\n- `cache_age_s`\n- `error`\n\n### 202 — Scrape accepted for background processing; the body is a receipt, not content. Returned when `async: true` was requested, or when a browser-path request's hold window expired before the render finished. Poll `GET /v1/scrape/{id}` for the result.\n- `schema_version`\n- `status`\n- `id`\n- `url`\n- `status_url`\n- `queued_at`\n- `events`\n\n### 400 — Bad request. When the `url` field fails strict validation the error\ncode is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 422 — Validation error.\n- `status`\n- `error`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`\n\n### 500 — Internal server error.\n- `status`\n- `error`"
165
+ "body": "# Scrape a URL\n\nFetches and processes a URL, returning content in one or more formats wrapped in a ScrapeEnvelope.\n\n**The response shape is decided by your request, not by how we route it.** In precedence order:\n\n1. `async: true` → **202** with a `ScrapeQueuedEnvelope` receipt, returned immediately. Poll `GET /v1/scrape/{id}` for the result.\n2. Otherwise, a request that needs a full page render — today that is `delay_ms > 0` — is **held open** until the render reaches a terminal state, then returns **200** with the content envelope (`success` or `failed`). If the render is still running when the hold window expires (28 seconds by default), the request returns the **202** receipt instead and the job continues in the background.\n3. Otherwise the request is served by the fast HTTP path and returns **200** with the content envelope, typically in under a second.\n\n**A failed fetch is a result, not a transport error.** An unreachable host, a refused connection, or a target whose bot protection defeats every proxy tier all come back on the same **200** as a `failed` envelope — never a 5xx. Narrow on the envelope's `status` before reading the body. A failure the fast path decides inline is recorded as a failed job, so its envelope normally carries that job's `id` and `GET /v1/scrape/{id}` returns the same envelope; if recording the failed job itself fails, the envelope still arrives on the same 200 with `id` set to `null` and there is nothing to poll. A failure a held render reaches carries that render's real `id`. Either way the request transfers no billable bytes and is charged nothing.\n\nSo a 202 means one of exactly two things: you asked for one with `async: true`, or the hold window expired. `wait_for_selector` and `wait_until` are `ScreenshotRequest` options, not `ScrapeRequest` options — sending either to this endpoint returns `422 validation_error`, so neither can produce a 202 here.\n\n**POST** `/v1/scrape`\n\n## Request Body\n\n- `url` (required)\n- `formats`\n- `country`\n- `delay_ms`\n- `timeout_ms`\n- `async`\n- `webhook_url`\n- `events`\n- `markdown_mode`\n- `markdown_query`\n- `markdown_links`\n- `markdown_images`\n- `with_links_summary`\n- `with_images_summary`\n- `markdown_compact`\n- `markdown_filter_images`\n- `markdown_include_media`\n- `markdown_include_warnings`\n- `markdown_include_stats`\n- `token_budget`\n- `token_encoding`\n- `mobile`\n- `solve_challenge`\n- `remove_base64_images`\n- `include_tags`\n- `exclude_tags`\n- `cache_ttl`\n- `custom`\n- `clean_markdown`\n- `x_internal_scrape_path`\n\n## Responses\n\n### 200 — Scrape reached a terminal state and the body is that terminal envelope: `success` carrying content, or `failed` carrying the error envelope. Returned by the fast HTTP path in one round trip, and by a browser-path request without `async: true` once its render reaches a terminal state inside the hold window. A held render that ends in failure answers 200 with the same `failed` envelope `GET /v1/scrape/{id}` returns — narrow on `status` before reading the body. A definitive upstream outcome is a result, not a transport error: an unreachable host, a refused connection, or a target whose bot protection defeats every proxy tier all answer 200 with the `failed` envelope, never a 5xx. An inline failure is recorded as a failed job, so its envelope normally carries that job's `id` and polling it returns the same envelope; `id` is `null` only when recording the failed job itself failed. `error.http_status` is present only when a real upstream HTTP status is known.\n- `schema_version`\n- `status`\n- `id`\n- `url`\n- `final_url`\n- `content_type`\n- `content_length`\n- `status_code`\n- `retrieved_at`\n- `formats`\n- `metadata`\n- `tables`\n- `warnings`\n- `stats`\n- `markdown_tokens`\n- `billing`\n- `custom`\n- `cache`\n- `cache_age_s`\n- `error`\n\n### 202 — Scrape accepted for background processing; the body is a receipt, not content. Returned when `async: true` was requested, or when a browser-path request's hold window expired before the render finished. Poll `GET /v1/scrape/{id}` for the result.\n- `schema_version`\n- `status`\n- `id`\n- `url`\n- `status_url`\n- `queued_at`\n- `events`\n\n### 400 — Bad request. When the `url` field fails strict validation the error\ncode is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 422 — Validation error.\n- `status`\n- `error`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`\n\n### 500 — Internal server error.\n- `status`\n- `error`"
166
166
  },
167
167
  "api/scrape/getscrape": {
168
168
  "title": "Get scrape result",
@@ -217,7 +217,7 @@
217
217
  "api/usage/getusage": {
218
218
  "title": "Get current billing period usage",
219
219
  "section": "API Reference",
220
- "body": "# Get current billing period usage\n\n**GET** `/v1/usage`\n\n## Responses\n\n### 200 — Period summary. In bytes or dual billing mode, includes byte fields\nand structured bandwidth/credits objects.\n- `period_start`\n- `period_end`\n- `credits_used`\n- `credits_single`\n- `credits_bulk`\n- `credits_monitor`\n- `credits_search`\n- `credits_limit`\n- `credits_remaining`\n- `has_overage`\n- `overage_credits`\n- `plan_name`\n- `plan_price_cents`\n- `plan_type`\n- `topup_spent_cents`\n- `topup_balance_bytes`\n- `period_days_elapsed`\n- `bytes_used`\n- `bytes_single`\n- `bytes_bulk`\n- `bytes_scrape`\n- `bytes_monitor`\n- `bytes_limit`\n- `bytes_remaining`\n- `rollover_bytes`\n- `topup_bytes`\n- `request_count`\n- `request_count_previous_period`\n- `playground_api_key_id`\n- `bandwidth`\n- `credits`"
220
+ "body": "# Get current billing period usage\n\n**GET** `/v1/usage`\n\n## Responses\n\n### 200 — Period summary. In bytes or dual billing mode, includes byte fields\nand structured bandwidth/credits objects.\n- `period_start`\n- `period_end`\n- `credits_used`\n- `credits_single`\n- `credits_bulk`\n- `credits_monitor`\n- `credits_scrape`\n- `credits_search`\n- `credits_limit`\n- `credits_remaining`\n- `has_overage`\n- `overage_credits`\n- `plan_name`\n- `plan_price_cents`\n- `plan_type`\n- `topup_spent_cents`\n- `topup_balance_bytes`\n- `period_days_elapsed`\n- `bytes_used`\n- `bytes_single`\n- `bytes_bulk`\n- `bytes_scrape`\n- `bytes_monitor`\n- `bytes_limit`\n- `bytes_remaining`\n- `rollover_bytes`\n- `topup_bytes`\n- `request_count`\n- `request_count_previous_period`\n- `playground_api_key_id`\n- `bandwidth`\n- `credits`"
221
221
  },
222
222
  "api/usage/getusagebyendpoint": {
223
223
  "title": "Get per-endpoint bandwidth breakdown",
@@ -247,12 +247,12 @@
247
247
  "billing": {
248
248
  "title": "Billing",
249
249
  "section": "General",
250
- "body": "# Billing\n\nHow ByteKit prices bandwidth and credits, and how balances, top-ups, and spending controls behave.\n\nByteKit meters two separate things: **bandwidth**, which pays for the capture endpoints, and\n**credits**, which pay for search and schema extraction. The relevant balance is checked before\nany billable work is admitted, so a request either runs against a balance or is rejected — it\nnever continues as unpriced usage.\n\n- [Balance and exhausted quota](https://bytekit.com/docs/billing/balance) — What happens when a ByteKit bandwidth or credit balance reaches zero.\n- [Bandwidth billing](https://bytekit.com/docs/billing/bandwidth) — How ByteKit measures billed bandwidth for capture and sitemap endpoints.\n- [Credit billing](https://bytekit.com/docs/billing/credits) — How search and schema extraction consume credits.\n- [Top-ups and rollover](https://bytekit.com/docs/billing/top-ups) — How purchased bandwidth and credits expire, carry across periods, and are consumed.\n- [Spending controls](https://bytekit.com/docs/billing/spending) — How spending caps and automatic bandwidth top-ups behave."
250
+ "body": "# Billing\n\nHow ByteKit prices bandwidth and credits, and how balances, top-ups, and spending controls behave.\n\nByteKit meters two separate things: **bandwidth**, which pays for the capture endpoints, and\n**credits**, which pay for search and schema extraction. The relevant balance is checked before\nany billable work is admitted, so a request either runs against a balance or is rejected — it\nnever continues as unpriced usage.\n\n- [Balance and exhausted quota](https://bytekit.com/docs/billing/balance) — What happens when a ByteKit bandwidth or credit balance reaches zero.\n- [Bandwidth billing](https://bytekit.com/docs/billing/bandwidth) — How ByteKit measures billed bandwidth for capture and sitemap endpoints.\n- [Credit billing](https://bytekit.com/docs/billing/credits) — How search and schema extraction consume credits.\n- [Top-ups and rollover](https://bytekit.com/docs/billing/top-ups) — How your USD balance is spent, why it never expires, and how plan allowance rolls over.\n- [Spending controls](https://bytekit.com/docs/billing/spending) — How spending caps and automatic bandwidth top-ups behave."
251
251
  },
252
252
  "billing/balance": {
253
253
  "title": "Balance and exhausted quota",
254
254
  "section": "General",
255
- "body": "# Balance and exhausted quota\n\nWhat happens when a ByteKit bandwidth or credit balance reaches zero.\n\nByteKit checks the relevant balance before admitting billable work. Capture endpoints use the bandwidth balance; search uses the credit balance; schema extraction requires both.\n\nWhen a request would exceed an enforced balance, ByteKit returns **HTTP 402** with the error code `quota_exceeded`. The request does not continue as unpriced usage.\n\nThere is no automatic overage: availability is an explicit plan setting, reported as the `has_overage` field on your plan (`GET /v1/account`, `GET /v1/plans`) and on `GET /v1/usage`. No standard plan enables it — Starter, Growth and Scale report `has_overage: false`, so a credit-metered request past the included allowance is refused with 402 `quota_exceeded` rather than admitted as billable overage. Only a custom plan arranged with ByteKit can enable overage; on such a plan a configured spending cap can permit or reject additional usage, returning 402 `spending_cap_reached` when the cap is crossed. Capture endpoints still enforce their bandwidth budget.\n\n## Starter grant\n\nA new pay-as-you-go account receives a one-time starter grant when it is first created: **50 MB of bandwidth and 100 credits**. It is issued once per account, is not a purchase, and does not expire. Granted value is spent last — after your plan's included allowance and after any purchased top-up — so a top-up you paid for is never consumed while free grant remains.\n\n`GET /v1/billing/balance` reports the grant separately from purchases: `granted_topup_bytes` and `granted_topup_credits` hold the grant, `purchased_topup_bytes` and `purchased_topup_credits` hold what you bought, and `topup_bytes` / `topup_credits` are the two added together.\n\nTo continue after a hard balance stop, purchase a top-up or move to a plan with more included usage. Auto-top-up can purchase bandwidth before the configured threshold is crossed, but it must be enabled and configured in advance; reaching zero does not silently enable it.\n\nSee **Dashboard → Settings → Billing** for included usage, purchased and rollover balances, and auto-top-up status."
255
+ "body": "# Balance and exhausted quota\n\nWhat happens when a ByteKit bandwidth or credit balance reaches zero.\n\nByteKit checks the relevant balance before admitting billable work. Capture endpoints use the bandwidth balance; search uses the credit balance; schema extraction requires both.\n\nWhen a request would exceed an enforced balance, ByteKit returns **HTTP 402** with the error code `quota_exceeded`. The request does not continue as unpriced usage.\n\nThere is no automatic overage: availability is an explicit plan setting, reported as the `has_overage` field on your plan (`GET /v1/account`, `GET /v1/plans`) and on `GET /v1/usage`. No standard plan enables it — Starter, Growth and Scale report `has_overage: false`, so a credit-metered request past the included allowance is refused with 402 `quota_exceeded` rather than admitted as billable overage. Only a custom plan arranged with ByteKit can enable overage; on such a plan a configured spending cap can permit or reject additional usage, returning 402 `spending_cap_reached` when the cap is crossed. Capture endpoints still enforce their bandwidth budget.\n\n## Starter grant\n\nA new pay-as-you-go account receives a one-time starter grant when it is first created: **50 MB of bandwidth and 100 credits**. It is issued once per account, is not a purchase, and does not expire. Granted value is spent last — after your plan's included allowance and after any purchased top-up — so a top-up you paid for is never consumed while free grant remains.\n\n`GET /v1/billing/balance` reports the grant separately from purchases: `granted_topup_bytes` and `granted_topup_credits` hold the grant, `purchased_topup_bytes` and `purchased_topup_credits` hold what you bought, and `topup_bytes` / `topup_credits` are the two added together.\n\nTo continue after a hard balance stop, purchase a top-up or move to a plan with more included usage. Auto-top-up can add funds to your USD balance when your remaining value drops below the configured dollar threshold, but it must be enabled and configured in advance; reaching zero does not silently enable it.\n\nSee **Dashboard → Settings → Billing** for included usage, purchased and rollover balances, and auto-top-up status."
256
256
  },
257
257
  "billing/bandwidth": {
258
258
  "title": "Bandwidth billing",
@@ -267,17 +267,17 @@
267
267
  "billing/spending": {
268
268
  "title": "Spending controls",
269
269
  "section": "General",
270
- "body": "# Spending controls\n\nHow spending caps and automatic bandwidth top-ups behave.\n\nByteKit has two distinct spending controls: a credit-overage cap and automatic bandwidth top-ups.\n\n## Credit-overage spending cap\n\nNo standard plan is overage-enabled: Starter, Growth and Scale stop at the included credit allowance with 402 `quota_exceeded`, so this cap never applies to them. It applies only to a custom plan arranged with ByteKit that carries an overage agreement.\n\nFor a credit-metered request on such a plan, ByteKit compares the calculated overage cost with the account's `max_overage_spend_cents`. When the request would cross that limit, the API returns **HTTP 402** with `spending_cap_reached`.\n\nThe current billing page does not expose a self-service control for this account-level overage cap. Contact support if it must be changed.\n\n## Automatic bandwidth top-ups\n\nThe billing page lets an account administrator enable or disable auto-top-up and configure:\n\n- the remaining-bandwidth threshold that triggers a purchase;\n- the amount of bandwidth to purchase; and\n- a monthly cap on automatic top-up spending, from $1 to $1,000.\n\nAll three are required when auto-top-up is enabled, and the account must have a Stripe customer. When remaining included bandwidth falls below the configured threshold, ByteKit queues a top-up — unless that purchase would take this month's automatic top-up spending past the cap, in which case it is skipped until the next month. An account that has never stored a cap is uncapped, and the API reports its cap as `null`.\n\nThese controls do not configure purchased-balance expiration. See [Top-ups](https://bytekit.com/docs/billing/top-ups) for the expiry and rollover rules that apply instead."
270
+ "body": "# Spending controls\n\nHow spending caps and automatic top-ups behave.\n\nByteKit has two distinct spending controls: a credit-overage cap and automatic top-ups of your USD balance.\n\n## Credit-overage spending cap\n\nNo standard plan is overage-enabled: Starter, Growth and Scale stop at the included credit allowance with 402 `quota_exceeded`, so this cap never applies to them. It applies only to a custom plan arranged with ByteKit that carries an overage agreement.\n\nFor a credit-metered request on such a plan, ByteKit compares the calculated overage cost with the account's `max_overage_spend_cents`. When the request would cross that limit, the API returns **HTTP 402** with `spending_cap_reached`.\n\nThe current billing page does not expose a self-service control for this account-level overage cap. Contact support if it must be changed.\n\n## Automatic top-ups\n\nThe billing page lets an account administrator enable or disable auto-top-up and configure:\n\n- the remaining value, in dollars, below which a top-up is triggered (at least $1);\n- the dollar amount each top-up adds to your USD balance ($5 to $1,000); and\n- a monthly cap on automatic top-up spending, from $1 to $1,000.\n\nAll three are required when auto-top-up is enabled, and the account must have a Stripe customer. Remaining value is your plan's remaining allowance plus your USD balance, priced at your plan's current top-up rate for the resource the request uses (bandwidth or search credits). When it falls below the configured threshold, ByteKit queues a top-up — unless that purchase would take this month's automatic top-up spending past the cap, in which case it is skipped until the next month. An account that has never stored a cap is uncapped, and the API reports its cap as `null`.\n\nYour USD balance never expires, so there is no expiry to configure. See [Top-ups](https://bytekit.com/docs/billing/top-ups) for how the balance is spent and for the rollover rules that apply to plan allowance."
271
271
  },
272
272
  "billing/top-ups": {
273
273
  "title": "Top-ups and rollover",
274
274
  "section": "General",
275
- "body": "# Top-ups and rollover\n\nHow purchased bandwidth and credits expire, carry across periods, and are consumed.\n\nTop-ups add bandwidth or credits without changing your plan's included allowance. Each purchase is recorded as its own lot, with its own expiry date. Value is spent in one order: your plan's included allowance, including any rollover from earlier periods, then purchased top-ups, then the one-time starter grant.\n\n## Expiration\n\nPurchased top-up lots expire **180 days after the payment provider object was created**. A cancellation or downgrade freezes the lot and **resets that deadline to 90 days from the freeze**. The reset runs in both directions: a lot with five months left loses that time, and a lot that was about to expire gains a little. The window is fixed; it is not configurable in the dashboard. Expired lots are removed from the active purchased balance and cannot fund new usage. If your subscription is cancelled or lapses, any purchased balance above the pay-as-you-go tier is held (not spent, not forfeited) until you resubscribe at the same tier or higher. Restoring the balance does not restore the original deadline — a released lot keeps the date the freeze assigned it. A second freeze restamps from that second freeze, because the rule is keyed to the event, not to the lot.\n\n## Billing-period rollover\n\nUnused bandwidth from your monthly plan allowance rolls over to the next billing period with no cap, for as long as the subscription stays on its plan or moves to a higher one. A downgrade or cancellation freezes it: the frozen balance stops being spendable, and resubscribing at the same tier or higher within 90 days restores it in full — after that it is permanently lost. Purchased value is held separately from the billing period you bought it in, so it is not reset when that period rolls over; the `topup_bytes` and `topup_credits` fields report the purchased balance that is still eligible and unexpired.\n\nCredits do not roll over — they reset every billing period. This does not affect top-up expiry, which follows the rule above and is not configurable.\n\nYour current purchased and rollover balances appear under **Dashboard → Settings → Billing**."
275
+ "body": "# Top-ups and rollover\n\nHow your USD balance is spent, why it never expires, and how plan allowance rolls over.\n\nTop-ups add dollars to your account's USD balance without changing your plan's included allowance. Value is spent in one order: your plan's included allowance, including any rollover from earlier periods, then the USD balance, then the one-time starter grant.\n\n## The USD balance\n\nYour USD balance never expires. It is not tied to the plan you were on when you added it: a cancellation or plan change does not freeze it, hold it, or reset its value. Usage beyond your included allowance draws from the balance at your current plan's top-up rate for the resource it uses — bandwidth or search credits — so the same dollars buy more on a plan with a lower rate. The bandwidth and credit amounts shown beside your balance are estimates at those current rates; the dollar figure is what you hold.\n\n## Billing-period rollover\n\nUnused bandwidth from your monthly plan allowance rolls over to the next billing period with no cap, for as long as the subscription stays on its plan or moves to a higher one. A downgrade or cancellation freezes it: the frozen balance stops being spendable, and resubscribing at the same tier or higher within 90 days restores it in full — after that it is permanently lost. The USD balance is separate from the billing period, so it is not reset when that period rolls over.\n\nCredits do not roll over — they reset every billing period. This does not affect your USD balance, which never expires.\n\nYour USD balance and rollover balances appear under **Dashboard → Settings → Billing**."
276
276
  },
277
277
  "changelog": {
278
278
  "title": "Changelog",
279
279
  "section": "General",
280
- "body": "# Changelog\n\nRelease history for the ByteKit SDKs, CLI, and MCP server\n\nEach section below is the `CHANGELOG.md` kept alongside that client’s source in the ByteKit\nrepository. Entries record what a release changed, including names and options it retired.\n\n## @hunt-labs/bytekit-sdk\n\nTypeScript SDK, published on npm.\n\n### [Unreleased]\n\n### [0.10.0] - 2026-09-11\n\n#### Changed\n\n- **A terminal `POST /v1/scrape` failure now throws instead of resolving (#1870).** The\n gateway used to report an upstream fetch failure — unreachable host, refused connection,\n or bot protection that defeated every proxy tier — as HTTP 503; it now answers **HTTP 200**\n with the canonical `failed` envelope (`id: null`), because a definitive upstream outcome is\n a result, not a transport error. `!response.ok` was this SDK's only failure seam, so without\n this change that body would resolve like a success and silence every caller's `catch`.\n `scrape.create` (and any `request` / `requestWithResponse` call to `POST /v1/scrape`) now\n raises `ByteKitError` carrying the envelope's `code` and `message`, the **actual** status\n `200`, the response headers, and `error.details` when one is supplied. A legacy 503 from a\n not-yet-upgraded gateway still throws through the unchanged non-2xx decoder, so the SDK\n works against both. **Upgrade note:** if you inspected `result.status === 'failed'` after\n `scrape.create`, move that handling into a `catch`.\n- Everything else is untouched: `scrape.get(id)`, bulk item results, and every other endpoint\n still deliver `failed` as data; `requestRaw` (`/v1/fetch`) never parses JSON and is\n unaffected; 204 and empty-body handling are unchanged. `request()` now delegates to\n `requestWithResponse()` so the guard has a single application site — identical in every\n observable respect but the return value, as both were already documented.\n\n### [0.9.4] - 2026-09-06 [NEVER PUBLISHED]\n\n**This version was cut but NEVER PUBLISHED — npm `latest` goes from 0.9.3 straight to 0.10.0.**\nPublication is triggered by CI on `main` from the version the manifest declares, and 0.10.0\n(#1870) superseded 0.9.4 in the tree before any release reached `main`. Everything below\nreaches consumers in the **0.10.0** artifact, which contains all of it; nothing is installable\nat 0.9.4: `npm i @hunt-labs/bytekit-sdk@0.9.4` fails.\n\n#### Added\n\n- Bulk fetch, scrape, and mixed-result reads now accept optional cursor, limit, and status\n page parameters while preserving the existing `(id, requestOptions?)` call shape (#3717).\n Generated response types publish stable item identities, page cursors and completeness,\n whole-job counters, exact mixed artifact keys, artifact warnings, bounded webhook recovery\n metadata, and the `artifact_unavailable` error contract.\n\n#### Fixed\n\n- Corrected the artifact-URL fallback documentation on `GET /v1/bulk/{id}/screenshots`\n (`image_url`, `content_url`, `markdown_url`) and `GET /v1/logs` (`artifact_url`) (#3717).\n Those fields were documented as null-plus-`artifact_unavailable` when no signature can be\n minted; the servers have always returned the row's stored value unchanged instead — `null`\n while nothing is stored, and otherwise the private unsigned storage URL, which answers `401`\n — and raise no warning. `GET /v1/fetch/bulk/{id}` does null the field and report\n `artifact_unavailable`, and its documentation is unchanged. No server behaviour changed and\n no type moved; the descriptions now match what the endpoints return.\n\n#### Changed\n\n- Regenerated `src/generated/api.d.ts` against the corrected `topup_balance_bytes` description\n on `GET /v1/usage` (#4251). The description read \"Remaining purchased top-up bytes\", which\n contradicted its own \"Equal to `topup_bytes`\" clause: the value covers purchased top-up lots\n and the one-time starter grant, which is what the endpoint has always returned. The clause\n recording that the figure is already net of consumed overage, and the \"Present only in\n dual/bytes billing mode\" clause, are both unchanged and still true. Types are unchanged and\n no server value changed; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the clarified `cache_age_s` description on\n `ScrapeSuccessEnvelope` (#4237). The description now records that `GET /v1/scrape/{id}`\n reports `cache: hit` without `cache_age_s`: the age is a property of the replay that happened\n at completion time, is not persisted on the row, and cannot be derived honestly afterwards.\n The one-directional \"Present only on `cache: hit`\" clause is unchanged and still true. Types\n are unchanged; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the completed `cache` presence list on\n `ScrapeSuccessEnvelope` (#4203). The field's description now names `GET /v1/scrape/{id}` as a\n third delivery path, alongside the synchronous response and webhook delivery: a polled scrape\n now reports the cache disposition its row recorded, and omits the field — rather than\n defaulting it to `miss` — for a row that recorded none. Types are unchanged; only the\n documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the corrected `PUT /v1/billing/auto-topup`\n request body (#3984). `monthly_cap_cents` is now typed `number | null`: an explicit `null` is\n the wire representation of \"no monthly cap\", and it is what the endpoint has always accepted —\n the request schema simply never documented it, while the 200 response schema already did.\n Omitting the key while `enabled` is `true` is still rejected with `422`, so send `null`\n rather than dropping the field. No server behaviour changes; the type widens to match what\n the API already accepted.\n- Regenerated `src/generated/api.d.ts` against the corrected monitor `scrape_options`\n documentation (#4024). The description no longer lists `headers` among the accepted\n fields — `POST /v1/monitors` never honoured a caller-supplied `headers` option and now\n rejects it with the same 400 every other capture endpoint returns for the field. Types are\n unchanged; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the completed `X-Scrape-Proxy-Tier-Label`\n omission list (#4030). The header's description now names a third case in which no tier is\n reported: a response replayed from stored bytes after this request's own cache lookup missed,\n which arrives as `X-Scrape-Cache: miss` and likewise ran no proxy tier. The two cases already\n documented — a cache hit, and responses the fast path did not serve — are unchanged. Types are\n unchanged; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the qualified `X-Scrape-Proxy-Tier-Label`\n omission list (#4132). The third case that list records — a response replayed from stored bytes\n after this request's own cache lookup missed — is not reachable through this API: every caller\n of the internal fetch path closes the handler branch that produces it, and the branch survives\n only as a deploy-skew safeguard. The description now says so rather than presenting the case as\n ordinary behaviour. The two reachable cases — a cache hit, and responses the fast path did not\n serve — are unchanged. Types are unchanged; only the documentation on them moved.\n\n### [0.9.3] - 2026-09-04\n\n#### Changed\n\n- Regenerated `src/generated/api.d.ts` against the corrected queued-scrape `status_url`\n documentation (#3925). `status_url` is a root-relative path, never an absolute URI: join it\n onto the API base URL you called (`https://api.bytekit.com`, no trailing slash) to get the URL\n to poll. The spec had declared it `format: uri` with an absolute example, which no server has\n ever emitted; the emitted value is unchanged, so no client behaviour moves.\n- Regenerated `src/generated/api.d.ts` against the documented proxy-tier response headers\n (#3926). `X-Scrape-Proxy-Tier-Label` now documents that it reports the tier that ACTUALLY\n served a scrape — after any escalation, never the tier first attempted — that it is\n diagnostic only, and that it is omitted on a cache hit, which replayed stored bytes and ran\n no tier. The deprecated numeric `X-Scrape-Proxy-Tier` documents the legacy `1` datacenter /\n `2` residential / `3` mobile vocabulary and its omission for the lean-browser tier. Types are\n unchanged; only the documentation on them moved.\n\n### [0.9.2] - 2026-09-03\n\n#### Changed\n\n- **Breaking (API):** the scrape `formats` vocabulary is now `raw | markdown | links | images`\n (#3775). The unprocessed-source format is called `raw` — it has returned JSON, XML and plain\n text alongside HTML since #1853, so the old raw-HTML name misdescribed it — and the\n cleaned-article-HTML format is gone. The server accepts no alias for either retired value, so\n a request naming one now comes back `422` with the new set in the message. Update `formats`\n and read the content back from `formats.raw`:\n\n ```ts\n const result = await client.scrape.create({ url, formats: ['raw', 'markdown'] });\n console.log(result.formats.raw);\n ```\n\n- Regenerated `src/generated/api.d.ts` against the documented `402` contract (#3784). Every\n quota-enforced operation now declares `402` through one shared `PaymentRequired` response, and\n the `X-Quota-*` headers are referenced by the operations that actually emit them. Types only —\n no runtime behavior changed.\n\n- The generated `events` field description on the scrape request type now documents the\n widened server default (`queued`, `completed`, `failed`) and that a caller may send an\n explicit subset to receive fewer deliveries (#3777). Types/docs only — this regeneration\n followed a server-side default change; the SDK carried no logic tied to the old default.\n\n### [0.9.1] - 2026-08-25\n\n#### Fixed\n\n- The generated `paths` type for the `200` of `GET /v1/scrape/bulk/{id}` now declares `items`\n (#3632). The route builds one body and varies only the status code, so the terminal `200`\n has always carried the per-URL scrape envelopes — but only the `202` documented them, so\n `scrape.bulk.get()` typed the results away at exactly the poll that has them. Types only:\n the field was already on the wire, and server behavior is unchanged.\n\n- The generated `paths` types now describe the `202` that `GET /v1/scrape/bulk/{id}`,\n `GET /v1/fetch/bulk/{id}` and `GET /v1/bulk/{id}` already serve while a bulk job is\n non-terminal (#3533). Each of the three returns 202 with the job envelope until the job is\n terminal and 200 afterwards, but only the 200 was declared, so anything typed off the spec\n had no shape for the response the very first poll receives. Types only: `scrape.bulk.get()`,\n `fetch.bulk.get()` and `bulk.get()` already resolved the body on any 2xx, and server behavior\n is unchanged.\n\n#### Changed\n\n- The generated `topup_balance_bytes` description on `GET /v1/usage` now states that the value is\n the remaining purchased top-up bytes, already net of any overage consumed against them (#3459).\n Types only: the field's name, type and wire format are unchanged. The server previously\n subtracted the consumed overage a second time when computing this value, so the number a client\n reads is larger than before for accounts that ran past their included allowance.\n\n### [0.9.0] - 2026-08-20\n\n#### Removed\n\n- **BREAKING: the `cookies` and `headers` request-body fields are gone from every capture\n endpoint** (#3242) — `/v1/scrape`, `/v1/scrape/bulk`, `/v1/screenshots`, `/v1/recordings` and\n `/v1/schema`. A request that carries either field is rejected with `400 validation_error`; it\n is not ignored, and there is no deprecation window, feature flag, or compatibility header.\n `ScrapeOpts.cookies`, `ScrapeOpts.headers` and the exported `ScrapeCookie` type are removed\n from the SDK surface, so a call that still passes them no longer compiles.\n\n ```ts\n // before — compiled, and the values were forwarded to the target site\n await client.scrape.create({ url, cookies: [{ name: 'session', value: 'abc' }] });\n // after — does not compile; the same body over raw HTTP is a 400 validation_error\n await client.scrape.create({ url });\n ```\n\n ByteKit continues to manage its own cookie jar and request headers internally; what was removed\n is the caller's ability to inject or override them.\n\n#### Changed\n\n- **The generated types now declare the `503` response of `GET`/`POST /v1/fetch`** (#3372).\n `/v1/fetch` answers `503` on two conditions and both carry the ordinary `Error` envelope, so\n a typed consumer reading `operations['getFetch']['responses']` / `['postFetch']` can handle it\n instead of meeting an undeclared status at runtime. Read `error.code` to tell the two apart,\n because they disagree about `error.http_status`:\n - `upstream_error` — the target returned HTTP `502`, relayed at `503` because Cloudflare\n replaces a clean origin 502 with its own error page. `error.http_status` stays `502`, the\n **true upstream status**, and is the only surviving record of what the target answered.\n - `internal_error` (`Fetch service unavailable.`) — the fetch service was unreachable. There\n is no upstream, so `error.http_status` reports `503`, matching what was served.\n\n No runtime behaviour changes, and every other documented `/v1/fetch` status is unaffected.\n\n### [0.8.0] - 2026-08-19\n\n#### Removed\n\n- **BREAKING: `billing_multiplier` and `billed_bytes` are gone from the scrape success\n envelope** (#3143). Read `billing` instead — a `BillingNode` that names every factor\n applied to the charge, the multiplier they compose to, and the resulting billed bytes:\n\n ```ts\n // before\n const spend = res.billed_bytes; // flat, base-endpoint only\n // after\n const spend = res.billing?.billed_bytes;\n const why = res.billing?.factors; // [{ name: 'endpoint', value: 1.5, reason: 'scrape_md' }, …]\n ```\n\n This is a correction, not a rename: the two surfaces reported **different numbers for the\n same charge**. The flat pair carried the BASE-endpoint composition, so a markdown cache hit\n read `0.5` / `400` while the real charge — and the `X-Billing-Multiplier` header — was\n `0.75` / `600`; an html-only miss read the per-format credits estimate `1.5` / `150` against\n an endpoint factor of `1.0` / `100`. The flat pair also never carried the `clean_markdown`\n ×3 surcharge, so on a successful clean it under-reported the amount billed by two thirds.\n `billing.multiplier` composes every applied factor behind exactly one rounding, so it is the\n number that predicts your invoice.\n\n `billing` is optional and is **absent** on resources that completed before the billing node\n existed. A pre-node row omits the field rather than reporting a zero node, because a zero\n node would assert that a real past charge was zero. Test the node for presence\n (`res.billing !== undefined`, or equivalently a plain truthiness check — `billing` is an\n object or `undefined`, and an object is always truthy, so the two are the same test here).\n The hazard is a condition that reaches _into_ the node: `if (res.billing?.billed_bytes)`\n silently skips a genuine zero-byte charge, because `0` is falsy. Check that the node is\n present, then read `billed_bytes` from it.\n\n ```ts\n // wrong — a real 0-byte charge is falsy and disappears\n if (res.billing?.billed_bytes) record(res.billing.billed_bytes);\n // right — presence first, value second\n if (res.billing) record(res.billing.billed_bytes); // 0 is a charge, not an absence\n ```\n\n Two endpoints deliberately carry no node: `/v1/search` is billed per credit and reports\n `credits_used`, and a single `/v1/fetch` reports its charge through response headers only.\n The `/v1/logs` row field named `billing_multiplier` is a **different field** and is not the\n envelope field this release removed. It carries the BASE settled `credits_charged` factor,\n not the composed real-endpoint value the `X-Billing-Multiplier` header reports — a markdown\n cache hit reads `0.5` on the logs row and `0.75` on the header.\n\n#### Changed\n\n- Generate\n\n---\n[Truncated to the 16384-byte per-page limit — this page is 180123 bytes in full. The text cut here is not searchable either: search_docs matches only the part kept above. Read all of it at https://bytekit.com/docs/changelog]"
280
+ "body": "# Changelog\n\nRelease history for the ByteKit SDKs, CLI, and MCP server\n\nEach section below is the `CHANGELOG.md` kept alongside that client’s source in the ByteKit\nrepository. Entries record what a release changed, including names and options it retired.\n\n## @hunt-labs/bytekit-sdk\n\nTypeScript SDK, published on npm.\n\n### [Unreleased]\n\n### [0.11.0] - 2026-09-14\n\n#### Added\n\n- **`solve_challenge` on `scrape.create` (#4447).** `ScrapeOpts` now carries\n `solve_challenge?: boolean`, and the generated `ScrapeRequest` schema type carries the field\n with its server default `false`. When `true`,\n the scrape attempts to clear a Cloudflare challenge; success is not guaranteed. It is billed\n as a normal browser render. A scrape that omits the option sends no `solve_challenge` key,\n so existing calls are unchanged on the wire.\n- **`credits_scrape` on the usage response types (#4452).** The generated `GET /v1/usage`\n response type and each `GET /v1/usage/daily` data item now carry `credits_scrape: number`:\n credits drawn under the scrape usage source, such as `/v1/schema` extractions. The gateway\n always charged this bucket but never returned it, so the published per-source credit fields\n could not add up to `credits_used`.\n\n#### Changed\n\n- **Internal `GET /v1/bulk` is cursor-paginated and its 100-job cap is gone (#4508).** The\n generated `listBulk` types record a changed response shape: the operation used to return a\n bare array of at most the 100 newest jobs, and now returns the same page envelope\n `GET /v1/monitors` does, `{ data, next_cursor, has_more }`, plus `limit` and `cursor` query\n parameters (`limit` is 1 to 100, default 25). A `status` filter and a `cursor` combine in\n one request: `status` narrows the set and the cursor addresses a position inside it. The\n operation's summary also no longer says \"in-flight\", which was wrong — it has always\n returned jobs of every status, `cancelled` included. This is a breaking change to the wire\n shape of an `x-sdk-scope: internal` operation; no SDK method calls it, so no published\n method signature moves.\n- **`GET /v1/logs` `billing_multiplier` is the bandwidth factor, not a credit count (#4469).**\n The generated logs-row type records the changed meaning of a public field: the value is now\n `billable_bytes` / `raw_bytes` rounded to 2 decimal places — the factor the request settled\n at, carrying the endpoint, cache-hit and clean-markdown factors, and the flat 1.5 Phase-1\n factor on screenshots and recordings. It used to be the row's persisted `credits_charged`,\n an account credit count charged per capture option, so two screenshots billed at the same\n 1.5 factor reported `2` and `1`. The 2 decimal places are load-bearing rather than\n cosmetic: `billable_bytes` is itself rounded, so an odd byte basis would otherwise surface\n as `1.500001943158721` instead of `1.5` on roughly half of all such rows. Every factor the\n field can report is a multiple of 0.25, so 2 places is exact for any basis of 100 bytes or\n more, and `raw_bytes` × `billing_multiplier` rounded to the nearest byte still reproduces\n `billable_bytes`. The `billable_bytes` doc comment therefore no longer says it is NOT\n `raw_bytes` × `billing_multiplier`. The field is also null on more rows than before: a\n search or webhook row has no byte basis, a capture whose Phase 1 was skipped has a zero one,\n and a capture old enough to predate the Phase-1 basis being recorded has none at all. One\n residual is documented rather than fixed: a markdown `/v1/fetch` row completed before the\n billing decomposition was recorded reports 1.0 where settlement charged 1.5, because nothing\n on such a row distinguishes it. The type shapes are unchanged (`number | null`), and no SDK\n method calls this endpoint.\n- **An all-null `/v1/schema` extraction your schema allows is validated again (#4490).** The\n generated `/v1/schema` 200 response type records the exception to #4455's rule: an output\n whose every leaf is `null` still arrives `validated: true` with the object intact, and is\n charged, when the schema you sent declares `\"null\"` in the `type` union of every leaf the\n output returned as `null`. Only that form counts — `nullable: true`, an `enum` containing\n `null` and `const: null` do not, and a response that is itself `null` rather than an object is\n never accepted however the root is declared. Everything else stays the #4455 miss. The `data`\n doc comment now also states the other half: a `validated: true` response always carries an\n object, never `null`. The type shapes are unchanged; only their doc comments moved.\n- **An all-null `/v1/schema` extraction is reported, not validated (#4455).** The generated\n `/v1/schema` 200 response type documents a new additive warning code, `empty_extraction`: a\n schema-valid output whose every leaf is `null` now arrives with `data: null` and\n `validated: false`, and is not charged the per-request credits. Previously it arrived as\n `validated: true` with the all-null object and no warning. The `data` and `validated` doc\n comments now also say that every `validated: false` response carries `data: null`; the old\n comment claimed exhausted retries returned the last raw output, which the API never did. The\n type shapes are unchanged; only their doc comments moved.\n- **An inline `POST /v1/scrape` failure is documented with a persisted `id` (#4454).** The\n gateway now records a sync scrape that ends `upstream_error` or `blocked` as a failed scrape\n job, so its `failed` envelope carries that job's `sc_` id instead of `null`, `scrape.get(id)`\n returns the same envelope, and the request appears in the dashboard Logs. The generated\n `createScrape` 200 and `ScrapeErrorEnvelope` doc comments and the `scrape.create` doc comment\n no longer say `id: null`. The type shapes are unchanged (`id` stays `string | null`), and\n `scrape.create` still throws `ByteKitError` on that envelope exactly as before.\n- **Internal `GET /v1/logs` types list search and webhook rows (#4460).** Both `endpoint` enums\n add `search` and `webhook`; a row's `source` is now `string | null`. No SDK method calls it.\n\n### [0.10.0] - 2026-09-11\n\n#### Changed\n\n- **A terminal `POST /v1/scrape` failure now throws instead of resolving (#1870).** The\n gateway used to report an upstream fetch failure — unreachable host, refused connection,\n or bot protection that defeated every proxy tier — as HTTP 503; it now answers **HTTP 200**\n with the canonical `failed` envelope (`id: null`), because a definitive upstream outcome is\n a result, not a transport error. `!response.ok` was this SDK's only failure seam, so without\n this change that body would resolve like a success and silence every caller's `catch`.\n `scrape.create` (and any `request` / `requestWithResponse` call to `POST /v1/scrape`) now\n raises `ByteKitError` carrying the envelope's `code` and `message`, the **actual** status\n `200`, the response headers, and `error.details` when one is supplied. A legacy 503 from a\n not-yet-upgraded gateway still throws through the unchanged non-2xx decoder, so the SDK\n works against both. **Upgrade note:** if you inspected `result.status === 'failed'` after\n `scrape.create`, move that handling into a `catch`.\n- Everything else is untouched: `scrape.get(id)`, bulk item results, and every other endpoint\n still deliver `failed` as data; `requestRaw` (`/v1/fetch`) never parses JSON and is\n unaffected; 204 and empty-body handling are unchanged. `request()` now delegates to\n `requestWithResponse()` so the guard has a single application site — identical in every\n observable respect but the return value, as both were already documented.\n\n### [0.9.4] - 2026-09-06 [NEVER PUBLISHED]\n\n**This version was cut but NEVER PUBLISHED — npm `latest` goes from 0.9.3 straight to 0.10.0.**\nPublication is triggered by CI on `main` from the version the manifest declares, and 0.10.0\n(#1870) superseded 0.9.4 in the tree before any release reached `main`. Everything below\nreaches consumers in the **0.10.0** artifact, which contains all of it; nothing is installable\nat 0.9.4: `npm i @hunt-labs/bytekit-sdk@0.9.4` fails.\n\n#### Added\n\n- Bulk fetch, scrape, and mixed-result reads now accept optional cursor, limit, and status\n page parameters while preserving the existing `(id, requestOptions?)` call shape (#3717).\n Generated response types publish stable item identities, page cursors and completeness,\n whole-job counters, exact mixed artifact keys, artifact warnings, bounded webhook recovery\n metadata, and the `artifact_unavailable` error contract.\n\n#### Fixed\n\n- Corrected the artifact-URL fallback documentation on `GET /v1/bulk/{id}/screenshots`\n (`image_url`, `content_url`, `markdown_url`) and `GET /v1/logs` (`artifact_url`) (#3717).\n Those fields were documented as null-plus-`artifact_unavailable` when no signature can be\n minted; the servers have always returned the row's stored value unchanged instead — `null`\n while nothing is stored, and otherwise the private unsigned storage URL, which answers `401`\n — and raise no warning. `GET /v1/fetch/bulk/{id}` does null the field and report\n `artifact_unavailable`, and its documentation is unchanged. No server behaviour changed and\n no type moved; the descriptions now match what the endpoints return.\n\n#### Changed\n\n- Regenerated `src/generated/api.d.ts` against the corrected `topup_balance_bytes` description\n on `GET /v1/usage` (#4251). The description read \"Remaining purchased top-up bytes\", which\n contradicted its own \"Equal to `topup_bytes`\" clause: the value covers purchased top-up lots\n and the one-time starter grant, which is what the endpoint has always returned. The clause\n recording that the figure is already net of consumed overage, and the \"Present only in\n dual/bytes billing mode\" clause, are both unchanged and still true. Types are unchanged and\n no server value changed; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the clarified `cache_age_s` description on\n `ScrapeSuccessEnvelope` (#4237). The description now records that `GET /v1/scrape/{id}`\n reports `cache: hit` without `cache_age_s`: the age is a property of the replay that happened\n at completion time, is not persisted on the row, and cannot be derived honestly afterwards.\n The one-directional \"Present only on `cache: hit`\" clause is unchanged and still true. Types\n are unchanged; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the completed `cache` presence list on\n `ScrapeSuccessEnvelope` (#4203). The field's description now names `GET /v1/scrape/{id}` as a\n third delivery path, alongside the synchronous response and webhook delivery: a polled scrape\n now reports the cache disposition its row recorded, and omits the field — rather than\n defaulting it to `miss` — for a row that recorded none. Types are unchanged; only the\n documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the corrected `PUT /v1/billing/auto-topup`\n request body (#3984). `monthly_cap_cents` is now typed `number | null`: an explicit `null` is\n the wire representation of \"no monthly cap\", and it is what the endpoint has always accepted —\n the request schema simply never documented it, while the 200 response schema already did.\n Omitting the key while `enabled` is `true` is still rejected with `422`, so send `null`\n rather than dropping the field. No server behaviour changes; the type widens to match what\n the API already accepted.\n- Regenerated `src/generated/api.d.ts` against the corrected monitor `scrape_options`\n documentation (#4024). The description no longer lists `headers` among the accepted\n fields — `POST /v1/monitors` never honoured a caller-supplied `headers` option and now\n rejects it with the same 400 every other capture endpoint returns for the field. Types are\n unchanged; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the completed `X-Scrape-Proxy-Tier-Label`\n omission list (#4030). The header's description now names a third case in which no tier is\n reported: a response replayed from stored bytes after this request's own cache lookup missed,\n which arrives as `X-Scrape-Cache: miss` and likewise ran no proxy tier. The two cases already\n documented — a cache hit, and responses the fast path did not serve — are unchanged. Types are\n unchanged; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the qualified `X-Scrape-Proxy-Tier-Label`\n omission list (#4132). The third case that list records — a response replayed from stored bytes\n after this request's own cache lookup missed — is not reachable through this API: every caller\n of the internal fetch path closes the handler branch that produces it, and the branch survives\n only as a deploy-skew safeguard. The description now says so rather than presenting the case as\n ordinary behaviour. The two reachable cases — a cache hit, and responses the fast path did not\n serve — are unchanged. Types are unchanged; only the documentation on them moved.\n\n### [0.9.3] - 2026-09-04\n\n#### Changed\n\n- Regenerated `src/generated/api.d.ts` against the corrected queued-scrape `status_url`\n documentation (#3925). `status_url` is a root-relative path, never an absolute URI: join it\n onto the API base URL you called (`https://api.bytekit.com`, no trailing slash) to get the URL\n to poll. The spec had declared it `format: uri` with an absolute example, which no server has\n ever emitted; the emitted value is unchanged, so no client behaviour moves.\n- Regenerated `src/generated/api.d.ts` against the documented proxy-tier response headers\n (#3926). `X-Scrape-Proxy-Tier-Label` now documents that it reports the tier that ACTUALLY\n served a scrape — after any escalation, never the tier first attempted — that it is\n diagnostic only, and that it is omitted on a cache hit, which replayed stored bytes and ran\n no tier. The deprecated numeric `X-Scrape-Proxy-Tier` documents the legacy `1` datacenter /\n `2` residential / `3` mobile vocabulary and its omission for the lean-browser tier. Types are\n unchanged; only the documentation on them moved.\n\n### [0.9.2] - 2026-09-03\n\n#### Changed\n\n- **Breaking (API):** the scrape `formats` vocabulary is now `raw | markdown | links | images`\n (#3775). The unprocessed-source format is called `raw` — it has returned JSON, XML and plain\n text alongside HTML since #1853, so the old raw-HTML name misdescribed it — and the\n cleaned-article-HTML format is gone. The server accepts no alias for either retired value, so\n a request naming one now comes back `422` with the new set in the message. Update `formats`\n and read the content back from `formats.raw`:\n\n ```ts\n const result = await client.scrape.create({ url, formats: ['raw', 'markdown'] });\n console.log(result.formats.raw);\n ```\n\n- Regenerated `src/generated/api.d.ts` against the documented `402` contract (#3784). Every\n quota-enforced operation now declares `402` through one shared `PaymentRequired` response, and\n the `X-Quota-*` headers are referenced by the operations that actually emit them. Types only —\n no runtime behavior changed.\n\n- The generated `events` field description on the scrape request type now documents the\n widened server default (`queued`, `completed`, `failed`) and that a caller may send an\n explicit subset to receive fewer deliveries (#3777). Types/docs only — this regeneration\n followed a server-side default change; the SDK carried no logic tied to the old default.\n\n### [0.9.1] - 2026-08-25\n\n#### Fixed\n\n- The generated `paths` type for the `200` of `GET /v1/scrape/bulk/{id}` now declares `items`\n (#3632). The route builds one body and varies only the status code, so the terminal `200`\n has always carried the per-URL scrape envelopes — but only the `202` documented them, so\n `scrape.bulk.get()` typed the results away at exactly the poll that has them. Types only:\n the field was already on the wire, and server behavior is unchanged.\n\n- The generated `p\n\n---\n[Truncated to the 16384-byte per-page limit — this page is 192373 bytes in full. The text cut here is not searchable either: search_docs matches only the part kept above. Read all of it at https://bytekit.com/docs/changelog]"
281
281
  },
282
282
  "cli": {
283
283
  "title": "Install & Authenticate",
@@ -307,7 +307,7 @@
307
307
  "cli/scrape": {
308
308
  "title": "Scrape",
309
309
  "section": "CLI Reference",
310
- "body": "# Scrape\n\nScrape URL content\n\nScrape URL content\n\n### scrape › bulk\n\nBulk scrape operations\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n#### scrape › bulk › create\n\nCreate a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `--file <path>` | Path to a newline-delimited file. Each line is a plain URL, or a JSON object carrying \"url\" plus per-item config. A line whose only key is \"url\" behaves exactly as before (sent as a bare URL string); any line with additional keys switches the payload to the per-item shape. |\n| `--webhook-url <url>` | HTTPS webhook URL notified when the job completes |\n| `--webhook-secret <secret>` | HMAC secret used to sign the completion webhook (omitted → unsigned) |\n| `--defaults <json>` | Defaults applied to every entry, as a JSON object (omitted → none). Unknown keys are rejected by /v1/bulk (422) and ignored by scrape bulk / fetch bulk; fetch bulk additionally rejects browser-only keys (wait_until, wait_for_selector, delay_ms) with a 400. `cookies` and `headers` are no longer accepted by any capture endpoint and 400 (#3242). |\n| `--metadata <json>` | Arbitrary metadata echoed on the job envelope, as a JSON object, e.g. '\\{\"run\":\"7\"\\}' (omitted → none) |\n| `--custom <json>` | User payload echoed on every scrape entry, as a JSON object, e.g. '\\{\"job\":\"1\"\\}' (omitted → none; a per-entry value in --file wins) |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk create --file <path> --webhook-url <url> --webhook-secret <secret> --defaults <json> --metadata <json> --custom <json>\n```\n\n#### scrape › bulk › get\n\nGet a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `--cursor <cursor>` | Continue from a cursor returned by the preceding page |\n| `--limit <n>` | Maximum items to return (1-500) |\n| `--status <status>` | Filter items by status: pending, processing, completed, failed, cancelled |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk get <id> --cursor <cursor> --limit <n> --status <status>\n```\n\n### scrape › create\n\nCreate a scrape job\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to scrape |\n| `--format <format>` | Output format; repeat or comma-separate for multiple (e.g. --format raw --format markdown, or --format raw,markdown). Sent as the formats array; omitted → server default. |\n| `--country <cc>` | Two-letter country code to route the request through (e.g. us, de) |\n| `--timeout-ms <n>` | Per-request timeout in milliseconds |\n| `--markdown-mode <mode>` | Markdown extraction mode: article, raw, llm |\n| `--markdown-query <q>` | BM25 query string for relevance-ranked markdown filtering (omitted → disabled) |\n| `--cache-ttl <ttl>` | Cache freshness: 0, Nh (hours), or Nd (days), e.g. 48h, 2d, 0 (omitted → server default) |\n| `--delay-ms <n>` | Post-load delay in milliseconds before capture |\n| `--events <csv>` | Webhook events (comma-separated): queued, completed, failed (omitted → server default) |\n| `--token-encoding <enc>` | Tokenizer for --token-budget: cl100k_base, o200k_base (omitted → server default) |\n| `--custom <json>` | User payload echoed on the envelope as a JSON object, e.g. '\\{\"job\":\"1\"\\}' (omitted → none) |\n| `--remove-base64-images` | Strip base64 data: images before conversion (server default) |\n| `--no-remove-base64-images` | Preserve base64 data: images in the pipeline output |\n| `--markdown-links <mode>` | Link rendering: inline, references, none, text |\n| `--markdown-images <mode>` | Image retention: inline, references, none, text |\n| `--with-links-summary` | Append a Links footer to the markdown output |\n| `--with-images-summary` | Append an Images footer to the markdown output |\n| `--markdown-compact` | Collapse excessive whitespace in the markdown output |\n| `--markdown-filter-images` | Filter low-signal images from the markdown output |\n| `--markdown-include-media` | Return rich link/image objects and a tables array |\n| `--markdown-include-warnings` | Include markdown-pipeline and tag-filter warnings |\n| `--markdown-include-stats` | Include a top-level stats object (chars, tokens, blocks) |\n| `--async` | Queue the scrape and return a job envelope immediately (no wait) |\n| `--webhook-url <url>` | HTTPS webhook URL notified when an async scrape completes |\n| `--token-budget <n>` | Maximum tokens of markdown to return |\n| `--clean-markdown` | Post-process markdown with the LLM cleaner (billed 3x) |\n| `--include-tags <csv>` | Comma-separated HTML tags to keep (e.g. article,main) |\n| `--exclude-tags <csv>` | Comma-separated HTML tags to drop (e.g. nav,footer) |\n| `--mobile` | Render with a mobile viewport/user-agent |\n| `--raw` | Print the requested format body raw, with no JSON wrapper |\n| `-o, --output <file>` | Write the output to the given file path (implies --raw unless --json is set) |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape create --url <url> --format <format> --country <cc> --timeout-ms <n> --markdown-mode <mode> --markdown-query <q> --cache-ttl <ttl> --delay-ms <n> --events <csv> --token-encoding <enc> --custom <json> --remove-base64-images --no-remove-base64-images --markdown-links <mode> --markdown-images <mode> --with-links-summary --with-images-summary --markdown-compact --markdown-filter-images --markdown-include-media --markdown-include-warnings --markdown-include-stats --async --webhook-url <url> --token-budget <n> --clean-markdown --include-tags <csv> --exclude-tags <csv> --mobile --raw\n```\n\n### scrape › get\n\nGet a scrape job by ID (use --raw/-o/--format to retrieve a completed body)\n\n| Option | Description |\n| --- | --- |\n| `--raw` | Print the requested format body raw, with no JSON wrapper |\n| `-o, --output <file>` | Write the output to the given file path (implies --raw unless --json is set) |\n| `--format <format>` | Which persisted format to emit — only takes effect with --raw/-o; ignored otherwise |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape get <id> --raw --format <format>\n```"
310
+ "body": "# Scrape\n\nScrape URL content\n\nScrape URL content\n\n### scrape › bulk\n\nBulk scrape operations\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n#### scrape › bulk › create\n\nCreate a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `--file <path>` | Path to a newline-delimited file. Each line is a plain URL, or a JSON object carrying \"url\" plus per-item config. A line whose only key is \"url\" behaves exactly as before (sent as a bare URL string); any line with additional keys switches the payload to the per-item shape. |\n| `--webhook-url <url>` | HTTPS webhook URL notified when the job completes |\n| `--webhook-secret <secret>` | HMAC secret used to sign the completion webhook (omitted → unsigned) |\n| `--defaults <json>` | Defaults applied to every entry, as a JSON object (omitted → none). Unknown keys are rejected by /v1/bulk (422) and ignored by scrape bulk / fetch bulk; fetch bulk additionally rejects browser-only keys (wait_until, wait_for_selector, delay_ms) with a 400. `cookies` and `headers` are no longer accepted by any capture endpoint and 400 (#3242). |\n| `--metadata <json>` | Arbitrary metadata echoed on the job envelope, as a JSON object, e.g. '\\{\"run\":\"7\"\\}' (omitted → none) |\n| `--custom <json>` | User payload echoed on every scrape entry, as a JSON object, e.g. '\\{\"job\":\"1\"\\}' (omitted → none; a per-entry value in --file wins) |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk create --file <path> --webhook-url <url> --webhook-secret <secret> --defaults <json> --metadata <json> --custom <json>\n```\n\n#### scrape › bulk › get\n\nGet a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `--cursor <cursor>` | Continue from a cursor returned by the preceding page |\n| `--limit <n>` | Maximum items to return (1-500) |\n| `--status <status>` | Filter items by status: pending, processing, completed, failed, cancelled |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk get <id> --cursor <cursor> --limit <n> --status <status>\n```\n\n### scrape › create\n\nCreate a scrape job\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to scrape |\n| `--format <format>` | Output format; repeat or comma-separate for multiple (e.g. --format raw --format markdown, or --format raw,markdown). Sent as the formats array; omitted → server default. |\n| `--country <cc>` | Two-letter country code to route the request through (e.g. us, de) |\n| `--timeout-ms <n>` | Per-request timeout in milliseconds |\n| `--markdown-mode <mode>` | Markdown extraction mode: article, raw, llm |\n| `--markdown-query <q>` | BM25 query string for relevance-ranked markdown filtering (omitted → disabled) |\n| `--cache-ttl <ttl>` | Cache freshness: 0, Nh (hours), or Nd (days), e.g. 48h, 2d, 0 (omitted → server default) |\n| `--delay-ms <n>` | Post-load delay in milliseconds before capture |\n| `--events <csv>` | Webhook events (comma-separated): queued, completed, failed (omitted → server default) |\n| `--token-encoding <enc>` | Tokenizer for --token-budget: cl100k_base, o200k_base (omitted → server default) |\n| `--custom <json>` | User payload echoed on the envelope as a JSON object, e.g. '\\{\"job\":\"1\"\\}' (omitted → none) |\n| `--remove-base64-images` | Strip base64 data: images before conversion (server default) |\n| `--no-remove-base64-images` | Preserve base64 data: images in the pipeline output |\n| `--markdown-links <mode>` | Link rendering: inline, references, none, text |\n| `--markdown-images <mode>` | Image retention: inline, references, none, text |\n| `--with-links-summary` | Append a Links footer to the markdown output |\n| `--with-images-summary` | Append an Images footer to the markdown output |\n| `--markdown-compact` | Collapse excessive whitespace in the markdown output |\n| `--markdown-filter-images` | Filter low-signal images from the markdown output |\n| `--markdown-include-media` | Return rich link/image objects and a tables array |\n| `--markdown-include-warnings` | Include markdown-pipeline and tag-filter warnings |\n| `--markdown-include-stats` | Include a top-level stats object (chars, tokens, blocks) |\n| `--async` | Queue the scrape and return a job envelope immediately (no wait) |\n| `--webhook-url <url>` | HTTPS webhook URL notified when an async scrape completes |\n| `--token-budget <n>` | Maximum tokens of markdown to return |\n| `--clean-markdown` | Post-process markdown with the LLM cleaner (billed 3x) |\n| `--include-tags <csv>` | Comma-separated HTML tags to keep (e.g. article,main) |\n| `--exclude-tags <csv>` | Comma-separated HTML tags to drop (e.g. nav,footer) |\n| `--mobile` | Render with a mobile viewport/user-agent |\n| `--solve-challenge` | Attempt to clear a Cloudflare challenge; success is not guaranteed. Billed as a normal browser render. |\n| `--raw` | Print the requested format body raw, with no JSON wrapper |\n| `-o, --output <file>` | Write the output to the given file path (implies --raw unless --json is set) |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape create --url <url> --format <format> --country <cc> --timeout-ms <n> --markdown-mode <mode> --markdown-query <q> --cache-ttl <ttl> --delay-ms <n> --events <csv> --token-encoding <enc> --custom <json> --remove-base64-images --no-remove-base64-images --markdown-links <mode> --markdown-images <mode> --with-links-summary --with-images-summary --markdown-compact --markdown-filter-images --markdown-include-media --markdown-include-warnings --markdown-include-stats --async --webhook-url <url> --token-budget <n> --clean-markdown --include-tags <csv> --exclude-tags <csv> --mobile --solve-challenge --raw\n```\n\n### scrape › get\n\nGet a scrape job by ID (use --raw/-o/--format to retrieve a completed body)\n\n| Option | Description |\n| --- | --- |\n| `--raw` | Print the requested format body raw, with no JSON wrapper |\n| `-o, --output <file>` | Write the output to the given file path (implies --raw unless --json is set) |\n| `--format <format>` | Which persisted format to emit — only takes effect with --raw/-o; ignored otherwise |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape get <id> --raw --format <format>\n```"
311
311
  },
312
312
  "cli/screenshots": {
313
313
  "title": "Screenshots",
@@ -397,7 +397,7 @@
397
397
  "mcp": {
398
398
  "title": "MCP Server",
399
399
  "section": "General",
400
- "body": "# MCP Server\n\nCall ByteKit web capture as a native tool from Claude, Cursor, and any MCP-compatible agent — hosted over HTTP or run locally over stdio.\n\nThe ByteKit **MCP server** exposes scraping, search, screenshots, and account\nlookups as [Model Context Protocol](https://modelcontextprotocol.io) tools. Your\nagent calls `scrape_url` or `screenshot_url` the same way it calls any other\ntool — no wrapper to write, no headless browser to manage.\n\nThere are two ways to connect: a **hosted HTTP endpoint** (nothing to install)\nand a **local stdio server** (`npx @hunt-labs/bytekit-mcp`).\n\n## Authentication\n\nBoth paths authenticate with a ByteKit API key. Sign up at\n[app.bytekit.com](https://app.bytekit.com) and create a key (prefixed\n`sk_live_`). The local server reads it from the `BYTEKIT_API_KEY` environment\nvariable (or the `--api-key` flag); the hosted endpoint takes it as a bearer\ntoken.\n\n## Option 1 — Hosted HTTP (no install)\n\nPoint any MCP client that speaks the Streamable HTTP transport at:\n\n```\nhttps://api.bytekit.com/mcp\n```\n\nSend your API key as a bearer token. Example client config for a host that\nspeaks Streamable HTTP directly (Cursor and most hosts accept this shape):\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"url\": \"https://api.bytekit.com/mcp\",\n \"headers\": {\n \"Authorization\": \"Bearer sk_live_xxx\"\n }\n }\n }\n}\n```\n\n**Paste your real key in place of `sk_live_xxx`.** A JSON config file is not a\nshell: most hosts read these values verbatim and do not substitute environment\nvariables inside `headers`, so writing `Bearer $BYTEKIT_API_KEY` here sends that\ntext to the API as the token, verbatim, and the API answers `401`.\n\n**Claude Desktop does not accept this shape.** `claude_desktop_config.json`\nonly launches local **stdio** subprocesses (`command`/`args`/`env`) — it has\nno native `url`-based remote-server entry, so pasting the config above into\nit will not connect. To reach the hosted endpoint from Claude Desktop, either:\n\n- add ByteKit as a [Connector](https://claude.com/connectors) (Settings →\n Connectors → Add custom connector), or\n- bridge it locally with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote):\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"command\": \"npx\",\n \"args\": [\n \"-y\",\n \"mcp-remote\",\n \"https://api.bytekit.com/mcp\",\n \"--header\",\n \"Authorization:${AUTH_HEADER}\"\n ],\n \"env\": {\n \"AUTH_HEADER\": \"Bearer sk_live_xxx\"\n }\n }\n }\n}\n```\n\nTwo details in that snippet are load-bearing, and both are documented by\n`mcp-remote` itself:\n\n- **`${AUTH_HEADER}`, not `$AUTH_HEADER`.** Claude Desktop launches\n `command`/`args` directly, with no shell in between, so it does not expand\n `$VAR` anywhere in the config. `mcp-remote` does its own substitution on\n `--header` values, but only of the braced `${VAR}` form, reading it from the\n process environment the `env` block supplies. A bare `$BYTEKIT_API_KEY` is\n passed through untouched and authenticates as that literal string — a\n guaranteed `401`.\n- **No space after the colon in `Authorization:${AUTH_HEADER}`.** The header\n value carries the space (`Bearer sk_live_xxx`) instead. `mcp-remote`'s README\n documents this as the workaround for a Cursor / Claude Desktop (Windows) bug\n where spaces inside `args` are not escaped when it invokes `npx`, mangling the\n value: `\"Authorization:${AUTH_HEADER}\" // note no spaces around ':'` with\n `\"AUTH_HEADER\": \"Bearer <auth-token>\" // spaces OK in env vars`.\n\nOr skip the hosted endpoint entirely and run the **local stdio server**\n(Option 2 below), which Claude Desktop supports natively.\n\n## Option 2 — Local stdio (`npx`)\n\nRun the server as a local subprocess over stdio. Nothing to install globally —\n`npx` fetches it on demand:\n\n```bash\nnpx @hunt-labs/bytekit-mcp --api-key $BYTEKIT_API_KEY\n```\n\nOr set the key in your environment and omit the flag:\n\n```bash\nexport BYTEKIT_API_KEY=sk_live_xxx\nnpx @hunt-labs/bytekit-mcp\n```\n\nClient config for a stdio server:\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@hunt-labs/bytekit-mcp\"],\n \"env\": {\n \"BYTEKIT_API_KEY\": \"sk_live_xxx\"\n }\n }\n }\n}\n```\n\n### API-key resolution order\n\nThe local server resolves the key in this order:\n\n1. `--api-key <key>` flag\n2. `BYTEKIT_API_KEY` environment variable\n\n## Tool inventory\n\n| Tool | What it does |\n| --- | --- |\n| `scrape_url` | Fetch a URL and return HTML, clean markdown, links, or images. |\n| `web_search` | Run a web search and return ranked organic results. |\n| `screenshot_url` | Capture a screenshot of a page (desktop/mobile, PNG/JPEG). |\n| `get_result` | Fetch a previously created screenshot by id. |\n| `get_account` | Return account details, plan, and current usage/quota. |\n| `list_docs` | List every page in the bundled ByteKit documentation. |\n| `search_docs` | Search the bundled documentation. |\n| `get_doc` | Fetch the full markdown of one documentation page. |\n\nThe server also exposes **resources** (`bytekit://account`,\n`bytekit://screenshot/{id}`) and **prompts** (`summarize_webpage`,\n`extract_structured_data`, `research_topic`) that MCP hosts can surface directly.\n\n## Limits\n\nThe hosted `POST /mcp` endpoint caps request bodies at **1 MB**. MCP tool\narguments are small (a URL plus a few options), so this comfortably covers\nevery tool and prompt in the matrix above — including `research_topic`, the\nlargest legitimate call, which carries a list of URLs. An oversized request\ngets a `413` with a JSON-RPC-shaped error body rather than a dropped\nconnection.\n\nEvery route in the table below carries its own body-size limit, sized to\nthat route's shape rather than reused from `/mcp` (a bulk endpoint's\nrealistic payload is far larger than an MCP tool call):\n\n| Endpoint | Limit | Error |\n|---|---|---|\n| `POST /v1/scrape`, `/v1/search`, `/v1/scrape/bulk`, `/v1/schema` | 512 KB | `400 request_too_large` |\n| `POST /v1/fetch` | 512 KB | `400 request_too_large` |\n| `POST /v1/screenshots` | 512 KB | `400 request_too_large` |\n| `POST /v1/monitors` | 512 KB | `400 request_too_large` |\n| `POST /v1/sitemap` | 512 KB | `400 request_too_large` |\n| `POST /v1/bulk` | 4 MB pre-auth (chunked) / 32 MB fail-safe (declared length) / per-plan up to 28.7 MB | `400 request_too_large` |\n| `POST /v1/fetch/bulk` | 2 MB pre-auth (chunked) / 20 MB fail-safe (declared length) / per-plan up to 16.8 MB | `400 request_too_large` |\n| `POST /v1/webhook-deliveries/{id}/retry` | 64 KB | `400 request_too_large` |\n| `POST /mcp` | 1 MB | `413` (JSON-RPC error) |\n\nThe two bulk endpoints are guarded in a two-tier shape, not by a single\nceiling. A streamed body with no `Content-Length` header is capped at the\nsmall pre-auth limit (4 MB / 2 MB) before your API key is checked; a body\nthat declares `Content-Length` is instead bounded there by a larger fail-safe\n(32 MB / 20 MB) rather than the real limit, since that branch reads nothing\nuntil your key is verified. Once your key is verified, a second check\nre-gates the body against your account's own `max_bulk_size`, the number of\nURLs or per-item configs your plan allows in one call. A custom plan with a\n`max_bulk_size` of 50,000 reaches 28.7 MB / 16.8 MB at that second check. A\nstandard-plan account's effective ceiling is exactly the pre-auth limit;\neither tier's overrun returns `400 request_too_large`.\n\n## Next steps\n\n- [Quickstart](https://bytekit.com/docs/quickstart) — make your first ByteKit API call.\n- [Authentication](https://bytekit.com/docs/guides/authentication) — key formats and management."
400
+ "body": "# MCP Server\n\nCall ByteKit web capture as a native tool from Claude, Cursor, and any MCP-compatible agent — hosted over HTTP or run locally over stdio.\n\nThe ByteKit **MCP server** exposes scraping, search, screenshots, and account\nlookups as [Model Context Protocol](https://modelcontextprotocol.io) tools. Your\nagent calls `scrape_url` or `screenshot_url` the same way it calls any other\ntool — no wrapper to write, no headless browser to manage.\n\nThere are two ways to connect: a **hosted HTTP endpoint** (nothing to install)\nand a **local stdio server** (`npx @hunt-labs/bytekit-mcp`).\n\n## Authentication\n\nBoth paths authenticate with a ByteKit API key. Sign up at\n[app.bytekit.com](https://app.bytekit.com) and create a key (prefixed\n`sk_live_`). The local server reads it from the `BYTEKIT_API_KEY` environment\nvariable (or the `--api-key` flag); the hosted endpoint takes it as a bearer\ntoken.\n\n## Option 1 — Hosted HTTP (no install)\n\nPoint any MCP client that speaks the Streamable HTTP transport at:\n\n```\nhttps://api.bytekit.com/mcp\n```\n\nSend your API key as a bearer token. Example client config for a host that\nspeaks Streamable HTTP directly (Cursor and most hosts accept this shape):\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"url\": \"https://api.bytekit.com/mcp\",\n \"headers\": {\n \"Authorization\": \"Bearer sk_live_xxx\"\n }\n }\n }\n}\n```\n\n**Paste your real key in place of `sk_live_xxx`.** A JSON config file is not a\nshell: most hosts read these values verbatim and do not substitute environment\nvariables inside `headers`, so writing `Bearer $BYTEKIT_API_KEY` here sends that\ntext to the API as the token, verbatim, and the API answers `401`.\n\n**Claude Desktop does not accept this shape.** `claude_desktop_config.json`\nonly launches local **stdio** subprocesses (`command`/`args`/`env`) — it has\nno native `url`-based remote-server entry, so pasting the config above into\nit will not connect. To reach the hosted endpoint from Claude Desktop, either:\n\n- add ByteKit as a [Connector](https://claude.com/connectors) (Settings →\n Connectors → Add custom connector), or\n- bridge it locally with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote):\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"command\": \"npx\",\n \"args\": [\n \"-y\",\n \"mcp-remote\",\n \"https://api.bytekit.com/mcp\",\n \"--header\",\n \"Authorization:${AUTH_HEADER}\"\n ],\n \"env\": {\n \"AUTH_HEADER\": \"Bearer sk_live_xxx\"\n }\n }\n }\n}\n```\n\nTwo details in that snippet are load-bearing, and both are documented by\n`mcp-remote` itself:\n\n- **`${AUTH_HEADER}`, not `$AUTH_HEADER`.** Claude Desktop launches\n `command`/`args` directly, with no shell in between, so it does not expand\n `$VAR` anywhere in the config. `mcp-remote` does its own substitution on\n `--header` values, but only of the braced `${VAR}` form, reading it from the\n process environment the `env` block supplies. A bare `$BYTEKIT_API_KEY` is\n passed through untouched and authenticates as that literal string — a\n guaranteed `401`.\n- **No space after the colon in `Authorization:${AUTH_HEADER}`.** The header\n value carries the space (`Bearer sk_live_xxx`) instead. `mcp-remote`'s README\n documents this as the workaround for a Cursor / Claude Desktop (Windows) bug\n where spaces inside `args` are not escaped when it invokes `npx`, mangling the\n value: `\"Authorization:${AUTH_HEADER}\" // note no spaces around ':'` with\n `\"AUTH_HEADER\": \"Bearer <auth-token>\" // spaces OK in env vars`.\n\nOr skip the hosted endpoint entirely and run the **local stdio server**\n(Option 2 below), which Claude Desktop supports natively.\n\n## Option 2 — Local stdio (`npx`)\n\nRun the server as a local subprocess over stdio. Nothing to install globally —\n`npx` fetches it on demand:\n\n```bash\nnpx @hunt-labs/bytekit-mcp --api-key $BYTEKIT_API_KEY\n```\n\nOr set the key in your environment and omit the flag:\n\n```bash\nexport BYTEKIT_API_KEY=sk_live_xxx\nnpx @hunt-labs/bytekit-mcp\n```\n\nClient config for a stdio server:\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@hunt-labs/bytekit-mcp\"],\n \"env\": {\n \"BYTEKIT_API_KEY\": \"sk_live_xxx\"\n }\n }\n }\n}\n```\n\n### API-key resolution order\n\nThe local server resolves the key in this order:\n\n1. `--api-key <key>` flag\n2. `BYTEKIT_API_KEY` environment variable\n\n## Tool inventory\n\n| Tool | What it does |\n| --- | --- |\n| `scrape_url` | Fetch a URL and return HTML, clean markdown, links, or images. Optional `solve_challenge` (boolean): Attempt to clear a Cloudflare challenge; success is not guaranteed. Billed as a normal browser render. |\n| `web_search` | Run a web search and return ranked organic results. |\n| `screenshot_url` | Capture a screenshot of a page (desktop/mobile, PNG/JPEG). |\n| `get_result` | Fetch a previously created screenshot by id. |\n| `get_account` | Return account details, plan, and current usage/quota. |\n| `list_docs` | List every page in the bundled ByteKit documentation. |\n| `search_docs` | Search the bundled documentation. |\n| `get_doc` | Fetch the full markdown of one documentation page. |\n\nThe server also exposes **resources** (`bytekit://account`,\n`bytekit://screenshot/{id}`) and **prompts** (`summarize_webpage`,\n`extract_structured_data`, `research_topic`) that MCP hosts can surface directly.\n\n## Limits\n\nThe hosted `POST /mcp` endpoint caps request bodies at **1 MB**. MCP tool\narguments are small (a URL plus a few options), so this comfortably covers\nevery tool and prompt in the matrix above — including `research_topic`, the\nlargest legitimate call, which carries a list of URLs. An oversized request\ngets a `413` with a JSON-RPC-shaped error body rather than a dropped\nconnection.\n\nEvery route in the table below carries its own body-size limit, sized to\nthat route's shape rather than reused from `/mcp` (a bulk endpoint's\nrealistic payload is far larger than an MCP tool call):\n\n| Endpoint | Limit | Error |\n|---|---|---|\n| `POST /v1/scrape`, `/v1/search`, `/v1/scrape/bulk`, `/v1/schema` | 512 KB | `400 request_too_large` |\n| `POST /v1/fetch` | 512 KB | `400 request_too_large` |\n| `POST /v1/screenshots` | 512 KB | `400 request_too_large` |\n| `POST /v1/monitors` | 512 KB | `400 request_too_large` |\n| `POST /v1/sitemap` | 512 KB | `400 request_too_large` |\n| `POST /v1/bulk` | 4 MB pre-auth (chunked) / 32 MB fail-safe (declared length) / per-plan up to 28.7 MB | `400 request_too_large` |\n| `POST /v1/fetch/bulk` | 2 MB pre-auth (chunked) / 20 MB fail-safe (declared length) / per-plan up to 16.8 MB | `400 request_too_large` |\n| `POST /v1/webhook-deliveries/{id}/retry` | 64 KB | `400 request_too_large` |\n| `POST /mcp` | 1 MB | `413` (JSON-RPC error) |\n\nThe two bulk endpoints are guarded in a two-tier shape, not by a single\nceiling. A streamed body with no `Content-Length` header is capped at the\nsmall pre-auth limit (4 MB / 2 MB) before your API key is checked; a body\nthat declares `Content-Length` is instead bounded there by a larger fail-safe\n(32 MB / 20 MB) rather than the real limit, since that branch reads nothing\nuntil your key is verified. Once your key is verified, a second check\nre-gates the body against your account's own `max_bulk_size`, the number of\nURLs or per-item configs your plan allows in one call. A custom plan with a\n`max_bulk_size` of 50,000 reaches 28.7 MB / 16.8 MB at that second check. A\nstandard-plan account's effective ceiling is exactly the pre-auth limit;\neither tier's overrun returns `400 request_too_large`.\n\n## Next steps\n\n- [Quickstart](https://bytekit.com/docs/quickstart) — make your first ByteKit API call.\n- [Authentication](https://bytekit.com/docs/guides/authentication) — key formats and management."
401
401
  },
402
402
  "quickstart": {
403
403
  "title": "Quickstart",
@@ -417,7 +417,7 @@
417
417
  "sdk/python/bulk": {
418
418
  "title": "Bulk",
419
419
  "section": "SDK Reference",
420
- "body": "# Bulk\n\nFunctions for interacting with the `bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Bulk\n\nCreate mixed bulk job\n\nEnqueues screenshots or scrapes in a single batch.\nProvide `urls` (simple list) or `items` (per-item config), not both.\nWebhook deliveries include `X-ByteKit-Event: bulk.completed` so\nreceivers can dispatch on the header without parsing the body shape.\nThe body follows `BulkCompletedWebhook`: at most 500 complete items and\n1 MiB, followed by cursor recovery through the existing mixed-item route\nwhenever `recovery_required` is true.\n\n**Limits:** request bodies are guarded in a two-tier shape. A streamed body\nwith no `Content-Length` header is capped at 4 MB before your API key\nis checked; a body that declares `Content-Length` is instead bounded\nthere by a 32 MB fail-safe (not the real limit — see below), since\nthat branch reads nothing until your key is verified. Once your key\nis verified, a second check re-gates the body against your account's\nown `max_bulk_size` (at this endpoint's richer per-item override\nbudget), which reaches 28.7 MB for the largest documented account. A\nstandard-plan account's effective ceiling is 4 MB; either tier's\noverrun returns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `body (CreateBulkBody): Provide `urls` (simple list) OR `items` (per-item config), not`\n- `both. `type` selects the capture kind per entry — only`\n- ``screenshot` and `scrape` are accepted (`recording` is`\n- `deactivated). Behaviour fields may be set per item or via`\n- ``defaults`; a per-item value overrides the matching default.`\n- `This includes `type`: an entry with no `type` of its own`\n- `inherits `defaults.type`, falling back to `screenshot` only`\n- `when neither is set.`\n- `The top-level object, each `items[]` entry, and `defaults``\n- `each reject unrecognized keys with a 422 `validation_error``\n- `(the offending key name appears in the error's `details``\n- `message text) rather than silently discarding them.`\n- ``items[]` and `defaults` do not share one field set`\n- ``device_scale_factor` is accepted only under `defaults` (a`\n- `per-item value 422s), and `duration`/`scenario` are accepted`\n- `only per item (a `defaults` value 422s). `metadata` is`\n- `different from those three: it is valid both at the top`\n- `level of the body and per item, but rejected with a 422 if`\n- `placed under `defaults`. See the `422` response below.`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateBulkResponse202, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateBulkResponse202, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateBulkResponse202, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateBulkResponse202, Error]]\n```\n\n## Delete Bulk\n\nCancel a bulk job\n\nCancels an in-flight bulk job: drains its still-queued (pending) child jobs and refunds the quota\nheld for exactly those drained children. Children already completed, failed, or in progress are\nuntouched and keep their charge. Idempotent — cancelling an already-terminal job (completed, failed,\nor cancelled) is a no-op that returns 200 with the job's real, unchanged status and refunds nothing.\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[DeleteBulkResponse200, Error]]\nsync(id=id, client=client) -> Optional[Union[DeleteBulkResponse200, Error]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[DeleteBulkResponse200, Error]]\nawait asyncio(id=id, client=client) -> Optional[Union[DeleteBulkResponse200, Error]]\n```\n\n## Get Bulk\n\nGet bulk job status\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nsync(id=id, client=client) -> Optional[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, GetBulkResponse200, GetBulkResponse202]]\n```\n\n## List Bulk Screenshots\n\nList bulk job items\n\nReturns the bulk job's items, discriminated by `type`.\n\n**Downloading item artifacts.** For a `completed` item with a storage key,\n`image_url` (`type: screenshot`) and both `content_url` and `markdown_url`\n(`type: scrape`) are **pre-signed** URLs, minted fresh on every read of\nthis endpoint and valid for **600 seconds (10 minutes)** —\nthe same signing lifetime as `content_url` on `GET /v1/fetch/bulk/\\{id\\}`.\nDownload inside that window, or re-poll this endpoint for a fresh\nsignature.\n\n**When no signature is minted.** Three cases mint none: an item that is not\n`completed`, a `completed` item with no storage key, and a `completed` item\nwhose object could not be signed — during an object-storage outage, for\ninstance. In all three the item's stored value is returned unchanged: `null`\nwhile nothing has been stored, and otherwise a **private, unsigned**\nobject-storage URL that answers `401`. These fields are neither nulled nor\nflagged in that case, so treat an artifact URL as usable only once you have\ndownloaded it, and re-poll for a fresh signature otherwise.\n`artifact_warnings` and its `artifact_unavailable` code describe the sibling\n`artifacts` object on `type: scrape` items only — they say nothing about\n`image_url`, `content_url`, or `markdown_url`.\n\n**Parameters**\n\n- `id (str)`\n- `cursor (Union[Unset, str])`\n- `limit (Union[Unset, int])`\n- `status (Union[Unset, ListBulkScreenshotsStatus])`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[ListBulkScreenshotsResponse200]\nsync(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[ListBulkScreenshotsResponse200]\nawait asyncio_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[ListBulkScreenshotsResponse200]\nawait asyncio(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[ListBulkScreenshotsResponse200]\n```"
420
+ "body": "# Bulk\n\nFunctions for interacting with the `bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Bulk\n\nCreate mixed bulk job\n\nEnqueues screenshots or scrapes in a single batch.\nProvide `urls` (simple list) or `items` (per-item config), not both.\nWebhook deliveries include `X-ByteKit-Event: bulk.completed` so\nreceivers can dispatch on the header without parsing the body shape.\nThe body follows `BulkCompletedWebhook`: at most 500 complete items and\n1 MiB, followed by cursor recovery through the existing mixed-item route\nwhenever `recovery_required` is true.\n\n**Limits:** request bodies are guarded in a two-tier shape. A streamed body\nwith no `Content-Length` header is capped at 4 MB before your API key\nis checked; a body that declares `Content-Length` is instead bounded\nthere by a 32 MB fail-safe (not the real limit — see below), since\nthat branch reads nothing until your key is verified. Once your key\nis verified, a second check re-gates the body against your account's\nown `max_bulk_size` (at this endpoint's richer per-item override\nbudget), which reaches 28.7 MB for the largest documented account. A\nstandard-plan account's effective ceiling is 4 MB; either tier's\noverrun returns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `body (CreateBulkBody): Provide `urls` (simple list) OR `items` (per-item config), not`\n- `both. `type` selects the capture kind per entry — only`\n- ``screenshot` and `scrape` are accepted (`recording` is`\n- `deactivated). Behaviour fields may be set per item or via`\n- ``defaults`; a per-item value overrides the matching default.`\n- `This includes `type`: an entry with no `type` of its own`\n- `inherits `defaults.type`, falling back to `screenshot` only`\n- `when neither is set.`\n- `The top-level object, each `items[]` entry, and `defaults``\n- `each reject unrecognized keys with a 422 `validation_error``\n- `(the offending key name appears in the error's `details``\n- `message text) rather than silently discarding them.`\n- ``items[]` and `defaults` do not share one field set`\n- ``device_scale_factor` is accepted only under `defaults` (a`\n- `per-item value 422s), and `duration`/`scenario` are accepted`\n- `only per item (a `defaults` value 422s). `metadata` is`\n- `different from those three: it is valid both at the top`\n- `level of the body and per item, but rejected with a 422 if`\n- `placed under `defaults`. See the `422` response below.`\n- `webhook_url` — `str` — Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported)\n- `urls` — `Union[Unset, list[str]]` — Simple URL list. Provide urls OR items, not both.\n- `items` — `Union[Unset, list['CreateBulkBodyItemsItem']]` — Per-item configs. Provide urls OR items, not both.\n- `defaults` — `Union[Unset, CreateBulkBodyDefaults]` — Default behaviour applied to every entry unless the item overrides it.\n- `webhook_secret` — `Union[Unset, str]` — HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code.\n- `metadata` — `Union[Unset, Metadata]` — Arbitrary key-value metadata. Max 4096 bytes when JSON-serialized.\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateBulkResponse202, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateBulkResponse202, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateBulkResponse202, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateBulkResponse202, Error]]\n```\n\n## Delete Bulk\n\nCancel a bulk job\n\nCancels an in-flight bulk job: drains its still-queued (pending) child jobs and refunds the quota\nheld for exactly those drained children. Children already completed, failed, or in progress are\nuntouched and keep their charge. Idempotent — cancelling an already-terminal job (completed, failed,\nor cancelled) is a no-op that returns 200 with the job's real, unchanged status and refunds nothing.\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[DeleteBulkResponse200, Error]]\nsync(id=id, client=client) -> Optional[Union[DeleteBulkResponse200, Error]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[DeleteBulkResponse200, Error]]\nawait asyncio(id=id, client=client) -> Optional[Union[DeleteBulkResponse200, Error]]\n```\n\n## Get Bulk\n\nGet bulk job status\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nsync(id=id, client=client) -> Optional[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, GetBulkResponse200, GetBulkResponse202]]\n```\n\n## List Bulk Screenshots\n\nList bulk job items\n\nReturns the bulk job's items, discriminated by `type`.\n\n**Downloading item artifacts.** For a `completed` item with a storage key,\n`image_url` (`type: screenshot`) and both `content_url` and `markdown_url`\n(`type: scrape`) are **pre-signed** URLs, minted fresh on every read of\nthis endpoint and valid for **600 seconds (10 minutes)** —\nthe same signing lifetime as `content_url` on `GET /v1/fetch/bulk/\\{id\\}`.\nDownload inside that window, or re-poll this endpoint for a fresh\nsignature.\n\n**When no signature is minted.** Three cases mint none: an item that is not\n`completed`, a `completed` item with no storage key, and a `completed` item\nwhose object could not be signed — during an object-storage outage, for\ninstance. In all three the item's stored value is returned unchanged: `null`\nwhile nothing has been stored, and otherwise a **private, unsigned**\nobject-storage URL that answers `401`. These fields are neither nulled nor\nflagged in that case, so treat an artifact URL as usable only once you have\ndownloaded it, and re-poll for a fresh signature otherwise.\n`artifact_warnings` and its `artifact_unavailable` code describe the sibling\n`artifacts` object on `type: scrape` items only — they say nothing about\n`image_url`, `content_url`, or `markdown_url`.\n\n**Parameters**\n\n- `id (str)`\n- `cursor (Union[Unset, str])`\n- `limit (Union[Unset, int])`\n- `status (Union[Unset, ListBulkScreenshotsStatus])`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[ListBulkScreenshotsResponse200]\nsync(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[ListBulkScreenshotsResponse200]\nawait asyncio_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[ListBulkScreenshotsResponse200]\nawait asyncio(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[ListBulkScreenshotsResponse200]\n```"
421
421
  },
422
422
  "sdk/python/client": {
423
423
  "title": "Client",
@@ -427,42 +427,42 @@
427
427
  "sdk/python/fetch": {
428
428
  "title": "Fetch",
429
429
  "section": "SDK Reference",
430
- "body": "# Fetch\n\nFunctions for interacting with the `fetch` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Get Fetch\n\nFetch a URL (GET)\n\nDirect HTTP fetch. Successful responses return the upstream response bytes verbatim;\nmetadata is returned in X-Fetch-* headers. Non-2xx upstream responses use the\n`upstream_error` JSON envelope with the upstream HTTP status.\n\n**Parameters**\n\n- `url_query (str)`\n- `country (Union[Unset, str])`\n- `timeout_ms (Union[Unset, int])`\n- `cache_ttl (Union[GetFetchCacheTtlType1, Unset, str])`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Response[Union[Error, str]]\nsync(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Optional[Union[Error, str]]\nawait asyncio_detailed(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Response[Union[Error, str]]\nawait asyncio(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Optional[Union[Error, str]]\n```\n\n## Post Fetch\n\nFetch a URL (POST)\n\nSame as GET /v1/fetch but with a JSON request body.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `body (FetchRequest)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[Error, str]]\nsync(client=client, body=body) -> Optional[Union[Error, str]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[Error, str]]\nawait asyncio(client=client, body=body) -> Optional[Union[Error, str]]\n```"
430
+ "body": "# Fetch\n\nFunctions for interacting with the `fetch` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Get Fetch\n\nFetch a URL (GET)\n\nDirect HTTP fetch. Successful responses return the upstream response bytes verbatim;\nmetadata is returned in X-Fetch-* headers. Non-2xx upstream responses use the\n`upstream_error` JSON envelope with the upstream HTTP status.\n\n**Parameters**\n\n- `url_query (str)`\n- `country (Union[Unset, str])`\n- `timeout_ms (Union[Unset, int])`\n- `cache_ttl (Union[GetFetchCacheTtlType1, Unset, str])`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Response[Union[Error, str]]\nsync(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Optional[Union[Error, str]]\nawait asyncio_detailed(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Response[Union[Error, str]]\nawait asyncio(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Optional[Union[Error, str]]\n```\n\n## Post Fetch\n\nFetch a URL (POST)\n\nSame as GET /v1/fetch but with a JSON request body.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `body (FetchRequest)`\n- `url` — `str`\n- `country` — `Union[Unset, str]`\n- `timeout_ms` — `Union[Unset, int]`\n- `cache_ttl` — `Union[FetchRequestCacheTtlType1, Unset, str]` — How long a freshly fetched URL may be served from cache. `0` skips the cache read; cache-eligible fresh results are still written with the default 7-day TTL so later non-zero-TTL callers can HIT. Safety-classified WAF husks remain live-only and are not written. Accepts `Nh` (hours, up to 168h), `Nd` (days, up to 7d), or the integer `0`. Examples: `0`, `48h`, `2d`. Invalid values receive a 422 validation_error with an actionable message.\n- `custom` — `Union[Unset, FetchRequestCustom]` — User-supplied JSON payload, base64-encoded into the `X-Fetch-Custom` response header so callers can correlate the response back to caller-side state (job IDs, batch metadata, etc.). Capped at 4096 UTF-8 bytes after JSON serialization. Does NOT affect cache-key inputs — two requests differing only in `custom` share the same cache slot.\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[Error, str]]\nsync(client=client, body=body) -> Optional[Union[Error, str]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[Error, str]]\nawait asyncio(client=client, body=body) -> Optional[Union[Error, str]]\n```"
431
431
  },
432
432
  "sdk/python/fetch-bulk": {
433
433
  "title": "Fetch Bulk",
434
434
  "section": "SDK Reference",
435
- "body": "# Fetch Bulk\n\nFunctions for interacting with the `fetch_bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Fetch Bulk\n\nBulk fetch URLs\n\nEnqueues multiple URLs for HTTP fetching. Results delivered via webhook.\nDoes not support options that require page rendering (wait_for_selector, etc.).\nCompletion deliveries use `X-ByteKit-Event: bulk.completed` and the\n`BulkCompletedWebhook` contract: at most 500 complete items and 1 MiB,\nfollowed by cursor recovery through `GET /v1/fetch/bulk/\\{id\\}` whenever\n`recovery_required` is true.\n\n**Limits:** request bodies are guarded in a two-tier shape. A streamed body\nwith no `Content-Length` header is capped at 2 MB before your API key\nis checked; a body that declares `Content-Length` is instead bounded\nthere by a 20 MB fail-safe (not the real limit — see below), since\nthat branch reads nothing until your key is verified. Once your key\nis verified, a second check re-gates the body against your account's\nown `max_bulk_size` (at this endpoint's per-item override budget),\nwhich reaches 16.8 MB for the largest documented account. A\nstandard-plan account's effective ceiling is 2 MB; either tier's\noverrun returns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `body (CreateFetchBulkBody)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateFetchBulkResponse202, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateFetchBulkResponse202, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateFetchBulkResponse202, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateFetchBulkResponse202, Error]]\n```\n\n## Get Fetch Bulk\n\nGet fetch bulk job status\n\nReturns the job envelope plus its per-URL items.\n\n**Downloading item content.** Each completed item's `content_url` is a\n**pre-signed** URL, minted fresh on every read of this endpoint and valid\nfor **600 seconds (10 minutes)** — the same signing lifetime as the\n`image_url` returned by `GET /v1/bulk/\\{id\\}/screenshots`. The underlying\nobjects are private, so an unsigned URL returns `401`: download the\ncontent inside that window, or re-poll this endpoint for a fresh\nsignature. Items that are not `completed`, and completed items with no\nstored object, or completed items whose object cannot be signed, carry\n`null`; the latter report `artifact_unavailable`. The private unsigned\nstorage URL is never returned.\n\n**Parameters**\n\n- `id (str)`\n- `cursor (Union[Unset, str])`\n- `limit (Union[Unset, int])`\n- `status (Union[Unset, GetFetchBulkStatus])`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\nsync(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\nawait asyncio_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\nawait asyncio(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\n```"
435
+ "body": "# Fetch Bulk\n\nFunctions for interacting with the `fetch_bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Fetch Bulk\n\nBulk fetch URLs\n\nEnqueues multiple URLs for HTTP fetching. Results delivered via webhook.\nDoes not support options that require page rendering (wait_for_selector, etc.).\nCompletion deliveries use `X-ByteKit-Event: bulk.completed` and the\n`BulkCompletedWebhook` contract: at most 500 complete items and 1 MiB,\nfollowed by cursor recovery through `GET /v1/fetch/bulk/\\{id\\}` whenever\n`recovery_required` is true.\n\n**Limits:** request bodies are guarded in a two-tier shape. A streamed body\nwith no `Content-Length` header is capped at 2 MB before your API key\nis checked; a body that declares `Content-Length` is instead bounded\nthere by a 20 MB fail-safe (not the real limit — see below), since\nthat branch reads nothing until your key is verified. Once your key\nis verified, a second check re-gates the body against your account's\nown `max_bulk_size` (at this endpoint's per-item override budget),\nwhich reaches 16.8 MB for the largest documented account. A\nstandard-plan account's effective ceiling is 2 MB; either tier's\noverrun returns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `body (CreateFetchBulkBody)`\n- `urls` — `list[Union['CreateFetchBulkBodyUrlsItemType1', str]]`\n- `webhook_url` — `str` — Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported)\n- `defaults` — `Union[Unset, CreateFetchBulkBodyDefaults]`\n- `webhook_secret` — `Union[Unset, str]` — HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code.\n- `metadata` — `Union[Unset, Metadata]` — Arbitrary key-value metadata. Max 4096 bytes when JSON-serialized.\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateFetchBulkResponse202, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateFetchBulkResponse202, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateFetchBulkResponse202, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateFetchBulkResponse202, Error]]\n```\n\n## Get Fetch Bulk\n\nGet fetch bulk job status\n\nReturns the job envelope plus its per-URL items.\n\n**Downloading item content.** Each completed item's `content_url` is a\n**pre-signed** URL, minted fresh on every read of this endpoint and valid\nfor **600 seconds (10 minutes)** — the same signing lifetime as the\n`image_url` returned by `GET /v1/bulk/\\{id\\}/screenshots`. The underlying\nobjects are private, so an unsigned URL returns `401`: download the\ncontent inside that window, or re-poll this endpoint for a fresh\nsignature. Items that are not `completed`, and completed items with no\nstored object, or completed items whose object cannot be signed, carry\n`null`; the latter report `artifact_unavailable`. The private unsigned\nstorage URL is never returned.\n\n**Parameters**\n\n- `id (str)`\n- `cursor (Union[Unset, str])`\n- `limit (Union[Unset, int])`\n- `status (Union[Unset, GetFetchBulkStatus])`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\nsync(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\nawait asyncio_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\nawait asyncio(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\n```"
436
436
  },
437
437
  "sdk/python/monitors": {
438
438
  "title": "Monitors",
439
439
  "section": "SDK Reference",
440
- "body": "# Monitors\n\nFunctions for interacting with the `monitors` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\nFirst-capture behavior is the same for both monitor types: the first capture is a silent baseline (`has_change=False`, `change_pct=None`) with no `change_detected` webhook, whether the monitor is `scrape` or `screenshot`. From the second capture onward both types diff against the previous capture.\n\n## Create Monitor\n\nCreate a change-detection monitor\n\nCreates a recurring change-detection monitor for a URL, delivering results via webhook.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `body (MonitorCreateRequest)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[Error, MonitorCreateResponse]]\nsync(client=client, body=body) -> Optional[Union[Error, MonitorCreateResponse]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[Error, MonitorCreateResponse]]\nawait asyncio(client=client, body=body) -> Optional[Union[Error, MonitorCreateResponse]]\n```\n\n## Delete Monitor\n\nCancel monitor\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Any, Error]]\nsync(id=id, client=client) -> Optional[Union[Any, Error]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Any, Error]]\nawait asyncio(id=id, client=client) -> Optional[Union[Any, Error]]\n```\n\n## Get Monitor\n\nGet monitor\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, MonitorResponse]]\nsync(id=id, client=client) -> Optional[Union[Error, MonitorResponse]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, MonitorResponse]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, MonitorResponse]]\n```\n\n## List Monitor Captures\n\nList monitor captures\n\n**Parameters**\n\n- `id (str)`\n- `limit (Union[Unset, int])`\n- `cursor (Union[Unset, str])`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, limit=limit, cursor=cursor) -> Response[ListMonitorCapturesResponse200]\nsync(id=id, client=client, limit=limit, cursor=cursor) -> Optional[ListMonitorCapturesResponse200]\nawait asyncio_detailed(id=id, client=client, limit=limit, cursor=cursor) -> Response[ListMonitorCapturesResponse200]\nawait asyncio(id=id, client=client, limit=limit, cursor=cursor) -> Optional[ListMonitorCapturesResponse200]\n```\n\n## List Monitors\n\nList monitors\n\n**Parameters**\n\n- `limit (Union[Unset, int])`\n- `cursor (Union[Unset, str])`\n- `status (Union[Unset, ListMonitorsStatus])`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, limit=limit, cursor=cursor, status=status) -> Response[ListMonitorsResponse200]\nsync(client=client, limit=limit, cursor=cursor, status=status) -> Optional[ListMonitorsResponse200]\nawait asyncio_detailed(client=client, limit=limit, cursor=cursor, status=status) -> Response[ListMonitorsResponse200]\nawait asyncio(client=client, limit=limit, cursor=cursor, status=status) -> Optional[ListMonitorsResponse200]\n```\n\n## Update Monitor\n\nUpdate monitor\n\n**Parameters**\n\n- `id (str)`\n- `body (MonitorUpdateRequest)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, body=body) -> Response[Union[Error, MonitorResponse]]\nsync(id=id, client=client, body=body) -> Optional[Union[Error, MonitorResponse]]\nawait asyncio_detailed(id=id, client=client, body=body) -> Response[Union[Error, MonitorResponse]]\nawait asyncio(id=id, client=client, body=body) -> Optional[Union[Error, MonitorResponse]]\n```"
440
+ "body": "# Monitors\n\nFunctions for interacting with the `monitors` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\nFirst-capture behavior is the same for both monitor types: the first capture is a silent baseline (`has_change=False`, `change_pct=None`) with no `change_detected` webhook, whether the monitor is `scrape` or `screenshot`. From the second capture onward both types diff against the previous capture.\n\n## Create Monitor\n\nCreate a change-detection monitor\n\nCreates a recurring change-detection monitor for a URL, delivering results via webhook.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `body (MonitorCreateRequest)`\n- `url` — `str`\n- `interval_type` — `MonitorCreateRequestIntervalType`\n- `webhook_url` — `str` — Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported)\n- `type_` — `Union[Unset, MonitorCreateRequestType]`\n- `cron_expression` — `Union[Unset, str]` — 5-field cron expression. Required when interval_type is \"cron\".\n- `change_threshold` — `Union[Unset, float]`\n- `notify_on` — `Union[Unset, MonitorCreateRequestNotifyOn]`\n- `webhook_secret` — `Union[Unset, str]` — HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code.\n- `webhook_headers` — `Union[Unset, MonitorCreateRequestWebhookHeaders]` — Max 20 headers. Keys must match /^[A-Za-z0-9-]+$/ and not be reserved.\n- `options` — `Union[Unset, MonitorCreateRequestOptions]` — Screenshot monitor options (device, viewport, format, etc.).\n- `scrape_options` — `Union[Unset, MonitorCreateRequestScrapeOptions]` — Scrape monitor options (formats, country, wait_for_selector, wait_until, delay_ms). Only for type=scrape.\n- `metadata` — `Union[Unset, Metadata]` — Arbitrary key-value metadata. Max 4096 bytes when JSON-serialized.\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[Error, MonitorCreateResponse]]\nsync(client=client, body=body) -> Optional[Union[Error, MonitorCreateResponse]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[Error, MonitorCreateResponse]]\nawait asyncio(client=client, body=body) -> Optional[Union[Error, MonitorCreateResponse]]\n```\n\n## Delete Monitor\n\nCancel monitor\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Any, Error]]\nsync(id=id, client=client) -> Optional[Union[Any, Error]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Any, Error]]\nawait asyncio(id=id, client=client) -> Optional[Union[Any, Error]]\n```\n\n## Get Monitor\n\nGet monitor\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, MonitorResponse]]\nsync(id=id, client=client) -> Optional[Union[Error, MonitorResponse]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, MonitorResponse]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, MonitorResponse]]\n```\n\n## List Monitor Captures\n\nList monitor captures\n\n**Parameters**\n\n- `id (str)`\n- `limit (Union[Unset, int])`\n- `cursor (Union[Unset, str])`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, limit=limit, cursor=cursor) -> Response[ListMonitorCapturesResponse200]\nsync(id=id, client=client, limit=limit, cursor=cursor) -> Optional[ListMonitorCapturesResponse200]\nawait asyncio_detailed(id=id, client=client, limit=limit, cursor=cursor) -> Response[ListMonitorCapturesResponse200]\nawait asyncio(id=id, client=client, limit=limit, cursor=cursor) -> Optional[ListMonitorCapturesResponse200]\n```\n\n## List Monitors\n\nList monitors\n\n**Parameters**\n\n- `limit (Union[Unset, int])`\n- `cursor (Union[Unset, str])`\n- `status (Union[Unset, ListMonitorsStatus])`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, limit=limit, cursor=cursor, status=status) -> Response[ListMonitorsResponse200]\nsync(client=client, limit=limit, cursor=cursor, status=status) -> Optional[ListMonitorsResponse200]\nawait asyncio_detailed(client=client, limit=limit, cursor=cursor, status=status) -> Response[ListMonitorsResponse200]\nawait asyncio(client=client, limit=limit, cursor=cursor, status=status) -> Optional[ListMonitorsResponse200]\n```\n\n## Update Monitor\n\nUpdate monitor\n\n**Parameters**\n\n- `id (str)`\n- `body (MonitorUpdateRequest)`\n- `url` — `Union[Unset, str]`\n- `interval_type` — `Union[Unset, MonitorUpdateRequestIntervalType]`\n- `cron_expression` — `Union[Unset, str]`\n- `change_threshold` — `Union[Unset, float]`\n- `notify_on` — `Union[Unset, MonitorUpdateRequestNotifyOn]`\n- `webhook_url` — `Union[Unset, str]` — Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported)\n- `webhook_secret` — `Union[Unset, str]` — HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code.\n- `webhook_headers` — `Union[Unset, MonitorUpdateRequestWebhookHeaders]`\n- `status` — `Union[Unset, MonitorUpdateRequestStatus]`\n- `options` — `Union[Unset, MonitorUpdateRequestOptions]`\n- `scrape_options` — `Union[Unset, MonitorUpdateRequestScrapeOptions]`\n- `metadata` — `Union[Unset, Metadata]` — Arbitrary key-value metadata. Max 4096 bytes when JSON-serialized.\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, body=body) -> Response[Union[Error, MonitorResponse]]\nsync(id=id, client=client, body=body) -> Optional[Union[Error, MonitorResponse]]\nawait asyncio_detailed(id=id, client=client, body=body) -> Response[Union[Error, MonitorResponse]]\nawait asyncio(id=id, client=client, body=body) -> Optional[Union[Error, MonitorResponse]]\n```"
441
441
  },
442
442
  "sdk/python/scrape": {
443
443
  "title": "Scrape",
444
444
  "section": "SDK Reference",
445
- "body": "# Scrape\n\nFunctions for interacting with the `scrape` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Scrape\n\nScrape a URL\n\nFetches and processes a URL, returning content in one or more formats wrapped in a ScrapeEnvelope.\n\n**The response shape is decided by your request, not by how we route it.** In precedence order:\n\n1. `async: true` → **202** with a `ScrapeQueuedEnvelope` receipt, returned immediately. Poll `GET\n/v1/scrape/\\{id\\}` for the result.\n2. Otherwise, a request that needs a full page render — today that is `delay_ms > 0` — is **held\nopen** until the render reaches a terminal state, then returns **200** with the content envelope\n(`success` or `failed`). If the render is still running when the hold window expires (28 seconds by\ndefault), the request returns the **202** receipt instead and the job continues in the background.\n3. Otherwise the request is served by the fast HTTP path and returns **200** with the content\nenvelope, typically in under a second.\n\n**A failed fetch is a result, not a transport error.** An unreachable host, a refused connection, or\na target whose bot protection defeats every proxy tier all come back on the same **200** as a\n`failed` envelope — never a 5xx. Narrow on the envelope's `status` before reading the body. A\nfailure the fast path decides inline happens before any job row exists, so its envelope carries `id:\nnull` and there is nothing to poll; a failure a held render reaches carries that render's real `id`.\nEither way the request transfers no billable bytes and is charged nothing.\n\nSo a 202 means one of exactly two things: you asked for one with `async: true`, or the hold window\nexpired. `wait_for_selector` and `wait_until` are `ScreenshotRequest` options, not `ScrapeRequest`\noptions — sending either to this endpoint returns `422 validation_error`, so neither can produce a\n202 here.\n\n**Parameters**\n\n- `body (ScrapeRequest)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\nsync(client=client, body=body) -> Optional[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio(client=client, body=body) -> Optional[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\n```\n\n## Get Scrape\n\nGet scrape result\n\nAlways returns 200. Check the `status` discriminator for the scrape state.\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\nsync(id=id, client=client) -> Optional[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\n```"
445
+ "body": "# Scrape\n\nFunctions for interacting with the `scrape` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Scrape\n\nScrape a URL\n\nFetches and processes a URL, returning content in one or more formats wrapped in a ScrapeEnvelope.\n\n**The response shape is decided by your request, not by how we route it.** In precedence order:\n\n1. `async: true` → **202** with a `ScrapeQueuedEnvelope` receipt, returned immediately. Poll `GET\n/v1/scrape/\\{id\\}` for the result.\n2. Otherwise, a request that needs a full page render — today that is `delay_ms > 0` — is **held\nopen** until the render reaches a terminal state, then returns **200** with the content envelope\n(`success` or `failed`). If the render is still running when the hold window expires (28 seconds by\ndefault), the request returns the **202** receipt instead and the job continues in the background.\n3. Otherwise the request is served by the fast HTTP path and returns **200** with the content\nenvelope, typically in under a second.\n\n**A failed fetch is a result, not a transport error.** An unreachable host, a refused connection, or\na target whose bot protection defeats every proxy tier all come back on the same **200** as a\n`failed` envelope — never a 5xx. Narrow on the envelope's `status` before reading the body. A\nfailure the fast path decides inline is recorded as a failed job, so its envelope normally carries\nthat job's `id` and `GET /v1/scrape/\\{id\\}` returns the same envelope; if recording the failed job\nitself fails, the envelope still arrives on the same 200 with `id` set to `null` and there is\nnothing to poll. A failure a held render reaches carries that render's real `id`. Either way the\nrequest transfers no billable bytes and is charged nothing.\n\nSo a 202 means one of exactly two things: you asked for one with `async: true`, or the hold window\nexpired. `wait_for_selector` and `wait_until` are `ScreenshotRequest` options, not `ScrapeRequest`\noptions — sending either to this endpoint returns `422 validation_error`, so neither can produce a\n202 here.\n\n**Parameters**\n\n- `body (ScrapeRequest)`\n- `url` — `str`\n- `formats` — `Union[Unset, list[ScrapeRequestFormatsItem]]`\n- `country` — `Union[Unset, str]`\n- `delay_ms` — `Union[Unset, int]` — Milliseconds to wait after page load before capturing, for content that renders late. Any value above 0 puts the request on the full browser render path. Unless `async: true` is also set, the request is then HELD until the render finishes and returns 200 with the content envelope, or returns the 202 receipt if the hold window expires first. `0` (the default) keeps the request on the fast HTTP path, which returns 200 in one round trip.\n- `timeout_ms` — `Union[Unset, int]`\n- `async_` — `Union[Unset, bool]` — When true, the request returns 202 with a `ScrapeQueuedEnvelope` receipt immediately and the scrape runs in the background; poll `GET /v1/scrape/\\{id\\}` for the result. This is the only way to ASK for a receipt, and it outranks every routing consequence: with `async: false` (the default) a browser-path request is held to completion instead of being receipted. A 202 can still arrive with `async: false`, but only when the hold window expires.\n- `webhook_url` — `Union[Unset, str]` — Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported)\n- `events` — `Union[Unset, list[ScrapeRequestEventsItem]]` — Webhook event types to deliver when webhook_url is set. Defaults to all three (queued, completed, failed); send an explicit subset to receive fewer.\n- `markdown_mode` — `Union[Unset, ScrapeRequestMarkdownMode]` — Markdown processing mode. article=article extraction (default), raw=minimal cleanup, llm=compact LLM-optimised output.\n- `markdown_query` — `Union[Unset, str]` — BM25 query string for relevance-ranked content filtering. Omit or leave empty to disable.\n- `markdown_links` — `Union[Unset, ScrapeRequestMarkdownLinks]` — Link rendering style in the markdown output. 'inline' (default) keeps `[text](url)` as-is. 'text' strips URLs, keeping only anchor text. 'none' strips URLs and removes reference definitions. 'references' converts to numbered `[text][N]` refs with a Links footer.\n- `markdown_images` — `Union[Unset, ScrapeRequestMarkdownImages]` — Image retention mode in the markdown output. 'inline' (default) keeps `![alt](url)` as-is. 'text' strips the URL, keeping only alt text. 'none' removes images entirely. 'references' converts to numbered `![alt][N]` refs with an Images footer. Distinct from markdown_filter_images (which drops low-signal images before conversion).\n- `with_links_summary` — `Union[Unset, bool]` — When true, appends a 'Links:\\n[1]: url\\n...' footer to the markdown output, built from the extracted link list. Automatically enabled when markdown_links is 'references'.\n- `with_images_summary` — `Union[Unset, bool]` — When true, appends an 'Images:\\n[1]: url\\n...' footer to the markdown output, built from the extracted image list.\n- `markdown_compact` — `Union[Unset, bool]` — Collapse excessive whitespace for a more compact output.\n- `markdown_filter_images` — `Union[Unset, bool]` — Filter low-signal images from the markdown output.\n- `markdown_include_media` — `Union[Unset, bool]` — When true, `formats.links` and `formats.images` return `ScrapeScoredLink[]` / `ScrapeScoredImage[]` (rich objects) instead of `string[]`, and a top-level `tables` array is included. Only effective when `markdown` is in `formats`.\n- `markdown_include_warnings` — `Union[Unset, bool]` — When true, enables markdown-pipeline and tag-filter warnings for requests that include the `markdown` format. Artifact availability warnings such as `artifact_unavailable` may appear independently of this flag.\n- `markdown_include_stats` — `Union[Unset, bool]` — When true, the response includes a top-level `stats` object with `ScrapeStats` (chars, tokens, blocks). Only effective when `markdown` is in `formats`.\n- `token_budget` — `Union[Unset, int]` — Maximum token count for the markdown output. When set and `markdown` is in `formats`, the output is truncated at the last paragraph → sentence → token boundary that keeps the estimated count under this limit. Absent → no truncation. Triggers a `markdown_tokens` field in the response.\n- `token_encoding` — `Union[Unset, ScrapeRequestTokenEncoding]` — Tokenizer encoding hint for `token_budget`. `cl100k_base` (default) matches GPT-4/4o; `o200k_base` matches GPT-4o-mini / o-series. Both use the same 4-char/token heuristic internally.\n- `mobile` — `Union[Unset, bool]` — When true, emulate a mobile device — the request uses a mobile (Android) user agent and a mobile viewport, so the upstream serves the mobile version of the page. Default false (desktop). The value is part of the cache key, so mobile and desktop responses are cached independently.\n- `solve_challenge` — `Union[Unset, bool]` — Attempts to clear a Cloudflare challenge; success is not guaranteed. Billed as a normal browser render.\n- `remove_base64_images` — `Union[Unset, bool]` — When true (default), base64-encoded `data:` image sources are stripped from the HTML before markdown conversion. Set to false to preserve base64 images in the pipeline output. Does not affect `raw`, which always returns the original source unchanged.\n- `include_tags` — `Union[Unset, list[str]]` — HTML element names (not CSS selectors) to keep. When non-empty, only content within these elements is included in the `markdown` output. Applied before `exclude_tags`. Does not affect `raw`, which always returns the full page.\n- `exclude_tags` — `Union[Unset, list[str]]` — HTML element names (not CSS selectors) to strip from the `markdown` output. Applied after `include_tags` when both are present. Does not affect `raw`, which always returns the full page.\n- `cache_ttl` — `Union[ScrapeRequestCacheTtlType1, Unset, str]` — How long a freshly fetched URL may be served from cache. `0` (string or integer) skips the cache read; cache-eligible results are still written. `Nh`/`Nd` set a TTL (capped at 168 h / 7 d). Safety-classified WAF husks are returned live but never stored in the shared cache. Honoured on both the synchronous and asynchronous paths; the async success envelope reports the lookup outcome via the `cache` field.\n- `custom` — `Union[Unset, ScrapeRequestCustom]` — User-supplied JSON payload, echoed back on the success envelope (sync, async, webhook). Capped at 4096 UTF-8 bytes (`Buffer.byteLength`). Distinct from the system-owned `metadata` column. Does NOT affect cache-key inputs — two requests differing only in `custom` resolve to the same cache entry.\n- `clean_markdown` — `Union[Unset, bool]` — When `true` and `markdown` is in `formats`, the converted markdown is sent to Groq LLM for cleaning (boilerplate removal, ad stripping, formatting improvement) before being returned. Graceful degradation: any Groq failure (key unset, 4xx/5xx, timeout, empty response) returns the raw markdown unchanged plus a warning in the `warnings` array. Billing: 3× credits and bytes applied only when cleaning succeeds.\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\nsync(client=client, body=body) -> Optional[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio(client=client, body=body) -> Optional[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\n```\n\n## Get Scrape\n\nGet scrape result\n\nAlways returns 200. Check the `status` discriminator for the scrape state.\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\nsync(id=id, client=client) -> Optional[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\n```"
446
446
  },
447
447
  "sdk/python/scrape-bulk": {
448
448
  "title": "Scrape Bulk",
449
449
  "section": "SDK Reference",
450
- "body": "# Scrape Bulk\n\nFunctions for interacting with the `scrape_bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Scrape Bulk\n\nBulk scrape URLs\n\nEnqueues multiple URLs for scraping. Results delivered via webhook.\nCompletion deliveries use `X-ByteKit-Event: bulk.completed` and the\n`BulkCompletedWebhook` contract: at most 500 complete items and 1 MiB,\nfollowed by cursor recovery through `GET /v1/scrape/bulk/\\{id\\}` whenever\n`recovery_required` is true.\n\n**Parameters**\n\n- `body (CreateScrapeBulkBody)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateScrapeBulkResponse202, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateScrapeBulkResponse202, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateScrapeBulkResponse202, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateScrapeBulkResponse202, Error]]\n```\n\n## Get Scrape Bulk\n\nGet scrape bulk job status\n\nReturns the job envelope plus its rehydrated per-URL scrape envelopes.\n\n**Downloading item content.** A `raw` or `markdown` artifact within the\n10-MiB inline cap is returned inline. An oversized one is replaced by a\n**pre-signed** URL, minted fresh on every read of this endpoint and valid\nfor **86400 seconds (24 hours)**. The underlying objects are private, so an\nunsigned URL returns `401`: download the content inside that window, or\nre-poll this endpoint for a fresh signature. An artifact that was never\nstored, or whose object cannot be signed, is omitted from `formats` and\nreported as `artifact_unavailable` in `warnings`. The private unsigned\nstorage URL is never returned.\n\n**Parameters**\n\n- `id (str)`\n- `cursor (Union[Unset, str])`\n- `limit (Union[Unset, int])`\n- `status (Union[Unset, GetScrapeBulkStatus])`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\nsync(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\nawait asyncio_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\nawait asyncio(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\n```"
450
+ "body": "# Scrape Bulk\n\nFunctions for interacting with the `scrape_bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Scrape Bulk\n\nBulk scrape URLs\n\nEnqueues multiple URLs for scraping. Results delivered via webhook.\nCompletion deliveries use `X-ByteKit-Event: bulk.completed` and the\n`BulkCompletedWebhook` contract: at most 500 complete items and 1 MiB,\nfollowed by cursor recovery through `GET /v1/scrape/bulk/\\{id\\}` whenever\n`recovery_required` is true.\n\n**Parameters**\n\n- `body (CreateScrapeBulkBody)`\n- `webhook_url` — `str` — Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported)\n- `urls` — `Union[Unset, list[str]]` — Simple URL list. Provide urls OR items, not both.\n- `items` — `Union[Unset, list['CreateScrapeBulkBodyItemsItem']]` — Per-item configs. Provide urls OR items, not both.\n- `defaults` — `Union[Unset, CreateScrapeBulkBodyDefaults]`\n- `webhook_secret` — `Union[Unset, str]` — HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code.\n- `metadata` — `Union[Unset, Metadata]` — Arbitrary key-value metadata. Max 4096 bytes when JSON-serialized.\n- `custom` — `Union[Unset, CreateScrapeBulkBodyCustom]` — Top-level user-supplied JSON payload, capped at 4096 UTF-8 bytes. Applied to every scrape-type entry that does not provide its own per-entry `custom` (the per-entry value wins). Echoed on each entry's success envelope in the bulk results response (the key is omitted when no `custom` was supplied at either level). Distinct from the system-owned `metadata` column and never used as a cache-key input.\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateScrapeBulkResponse202, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateScrapeBulkResponse202, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateScrapeBulkResponse202, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateScrapeBulkResponse202, Error]]\n```\n\n## Get Scrape Bulk\n\nGet scrape bulk job status\n\nReturns the job envelope plus its rehydrated per-URL scrape envelopes.\n\n**Downloading item content.** A `raw` or `markdown` artifact within the\n10-MiB inline cap is returned inline. An oversized one is replaced by a\n**pre-signed** URL, minted fresh on every read of this endpoint and valid\nfor **86400 seconds (24 hours)**. The underlying objects are private, so an\nunsigned URL returns `401`: download the content inside that window, or\nre-poll this endpoint for a fresh signature. An artifact that was never\nstored, or whose object cannot be signed, is omitted from `formats` and\nreported as `artifact_unavailable` in `warnings`. The private unsigned\nstorage URL is never returned.\n\n**Parameters**\n\n- `id (str)`\n- `cursor (Union[Unset, str])`\n- `limit (Union[Unset, int])`\n- `status (Union[Unset, GetScrapeBulkStatus])`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\nsync(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\nawait asyncio_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\nawait asyncio(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\n```"
451
451
  },
452
452
  "sdk/python/screenshots": {
453
453
  "title": "Screenshots",
454
454
  "section": "SDK Reference",
455
- "body": "# Screenshots\n\nFunctions for interacting with the `screenshots` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Screenshot\n\nCapture a screenshot\n\nSync by default (holds up to 28s). Pass `?async=true` to return 202 immediately.\nPoll via GET /v1/screenshots/\\{id\\}.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `async_ (Union[Unset, bool])`\n- `body (ScreenshotRequest)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body, async_=async_) -> Response[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nsync(client=client, body=body, async_=async_) -> Optional[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nawait asyncio_detailed(client=client, body=body, async_=async_) -> Response[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nawait asyncio(client=client, body=body, async_=async_) -> Optional[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\n```\n\n## Get Screenshot\n\nGet screenshot status\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nsync(id=id, client=client) -> Optional[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\n```"
455
+ "body": "# Screenshots\n\nFunctions for interacting with the `screenshots` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Screenshot\n\nCapture a screenshot\n\nSync by default (holds up to 28s). Pass `?async=true` to return 202 immediately.\nPoll via GET /v1/screenshots/\\{id\\}.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `async_ (Union[Unset, bool])`\n- `body (ScreenshotRequest)`\n- `url` — `str`\n- `device` — `Union[Unset, ScreenshotRequestDevice]`\n- `viewport` — `Union['Viewport', None, Unset]`\n- `full_page` — `Union[Unset, bool]`\n- `format_` — `Union[Unset, ScreenshotRequestFormat]`\n- `quality` — `Union[Unset, int]`\n- `block_ads` — `Union[Unset, bool]`\n- `block_cookie_banners` — `Union[Unset, bool]`\n- `wait_until` — `Union[Unset, ScreenshotRequestWaitUntil]`\n- `wait_for_selector` — `Union[None, Unset, str]`\n- `delay_ms` — `Union[Unset, int]`\n- `scroll` — `Union[Unset, bool]`\n- `clip` — `Union['Clip', None, Unset]`\n- `dark_mode` — `Union[Unset, bool]`\n- `device_scale_factor` — `Union[None, ScreenshotRequestDeviceScaleFactorType1, ScreenshotRequestDeviceScaleFactorType2Type1, ScreenshotRequestDeviceScaleFactorType3Type1, Unset]`\n- `include_html` — `Union[Unset, bool]`\n- `country` — `Union[Unset, str]`\n- `language` — `Union[None, Unset, str]`\n- `metadata` — `Union[Unset, Metadata]` — Arbitrary key-value metadata. Max 4096 bytes when JSON-serialized.\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body, async_=async_) -> Response[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nsync(client=client, body=body, async_=async_) -> Optional[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nawait asyncio_detailed(client=client, body=body, async_=async_) -> Response[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nawait asyncio(client=client, body=body, async_=async_) -> Optional[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\n```\n\n## Get Screenshot\n\nGet screenshot status\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nsync(id=id, client=client) -> Optional[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, ScreenshotResponse, Union['Error', 'ScreenshotResponse']]]\n```"
456
456
  },
457
457
  "sdk/python/search": {
458
458
  "title": "Search",
459
459
  "section": "SDK Reference",
460
- "body": "# Search\n\nFunctions for interacting with the `search` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Search\n\nSearch the web\n\nRuns a web search for `query` and returns ranked organic results with\ncontiguous `position` values from 1.\n\nUse `limit` (1–100, default 10) to request more results in a single\ncall. Results are fetched in pages of 10, so a call consumes\n`ceil(limit / 10)` credits (capped at 10) from the account's monthly\ncredits bucket — for example `limit=10` costs 1 credit and `limit=35`\ncosts 4. Credits are charged for every page fetched regardless of how\nmany results a page returns. The credit count is reported as\n`credits_used` in the response.\n\n**Parameters**\n\n- `body (CreateSearchBody)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateSearchResponse200, CreateSearchResponse502, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateSearchResponse200, CreateSearchResponse502, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateSearchResponse200, CreateSearchResponse502, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateSearchResponse200, CreateSearchResponse502, Error]]\n```"
460
+ "body": "# Search\n\nFunctions for interacting with the `search` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Search\n\nSearch the web\n\nRuns a web search for `query` and returns ranked organic results with\ncontiguous `position` values from 1.\n\nUse `limit` (1–100, default 10) to request more results in a single\ncall. Results are fetched in pages of 10, so a call consumes\n`ceil(limit / 10)` credits (capped at 10) from the account's monthly\ncredits bucket — for example `limit=10` costs 1 credit and `limit=35`\ncosts 4. Credits are charged for every page fetched regardless of how\nmany results a page returns. The credit count is reported as\n`credits_used` in the response.\n\n**Parameters**\n\n- `body (CreateSearchBody)`\n- `query` — `str` — The search query.\n- `type_` — `Union[Unset, CreateSearchBodyType]` — Which search index to query. `web` (default) returns ranked organic results; `news` returns news articles in the same `results` array, additionally populating `source` and `image` on each item; `images` returns image results, populating `source`, `domain`, and a fuller `image` object (full- image dimensions plus a thumbnail URL and dimensions) while omitting `snippet` and `date`. Billing is identical for all three.\n- `limit` — `Union[Unset, int]` — Maximum number of organic results to return. Results are fetched in pages of 10, so the call costs `ceil(limit / 10)` credits (capped at 10).\n- `country` — `Union[Unset, str]` — Two-letter country code to localize results (e.g. `us`, `de`), normalized to lowercase. Defaults to `us`.\n- `language` — `Union[Unset, str]` — Two-letter ISO-639-1 language code for results (e.g. `en`, `fr`), normalized to lowercase. Defaults to `en`.\n- `date_range` — `Union[Unset, CreateSearchBodyDateRange]` — Restrict results to a recency window: `any` (default, no time filter), `hour` (past hour), `day` (past 24 hours), `week` (past week), `month` (past month), or `year` (past year). Applies identically to every `type`; billing is unchanged.\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateSearchResponse200, CreateSearchResponse502, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateSearchResponse200, CreateSearchResponse502, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateSearchResponse200, CreateSearchResponse502, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateSearchResponse200, CreateSearchResponse502, Error]]\n```"
461
461
  },
462
462
  "sdk/python/sitemap": {
463
463
  "title": "Sitemap",
464
464
  "section": "SDK Reference",
465
- "body": "# Sitemap\n\nFunctions for interacting with the `sitemap` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Sitemap\n\nDiscover URLs on a domain\n\nCrawls a domain to build a sitemap. Returns cached results if available\nwithin cache_ttl. Results delivered via webhook and downloadable from results_url.\nWebhook deliveries include `X-ByteKit-Event: sitemap.completed` or\n`X-ByteKit-Event: sitemap.failed` so receivers can dispatch on the\nheader without parsing the body shape.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `body (SitemapRequest)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[Error, SitemapResponse]]\nsync(client=client, body=body) -> Optional[Union[Error, SitemapResponse]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[Error, SitemapResponse]]\nawait asyncio(client=client, body=body) -> Optional[Union[Error, SitemapResponse]]\n```\n\n## Get Sitemap\n\nGet sitemap job status\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, SitemapResponse]]\nsync(id=id, client=client) -> Optional[Union[Error, SitemapResponse]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, SitemapResponse]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, SitemapResponse]]\n```"
465
+ "body": "# Sitemap\n\nFunctions for interacting with the `sitemap` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Sitemap\n\nDiscover URLs on a domain\n\nCrawls a domain to build a sitemap. Returns cached results if available\nwithin cache_ttl. Results delivered via webhook and downloadable from results_url.\nWebhook deliveries include `X-ByteKit-Event: sitemap.completed` or\n`X-ByteKit-Event: sitemap.failed` so receivers can dispatch on the\nheader without parsing the body shape.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**Parameters**\n\n- `body (SitemapRequest)`\n- `url` — `str`\n- `strategy` — `Union[Unset, SitemapRequestStrategy]`\n- `max_depth` — `Union[Unset, int]`\n- `max_urls` — `Union[Unset, int]`\n- `process` — `Union['SitemapRequestProcessType0', None, Unset]`\n- `webhook_url` — `Union[Unset, str]` — Optional webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported). When omitted, no `sitemap.completed`/`sitemap.failed` webhook is delivered and the job is poll-only via `GET /v1/sitemap/\\{id\\}`. When present, delivery is unchanged. `webhook_secret` is ignored when `webhook_url` is absent.\n- `webhook_secret` — `Union[None, Unset, str]` — HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code.\n- `cache_ttl` — `Union[Unset, str]` — Max 90 days.\n- `compact` — `Union[Unset, bool]`\n- `metadata` — `Union[Unset, Metadata]` — Arbitrary key-value metadata. Max 4096 bytes when JSON-serialized.\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[Error, SitemapResponse]]\nsync(client=client, body=body) -> Optional[Union[Error, SitemapResponse]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[Error, SitemapResponse]]\nawait asyncio(client=client, body=body) -> Optional[Union[Error, SitemapResponse]]\n```\n\n## Get Sitemap\n\nGet sitemap job status\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, SitemapResponse]]\nsync(id=id, client=client) -> Optional[Union[Error, SitemapResponse]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, SitemapResponse]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, SitemapResponse]]\n```"
466
466
  },
467
467
  "sdk/python/usage": {
468
468
  "title": "Usage",
@@ -507,7 +507,7 @@
507
507
  "sdk/typescript/scrape": {
508
508
  "title": "Scrape",
509
509
  "section": "SDK Reference",
510
- "body": "# Scrape\n\nFetch a URL as raw HTML, clean markdown, or structured content. Accessed via `client.scrape`.\n\n## create\n\n```ts\nclient.scrape.create(opts: ScrapeOpts, requestOptions?: RequestOptions): Promise<ScrapeCreateResponse>\n```\n\nPOST /v1/scrape — create a scrape job.\n\nResolves to the 200 `success` content envelope or the 202 queued receipt;\nnarrow on `status` to tell them apart. A TERMINAL FAILURE THROWS: the server\ndelivers it as a `failed` envelope on HTTP 200 (a definitive upstream outcome\nis a result, not a transport error), and this method converts it into the\n`ByteKitError` you already catch — `err.code`, `err.message`, and `err.status`\n200. `scrape.get(id)` is unchanged and still returns `failed` as data.\n\nSee `ScrapeCreateResponse` for the full precedence: `async: true` receipts\nimmediately, a browser-path request without it is held open until the render\nreaches a terminal state (200) or the server's hold window expires (202 — a\nreceipt you did not ask for), and everything else takes the fast path (200).\n\nA held request therefore occupies the connection for as long as the render\ntakes, up to the server's hold window (28 s by default) — well inside this\nSDK's 120 s default `timeoutMs`, but worth raising `requestTimeoutMs` if you\nlowered it.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`; both override the constructor's `timeoutMs` default. They\nare a different axis from `opts.timeout_ms`, which is the SERVER-side scrape budget.\n\n## get\n\n```ts\nclient.scrape.get(id: ScrapeId, requestOptions?: RequestOptions): Promise<ScrapeGetResponse>\n```\n\nGET /v1/scrape/\\{id\\} — poll a scrape by ID\n\n## Options (`ScrapeOpts`)\n\n- `url` (required) — `string`\n- `formats` — `Array<'raw' | 'markdown' | 'links' | 'images'>`\n- `country` — `string`\n- `delay_ms` — `number`\n- `timeout_ms` — `number` — SERVER-side scrape budget in ms — how long the server may spend on the scrape itself. For the CLIENT-side abort budget (when this SDK gives up on the wire), see `RequestOptions.requestTimeoutMs`.\n- `async` — `boolean`\n- `webhook_url` — `string`\n- `events` — `Array<'queued' | 'completed' | 'failed'>`\n- `markdown_mode` — `MarkdownMode` — Markdown processing mode. article=article extraction (default), raw=minimal cleanup, llm=compact LLM-optimised output.\n- `markdown_query` — `string` — BM25 query string for relevance-ranked content filtering. Omit or leave empty to disable.\n- `markdown_links` — `MarkdownLinks` — Link rendering style in the markdown output.\n- `markdown_images` — `MarkdownImages` — Image retention mode in the markdown output. Distinct from `markdown_filter_images` (which drops low-signal images before conversion).\n- `with_links_summary` — `boolean` — When true, appends a `Links:` footer to the markdown output. Automatically enabled when `markdown_links` is `'references'`.\n- `with_images_summary` — `boolean` — When true, appends an `Images:` footer to the markdown output.\n- `markdown_compact` — `boolean` — Collapse excessive whitespace for a more compact output.\n- `markdown_filter_images` — `boolean` — Filter low-signal images from the markdown output.\n- `markdown_include_media` — `boolean` — When true, `formats.links` and `formats.images` return `ScrapeScoredLink[]` / `ScrapeScoredImage[]` (rich objects) instead of `string[]`, and a top-level `tables` array is included. Only effective when `markdown` is in `formats`.\n- `markdown_include_warnings` — `boolean` — When true, the response includes markdown-pipeline and tag-filter warnings. `artifact_unavailable` may appear independently when a requested persisted format cannot be rehydrated.\n- `markdown_include_stats` — `boolean` — When true, the response includes a top-level `stats` object with `ScrapeStats` (chars, tokens, blocks). Only effective when `markdown` is in `formats`.\n- `token_budget` — `number` — Maximum token count for the markdown output. Truncates at the last paragraph → sentence → token boundary under the limit. Absent → no truncation.\n- `token_encoding` — `TokenEncoding` — Tokenizer encoding hint for `token_budget`. `cl100k_base` (default) matches GPT-4/4o; `o200k_base` matches GPT-4o-mini / o-series.\n- `mobile` — `boolean` — When true, emulate a mobile device (mobile UA + viewport). Default false (desktop). Part of the cache key, so mobile and desktop responses cache independently.\n- `remove_base64_images` — `boolean` — When true (default), base64-encoded `data:` image sources are stripped before markdown conversion. Set false to preserve them. Does not affect `raw`.\n- `include_tags` — `string[]` — HTML element names (not CSS selectors) to keep. When non-empty, only content within these elements is included in `markdown` output. Applied before `exclude_tags`. Does not affect `raw`.\n- `exclude_tags` — `string[]` — HTML element names (not CSS selectors) to strip from `markdown` output. Applied after `include_tags`. Does not affect `raw`.\n- `clean_markdown` — `boolean` — When true and `markdown` is in `formats`, the converted markdown is sent to Groq for cleaning before return. Graceful degradation on any Groq failure. Billing: 3× credits and bytes applied only when cleaning succeeds.\n- `cache_ttl` — `string | 0` — How long a freshly fetched URL may be served from cache. `'0'`/`0` skips the\ncache read (the result is still written), `'Nh'`/`'Nd'` set a TTL (capped at\n168h / 7d). Default `'48h'`. Honoured on both the synchronous and asynchronous\npaths; the async success envelope reports the outcome via the `cache` field.\n- `custom` — `Record<string, unknown>` — User-supplied JSON payload, echoed back on the success envelope so callers\ncan correlate the response to caller-side state (job IDs, batch metadata).\nCapped at 4096 UTF-8 bytes after JSON serialization. Does NOT affect\ncache-key inputs — two requests differing only in `custom` share the same\ncache slot."
510
+ "body": "# Scrape\n\nFetch a URL as raw HTML, clean markdown, or structured content. Accessed via `client.scrape`.\n\n## create\n\n```ts\nclient.scrape.create(opts: ScrapeOpts, requestOptions?: RequestOptions): Promise<ScrapeCreateResponse>\n```\n\nPOST /v1/scrape — create a scrape job.\n\nResolves to the 200 `success` content envelope or the 202 queued receipt;\nnarrow on `status` to tell them apart. A TERMINAL FAILURE THROWS: the server\ndelivers it as a `failed` envelope on HTTP 200 (a definitive upstream outcome\nis a result, not a transport error), and this method converts it into the\n`ByteKitError` you already catch — `err.code`, `err.message`, and `err.status`\n200. `scrape.get(id)` is unchanged and still returns `failed` as data.\n\nSee `ScrapeCreateResponse` for the full precedence: `async: true` receipts\nimmediately, a browser-path request without it is held open until the render\nreaches a terminal state (200) or the server's hold window expires (202 — a\nreceipt you did not ask for), and everything else takes the fast path (200).\n\nA held request therefore occupies the connection for as long as the render\ntakes, up to the server's hold window (28 s by default) — well inside this\nSDK's 120 s default `timeoutMs`, but worth raising `requestTimeoutMs` if you\nlowered it.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`; both override the constructor's `timeoutMs` default. They\nare a different axis from `opts.timeout_ms`, which is the SERVER-side scrape budget.\n\n## get\n\n```ts\nclient.scrape.get(id: ScrapeId, requestOptions?: RequestOptions): Promise<ScrapeGetResponse>\n```\n\nGET /v1/scrape/\\{id\\} — poll a scrape by ID\n\n## Options (`ScrapeOpts`)\n\n- `url` (required) — `string`\n- `formats` — `Array<'raw' | 'markdown' | 'links' | 'images'>`\n- `country` — `string`\n- `delay_ms` — `number`\n- `timeout_ms` — `number` — SERVER-side scrape budget in ms — how long the server may spend on the scrape itself. For the CLIENT-side abort budget (when this SDK gives up on the wire), see `RequestOptions.requestTimeoutMs`.\n- `async` — `boolean`\n- `webhook_url` — `string`\n- `events` — `Array<'queued' | 'completed' | 'failed'>`\n- `markdown_mode` — `MarkdownMode` — Markdown processing mode. article=article extraction (default), raw=minimal cleanup, llm=compact LLM-optimised output.\n- `markdown_query` — `string` — BM25 query string for relevance-ranked content filtering. Omit or leave empty to disable.\n- `markdown_links` — `MarkdownLinks` — Link rendering style in the markdown output.\n- `markdown_images` — `MarkdownImages` — Image retention mode in the markdown output. Distinct from `markdown_filter_images` (which drops low-signal images before conversion).\n- `with_links_summary` — `boolean` — When true, appends a `Links:` footer to the markdown output. Automatically enabled when `markdown_links` is `'references'`.\n- `with_images_summary` — `boolean` — When true, appends an `Images:` footer to the markdown output.\n- `markdown_compact` — `boolean` — Collapse excessive whitespace for a more compact output.\n- `markdown_filter_images` — `boolean` — Filter low-signal images from the markdown output.\n- `markdown_include_media` — `boolean` — When true, `formats.links` and `formats.images` return `ScrapeScoredLink[]` / `ScrapeScoredImage[]` (rich objects) instead of `string[]`, and a top-level `tables` array is included. Only effective when `markdown` is in `formats`.\n- `markdown_include_warnings` — `boolean` — When true, the response includes markdown-pipeline and tag-filter warnings. `artifact_unavailable` may appear independently when a requested persisted format cannot be rehydrated.\n- `markdown_include_stats` — `boolean` — When true, the response includes a top-level `stats` object with `ScrapeStats` (chars, tokens, blocks). Only effective when `markdown` is in `formats`.\n- `token_budget` — `number` — Maximum token count for the markdown output. Truncates at the last paragraph → sentence → token boundary under the limit. Absent → no truncation.\n- `token_encoding` — `TokenEncoding` — Tokenizer encoding hint for `token_budget`. `cl100k_base` (default) matches GPT-4/4o; `o200k_base` matches GPT-4o-mini / o-series.\n- `solve_challenge` — `boolean` — Attempts to clear a Cloudflare challenge; success is not guaranteed. Billed as a normal browser render.\n- `mobile` — `boolean` — When true, emulate a mobile device (mobile UA + viewport). Default false (desktop). Part of the cache key, so mobile and desktop responses cache independently.\n- `remove_base64_images` — `boolean` — When true (default), base64-encoded `data:` image sources are stripped before markdown conversion. Set false to preserve them. Does not affect `raw`.\n- `include_tags` — `string[]` — HTML element names (not CSS selectors) to keep. When non-empty, only content within these elements is included in `markdown` output. Applied before `exclude_tags`. Does not affect `raw`.\n- `exclude_tags` — `string[]` — HTML element names (not CSS selectors) to strip from `markdown` output. Applied after `include_tags`. Does not affect `raw`.\n- `clean_markdown` — `boolean` — When true and `markdown` is in `formats`, the converted markdown is sent to Groq for cleaning before return. Graceful degradation on any Groq failure. Billing: 3× credits and bytes applied only when cleaning succeeds.\n- `cache_ttl` — `string | 0` — How long a freshly fetched URL may be served from cache. `'0'`/`0` skips the\ncache read (the result is still written), `'Nh'`/`'Nd'` set a TTL (capped at\n168h / 7d). Default `'48h'`. Honoured on both the synchronous and asynchronous\npaths; the async success envelope reports the outcome via the `cache` field.\n- `custom` — `Record<string, unknown>` — User-supplied JSON payload, echoed back on the success envelope so callers\ncan correlate the response to caller-side state (job IDs, batch metadata).\nCapped at 4096 UTF-8 bytes after JSON serialization. Does NOT affect\ncache-key inputs — two requests differing only in `custom` share the same\ncache slot."
511
511
  },
512
512
  "sdk/typescript/scrape-bulk": {
513
513
  "title": "Scrape Bulk",
@@ -52,6 +52,10 @@ export function scrapeUrlTool(server, client) {
52
52
  .optional()
53
53
  .describe('Content formats to return. Default: ["markdown"]. Options: markdown, raw, links, images. Omit the parameter for the default; an empty array is rejected.'),
54
54
  country: z.string().optional().describe('Two-letter country code for geo-targeted scraping'),
55
+ solve_challenge: z
56
+ .boolean()
57
+ .optional()
58
+ .describe('Attempt to clear a Cloudflare challenge; success is not guaranteed. Billed as a normal browser render.'),
55
59
  }, async (params) => {
56
60
  try {
57
61
  const formats = params.formats ?? ['markdown'];
@@ -59,6 +63,7 @@ export function scrapeUrlTool(server, client) {
59
63
  url: params.url,
60
64
  formats,
61
65
  ...(params.country !== undefined && { country: params.country }),
66
+ ...(params.solve_challenge !== undefined && { solve_challenge: params.solve_challenge }),
62
67
  });
63
68
  const { text, isError } = renderScrapeResult(result);
64
69
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hunt-labs/bytekit-mcp",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "ByteKit MCP server — exposes ByteKit web-data tools (scrape, screenshot, search, docs) to AI agents over the Model Context Protocol, hosted or as a local stdio server.",
5
5
  "license": "MIT",
6
6
  "type": "module",