browser-use-sdk 3.4.3 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/v3.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { H as HttpClient } from './errors-BtB79l7x.js';
3
- export { B as BrowserUseError } from './errors-BtB79l7x.js';
2
+ import { H as HttpClient, X as X402Client } from './errors-Bp9CqFUs.js';
3
+ export { B as BrowserUseError } from './errors-Bp9CqFUs.js';
4
4
 
5
5
  interface components {
6
6
  schemas: {
@@ -50,6 +50,12 @@ interface components {
50
50
  * @description The plan information
51
51
  */
52
52
  planInfo: components["schemas"]["PlanInfo"];
53
+ /**
54
+ * Is Free Tier
55
+ * @description Whether the account is on the free tier
56
+ * @default false
57
+ */
58
+ isFreeTier: boolean;
53
59
  /**
54
60
  * Project ID
55
61
  * Format: uuid
@@ -57,6 +63,200 @@ interface components {
57
63
  */
58
64
  projectId: string;
59
65
  };
66
+ /** BoxCreateRequest */
67
+ BoxCreateRequest: {
68
+ /** Profile Id */
69
+ profile_id?: string | null;
70
+ /** Size */
71
+ size?: ("small" | "medium" | "large") | null;
72
+ };
73
+ /** BoxCreateResponse */
74
+ BoxCreateResponse: {
75
+ box: components["schemas"]["BoxView"];
76
+ };
77
+ /** BoxPatchRequest */
78
+ BoxPatchRequest: {
79
+ /** Dsp Enabled */
80
+ dsp_enabled?: boolean | null;
81
+ };
82
+ /**
83
+ * BoxResizeRequest
84
+ * @description Resize an existing box to a larger tier.
85
+ *
86
+ * Upgrade-only: the backend rejects requests where `size` isn't strictly
87
+ * larger than the box's current size. Downsize → 400 with a hint to
88
+ * destroy + redeploy. Same size → 409 (idempotent failure — no work to do).
89
+ */
90
+ BoxResizeRequest: {
91
+ /**
92
+ * Size
93
+ * @enum {string}
94
+ */
95
+ size: "small" | "medium" | "large";
96
+ };
97
+ /**
98
+ * BoxRestartMode
99
+ * @description How aggressive a /me/restart should be.
100
+ *
101
+ * `service` — fastest, fixes ~95% of cases (agent process crash, OOM,
102
+ * wedged TG long-poll). SSM `systemctl restart bux-tg`. ~5s.
103
+ * `reboot` — fallback for kernel-hung / SSM-unreachable boxes. AWS
104
+ * rebootInstances. ~30-60s. IP + EBS preserved.
105
+ * @enum {string}
106
+ */
107
+ BoxRestartMode: "service" | "reboot";
108
+ /** BoxRestartRequest */
109
+ BoxRestartRequest: {
110
+ /** @default service */
111
+ mode: components["schemas"]["BoxRestartMode"];
112
+ };
113
+ /**
114
+ * BoxSizeListResponse
115
+ * @description Catalog of available size tiers, returned to the deploy picker.
116
+ *
117
+ * Keeping the list server-side (instead of hardcoding prices in the
118
+ * frontend) means the day we re-tier or run a promo, we don't have
119
+ * to ship a frontend deploy. Just edit `sizing.py`.
120
+ */
121
+ BoxSizeListResponse: {
122
+ /** Sizes */
123
+ sizes: components["schemas"]["BoxSizeSpecView"][];
124
+ /**
125
+ * Default
126
+ * @enum {string}
127
+ */
128
+ default: "small" | "medium" | "large";
129
+ };
130
+ /**
131
+ * BoxSizeSpecView
132
+ * @description User-visible spec sheet for one size tier. Returned alongside
133
+ * BoxView so the UI can render the tooltip ("2 vCPU · 4 GB · 20 GB")
134
+ * without a second round trip + so the picker on /bux can show all
135
+ * three rows without us hardcoding prices in the frontend.
136
+ */
137
+ BoxSizeSpecView: {
138
+ /**
139
+ * Name
140
+ * @enum {string}
141
+ */
142
+ name: "small" | "medium" | "large";
143
+ /** Vcpu */
144
+ vcpu: number;
145
+ /** Ram Gb */
146
+ ram_gb: number;
147
+ /** Disk Gb */
148
+ disk_gb: number;
149
+ /** Daily Usd */
150
+ daily_usd: number;
151
+ /** Min Balance Usd */
152
+ min_balance_usd: number;
153
+ };
154
+ /**
155
+ * BoxStatus
156
+ * @enum {string}
157
+ */
158
+ BoxStatus: "provisioning" | "awaiting_oauth" | "ready" | "resizing" | "error" | "halted" | "destroyed";
159
+ /** BoxView */
160
+ BoxView: {
161
+ /**
162
+ * Id
163
+ * Format: uuid
164
+ */
165
+ id: string;
166
+ /**
167
+ * Project Id
168
+ * Format: uuid
169
+ */
170
+ project_id: string;
171
+ /** Profile Id */
172
+ profile_id: string | null;
173
+ /**
174
+ * Size
175
+ * @enum {string}
176
+ */
177
+ size: "small" | "medium" | "large";
178
+ size_spec: components["schemas"]["BoxSizeSpecView"];
179
+ /** Ec2 Instance Id */
180
+ ec2_instance_id: string | null;
181
+ /** Public Ip */
182
+ public_ip: string | null;
183
+ status: components["schemas"]["BoxStatus"];
184
+ /** Status Detail */
185
+ status_detail: string | null;
186
+ /** Claude Authed */
187
+ claude_authed: boolean;
188
+ /** Tg Installed */
189
+ tg_installed: boolean;
190
+ /** Tg Bot Username */
191
+ tg_bot_username: string | null;
192
+ /** Dsp Enabled */
193
+ dsp_enabled: boolean;
194
+ /** Live Browser Url */
195
+ live_browser_url: string | null;
196
+ /** Last Heartbeat At */
197
+ last_heartbeat_at: string | null;
198
+ /** Trial Ends At */
199
+ trial_ends_at?: string | null;
200
+ /**
201
+ * Created At
202
+ * Format: date-time
203
+ */
204
+ created_at: string;
205
+ /**
206
+ * Updated At
207
+ * Format: date-time
208
+ */
209
+ updated_at: string;
210
+ };
211
+ /**
212
+ * BrowserDownloadFile
213
+ * @description A single file the browser downloaded during the session.
214
+ */
215
+ BrowserDownloadFile: {
216
+ /**
217
+ * Path
218
+ * @description File name (basename relative to the session downloads prefix)
219
+ */
220
+ path: string;
221
+ /**
222
+ * Size
223
+ * @description File size in bytes
224
+ */
225
+ size: number;
226
+ /**
227
+ * Lastmodified
228
+ * Format: date-time
229
+ * @description When the file was last modified in S3
230
+ */
231
+ lastModified: string;
232
+ /**
233
+ * Url
234
+ * @description Presigned download URL (15 min expiry). Only included when `includeUrls=true`.
235
+ */
236
+ url?: string | null;
237
+ };
238
+ /**
239
+ * BrowserDownloadListResponse
240
+ * @description Paginated list of browser downloads with optional presigned URLs.
241
+ */
242
+ BrowserDownloadListResponse: {
243
+ /**
244
+ * Files
245
+ * @description List of files downloaded by the browser
246
+ */
247
+ files: components["schemas"]["BrowserDownloadFile"][];
248
+ /**
249
+ * Nextcursor
250
+ * @description Cursor for the next page. Pass as the `cursor` query parameter to fetch the next page.
251
+ */
252
+ nextCursor?: string | null;
253
+ /**
254
+ * Hasmore
255
+ * @description Whether there are more files beyond this page.
256
+ * @default false
257
+ */
258
+ hasMore: boolean;
259
+ };
60
260
  /**
61
261
  * BrowserSessionItemView
62
262
  * @description View model for representing a browser session in list views.
@@ -265,11 +465,17 @@ interface components {
265
465
  *
266
466
  * - `bu-mini` / `gemini-3-flash`: Gemini 3 Flash — fast and cost-effective. Best for simple, well-defined tasks like form filling or data extraction.
267
467
  * - `bu-max` / `claude-sonnet-4.6`: Claude Sonnet 4.6 — balanced performance. Best for multi-step workflows that require reasoning and decision-making.
268
- * - `bu-ultra` / `claude-opus-4.6`: Claude Opus 4.6 — most capable. Best for complex tasks that require advanced reasoning, long-horizon planning, or handling ambiguous instructions.
468
+ * - `bu-ultra` / `claude-opus-4.6`: Claude Opus 4.6 — capable general-purpose Opus tier.
469
+ * - `claude-opus-4.7`: Claude Opus 4.7 — most capable. Best for complex tasks that require advanced reasoning, long-horizon planning, or handling ambiguous instructions.
269
470
  * - `gpt-5.4-mini`: GPT-5.4 mini — OpenAI's fast and efficient model. Best for tasks that benefit from OpenAI's capabilities.
270
471
  * @enum {string}
271
472
  */
272
- BuModel: "bu-mini" | "bu-max" | "bu-ultra" | "gemini-3-flash" | "claude-sonnet-4.6" | "claude-opus-4.6" | "gpt-5.4-mini";
473
+ BuModel: "bu-mini" | "bu-max" | "bu-ultra" | "gemini-3-flash" | "claude-sonnet-4.6" | "claude-opus-4.6" | "claude-opus-4.7" | "gpt-5.4-mini";
474
+ /** ClaudeLoginCodeRequest */
475
+ ClaudeLoginCodeRequest: {
476
+ /** Code */
477
+ code: string;
478
+ };
273
479
  /**
274
480
  * CreateBrowserSessionRequest
275
481
  * @description Request model for creating a browser session.
@@ -345,6 +551,12 @@ interface components {
345
551
  * @description Password for proxy authentication.
346
552
  */
347
553
  password?: string | null;
554
+ /**
555
+ * Ignore Certificate Errors
556
+ * @description Ignore TLS certificate errors. Enable this if your proxy uses a self-signed or untrusted certificate (e.g. Burp Suite, corporate proxies).
557
+ * @default false
558
+ */
559
+ ignoreCertErrors: boolean;
348
560
  };
349
561
  /**
350
562
  * FileInfo
@@ -696,106 +908,10 @@ interface components {
696
908
  * @enum {string}
697
909
  */
698
910
  ProxyCountryCode: "ad" | "ae" | "af" | "ag" | "ai" | "al" | "am" | "an" | "ao" | "aq" | "ar" | "as" | "at" | "au" | "aw" | "az" | "ba" | "bb" | "bd" | "be" | "bf" | "bg" | "bh" | "bi" | "bj" | "bl" | "bm" | "bn" | "bo" | "bq" | "br" | "bs" | "bt" | "bv" | "bw" | "by" | "bz" | "ca" | "cc" | "cd" | "cf" | "cg" | "ch" | "ck" | "cl" | "cm" | "co" | "cr" | "cs" | "cu" | "cv" | "cw" | "cx" | "cy" | "cz" | "de" | "dj" | "dk" | "dm" | "do" | "dz" | "ec" | "ee" | "eg" | "eh" | "er" | "es" | "et" | "fi" | "fj" | "fk" | "fm" | "fo" | "fr" | "ga" | "gd" | "ge" | "gf" | "gg" | "gh" | "gi" | "gl" | "gm" | "gn" | "gp" | "gq" | "gr" | "gs" | "gt" | "gu" | "gw" | "gy" | "hk" | "hm" | "hn" | "hr" | "ht" | "hu" | "id" | "ie" | "il" | "im" | "in" | "iq" | "ir" | "is" | "it" | "je" | "jm" | "jo" | "jp" | "ke" | "kg" | "kh" | "ki" | "km" | "kn" | "kp" | "kr" | "kw" | "ky" | "kz" | "la" | "lb" | "lc" | "li" | "lk" | "lr" | "ls" | "lt" | "lu" | "lv" | "ly" | "ma" | "mc" | "md" | "me" | "mf" | "mg" | "mh" | "mk" | "ml" | "mm" | "mn" | "mo" | "mp" | "mq" | "mr" | "ms" | "mt" | "mu" | "mv" | "mw" | "mx" | "my" | "mz" | "na" | "nc" | "ne" | "nf" | "ng" | "ni" | "nl" | "no" | "np" | "nr" | "nu" | "nz" | "om" | "pa" | "pe" | "pf" | "pg" | "ph" | "pk" | "pl" | "pm" | "pn" | "pr" | "ps" | "pt" | "pw" | "py" | "qa" | "re" | "ro" | "rs" | "ru" | "rw" | "sa" | "sb" | "sc" | "sd" | "se" | "sg" | "sh" | "si" | "sj" | "sk" | "sl" | "sm" | "sn" | "so" | "sr" | "ss" | "st" | "sv" | "sx" | "sy" | "sz" | "tc" | "td" | "tf" | "tg" | "th" | "tj" | "tk" | "tl" | "tm" | "tn" | "to" | "tr" | "tt" | "tv" | "tw" | "tz" | "ua" | "ug" | "uk" | "us" | "uy" | "uz" | "va" | "vc" | "ve" | "vg" | "vi" | "vn" | "vu" | "wf" | "ws" | "xk" | "ye" | "yt" | "za" | "zm" | "zw";
699
- /**
700
- * RunTaskRequest
701
- * @description Create a new session, dispatch a task, or both.
702
- *
703
- * - **No `sessionId` + no `task`**: creates an idle session (useful for uploading files before running a task).
704
- * - **No `sessionId` + `task`**: creates a new session and immediately runs the task.
705
- * - **`sessionId` + `task`**: dispatches the task to an existing idle session.
706
- * - **`sessionId` + no `task`**: returns 422 — a task is required when targeting an existing session.
707
- */
911
+ /** RunTaskRequest */
708
912
  RunTaskRequest: {
709
- /**
710
- * Task
711
- * @description The natural-language instruction for the agent to execute (e.g. "Go to amazon.com and find the best-rated wireless mouse under $50"). Required when dispatching to an existing session.
712
- */
713
- task?: string | null;
714
- /**
715
- * @description The model to use. "gemini-3-flash" is fast and cheap, "claude-sonnet-4.6" is balanced, "claude-opus-4.6" is most capable. See BuModel for details.
716
- * @default claude-sonnet-4.6
717
- */
718
- model: components["schemas"]["BuModel"];
719
- /**
720
- * Sessionid
721
- * @description ID of an existing idle session to dispatch the task to. If omitted, a new session is created.
722
- */
723
- sessionId?: string | null;
724
- /**
725
- * Keepalive
726
- * @description If true, the session stays alive in idle state after the task completes instead of automatically stopping. This lets you dispatch follow-up tasks to the same session, preserving browser state and files.
727
- * @default false
728
- */
729
- keepAlive: boolean;
730
- /**
731
- * Maxcostusd
732
- * @description Maximum total cost in USD allowed for this session. The task will be stopped if this limit is reached. If omitted, a default limit applies (capped by your available balance).
733
- */
734
- maxCostUsd?: number | string | null;
735
- /**
736
- * Profileid
737
- * @description ID of a browser profile to load into the session. Profiles persist cookies, local storage, and other browser state across sessions. Create profiles via the Profiles API.
738
- */
739
- profileId?: string | null;
740
- /**
741
- * Workspaceid
742
- * @description ID of a workspace to attach to the session. Workspaces provide persistent file storage that carries across sessions. Create workspaces via the Workspaces API.
743
- */
744
- workspaceId?: string | null;
745
- /**
746
- * @description Country code for the browser proxy (e.g. "US", "DE", "JP"). Set to null to disable the proxy. The proxy routes browser traffic through the specified country, useful for accessing geo-restricted content.
747
- * @default us
748
- */
749
- proxyCountryCode: components["schemas"]["ProxyCountryCode"] | null;
750
- /**
751
- * Outputschema
752
- * @description A JSON Schema that the agent's final output must conform to. When set, the agent will return structured data matching this schema in the `output` field of the response. Example: {"type": "object", "properties": {"price": {"type": "number"}, "title": {"type": "string"}}}.
753
- */
754
- outputSchema?: {
755
- [key: string]: unknown;
756
- } | null;
757
- /**
758
- * Enablescheduledtasks
759
- * @description If true, the agent can create scheduled tasks that run on a recurring basis (e.g. "every Monday morning, check my inbox and summarize new emails"). Scheduled tasks are tied to your project and persist beyond the session. Note: all scheduled tasks are visible project-wide, so avoid enabling this in multi-user setups where task isolation is needed.
760
- * @default false
761
- */
762
- enableScheduledTasks: boolean;
763
- /**
764
- * Sensitivedata
765
- * @description Key-value pairs of sensitive data (e.g. passwords, API keys) that the agent can use via secure placeholders. Keys are exposed to the LLM; values are never shown. The agent uses `<secret>key</secret>` placeholders in browser_type_text to securely enter values. WARNING: sensitive data may be visible in screenshots if the page renders values in unmasked form fields.
766
- */
767
- sensitiveData?: {
768
- [key: string]: string;
769
- } | null;
770
- /**
771
- * Enablerecording
772
- * @description If true, records a video of the browser session. The recording URLs will be available in the `recordingUrls` field of the session response after the task completes.
773
- * @default false
774
- */
775
- enableRecording: boolean;
776
- /**
777
- * Skills
778
- * @description If true, enables built-in agent skills like Google Sheets integration and file management. Set to false to restrict the agent to browser-only actions.
779
- * @default true
780
- */
781
- skills: boolean;
782
- /**
783
- * Agentmail
784
- * @description If true, provisions a temporary email inbox (via AgentMail) for the session. The email address is available in the `agentmailEmail` field of the session response. Useful for tasks that require email verification or sign-ups.
785
- * @default true
786
- */
787
- agentmail: boolean;
788
- /**
789
- * Cachescript
790
- * @description Controls deterministic script caching. `null` (default): auto-detected — enabled when the task contains `@{{value}}` brackets and a workspace is attached. `true`: force-enable script caching even without brackets (caches the exact task). `false`: force-disable, even if brackets are present. When active, the first call runs the full agent and saves a reusable script. Subsequent calls with the same task template execute the cached script with $0 LLM cost. Requires workspace_id when enabled. Example: "Get prices from @{{https://example.com}} for @{{electronics}}".
791
- */
792
- cacheScript?: boolean | null;
793
- /**
794
- * Autoheal
795
- * @description When cache_script is active, controls whether a lightweight LLM validates the cached script output. If the output looks incorrect (empty, error, wrong structure), the system automatically re-triggers the full agent to generate a new version of the script. Set to false to disable validation and always return the raw script output.
796
- * @default true
797
- */
798
- autoHeal: boolean;
913
+ /** Prompt */
914
+ prompt: string;
799
915
  };
800
916
  /** SessionListResponse */
801
917
  SessionListResponse: {
@@ -856,7 +972,7 @@ interface components {
856
972
  title?: string | null;
857
973
  /**
858
974
  * Output
859
- * @description The agent's final output. If `outputSchema` was provided, this will be structured data conforming to that schema. Otherwise it may be a free-form string or null. Populated once the task completes, regardless of whether `isTaskSuccessful` is true or false.
975
+ * @description The agent's final output. If `codeMode` was true, this will be an object with `text` (summary), `code` (Python source), and optionally `output` (execution result). If `outputSchema` was provided, this will be structured data conforming to that schema. Otherwise it may be a free-form string or null.
860
976
  */
861
977
  output?: unknown | null;
862
978
  /**
@@ -962,6 +1078,11 @@ interface components {
962
1078
  * @description Temporary email address provisioned for this session (via AgentMail). Only present if `agentmail` was enabled.
963
1079
  */
964
1080
  agentmailEmail?: string | null;
1081
+ /**
1082
+ * Integrationsused
1083
+ * @description List of integration providers used during this session (e.g. ["gmail", "slack", "agentmail"]).
1084
+ */
1085
+ integrationsUsed?: string[];
965
1086
  /**
966
1087
  * Createdat
967
1088
  * Format: date-time
@@ -986,6 +1107,19 @@ interface components {
986
1107
  */
987
1108
  detail: string;
988
1109
  };
1110
+ /**
1111
+ * ShellResponse
1112
+ * @description Terminal URL — user opens this in their browser, gets a live shell.
1113
+ */
1114
+ ShellResponse: {
1115
+ /** Url */
1116
+ url: string;
1117
+ /**
1118
+ * Expires In Seconds
1119
+ * @default 900
1120
+ */
1121
+ expires_in_seconds: number;
1122
+ };
989
1123
  /** StopSessionRequest */
990
1124
  StopSessionRequest: {
991
1125
  /**
@@ -1003,6 +1137,65 @@ interface components {
1003
1137
  * @enum {string}
1004
1138
  */
1005
1139
  StopStrategy: "task" | "session";
1140
+ /** TelegramInstallRequest */
1141
+ TelegramInstallRequest: {
1142
+ /** Bot Token */
1143
+ bot_token: string;
1144
+ };
1145
+ /** TelegramInstallResponse */
1146
+ TelegramInstallResponse: {
1147
+ /** Installed */
1148
+ installed: boolean;
1149
+ /** Bot Username */
1150
+ bot_username: string;
1151
+ /** Deeplink */
1152
+ deeplink: string;
1153
+ /** Setup Token */
1154
+ setup_token: string;
1155
+ };
1156
+ /**
1157
+ * TgAutoSessionView
1158
+ * @description Snapshot of a QR onboarding session. Returned by start, status, and
1159
+ * cancel — same shape so the FE renders a single view component.
1160
+ */
1161
+ TgAutoSessionView: {
1162
+ /**
1163
+ * Id
1164
+ * Format: uuid
1165
+ */
1166
+ id: string;
1167
+ /**
1168
+ * State
1169
+ * @enum {string}
1170
+ */
1171
+ state: "pending_browser" | "waiting_scan" | "login_detected" | "minting" | "installing" | "installed" | "failed" | "expired";
1172
+ /** Live Url */
1173
+ live_url: string | null;
1174
+ /** Bot Username */
1175
+ bot_username: string | null;
1176
+ /** Error Code */
1177
+ error_code: ("bu_cloud_auth" | "bu_cloud_unavailable" | "bu_cloud_rate_limited" | "bu_cloud_timeout" | "scan_timeout" | "agent_dispatch_failed" | "agent_timeout" | "agent_no_output" | "agent_failed" | "invalid_token" | "bot_username_collision" | "rate_limited_botfather" | "box_not_ready" | "tg_already_installed" | "install_telegram_failed" | "box_offline" | "cancelled" | "concurrent_limit" | "internal") | null;
1178
+ /** Error Message */
1179
+ error_message: string | null;
1180
+ /**
1181
+ * Created At
1182
+ * Format: date-time
1183
+ */
1184
+ created_at: string;
1185
+ /**
1186
+ * Updated At
1187
+ * Format: date-time
1188
+ */
1189
+ updated_at: string;
1190
+ };
1191
+ /**
1192
+ * TgAutoStartResponse
1193
+ * @description Returned by POST /me/tg/auto. The session is already running by the
1194
+ * time this returns — frontend opens the iframe and starts polling.
1195
+ */
1196
+ TgAutoStartResponse: {
1197
+ session: components["schemas"]["TgAutoSessionView"];
1198
+ };
1006
1199
  /**
1007
1200
  * TooManyConcurrentActiveSessionsError
1008
1201
  * @description Error response when user has too many concurrent active sessions
@@ -1014,6 +1207,28 @@ interface components {
1014
1207
  */
1015
1208
  detail: string;
1016
1209
  };
1210
+ /**
1211
+ * TrialEligibilityView
1212
+ * @description GET /me/trial-eligibility — is this user eligible for a free trial?
1213
+ *
1214
+ * Account-scoped — paid users see this too (one free trial per user,
1215
+ * regardless of payment tier).
1216
+ *
1217
+ * `reason` is a stable machine-readable code the FE branches on:
1218
+ * - 'already_used' — user has already started a trial in their
1219
+ * lifetime. Render an "upgrade to deploy" CTA.
1220
+ * - 'no_owner' — couldn't resolve the project's owner profile (rare,
1221
+ * older projects). FE falls back to generic "add credits" copy.
1222
+ * - None when eligible=True.
1223
+ */
1224
+ TrialEligibilityView: {
1225
+ /** Eligible */
1226
+ eligible: boolean;
1227
+ /** Reason */
1228
+ reason?: ("already_used" | "no_owner") | null;
1229
+ /** Message */
1230
+ message?: string | null;
1231
+ };
1017
1232
  /**
1018
1233
  * UpdateBrowserSessionRequest
1019
1234
  * @description Request model for updating browser session state.
@@ -1034,6 +1249,50 @@ interface components {
1034
1249
  /** Error Type */
1035
1250
  type: string;
1036
1251
  };
1252
+ /** WindowCreateRequest */
1253
+ WindowCreateRequest: {
1254
+ /** Label */
1255
+ label?: string | null;
1256
+ };
1257
+ /** WindowListResponse */
1258
+ WindowListResponse: {
1259
+ /** Windows */
1260
+ windows: components["schemas"]["WindowView"][];
1261
+ };
1262
+ /** WindowRenameRequest */
1263
+ WindowRenameRequest: {
1264
+ /** Label */
1265
+ label: string;
1266
+ };
1267
+ /**
1268
+ * WindowView
1269
+ * @description One tmux window on the box. id is the tmux session name (`bux-w<n>`).
1270
+ *
1271
+ * `label` is a user-supplied name (max 64 chars) stored as a tmux
1272
+ * per-session option (@bux-label). `attached` is True if any tmux
1273
+ * client is currently connected to the window. The FE shows a small
1274
+ * indicator next to attached windows so users know which one a phone
1275
+ * is currently mirroring.
1276
+ */
1277
+ WindowView: {
1278
+ /** Id */
1279
+ id: string;
1280
+ /**
1281
+ * Label
1282
+ * @default
1283
+ */
1284
+ label: string;
1285
+ /**
1286
+ * Attached
1287
+ * @default false
1288
+ */
1289
+ attached: boolean;
1290
+ /**
1291
+ * Created At
1292
+ * @default 0
1293
+ */
1294
+ created_at: number;
1295
+ };
1037
1296
  /**
1038
1297
  * WorkspaceCreateRequest
1039
1298
  * @description Request model for creating a new workspace.
@@ -1111,6 +1370,119 @@ interface components {
1111
1370
  */
1112
1371
  updatedAt: string;
1113
1372
  };
1373
+ /**
1374
+ * RunTaskRequest
1375
+ * @description Create a new session, dispatch a task, or both.
1376
+ *
1377
+ * - **No `sessionId` + no `task`**: creates an idle session (useful for uploading files before running a task).
1378
+ * - **No `sessionId` + `task`**: creates a new session and immediately runs the task.
1379
+ * - **`sessionId` + `task`**: dispatches the task to an existing idle session.
1380
+ * - **`sessionId` + no `task`**: returns 422 — a task is required when targeting an existing session.
1381
+ */
1382
+ app__endpoints__api__v3__sessions__views__RunTaskRequest: {
1383
+ /**
1384
+ * Task
1385
+ * @description The natural-language instruction for the agent to execute (e.g. "Go to amazon.com and find the best-rated wireless mouse under $50"). Required when dispatching to an existing session.
1386
+ */
1387
+ task?: string | null;
1388
+ /**
1389
+ * @description The model to use. "gemini-3-flash" is fast and cheap, "claude-sonnet-4.6" is balanced, "claude-opus-4.7" is most capable (default). See BuModel for details.
1390
+ * @default claude-opus-4.7
1391
+ */
1392
+ model: components["schemas"]["BuModel"];
1393
+ /**
1394
+ * Sessionid
1395
+ * @description ID of an existing idle session to dispatch the task to. If omitted, a new session is created.
1396
+ */
1397
+ sessionId?: string | null;
1398
+ /**
1399
+ * Keepalive
1400
+ * @description If true, the session stays alive in idle state after the task completes instead of automatically stopping. This lets you dispatch follow-up tasks to the same session, preserving browser state and files.
1401
+ * @default false
1402
+ */
1403
+ keepAlive: boolean;
1404
+ /**
1405
+ * Maxcostusd
1406
+ * @description Maximum total cost in USD allowed for this session. The task will be stopped if this limit is reached. If omitted, a default limit applies (capped by your available balance). When dispatching a follow-up task to an existing session (`sessionId` is set), supplying this value overrides the session's budget for the upcoming dispatch; otherwise the budget is automatically refreshed to current spend + default.
1407
+ */
1408
+ maxCostUsd?: number | string | null;
1409
+ /**
1410
+ * Profileid
1411
+ * @description ID of a browser profile to load into the session. Profiles persist cookies, local storage, and other browser state across sessions. Create profiles via the Profiles API.
1412
+ */
1413
+ profileId?: string | null;
1414
+ /**
1415
+ * Workspaceid
1416
+ * @description ID of a workspace to attach to the session. Workspaces provide persistent file storage that carries across sessions. Create workspaces via the Workspaces API.
1417
+ */
1418
+ workspaceId?: string | null;
1419
+ /**
1420
+ * @description Country code for the browser proxy (e.g. "US", "DE", "JP"). Set to null to disable the proxy. The proxy routes browser traffic through the specified country, useful for accessing geo-restricted content.
1421
+ * @default us
1422
+ */
1423
+ proxyCountryCode: components["schemas"]["ProxyCountryCode"] | null;
1424
+ /**
1425
+ * Outputschema
1426
+ * @description A JSON Schema that the agent's final output must conform to. When set, the agent will return structured data matching this schema in the `output` field of the response. Example: {"type": "object", "properties": {"price": {"type": "number"}, "title": {"type": "string"}}}.
1427
+ */
1428
+ outputSchema?: {
1429
+ [key: string]: unknown;
1430
+ } | null;
1431
+ /**
1432
+ * Enablescheduledtasks
1433
+ * @description If true, the agent can create scheduled tasks that run on a recurring basis (e.g. "every Monday morning, check my inbox and summarize new emails"). Scheduled tasks are tied to your project and persist beyond the session. Note: all scheduled tasks are visible project-wide, so avoid enabling this in multi-user setups where task isolation is needed.
1434
+ * @default false
1435
+ */
1436
+ enableScheduledTasks: boolean;
1437
+ /**
1438
+ * Sensitivedata
1439
+ * @description Key-value pairs of sensitive data (e.g. passwords, API keys) that the agent can use via secure placeholders. Keys are exposed to the LLM; values are never shown. The agent uses `<secret>key</secret>` placeholders in browser_type_text to securely enter values.
1440
+ */
1441
+ sensitiveData?: {
1442
+ [key: string]: string;
1443
+ } | null;
1444
+ /**
1445
+ * Enablerecording
1446
+ * @description If true, records a video of the browser session. The recording URLs will be available in the `recordingUrls` field of the session response after the task completes.
1447
+ * @default false
1448
+ */
1449
+ enableRecording: boolean;
1450
+ /**
1451
+ * Skills
1452
+ * @description If true, enables built-in agent skills like Google Sheets integration and file management. Set to false to restrict the agent to browser-only actions.
1453
+ * @default true
1454
+ */
1455
+ skills: boolean;
1456
+ /**
1457
+ * Agentmail
1458
+ * @description If true, provisions a temporary email inbox (via AgentMail) for the session. The email address is available in the `agentmailEmail` field of the session response. Useful for tasks that require email verification or sign-ups.
1459
+ * @default true
1460
+ */
1461
+ agentmail: boolean;
1462
+ /**
1463
+ * Codemode
1464
+ * @description When true, the agent returns structured output with `text` (summary) and `code` (validated Python source) fields instead of free-form text.
1465
+ * @default false
1466
+ */
1467
+ codeMode: boolean;
1468
+ /**
1469
+ * Cachescript
1470
+ * @description Controls deterministic script caching. `null` (default): auto-detected — enabled when the task contains `@{{value}}` brackets and a workspace is attached. `true`: force-enable script caching even without brackets (caches the exact task). `false`: force-disable, even if brackets are present. When active, the first call runs the full agent and saves a reusable script. Subsequent calls with the same task template execute the cached script with $0 LLM cost. Requires workspace_id when enabled. Example: "Get prices from @{{https://example.com}} for @{{electronics}}".
1471
+ */
1472
+ cacheScript?: boolean | null;
1473
+ /**
1474
+ * Useownkey
1475
+ * @description If true, uses your own LLM API key (configured in project settings) instead of Browser Use managed keys. You pay your provider directly for inference; Browser Use charges a reduced orchestration fee (0.2× of provider list prices). If no key is configured for the model's provider, the request is rejected.
1476
+ * @default false
1477
+ */
1478
+ useOwnKey: boolean;
1479
+ /**
1480
+ * Autoheal
1481
+ * @description When cache_script is active, controls whether a lightweight LLM validates the cached script output. If the output looks incorrect (empty, error, wrong structure), the system automatically re-triggers the full agent to generate a new version of the script. Set to false to disable validation and always return the raw script output.
1482
+ * @default true
1483
+ */
1484
+ autoHeal: boolean;
1485
+ };
1114
1486
  };
1115
1487
  responses: never;
1116
1488
  parameters: never;
@@ -1132,10 +1504,16 @@ type BrowserSessionItemView$1 = components["schemas"]["BrowserSessionItemView"];
1132
1504
  type BrowserSessionView$1 = components["schemas"]["BrowserSessionView"];
1133
1505
  type BrowserSessionListResponse$1 = components["schemas"]["BrowserSessionListResponse"];
1134
1506
  type UpdateBrowserSessionRequest$1 = components["schemas"]["UpdateBrowserSessionRequest"];
1507
+ type BrowserDownloadListResponse$1 = components["schemas"]["BrowserDownloadListResponse"];
1135
1508
  interface BrowserListParams {
1136
1509
  page?: number;
1137
1510
  page_size?: number;
1138
1511
  }
1512
+ interface BrowserDownloadsParams {
1513
+ limit?: number;
1514
+ cursor?: string;
1515
+ includeUrls?: boolean;
1516
+ }
1139
1517
  declare class Browsers {
1140
1518
  private readonly http;
1141
1519
  constructor(http: HttpClient);
@@ -1149,6 +1527,8 @@ declare class Browsers {
1149
1527
  update(sessionId: string, body: UpdateBrowserSessionRequest$1): Promise<BrowserSessionView$1>;
1150
1528
  /** Stop a browser session. Convenience wrapper around update. */
1151
1529
  stop(sessionId: string): Promise<BrowserSessionView$1>;
1530
+ /** List files the browser downloaded to S3 during the session. */
1531
+ downloads(sessionId: string, params?: BrowserDownloadsParams): Promise<BrowserDownloadListResponse$1>;
1152
1532
  }
1153
1533
 
1154
1534
  type ProfileView$1 = components["schemas"]["ProfileView"];
@@ -1175,7 +1555,7 @@ declare class Profiles {
1175
1555
  delete(profileId: string): Promise<void>;
1176
1556
  }
1177
1557
 
1178
- type RunTaskRequest$2 = components["schemas"]["RunTaskRequest"];
1558
+ type RunTaskRequest$2 = components["schemas"]["app__endpoints__api__v3__sessions__views__RunTaskRequest"];
1179
1559
  /** All fields optional — omit `task` to create an idle session. */
1180
1560
  type CreateSessionBody = Partial<RunTaskRequest$2>;
1181
1561
  type SessionResponse$2 = components["schemas"]["SessionResponse"];
@@ -1191,9 +1571,13 @@ interface SessionMessagesParams {
1191
1571
  before?: string | null;
1192
1572
  limit?: number;
1193
1573
  }
1574
+ interface SessionsOptions {
1575
+ useOwnKey?: boolean;
1576
+ }
1194
1577
  declare class Sessions {
1195
1578
  private readonly http;
1196
- constructor(http: HttpClient);
1579
+ private readonly options;
1580
+ constructor(http: HttpClient, options?: SessionsOptions);
1197
1581
  /** Create a session and optionally dispatch a task. */
1198
1582
  create(body?: CreateSessionBody): Promise<SessionResponse$2>;
1199
1583
  /** List sessions for the authenticated project. */
@@ -1338,12 +1722,29 @@ declare class SessionRun<T = string> implements PromiseLike<SessionResult<T>> {
1338
1722
  private _parseOutput;
1339
1723
  }
1340
1724
 
1341
- type RunTaskRequest$1 = components["schemas"]["RunTaskRequest"];
1725
+ type RunTaskRequest$1 = components["schemas"]["app__endpoints__api__v3__sessions__views__RunTaskRequest"];
1342
1726
  interface BrowserUseOptions {
1343
1727
  apiKey?: string;
1344
1728
  baseUrl?: string;
1345
1729
  maxRetries?: number;
1346
1730
  timeout?: number;
1731
+ /**
1732
+ * Use your own LLM API key configured in Browser Use project settings for v3 agent runs.
1733
+ */
1734
+ useOwnKey?: boolean;
1735
+ /**
1736
+ * Pre-built x402 client (advanced — for custom signers / multi-network).
1737
+ * If set, the SDK uses pay-per-request authentication via USDC instead of
1738
+ * an API key. Requires the optional peer deps `@x402/fetch`, `@x402/evm`,
1739
+ * and `viem`.
1740
+ */
1741
+ x402?: X402Client;
1742
+ /**
1743
+ * EVM wallet private key for x402 mode. Equivalent to building an x402
1744
+ * client from this key and passing it as `x402`. Falls back to
1745
+ * `BROWSER_USE_X402_PRIVATE_KEY`.
1746
+ */
1747
+ x402PrivateKey?: string;
1347
1748
  }
1348
1749
  type RunSessionOptions = Partial<Omit<RunTaskRequest$1, "task">> & RunOptions & {
1349
1750
  schema?: z.ZodType;
@@ -1386,12 +1787,14 @@ type MessageListResponse = S["MessageListResponse"];
1386
1787
  type MessageResponse = S["MessageResponse"];
1387
1788
  type WorkspaceView = S["WorkspaceView"];
1388
1789
  type WorkspaceListResponse = S["WorkspaceListResponse"];
1389
- type RunTaskRequest = S["RunTaskRequest"];
1790
+ type RunTaskRequest = S["app__endpoints__api__v3__sessions__views__RunTaskRequest"];
1390
1791
  type StopSessionRequest = S["StopSessionRequest"];
1391
1792
  type FileUploadRequest = S["FileUploadRequest"];
1392
1793
  type FileUploadItem = S["FileUploadItem"];
1393
1794
  type WorkspaceCreateRequest = S["WorkspaceCreateRequest"];
1394
1795
  type WorkspaceUpdateRequest = S["WorkspaceUpdateRequest"];
1796
+ type BrowserDownloadFile = S["BrowserDownloadFile"];
1797
+ type BrowserDownloadListResponse = S["BrowserDownloadListResponse"];
1395
1798
  type BrowserSessionItemView = S["BrowserSessionItemView"];
1396
1799
  type BrowserSessionView = S["BrowserSessionView"];
1397
1800
  type BrowserSessionListResponse = S["BrowserSessionListResponse"];
@@ -1410,4 +1813,4 @@ type BuModel = S["BuModel"];
1410
1813
  type ProxyCountryCode = S["ProxyCountryCode"];
1411
1814
  type StopStrategy = S["StopStrategy"];
1412
1815
 
1413
- export { type AccountView, Billing, type BrowserListParams, type BrowserSessionItemView, type BrowserSessionListResponse, type BrowserSessionStatus, type BrowserSessionUpdateAction, type BrowserSessionView, BrowserUse, type BrowserUseOptions, Browsers, type BuAgentSessionStatus, type BuModel, type CreateBrowserSessionRequest, type CreateSessionBody, type FileInfo, type FileListResponse, type FileUploadItem, type FileUploadRequest, type FileUploadResponse, type FileUploadResponseItem, type MessageListResponse, type MessageResponse, type PlanInfo, type ProfileCreateRequest, type ProfileListParams, type ProfileListResponse, type ProfileUpdateRequest, type ProfileView, Profiles, type ProxyCountryCode, type RunOptions, type RunSessionOptions, type RunTaskRequest, type SessionListParams, type SessionListResponse, type SessionMessagesParams, type SessionResponse, type SessionResult, SessionRun, Sessions, type StopSessionRequest, type StopStrategy, type UpdateBrowserSessionRequest, type components as V3Types, type WorkspaceCreateRequest, type WorkspaceFilesParams, type WorkspaceListParams, type WorkspaceListResponse, type WorkspaceUpdateRequest, type WorkspaceView, Workspaces };
1816
+ export { type AccountView, Billing, type BrowserDownloadFile, type BrowserDownloadListResponse, type BrowserDownloadsParams, type BrowserListParams, type BrowserSessionItemView, type BrowserSessionListResponse, type BrowserSessionStatus, type BrowserSessionUpdateAction, type BrowserSessionView, BrowserUse, type BrowserUseOptions, Browsers, type BuAgentSessionStatus, type BuModel, type CreateBrowserSessionRequest, type CreateSessionBody, type FileInfo, type FileListResponse, type FileUploadItem, type FileUploadRequest, type FileUploadResponse, type FileUploadResponseItem, type MessageListResponse, type MessageResponse, type PlanInfo, type ProfileCreateRequest, type ProfileListParams, type ProfileListResponse, type ProfileUpdateRequest, type ProfileView, Profiles, type ProxyCountryCode, type RunOptions, type RunSessionOptions, type RunTaskRequest, type SessionListParams, type SessionListResponse, type SessionMessagesParams, type SessionResponse, type SessionResult, SessionRun, Sessions, type SessionsOptions, type StopSessionRequest, type StopStrategy, type UpdateBrowserSessionRequest, type components as V3Types, type WorkspaceCreateRequest, type WorkspaceFilesParams, type WorkspaceListParams, type WorkspaceListResponse, type WorkspaceUpdateRequest, type WorkspaceView, Workspaces };