@hushscript/sdk 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4366 @@
1
+ import { Client } from 'openapi-fetch';
2
+
3
+ /** Time as the SDK sees it. Injected so conformance runs and tests never wait in real time. */
4
+ interface Clock {
5
+ /** Milliseconds on a monotonic scale; only differences matter. */
6
+ now(): number;
7
+ /** Resolves after `ms`; rejects with the signal's reason if it aborts first. */
8
+ sleep(ms: number, signal?: AbortSignal): Promise<void>;
9
+ }
10
+
11
+ /** At most `capacity` acquisitions in any `windowMs`; later callers wait for the window to slide. */
12
+ declare class TokenBucket {
13
+ #private;
14
+ constructor(capacity: number, windowMs: number, clock: Clock);
15
+ /** Resolves with the milliseconds spent waiting (0 when a slot was free). */
16
+ acquire(signal?: AbortSignal): Promise<number>;
17
+ }
18
+
19
+ type LogLevel = "off" | "debug";
20
+ interface AttemptLog {
21
+ method: string;
22
+ /** `/v1/...` path without its query, or `r2:part/{n}` for direct storage URLs. */
23
+ target: string;
24
+ /** HTTP status, or a short label such as `network_error` or `timeout`. */
25
+ status: number | string;
26
+ attempt: number;
27
+ durationMs: number;
28
+ retryDelayMs: number | null;
29
+ }
30
+ interface Logger {
31
+ readonly enabled: boolean;
32
+ attempt(entry: AttemptLog): void;
33
+ }
34
+
35
+ interface HushscriptOptions {
36
+ /** Falls back to HUSHSCRIPT_TOKEN when null, undefined, empty or only whitespace. */
37
+ token?: string | null | undefined;
38
+ /** Falls back to HUSHSCRIPT_BASE_URL, then the production host. */
39
+ baseUrl?: string | null | undefined;
40
+ /** Seconds per request; default 60, at most 3600. */
41
+ timeout?: number | undefined;
42
+ /** Retries after the first attempt, per request; default 3. */
43
+ maxRetries?: number | undefined;
44
+ /** Falls back to HUSHSCRIPT_LOG, then "off". */
45
+ logLevel?: LogLevel | null | undefined;
46
+ /** Lets the client be constructed where `window` and `document` exist (tests only). */
47
+ dangerouslyAllowBrowser?: boolean | undefined;
48
+ clock?: Clock | undefined;
49
+ }
50
+ interface ConfigValues {
51
+ baseUrl: string;
52
+ timeoutMs: number;
53
+ partTimeoutMs: number;
54
+ maxRetries: number;
55
+ logLevel: LogLevel;
56
+ clock: Clock;
57
+ logger: Logger;
58
+ random: () => number;
59
+ createPacer: TokenBucket;
60
+ userAgent: string;
61
+ }
62
+ /** Validated options. The token is reachable only through `authorization()` and never printed. */
63
+ declare class ResolvedConfig {
64
+ #private;
65
+ readonly baseUrl: string;
66
+ readonly timeoutMs: number;
67
+ /** Per upload part PUT; not configurable. */
68
+ readonly partTimeoutMs: number;
69
+ readonly maxRetries: number;
70
+ readonly logLevel: LogLevel;
71
+ readonly clock: Clock;
72
+ readonly logger: Logger;
73
+ readonly random: () => number;
74
+ /** Paces `POST /v1/uploads` for this client instance. */
75
+ readonly createPacer: TokenBucket;
76
+ readonly userAgent: string;
77
+ constructor(token: string | null, values: ConfigValues);
78
+ authorization(): string;
79
+ /** Replaces the token for every later request (token rotation); the new one is redacted from then on. */
80
+ setToken(token: string): void;
81
+ toJSON(): Record<string, unknown>;
82
+ toString(): string;
83
+ }
84
+
85
+ /**
86
+ * This file was auto-generated by openapi-typescript.
87
+ * Do not make direct changes to the file.
88
+ */
89
+
90
+ interface paths {
91
+ "/v1/account": {
92
+ parameters: {
93
+ query?: never;
94
+ header?: never;
95
+ path?: never;
96
+ cookie?: never;
97
+ };
98
+ /**
99
+ * Read the account's balance, expiry and upload admission limits
100
+ * @description Returns the caller's net credit balance, when that balance is next scheduled to expire without a completed transcription or purchase, whether a card is on file, the account's data region, and the account's current daily-minutes and concurrent-jobs limits. Call this before create_upload to confirm there is enough balance and daily headroom for the upload about to be attempted.
101
+ */
102
+ get: operations["get_account"];
103
+ put?: never;
104
+ post?: never;
105
+ delete?: never;
106
+ options?: never;
107
+ head?: never;
108
+ patch?: never;
109
+ trace?: never;
110
+ };
111
+ "/v1/uploads": {
112
+ parameters: {
113
+ query?: never;
114
+ header?: never;
115
+ path?: never;
116
+ cookie?: never;
117
+ };
118
+ get?: never;
119
+ put?: never;
120
+ /**
121
+ * Start a new transcription upload and place a credit hold
122
+ * @description Declares the size and duration of a new audio upload, places a credit hold for the billable seconds (duration plus any transcription_options surcharge), and returns a job id plus, when direct-to-R2 uploads are available, a first page of presigned part URLs. Resending the same idempotency_key returns the already-created job instead of opening a second one. Long direct-to-R2 transfers must call heartbeat_upload periodically or the job is reaped as idle.
123
+ */
124
+ post: operations["create_upload"];
125
+ delete?: never;
126
+ options?: never;
127
+ head?: never;
128
+ patch?: never;
129
+ trace?: never;
130
+ };
131
+ "/v1/uploads/{job}/part-urls": {
132
+ parameters: {
133
+ query?: never;
134
+ header?: never;
135
+ path?: never;
136
+ cookie?: never;
137
+ };
138
+ /**
139
+ * Fetch a page of presigned direct-to-R2 part URLs
140
+ * @description Returns a fresh page of presigned PUT URLs for the given job's direct-to-R2 upload, starting at the requested part number. Presigned URLs expire, so a client resuming a stalled transfer should call this again rather than reusing URLs from create_upload's response.
141
+ */
142
+ get: operations["get_upload_part_urls"];
143
+ put?: never;
144
+ post?: never;
145
+ delete?: never;
146
+ options?: never;
147
+ head?: never;
148
+ patch?: never;
149
+ trace?: never;
150
+ };
151
+ "/v1/uploads/{job}/parts/{n}": {
152
+ parameters: {
153
+ query?: never;
154
+ header?: never;
155
+ path?: never;
156
+ cookie?: never;
157
+ };
158
+ get?: never;
159
+ /**
160
+ * Upload one part of a job's audio through this API
161
+ * @description Sends one part's raw bytes to be written into the job's in-progress R2 multipart upload. Only needed when direct-to-R2 presigned URLs are unavailable, or as a fallback for a part whose presigned PUT failed. A repeated PUT of the same part number replaces that part rather than adding to the declared total, so retries are always safe.
162
+ */
163
+ put: operations["upload_part"];
164
+ post?: never;
165
+ delete?: never;
166
+ options?: never;
167
+ head?: never;
168
+ patch?: never;
169
+ trace?: never;
170
+ };
171
+ "/v1/uploads/{job}/heartbeat": {
172
+ parameters: {
173
+ query?: never;
174
+ header?: never;
175
+ path?: never;
176
+ cookie?: never;
177
+ };
178
+ get?: never;
179
+ put?: never;
180
+ /**
181
+ * Keep a direct-to-R2 upload alive
182
+ * @description Refreshes the job's activity clock for a direct-to-R2 transfer, whose bytes never pass through this API and so never otherwise refresh it. Call this at an interval well under the 20 minute idle timeout for the whole duration of a long transfer, or the job is reaped mid-flight.
183
+ */
184
+ post: operations["heartbeat_upload"];
185
+ delete?: never;
186
+ options?: never;
187
+ head?: never;
188
+ patch?: never;
189
+ trace?: never;
190
+ };
191
+ "/v1/uploads/{job}/complete": {
192
+ parameters: {
193
+ query?: never;
194
+ header?: never;
195
+ path?: never;
196
+ cookie?: never;
197
+ };
198
+ get?: never;
199
+ put?: never;
200
+ /**
201
+ * Finish an upload and start transcription
202
+ * @description Marks every declared part as uploaded, probes the assembled object's exact duration, and reconciles the credit hold to the verified billable seconds; if the balance cannot cover the verified total the job is rejected and the hold released rather than run over budget. On success the job moves to queued or processing (reported as queued while verification is still pending) for transcription.
203
+ */
204
+ post: operations["complete_upload"];
205
+ delete?: never;
206
+ options?: never;
207
+ head?: never;
208
+ patch?: never;
209
+ trace?: never;
210
+ };
211
+ "/v1/jobs": {
212
+ parameters: {
213
+ query?: never;
214
+ header?: never;
215
+ path?: never;
216
+ cookie?: never;
217
+ };
218
+ /**
219
+ * List the account's transcription jobs
220
+ * @description Returns a page of pipeline jobs for the caller's account, newest first. Jobs accumulate for the lifetime of the account, not just while in flight, so this list pages: pass the next_cursor value from one page as the cursor parameter of the next request to page forward; the cursor is opaque and this API refuses one it did not mint rather than silently restarting at page one, since a caller that trusted a silent restart would believe it had paged forward when it had not. Pass active=1 to see only jobs that have not yet reached a terminal state.
221
+ */
222
+ get: operations["list_jobs"];
223
+ put?: never;
224
+ post?: never;
225
+ delete?: never;
226
+ options?: never;
227
+ head?: never;
228
+ patch?: never;
229
+ trace?: never;
230
+ };
231
+ "/v1/jobs/{id}": {
232
+ parameters: {
233
+ query?: never;
234
+ header?: never;
235
+ path?: never;
236
+ cookie?: never;
237
+ };
238
+ /**
239
+ * Read one transcription job
240
+ * @description Returns one pipeline job's current state, billing figures, and transcription options summary. Poll this (or list_jobs) after complete_upload until state reaches done or failed.
241
+ */
242
+ get: operations["get_job"];
243
+ put?: never;
244
+ post?: never;
245
+ delete?: never;
246
+ options?: never;
247
+ head?: never;
248
+ patch?: never;
249
+ trace?: never;
250
+ };
251
+ "/v1/transcripts": {
252
+ parameters: {
253
+ query?: never;
254
+ header?: never;
255
+ path?: never;
256
+ cookie?: never;
257
+ };
258
+ /**
259
+ * List the account's transcripts
260
+ * @description Returns a page of the caller's transcripts, newest first, with metadata only (no body text). Pass the next_cursor value from one page as the cursor parameter of the next request to page forward; the cursor is opaque and this API refuses one it did not mint rather than silently restarting at page one, since a caller that trusted a silent restart would believe it had paged forward when it had not.
261
+ */
262
+ get: operations["list_transcripts"];
263
+ put?: never;
264
+ post?: never;
265
+ delete?: never;
266
+ options?: never;
267
+ head?: never;
268
+ patch?: never;
269
+ trace?: never;
270
+ };
271
+ "/v1/transcripts/{id}": {
272
+ parameters: {
273
+ query?: never;
274
+ header?: never;
275
+ path?: never;
276
+ cookie?: never;
277
+ };
278
+ /**
279
+ * Read one transcript's metadata and full body
280
+ * @description Returns one transcript's metadata plus its full structured body (the original transcription and any translations, keyed by locale). This is the reference way to fetch a transcript body from this API; format conversion such as SRT, WebVTT or plain text is the caller's job. This route reads the body through the same loader the rest of the backend uses, including its legacy full-envelope path for a transcript stored before the chunked-body protocol existed, so a caller can rely on this route regardless of which storage path actually served a given transcript. The backend's own code calls this whole-body route a rolling-deploy fallback for older clients, alongside the newer manifest and chunk endpoints; that label describes the route itself, not the legacy storage path, and this remains the frozen /v1 way to fetch any transcript's body.
281
+ */
282
+ get: operations["get_transcript"];
283
+ put?: never;
284
+ post?: never;
285
+ delete?: never;
286
+ options?: never;
287
+ head?: never;
288
+ patch?: never;
289
+ trace?: never;
290
+ };
291
+ "/v1/transcripts/deleted": {
292
+ parameters: {
293
+ query?: never;
294
+ header?: never;
295
+ path?: never;
296
+ cookie?: never;
297
+ };
298
+ /**
299
+ * List deletion records for removed transcripts
300
+ * @description Returns a page of the deletion records kept after a transcript is removed, whichever path removed it: an explicit delete, a scheduled deletion, the retention sweep or account deletion. Each record carries the transcript's title, duration and upload time, when and why it was deleted, and the stored deletion receipt. The transcript content itself is gone and cannot be recovered. Records are ordered by the deleted transcript's original upload time, newest first, so they interleave with GET /v1/transcripts by the same key. Pass the next_cursor value from one page as the cursor parameter of the next request to page further back; the cursor is opaque and this API refuses one it did not mint, including a cursor minted by GET /v1/transcripts.
301
+ */
302
+ get: operations["list_deleted_transcripts"];
303
+ put?: never;
304
+ post?: never;
305
+ delete?: never;
306
+ options?: never;
307
+ head?: never;
308
+ patch?: never;
309
+ trace?: never;
310
+ };
311
+ "/v1/billing/packs": {
312
+ parameters: {
313
+ query?: never;
314
+ header?: never;
315
+ path?: never;
316
+ cookie?: never;
317
+ };
318
+ /**
319
+ * List purchasable minute packs
320
+ * @description Returns the account's minute-pack catalogue, priced in the account's own currency, including any referral buyer bonus currently available. Read the id of the pack to buy from here before calling buy_minutes. Needs the billing scope AND machine billing switched on for the account in the Hushscript app; either one off is a pat_scope_missing (code 2023) refusal, whichever it was.
321
+ */
322
+ get: operations["list_packs"];
323
+ put?: never;
324
+ post?: never;
325
+ delete?: never;
326
+ options?: never;
327
+ head?: never;
328
+ patch?: never;
329
+ trace?: never;
330
+ };
331
+ "/v1/billing/purchase": {
332
+ parameters: {
333
+ query?: never;
334
+ header?: never;
335
+ path?: never;
336
+ cookie?: never;
337
+ };
338
+ get?: never;
339
+ put?: never;
340
+ /**
341
+ * Charge the account's saved default card for a minute pack
342
+ * @description Charges a saved, fast_checkout_eligible payment method for one pack and credits the account's balance on success. quick_payment_method_id must be the account's current default, except when the account has no default at all, in which case naming an eligible card here makes it the new default. quick_payment_method_id is required: this API can only complete a purchase against a card already on file and has no way to open an interactive Checkout session, so an agent cannot use it to attach a new card. list_saved_cards can only list a card already on file, not create one; add a card first, either through the Hushscript app or by opening the hosted Checkout session create_setup_session returns. A request with no quick_payment_method_id, or a Quick Buy charge that needed authentication, a different payment method, or was declined, is refused outright rather than opened as a Checkout session nobody in this flow could complete. Needs the billing scope AND machine billing switched on for the account in the Hushscript app; either one off is a pat_scope_missing (code 2023) refusal, whichever it was.
343
+ */
344
+ post: operations["buy_minutes"];
345
+ delete?: never;
346
+ options?: never;
347
+ head?: never;
348
+ patch?: never;
349
+ trace?: never;
350
+ };
351
+ "/v1/billing/cards": {
352
+ parameters: {
353
+ query?: never;
354
+ header?: never;
355
+ path?: never;
356
+ cookie?: never;
357
+ };
358
+ /**
359
+ * List the account's saved payment methods
360
+ * @description Returns every payment method saved on the account plus which one is the current default. This is the only source of a quick_payment_method_id for buy_minutes; it can only list a card already on file, not attach a new one. Needs the billing scope AND machine billing switched on for the account in the Hushscript app; either one off is a pat_scope_missing (code 2023) refusal, whichever it was.
361
+ */
362
+ get: operations["list_saved_cards"];
363
+ put?: never;
364
+ post?: never;
365
+ delete?: never;
366
+ options?: never;
367
+ head?: never;
368
+ patch?: never;
369
+ trace?: never;
370
+ };
371
+ "/v1/billing/cards/default": {
372
+ parameters: {
373
+ query?: never;
374
+ header?: never;
375
+ path?: never;
376
+ cookie?: never;
377
+ };
378
+ get?: never;
379
+ put?: never;
380
+ /**
381
+ * Switch which saved card Quick Buy charges
382
+ * @description Sets the given payment method as the account's default, which is the card buy_minutes charges when a caller sends its id as quick_payment_method_id. Use this to switch the default or to pick among multiple eligible cards; buy_minutes only adopts one automatically when the account has no default at all. The id must belong to a payment method already on file, from list_saved_cards; a well formed id this account does not own answers not found, exactly like one that is not a payment method at all. Needs the billing scope AND machine billing switched on for the account in the Hushscript app; either one off is a pat_scope_missing (code 2023) refusal, whichever it was.
383
+ */
384
+ post: operations["set_default_card"];
385
+ delete?: never;
386
+ options?: never;
387
+ head?: never;
388
+ patch?: never;
389
+ trace?: never;
390
+ };
391
+ "/v1/billing/setup-session": {
392
+ parameters: {
393
+ query?: never;
394
+ header?: never;
395
+ path?: never;
396
+ cookie?: never;
397
+ };
398
+ get?: never;
399
+ put?: never;
400
+ /**
401
+ * Open a hosted Checkout Session that saves a card with no charge
402
+ * @description Creates a Stripe Checkout Session in setup mode and returns its checkout_url. Open that URL in a browser you control (your own automation, not this API) so Stripe can render the card form and handle any bank authentication itself; card details never pass through this API. No charge is made. Once the caller completes the hosted page, the saved card becomes available from list_saved_cards and can be set as the default with set_default_card; list_saved_cards can lag a just-completed Session by up to 30 seconds, since nothing calls back into this API when the hosted page finishes, so retry rather than concluding the save failed. expires_at is when the Session stops accepting a card; call this endpoint again for a fresh link after that. idempotency_key is optional: omit it and every call opens a new Session, which is safe since a setup Session is never charged and expires on its own; supply your own key only if you want a retried call to land on the same Session instead. Needs the billing scope AND machine billing switched on for the account in the Hushscript app; either one off is a pat_scope_missing (code 2023) refusal, whichever it was.
403
+ */
404
+ post: operations["create_setup_session"];
405
+ delete?: never;
406
+ options?: never;
407
+ head?: never;
408
+ patch?: never;
409
+ trace?: never;
410
+ };
411
+ "/v1/billing/transactions": {
412
+ parameters: {
413
+ query?: never;
414
+ header?: never;
415
+ path?: never;
416
+ cookie?: never;
417
+ };
418
+ /**
419
+ * List the account's purchase history
420
+ * @description Returns a page of the account's past purchases, newest first, each with its settlement status and public receipt reference. Pass the next_cursor value from one page as the cursor parameter of the next request to page further back; the cursor is opaque and this API refuses one it did not mint rather than silently restarting at page one, since a caller that trusted a silent restart would believe it had paged forward when it had not.
421
+ */
422
+ get: operations["list_transactions"];
423
+ put?: never;
424
+ post?: never;
425
+ delete?: never;
426
+ options?: never;
427
+ head?: never;
428
+ patch?: never;
429
+ trace?: never;
430
+ };
431
+ "/v1/billing/ledger": {
432
+ parameters: {
433
+ query?: never;
434
+ header?: never;
435
+ path?: never;
436
+ cookie?: never;
437
+ };
438
+ /**
439
+ * List the account's credit ledger
440
+ * @description Returns a page of the append-only credit ledger, newest first: every hold, settle, release, purchase and refund that has moved the account's second balance, with the job that spent them where there is one. Pass the next_cursor value from one page as the cursor parameter of the next request to page further back; the cursor is opaque and this API refuses one it did not mint rather than silently restarting at page one, since a caller that trusted a silent restart would believe it had paged forward when it had not.
441
+ */
442
+ get: operations["list_credit_ledger"];
443
+ put?: never;
444
+ post?: never;
445
+ delete?: never;
446
+ options?: never;
447
+ head?: never;
448
+ patch?: never;
449
+ trace?: never;
450
+ };
451
+ "/v1/billing/holds": {
452
+ parameters: {
453
+ query?: never;
454
+ header?: never;
455
+ path?: never;
456
+ cookie?: never;
457
+ };
458
+ /**
459
+ * List the account's active credit holds
460
+ * @description Returns a page of the seconds currently reserved by in-flight work: transcription jobs still running plus unresolved translation, insights and question holds, newest first. Held seconds are not spent yet and are already excluded from the account balance. This is not the ledger: a historical hold entry there may since have been settled or released, while every row here is still outstanding. Pass the next_cursor value from one page as the cursor parameter of the next request to page further back; the cursor is opaque and this API refuses one it did not mint rather than silently restarting at page one.
461
+ */
462
+ get: operations["list_holds"];
463
+ put?: never;
464
+ post?: never;
465
+ delete?: never;
466
+ options?: never;
467
+ head?: never;
468
+ patch?: never;
469
+ trace?: never;
470
+ };
471
+ "/v1/org": {
472
+ parameters: {
473
+ query?: never;
474
+ header?: never;
475
+ path?: never;
476
+ cookie?: never;
477
+ };
478
+ /**
479
+ * Read the caller's organization summary
480
+ * @description A pure passthrough of GET /api/org's body: plan state and term, pool balance and expiry, retention policy, tax id, auto-renewal source and failure count, the workspace-wide default per-member cap, and the caller's own effective cap and month-to-date spend against the pool. Membership only, not admin -- renewal_user_id is visible to admins only.
481
+ */
482
+ get: operations["get_org"];
483
+ put?: never;
484
+ post?: never;
485
+ delete?: never;
486
+ options?: never;
487
+ head?: never;
488
+ patch?: never;
489
+ trace?: never;
490
+ };
491
+ "/v1/org/members": {
492
+ parameters: {
493
+ query?: never;
494
+ header?: never;
495
+ path?: never;
496
+ cookie?: never;
497
+ };
498
+ /**
499
+ * List the caller's organization members
500
+ * @description Returns a page of the caller's organization's members, most recently joined first. Org admin only. Pass the next_cursor value from one page as the cursor parameter of the next request to page further back; the cursor is opaque and this API refuses one it did not mint rather than silently restarting at page one.
501
+ */
502
+ get: operations["list_org_members"];
503
+ put?: never;
504
+ post?: never;
505
+ delete?: never;
506
+ options?: never;
507
+ head?: never;
508
+ patch?: never;
509
+ trace?: never;
510
+ };
511
+ "/v1/org/invoices": {
512
+ parameters: {
513
+ query?: never;
514
+ header?: never;
515
+ path?: never;
516
+ cookie?: never;
517
+ };
518
+ /**
519
+ * List the caller's organization invoices
520
+ * @description Returns a page of the caller's organization's plan and pack invoices, newest first. Org admin only. Pass the next_cursor value from one page as the cursor parameter of the next request to page further back; the cursor is opaque and this API refuses one it did not mint rather than silently restarting at page one.
521
+ */
522
+ get: operations["list_org_invoices"];
523
+ put?: never;
524
+ post?: never;
525
+ delete?: never;
526
+ options?: never;
527
+ head?: never;
528
+ patch?: never;
529
+ trace?: never;
530
+ };
531
+ "/v1/org/transcripts": {
532
+ parameters: {
533
+ query?: never;
534
+ header?: never;
535
+ path?: never;
536
+ cookie?: never;
537
+ };
538
+ /**
539
+ * List the caller's organization's firm-custody transcripts
540
+ * @description Returns a page of the caller's organization's firm-custody transcripts, newest first. Reviewer right only (org_reviewer_required if the caller lacks it). Never returns transcript body or title content beyond the title field; opening a transcript body through the transcript read routes is logged to the organization's access log and audit log, and emails the transcript's owner the first time a given reviewer opens it. Pass the next_cursor value from one page as the cursor parameter of the next request to page further back; the cursor is opaque and this API refuses one it did not mint rather than silently restarting at page one.
541
+ */
542
+ get: operations["list_org_transcripts"];
543
+ put?: never;
544
+ post?: never;
545
+ delete?: never;
546
+ options?: never;
547
+ head?: never;
548
+ patch?: never;
549
+ trace?: never;
550
+ };
551
+ "/v1/org/ledger": {
552
+ parameters: {
553
+ query?: never;
554
+ header?: never;
555
+ path?: never;
556
+ cookie?: never;
557
+ };
558
+ /**
559
+ * List the caller's organization's minute-pool ledger
560
+ * @description Returns a page of the caller's organization's shared minute pool history (holds, settles, releases, purchases), newest first. Org admin only. Pass the next_cursor value from one page as the cursor parameter of the next request to page further back; the cursor is opaque and this API refuses one it did not mint rather than silently restarting at page one.
561
+ */
562
+ get: operations["list_org_ledger"];
563
+ put?: never;
564
+ post?: never;
565
+ delete?: never;
566
+ options?: never;
567
+ head?: never;
568
+ patch?: never;
569
+ trace?: never;
570
+ };
571
+ "/v1/org/audit": {
572
+ parameters: {
573
+ query?: never;
574
+ header?: never;
575
+ path?: never;
576
+ cookie?: never;
577
+ };
578
+ /**
579
+ * List the caller's organization's audit log
580
+ * @description Returns a page of the caller's organization's admin audit log, newest first. Org admin only. Pass the next_cursor value from one page as the cursor parameter of the next request to page further back; the cursor is opaque and this API refuses one it did not mint rather than silently restarting at page one.
581
+ */
582
+ get: operations["list_org_audit"];
583
+ put?: never;
584
+ post?: never;
585
+ delete?: never;
586
+ options?: never;
587
+ head?: never;
588
+ patch?: never;
589
+ trace?: never;
590
+ };
591
+ "/v1/org/matters": {
592
+ parameters: {
593
+ query?: never;
594
+ header?: never;
595
+ path?: never;
596
+ cookie?: never;
597
+ };
598
+ /**
599
+ * List the caller's organization's matter registry
600
+ * @description Returns up to 200 rows of the caller's organization's matter registry, ordered by code. Membership gated, not admin only: a member filing a transcript under an existing matter is offered this same list. Every row here is {id, code, status} for every caller, including an admin's own token -- the client a matter belongs to is /api admin only: GET /api/org/matters publishes client_id and the client's own code to an admin caller there, but this /v1 route never does, for any caller.
601
+ */
602
+ get: operations["list_org_matters"];
603
+ put?: never;
604
+ post?: never;
605
+ delete?: never;
606
+ options?: never;
607
+ head?: never;
608
+ patch?: never;
609
+ trace?: never;
610
+ };
611
+ "/v1/org/usage": {
612
+ parameters: {
613
+ query?: never;
614
+ header?: never;
615
+ path?: never;
616
+ cookie?: never;
617
+ };
618
+ /**
619
+ * Aggregate the caller's organization's settled spend by member, matter or client
620
+ * @description Aggregates settled minute-pool spend over a bounded range (at most 366 days), grouped by member, by matter code or by client code, and priced at the workspace's own report-only rebill rate. This is the one org read that is not a list: it has no cursor and no paging, since it reports at most one row per member, per matter or per client. Billing gated, like GET /v1/org/ledger, because it aggregates the same org_credit_ledger table.
621
+ */
622
+ get: operations["org_usage_report"];
623
+ put?: never;
624
+ post?: never;
625
+ delete?: never;
626
+ options?: never;
627
+ head?: never;
628
+ patch?: never;
629
+ trace?: never;
630
+ };
631
+ "/v1/org/usage.csv": {
632
+ parameters: {
633
+ query?: never;
634
+ header?: never;
635
+ path?: never;
636
+ cookie?: never;
637
+ };
638
+ /**
639
+ * Download the caller's organization's settled spend by member, matter or client as CSV
640
+ * @description Same aggregation as GET /v1/org/usage, downloaded as a CSV file instead of a JSON body.
641
+ */
642
+ get: operations["org_usage_report_csv"];
643
+ put?: never;
644
+ post?: never;
645
+ delete?: never;
646
+ options?: never;
647
+ head?: never;
648
+ patch?: never;
649
+ trace?: never;
650
+ };
651
+ "/v1/org/ledger.csv": {
652
+ parameters: {
653
+ query?: never;
654
+ header?: never;
655
+ path?: never;
656
+ cookie?: never;
657
+ };
658
+ /**
659
+ * Download the caller's organization's whole minute-pool ledger as CSV
660
+ * @description Downloads the caller's organization's entire org_credit_ledger history (not paged, unlike GET /v1/org/ledger) as a CSV file. Sets X-Hushscript-Csv-Truncated: 1 if the export hit its internal page ceiling.
661
+ */
662
+ get: operations["org_ledger_csv"];
663
+ put?: never;
664
+ post?: never;
665
+ delete?: never;
666
+ options?: never;
667
+ head?: never;
668
+ patch?: never;
669
+ trace?: never;
670
+ };
671
+ "/v1/org/audit.csv": {
672
+ parameters: {
673
+ query?: never;
674
+ header?: never;
675
+ path?: never;
676
+ cookie?: never;
677
+ };
678
+ /**
679
+ * Download the caller's organization's whole audit log as CSV
680
+ * @description Downloads the caller's organization's entire org_audit_log history (not paged, unlike GET /v1/org/audit) as a CSV file, with the same detail redaction GET /v1/org/audit applies. Sets X-Hushscript-Csv-Truncated: 1 if the export hit its internal page ceiling.
681
+ */
682
+ get: operations["org_audit_csv"];
683
+ put?: never;
684
+ post?: never;
685
+ delete?: never;
686
+ options?: never;
687
+ head?: never;
688
+ patch?: never;
689
+ trace?: never;
690
+ };
691
+ "/v1/org/custody": {
692
+ parameters: {
693
+ query?: never;
694
+ header?: never;
695
+ path?: never;
696
+ cookie?: never;
697
+ };
698
+ get?: never;
699
+ put?: never;
700
+ /**
701
+ * Schedule the private to firm custody switch
702
+ * @description Org admin only. Schedules the workspace's custody mode to switch from private to firm a fixed notice period from now, and mails every member. Nothing changes immediately: a daily background lane flips the mode once the notice period expires. Only the value firm is accepted; a switch from firm back to private is not supported here, since transcripts already stamped under firm custody would silently change custodian.
703
+ */
704
+ post: operations["schedule_org_custody"];
705
+ delete?: never;
706
+ options?: never;
707
+ head?: never;
708
+ patch?: never;
709
+ trace?: never;
710
+ };
711
+ "/v1/org/members/{user_id}": {
712
+ parameters: {
713
+ query?: never;
714
+ header?: never;
715
+ path?: never;
716
+ cookie?: never;
717
+ };
718
+ get?: never;
719
+ put?: never;
720
+ post?: never;
721
+ delete?: never;
722
+ options?: never;
723
+ head?: never;
724
+ /**
725
+ * Change a workspace member's rights or cap
726
+ * @description Admin only. Sets any subset of the member's is_admin, is_billing and is_reviewer rights, and their per-member monthly cap in seconds. At least one field must be present. Demoting the workspace's last remaining admin is refused, evaluated inside the same atomic update so two concurrent demotions cannot both succeed and strand the workspace with no admin.
727
+ */
728
+ patch: operations["patch_org_member"];
729
+ trace?: never;
730
+ };
731
+ "/v1/org/transcripts/{id}/hold": {
732
+ parameters: {
733
+ query?: never;
734
+ header?: never;
735
+ path?: never;
736
+ cookie?: never;
737
+ };
738
+ get?: never;
739
+ put?: never;
740
+ /**
741
+ * Place a legal hold on a transcript
742
+ * @description Reviewer only. Places a legal hold on one transcript in the caller's firm-custody workspace. A held transcript is exempt from the retention sweep, the retention re-clamp sweep and ordinary deletion, and its body, translations, cleaned text and AI outputs cannot be edited or regenerated (409 transcript_legal_hold), until the hold is lifted.
743
+ */
744
+ post: operations["place_transcript_hold"];
745
+ /**
746
+ * Lift a legal hold on a transcript
747
+ * @description Reviewer only. Lifts a legal hold on one transcript in the caller's firm-custody workspace. A held transcript is exempt from the retention sweep, the retention re-clamp sweep and ordinary deletion, and its body, translations, cleaned text and AI outputs cannot be edited or regenerated (409 transcript_legal_hold), until the hold is lifted.
748
+ */
749
+ delete: operations["lift_transcript_hold"];
750
+ options?: never;
751
+ head?: never;
752
+ patch?: never;
753
+ trace?: never;
754
+ };
755
+ "/v1/transcription-context": {
756
+ parameters: {
757
+ query?: never;
758
+ header?: never;
759
+ path?: never;
760
+ cookie?: never;
761
+ };
762
+ /**
763
+ * Read the account's saved transcription context
764
+ * @description Returns every saved dictionary and prompt preset on the account. A dictionary teaches the transcriber names and terms it would otherwise mishear; a prompt preset is standing free-text guidance. Both can be selected by id on an upload. This response is not paginated and carries no cursor: an account may hold at most 50 dictionaries and 20 prompt presets, both enforced when they are created, so a single response is always the complete set.
765
+ */
766
+ get: operations["get_transcription_context"];
767
+ put?: never;
768
+ post?: never;
769
+ delete?: never;
770
+ options?: never;
771
+ head?: never;
772
+ patch?: never;
773
+ trace?: never;
774
+ };
775
+ "/v1/agent/accounts": {
776
+ parameters: {
777
+ query?: never;
778
+ header?: never;
779
+ path?: never;
780
+ cookie?: never;
781
+ };
782
+ get?: never;
783
+ put?: never;
784
+ /**
785
+ * Start a headless, payment-first account signup
786
+ * @description Opens a hosted Stripe Checkout Session for a payment-first, headless account signup. No account and no session cookie exist yet: complete checkout_url with your own browser automation, then claim the account with claim_secret at POST /v1/agent/accounts/{signup_id}/claim. Every field is validated before any Stripe call, followed by the same restricted-jurisdiction and allowlist gates the human signup paths apply. accept_terms_version must equal the server's current policy version, returned in the policy_version_stale error when it does not match. pack selects a minute pack by id; amount and currency come back server derived and must never be sent in the request. data_region is derived from your network location and an optional hint is honored only when it agrees with that derivation. signup_id is region-prefixed (hsr1:<region>:<id>) and must be presented back verbatim to the claim route, so the request reaches the same regional backend that holds the row. Set dry_run to true to validate the request and get back a synthetic 200 response with no Stripe session created and no charge possible, for rehearsing the shape before spending real money; a dry run signup_id is never region-prefixed and can never be claimed.
787
+ */
788
+ post: operations["create_agent_account_signup"];
789
+ delete?: never;
790
+ options?: never;
791
+ head?: never;
792
+ patch?: never;
793
+ trace?: never;
794
+ };
795
+ "/v1/agent/accounts/{signup_id}/claim": {
796
+ parameters: {
797
+ query?: never;
798
+ header?: never;
799
+ path?: never;
800
+ cookie?: never;
801
+ };
802
+ get?: never;
803
+ put?: never;
804
+ /**
805
+ * Claim a paid agent signup into a real account
806
+ * @description Exchanges a paid, unclaimed agent signup for the account it pays for. Presents the claim_secret returned once by POST /v1/agent/accounts; a wrong secret, an unknown signup_id, an already claimed signup, a refunded signup, and an expired signup all answer the identical agent_claim_invalid error so a caller can never learn which of those is true. Only once that secret checks out does payment state matter: a signup whose Checkout Session has not settled to paid answers wrong_state instead. A successful claim is single use; creates exactly one account with a synthetic, unresolvable login identity; grants the paid pack once, never twice, even on a retried request; and mints exactly one personal access token with the account's own agent scopes, returned only in this response.
807
+ */
808
+ post: operations["claim_agent_account"];
809
+ delete?: never;
810
+ options?: never;
811
+ head?: never;
812
+ patch?: never;
813
+ trace?: never;
814
+ };
815
+ "/v1/agent/credentials/rotate": {
816
+ parameters: {
817
+ query?: never;
818
+ header?: never;
819
+ path?: never;
820
+ cookie?: never;
821
+ };
822
+ get?: never;
823
+ put?: never;
824
+ /**
825
+ * Rotate the calling agent PAT
826
+ * @description Atomically mints a successor personal access token and revokes the one that authenticated this request. A machine account has no password and no usable mailbox, so this is its only way to rotate a leaked credential. The successor keeps the predecessor's scopes, billing_enabled flag, name, client_label, and expiry policy; only the secret changes. The predecessor fails authentication on the very next request. This route references no token but the one that called it: it cannot list, mint, or revoke any other credential.
827
+ */
828
+ post: operations["rotate_agent_credentials"];
829
+ delete?: never;
830
+ options?: never;
831
+ head?: never;
832
+ patch?: never;
833
+ trace?: never;
834
+ };
835
+ }
836
+ interface components {
837
+ schemas: {
838
+ /** @description The frozen /v1 error body. error and code are always present together; the remaining keys are optional detail this API includes only when the specific error carries them, and they are omitted rather than emitted as null when absent. */
839
+ Error: {
840
+ /** @description The error's slug. See x-error-catalog for the full list. */
841
+ error: string;
842
+ /** @description The error's stable numeric code. See x-error-catalog. Never reused or renumbered. */
843
+ code: number;
844
+ /** @description Seconds the failed action needed. Present on a balance-shortfall error. */
845
+ needed_seconds?: number;
846
+ /** @description The account's personal balance in seconds. Present on a personal balance-shortfall error. */
847
+ balance_seconds?: number;
848
+ /** @description Seconds already committed to other in-flight jobs. Present alongside balance_seconds. */
849
+ held_seconds?: number;
850
+ /** @description The organization's shared pool balance in seconds. Present on an org-funded balance-shortfall error instead of balance_seconds. */
851
+ org_balance_seconds?: number;
852
+ limits?: components["schemas"]["UploadLimits"];
853
+ /** @description Structured recovery detail for an error that is not a plain balance shortfall. Present on agent_pack_locked and agent_purchase_capped. */
854
+ details?: {
855
+ /** @description Pack ids the agent account may buy right now. Present on agent_pack_locked; retry with one of these. */
856
+ allowed_packs?: string[];
857
+ /** @description The per-credential purchase cap for the rolling window. Present on agent_purchase_capped. */
858
+ limit?: number;
859
+ /** @description The length of the rolling window in seconds. Present on agent_purchase_capped. */
860
+ window_seconds?: number;
861
+ /** @description Seconds until the oldest purchase counted toward the cap leaves the window. Present on agent_purchase_capped; matches the Retry-After header. */
862
+ retry_after_seconds?: number;
863
+ };
864
+ };
865
+ /** @description The caller's current upload admission limits, shared by every response that carries them. */
866
+ UploadLimits: {
867
+ /** @description The account's daily transcription-minutes cap, in seconds. */
868
+ max_daily_seconds: number;
869
+ /** @description The maximum number of concurrent pipeline jobs this account may have in flight. */
870
+ max_active_jobs: number;
871
+ /** @description How many pipeline jobs are currently in flight. */
872
+ active_jobs: number;
873
+ /** @description Billable seconds already used today, in the account's own rolling day. */
874
+ used_today_seconds: number;
875
+ };
876
+ AccountResponse: {
877
+ /** @description Net balance in seconds: the raw balance minus any clawback debt. May be negative. */
878
+ balance_seconds: number;
879
+ /** @description Seconds currently committed to in-flight jobs and not yet settled. */
880
+ held_seconds: number;
881
+ /** @description Unix seconds after which the balance expires without a completed transcription or purchase, or null if no expiry is currently armed. */
882
+ credits_expire_at: number | null;
883
+ card_on_file: boolean;
884
+ /** @description The region this account's data lives in, e.g. us, eu, apac or oc. */
885
+ data_region: string;
886
+ limits: components["schemas"]["UploadLimits"];
887
+ };
888
+ PresignedPartUrl: {
889
+ /** @description The 1-based part number this URL is for. */
890
+ n: number;
891
+ /**
892
+ * Format: uri
893
+ * @description A presigned R2 PUT URL, valid for a limited time.
894
+ */
895
+ url: string;
896
+ };
897
+ UploadCreateResponse: {
898
+ job_id: string;
899
+ /** @description The account's net balance after this upload's hold was placed. */
900
+ balance_seconds: number;
901
+ held_seconds: number;
902
+ limits: components["schemas"]["UploadLimits"];
903
+ /** @description One page of presigned direct-to-R2 PUT URLs, or null when direct-to-R2 uploads are not available for this job and parts must be sent to upload_part instead. */
904
+ upload: {
905
+ /** @description The byte size of every part except the last. */
906
+ part_size_bytes: number;
907
+ /** @description The total number of parts this upload is split into. */
908
+ total_parts: number;
909
+ /** @description Presigned URLs for this page's parts, starting at the requested (or first) part number. */
910
+ part_urls: components["schemas"]["PresignedPartUrl"][];
911
+ /** @description The next part number not covered by this page, or null once every part has a URL. */
912
+ next_part_number: number | null;
913
+ } | null;
914
+ /**
915
+ * @description Which balance this upload's hold was placed against.
916
+ * @enum {string}
917
+ */
918
+ funding: "personal" | "org";
919
+ /** @description The job's initial state, typically uploading. */
920
+ state: string;
921
+ };
922
+ UploadCompleteResponse: {
923
+ ok: boolean;
924
+ /** @description The job's state immediately after completion, e.g. queued, processing or done. */
925
+ state: string;
926
+ /** @description The probed exact duration, once verification has run; null while verification is still pending. */
927
+ verified_seconds: number | null;
928
+ /** @description The account's net balance after the hold was reconciled to the verified duration. */
929
+ balance_seconds: number;
930
+ held_seconds: number;
931
+ };
932
+ /** @description A content-free summary of the transcription options a job was submitted with: what was requested, never the free-text content itself. */
933
+ OptionsSummary: {
934
+ /** @description The manually forced language, or null if language auto-detection was used. */
935
+ language_code: string | null;
936
+ speaker_detection: boolean;
937
+ medical_mode: boolean;
938
+ multichannel: boolean;
939
+ translation_targets: string[];
940
+ /** @description Whether a keyterms prompt was set. The terms themselves are not included. */
941
+ keyterms: boolean;
942
+ /** @description Whether a free-text context prompt was set. The prompt itself is not included. */
943
+ prompt: boolean;
944
+ /** @description This upload's override of automatic Insights generation, or null if it used the account default. */
945
+ auto_generate_insights: boolean | null;
946
+ };
947
+ Job: {
948
+ id: string;
949
+ /** @description One of uploading, fetching, queued, processing, done or failed. */
950
+ state: string;
951
+ mode: string;
952
+ declared_seconds: number;
953
+ /** @description The probed exact duration, once known. */
954
+ verified_seconds: number | null;
955
+ actual_seconds: number | null;
956
+ billable_seconds: number;
957
+ /** @description A short failure reason when state is failed, otherwise null. */
958
+ error: string | null;
959
+ /**
960
+ * @description Set when the file itself could not be read: `media_unreadable` when the upload could not be probed as audio, `media_undecodable` when the transcription provider could not decode it. Either way the file needs converting (for example to MP3 or WAV) and uploading again; nothing was charged and the hold was released. Null for every other job, including failures of any other kind and jobs that failed before this field existed.
961
+ * @enum {string|null}
962
+ */
963
+ failure_kind: "media_unreadable" | "media_undecodable" | null;
964
+ /** @description The id of an earlier failed job of yours that this job retries, set when the browser app re-uploaded a converted copy of an unreadable file, otherwise null. */
965
+ retry_of: string | null;
966
+ created_at: number;
967
+ /** @description The resulting transcript's id, once transcription has finished. */
968
+ transcript_id: string | null;
969
+ private_result_expires_at: number | null;
970
+ private_result_available: boolean;
971
+ options: components["schemas"]["OptionsSummary"];
972
+ /** @description Bytes fetched so far for a from-url import. Present only while a fetch is in progress. */
973
+ fetched_bytes?: number;
974
+ /** @description The total byte size a from-url import is fetching toward. Present only while a fetch is in progress. */
975
+ fetch_total_bytes?: number;
976
+ };
977
+ JobList: {
978
+ jobs: components["schemas"]["Job"][];
979
+ /** @description An opaque token for the next page's cursor parameter, or null on the last page. This API refuses a cursor it did not mint. */
980
+ next_cursor: string | null;
981
+ };
982
+ Utterance: {
983
+ speaker: string;
984
+ start_ms: number;
985
+ end_ms: number;
986
+ text: string;
987
+ };
988
+ TranscriptLanguage: {
989
+ utterances: components["schemas"]["Utterance"][];
990
+ };
991
+ /** @description The transcript's full structured body. */
992
+ TranscriptEnvelope: {
993
+ version: number;
994
+ original: components["schemas"]["TranscriptLanguage"];
995
+ /** @description Keyed by target locale, plus the reserved key cleaned for the AI-rewritten cleaned body when one exists. */
996
+ translations: {
997
+ [key: string]: components["schemas"]["TranscriptLanguage"];
998
+ };
999
+ };
1000
+ TranscriptDetail: {
1001
+ id: string;
1002
+ title: string;
1003
+ language_detected: string | null;
1004
+ duration_seconds: number;
1005
+ /** @description Provider speaker label mapped to a display name, for every speaker the caller has renamed. */
1006
+ speaker_names: {
1007
+ [key: string]: string;
1008
+ };
1009
+ tags: string[];
1010
+ created_at: number;
1011
+ updated_at: number;
1012
+ /** @description When this transcript is scheduled to be purged, or null to keep it indefinitely. */
1013
+ auto_delete_at: number | null;
1014
+ /** @description Whether the original body has been edited since transcription. */
1015
+ edited: boolean;
1016
+ /** @description The workspace matter this transcript is filed under, or null. Set at upload time and editable afterwards; always null for a transcript that was never funded by a workspace. */
1017
+ matter_code: string | null;
1018
+ /** @description The workspace client this transcript is filed under, or null. Set at upload time and editable afterwards; always null for a transcript that was never funded by a workspace. */
1019
+ client_code: string | null;
1020
+ body: components["schemas"]["TranscriptEnvelope"];
1021
+ };
1022
+ TranscriptListRow: {
1023
+ id: string;
1024
+ title: string;
1025
+ language_detected: string | null;
1026
+ duration_seconds: number;
1027
+ created_at: number;
1028
+ auto_delete_at: number | null;
1029
+ tags: string[];
1030
+ options: components["schemas"]["OptionsSummary"];
1031
+ /**
1032
+ * @description A display hint only, never an authority on whether Insights may be generated or charged for.
1033
+ * @enum {string}
1034
+ */
1035
+ insights_state: "generating" | "ready" | "failed" | "none";
1036
+ };
1037
+ TranscriptList: {
1038
+ transcripts: components["schemas"]["TranscriptListRow"][];
1039
+ /** @description An opaque token for the next page's cursor parameter, or null on the last page. This API refuses a cursor it did not mint. */
1040
+ next_cursor: string | null;
1041
+ };
1042
+ Pack: {
1043
+ id: string;
1044
+ /** @description The price in minor units of currency, already localized for the account's country. */
1045
+ amount: number;
1046
+ currency: string;
1047
+ seconds: number;
1048
+ /** @description Extra seconds this purchase would add from an available referral buyer bonus. Zero when none is available. */
1049
+ referral_bonus_seconds: number;
1050
+ /** @description Whether the caller's account may buy this pack right now. Present for agent accounts only: an agent's pack tier gates the larger packs until enough prior payments have settled past the dispute window. Absent on every human caller's response, whose packs are all always available. */
1051
+ available?: boolean;
1052
+ };
1053
+ PacksResponse: {
1054
+ packs: components["schemas"]["Pack"][];
1055
+ };
1056
+ PurchaseResponse: {
1057
+ /** @constant */
1058
+ status: "ok";
1059
+ /** @description The account's net balance after this purchase settled. */
1060
+ balance_seconds: number;
1061
+ };
1062
+ Card: {
1063
+ /** @description Use this value as quick_payment_method_id when it is is_default and fast_checkout_eligible. If default_id is null, naming any fast_checkout_eligible card here also makes it the new default. */
1064
+ id: string;
1065
+ type: string;
1066
+ brand: string;
1067
+ last4: string;
1068
+ exp_month: number;
1069
+ exp_year: number;
1070
+ email: string | null;
1071
+ is_default: boolean;
1072
+ /** @description Whether this method may be charged off-session by buy_minutes. */
1073
+ fast_checkout_eligible: boolean;
1074
+ };
1075
+ CardsResponse: {
1076
+ default_id: string | null;
1077
+ methods: components["schemas"]["Card"][];
1078
+ };
1079
+ SetupSessionResponse: {
1080
+ /** @description Open this URL in a browser you control to complete the hosted setup page. */
1081
+ checkout_url: string;
1082
+ session_id: string;
1083
+ /** @description Unix timestamp after which the Session stops accepting a card. */
1084
+ expires_at: number;
1085
+ };
1086
+ Transaction: {
1087
+ /** @description This row's own id. */
1088
+ id: number;
1089
+ seconds: number;
1090
+ amount_cents: number;
1091
+ amount_refunded_cents: number;
1092
+ currency: string;
1093
+ status: string;
1094
+ created_at: number;
1095
+ payment_method_type: string | null;
1096
+ payment_method_brand: string | null;
1097
+ payment_method_last4: string | null;
1098
+ /** @description The public receipt reference, e.g. HS-20260101-abcdef0123456789-1. */
1099
+ receipt_number: string | null;
1100
+ initiated_via: string | null;
1101
+ };
1102
+ TransactionsResponse: {
1103
+ transactions: components["schemas"]["Transaction"][];
1104
+ /** @description An opaque token for the next page's cursor parameter, or null on the last page. This API refuses a cursor it did not mint. */
1105
+ next_cursor: string | null;
1106
+ account_reference: string;
1107
+ };
1108
+ CreditLedgerEntry: {
1109
+ id: number;
1110
+ delta_seconds: number;
1111
+ kind: string;
1112
+ job_id: string | null;
1113
+ note: string | null;
1114
+ created_at: number;
1115
+ };
1116
+ CreditLedgerResponse: {
1117
+ entries: components["schemas"]["CreditLedgerEntry"][];
1118
+ /** @description An opaque token for the next page's cursor parameter, or null on the last page. This API refuses a cursor it did not mint. */
1119
+ next_cursor: string | null;
1120
+ };
1121
+ ActiveHold: {
1122
+ id: string;
1123
+ /**
1124
+ * @description Which kind of work reserved these seconds. The id is that work's own id and is unique only within its kind.
1125
+ * @enum {string}
1126
+ */
1127
+ kind: "transcription" | "translation" | "insights" | "qa";
1128
+ seconds: number;
1129
+ created_at: number;
1130
+ };
1131
+ HoldsResponse: {
1132
+ holds: components["schemas"]["ActiveHold"][];
1133
+ /** @description An opaque token for the next page's cursor parameter, or null on the last page. This API refuses a cursor it did not mint. */
1134
+ next_cursor: string | null;
1135
+ };
1136
+ DeletedTranscript: {
1137
+ id: string;
1138
+ title: string;
1139
+ duration_seconds: number;
1140
+ /** @description When the transcript was originally uploaded, Unix seconds. This is the key the list is ordered and paged on. */
1141
+ created_at: number;
1142
+ deleted_at: number;
1143
+ /**
1144
+ * @description Which deletion path removed the transcript: an explicit delete (manual), the transcript's own auto_delete_at retention date (scheduled), the dormant-account purge (dormant), or the global retention sweep (expired).
1145
+ * @enum {string}
1146
+ */
1147
+ cause: "manual" | "scheduled" | "dormant" | "expired";
1148
+ /** @description The receipt recorded when the transcript was deleted, kept so the deletion stays evidenced after the content itself is gone. Null when the stored receipt could not be read back. */
1149
+ receipt: {
1150
+ type: string;
1151
+ version: number;
1152
+ /** @description UTC timestamp, seconds precision. */
1153
+ created_at: string;
1154
+ items: {
1155
+ kind: string;
1156
+ /** @description UTC timestamp, seconds precision, e.g. 2026-09-07T14:53:35Z. */
1157
+ deleted_at: string;
1158
+ }[];
1159
+ } | null;
1160
+ };
1161
+ DeletedTranscriptsResponse: {
1162
+ deleted: components["schemas"]["DeletedTranscript"][];
1163
+ /** @description An opaque token for the next page's cursor parameter, or null on the last page. This API refuses a cursor it did not mint. */
1164
+ next_cursor: string | null;
1165
+ };
1166
+ DictionaryEntry: {
1167
+ id: string;
1168
+ /** @description The spelling the transcript should use. */
1169
+ canonical: string;
1170
+ /** @description Alternative spellings that should be normalized to the canonical form. */
1171
+ variants: string[];
1172
+ /**
1173
+ * @description What kind of term this is. Never empty and never null: an entry saved without a category is stored as other.
1174
+ * @enum {string}
1175
+ */
1176
+ category: "person_name" | "organization" | "product" | "place" | "technical_term" | "medical_term" | "legal_term" | "acronym" | "abbreviation" | "preferred_spelling" | "other";
1177
+ /** @description Free-text note about the entry. Empty when unset; never null. */
1178
+ note: string;
1179
+ case_sensitive: boolean;
1180
+ created_at: number;
1181
+ updated_at: number;
1182
+ };
1183
+ ContextDictionary: {
1184
+ id: string;
1185
+ name: string;
1186
+ /** @description Free-text description. Empty when unset; never null. */
1187
+ description: string;
1188
+ /** @description The language this applies to: all, or one of the supported source language codes. Never empty and never null: unset is stored as all. */
1189
+ language_code: string;
1190
+ entries: components["schemas"]["DictionaryEntry"][];
1191
+ /** @description The flat recognition terms this dictionary compiles into. Derived from entries when entries exist (every canonical spelling and its variants, deduplicated); otherwise the legacy flat list stored before entries existed. */
1192
+ terms: string[];
1193
+ /** @description Whether this dictionary is applied to an upload that selects none explicitly. At most one dictionary is the default. */
1194
+ is_default: boolean;
1195
+ created_at: number;
1196
+ updated_at: number;
1197
+ };
1198
+ ContextPromptPreset: {
1199
+ id: string;
1200
+ name: string;
1201
+ /** @description Free-text description. Empty when unset; never null. */
1202
+ description: string;
1203
+ /** @description The language this applies to: all, or one of the supported source language codes. Never empty and never null: unset is stored as all. */
1204
+ language_code: string;
1205
+ body: string;
1206
+ is_default: boolean;
1207
+ created_at: number;
1208
+ updated_at: number;
1209
+ };
1210
+ /** @description Not paginated and carrying no cursor: both collections are capped when they are written (50 dictionaries, 20 prompt presets), so this response is always complete. */
1211
+ TranscriptionContextResponse: {
1212
+ dictionaries: components["schemas"]["ContextDictionary"][];
1213
+ prompts: components["schemas"]["ContextPromptPreset"][];
1214
+ };
1215
+ OrgMember: {
1216
+ user_id: string;
1217
+ email: string;
1218
+ role: string;
1219
+ joined_at: number;
1220
+ is_admin: boolean;
1221
+ is_billing: boolean;
1222
+ is_reviewer: boolean;
1223
+ /** @description This member's own monthly seconds cap, or null when unset. */
1224
+ monthly_cap_seconds: number | null;
1225
+ };
1226
+ OrgMembersResponse: {
1227
+ members: components["schemas"]["OrgMember"][];
1228
+ /** @description An opaque token for the next page's cursor parameter, or null on the last page. This API refuses a cursor it did not mint. */
1229
+ next_cursor: string | null;
1230
+ };
1231
+ OrgInvoice: {
1232
+ id: string;
1233
+ number: string | null;
1234
+ kind: string;
1235
+ sku: string;
1236
+ seconds: number;
1237
+ amount_cents: number;
1238
+ currency: string;
1239
+ payment_reference: string;
1240
+ status: string;
1241
+ po_number: string | null;
1242
+ issued_at: number;
1243
+ paid_at: number | null;
1244
+ created_at: number;
1245
+ };
1246
+ OrgInvoicesResponse: {
1247
+ invoices: components["schemas"]["OrgInvoice"][];
1248
+ /** @description An opaque token for the next page's cursor parameter, or null on the last page. This API refuses a cursor it did not mint. */
1249
+ next_cursor: string | null;
1250
+ };
1251
+ /** @description One row of the organization's firm-custody transcript index. Never carries transcript body or content beyond the title. */
1252
+ OrgTranscript: {
1253
+ id: string;
1254
+ title: string;
1255
+ created_at: number;
1256
+ duration_seconds: number;
1257
+ /** @description The transcript owner's user id. */
1258
+ user_id: string;
1259
+ legal_hold: boolean;
1260
+ };
1261
+ OrgTranscriptsResponse: {
1262
+ transcripts: components["schemas"]["OrgTranscript"][];
1263
+ /** @description An opaque token for the next page's cursor parameter, or null on the last page. This API refuses a cursor it did not mint. */
1264
+ next_cursor: string | null;
1265
+ };
1266
+ OrgLedgerEntry: {
1267
+ id: number;
1268
+ delta_seconds: number;
1269
+ kind: string;
1270
+ job_id: string | null;
1271
+ invoice_id: string | null;
1272
+ actor_user_id: string | null;
1273
+ member_email: string | null;
1274
+ note: string | null;
1275
+ created_at: number;
1276
+ };
1277
+ OrgLedgerResponse: {
1278
+ entries: components["schemas"]["OrgLedgerEntry"][];
1279
+ /** @description An opaque token for the next page's cursor parameter, or null on the last page. This API refuses a cursor it did not mint. */
1280
+ next_cursor: string | null;
1281
+ };
1282
+ OrgAuditEntry: {
1283
+ id: number;
1284
+ actor_user_id: string | null;
1285
+ event: string;
1286
+ detail: string | null;
1287
+ created_at: number;
1288
+ };
1289
+ OrgAuditResponse: {
1290
+ entries: components["schemas"]["OrgAuditEntry"][];
1291
+ /** @description An opaque token for the next page's cursor parameter, or null on the last page. This API refuses a cursor it did not mint. */
1292
+ next_cursor: string | null;
1293
+ };
1294
+ OrgMatter: {
1295
+ id: string;
1296
+ code: string;
1297
+ /** @enum {string} */
1298
+ status: "open" | "closed";
1299
+ };
1300
+ OrgMattersResponse: {
1301
+ matters: components["schemas"]["OrgMatter"][];
1302
+ };
1303
+ OrgUsageRow: {
1304
+ /** @description The member email, matter code or client code this row aggregates, or "(none)" for an unfiled job or a purged member. */
1305
+ key: string;
1306
+ jobs: number;
1307
+ billed_seconds: number;
1308
+ /** @description billed_seconds priced at the workspace's rebill_rate_cents_per_hour, rounded up to the cent. */
1309
+ cost_cents: number;
1310
+ };
1311
+ OrgUsageResponse: {
1312
+ rows: components["schemas"]["OrgUsageRow"][];
1313
+ from: number;
1314
+ to: number;
1315
+ /** @enum {string} */
1316
+ group_by: "member" | "matter" | "client";
1317
+ rate_cents_per_hour: number;
1318
+ };
1319
+ /** @description The client must never supply amount: it is derived server side from pack. */
1320
+ AgentSignupRequest: {
1321
+ /** @description Address for receipts and notices only. Never used to sign in; the created account has no login path of its own. */
1322
+ contact_email: string;
1323
+ /** @description Which minute pack to buy. See GET /v1/billing/packs for the catalogue. */
1324
+ pack_id: string;
1325
+ /** @description Must equal the server's current policy version or the request is refused with policy_version_stale, which names the current value. */
1326
+ accept_terms_version: string;
1327
+ /** @description Optional region hint. Honored only when it agrees with the region derived from your network location; otherwise the derived region is used silently. */
1328
+ data_region?: string;
1329
+ agent: {
1330
+ name: string;
1331
+ platform: string;
1332
+ contact_url?: string;
1333
+ };
1334
+ /** @description Validate the request and return a synthetic response with no Stripe session and no charge. Defaults to false. */
1335
+ dry_run?: boolean;
1336
+ };
1337
+ AgentSignupResponse: {
1338
+ /** @description Region-prefixed (hsr1:<region>:<id>), e.g. hsr1:eu:4c3a1f9e7b2d4e6f8a0c1b2d3e4f5061. Present it back verbatim as the path segment when claiming the account. A dry_run response's signup_id is prefixed dry_ instead and can never be claimed. */
1339
+ signup_id: string;
1340
+ /** @description Returned exactly once. Only its hash is stored; there is no way to recover it later. */
1341
+ claim_secret: string;
1342
+ /** @description Open this URL in a browser you control to complete the hosted Checkout page. */
1343
+ checkout_url: string;
1344
+ pack: string;
1345
+ /** @description Charge amount in the currency's minor unit. */
1346
+ amount: number;
1347
+ currency: string;
1348
+ /** @description Unix timestamp after which the Session stops accepting a card. */
1349
+ expires_at: number;
1350
+ };
1351
+ AgentClaimRequest: {
1352
+ /** @description The secret returned exactly once by POST /v1/agent/accounts. */
1353
+ claim_secret: string;
1354
+ };
1355
+ AgentClaimResponse: {
1356
+ /** @description The account created by this claim. There is no login path for it; authenticate with pat instead. */
1357
+ user_id: string;
1358
+ /** @description Returned exactly once. Only its hash is stored; there is no way to recover it later. */
1359
+ pat: string;
1360
+ /** @description The scopes carried by pat. */
1361
+ scopes: string[];
1362
+ /** @description The account's balance immediately after the pack this signup paid for was granted. */
1363
+ balance_seconds: number;
1364
+ };
1365
+ AgentCredentialsRotateResponse: {
1366
+ /** @description The successor token, returned exactly once. Only its hash is stored; there is no way to recover it later. The predecessor that authenticated this request stops working immediately. */
1367
+ pat: string;
1368
+ /** @description The successor's id. */
1369
+ pat_id: string;
1370
+ /** @description The scopes carried by pat, identical to the predecessor's. */
1371
+ scopes: string[];
1372
+ /** @description The successor's expiry policy, carried over from the predecessor unchanged. Null when the predecessor never expired. */
1373
+ expires_at?: number | null;
1374
+ };
1375
+ OrgSummaryResponse: {
1376
+ id: string;
1377
+ name: string;
1378
+ /** @description The caller's own role in this organization: admin or member. */
1379
+ role: string;
1380
+ plan: string;
1381
+ /** @description annual or monthly, or null if the org has never had a plan. */
1382
+ plan_term: string | null;
1383
+ /** @description Unix seconds the current term runs until, or null before the org's first plan is paid. */
1384
+ plan_active_until: number | null;
1385
+ /** @description Whether the term itself is still running (ignores grace). */
1386
+ plan_active: boolean;
1387
+ /** @description pending, active, grace, or frozen. */
1388
+ plan_state: string;
1389
+ grace_until: number | null;
1390
+ seats_limit: number | null;
1391
+ seats_used: number;
1392
+ /** @description Seats held by pending, unexpired invites. */
1393
+ seats_pending: number;
1394
+ /** @description The pool's raw balance. Can be negative after a void clawback or a negative pool adjustment. */
1395
+ balance_seconds: number;
1396
+ /** @description balance_seconds floored at zero, and zeroed outright when the org is outside its funding window (frozen or lapsed past grace). */
1397
+ spendable_seconds: number;
1398
+ /** @description Unix seconds the pool's own rolling 365-day expiry falls at, re-anchored on every credit and every settle. Null if the pool has never held a positive balance. */
1399
+ pool_expires_at: number | null;
1400
+ default_retention_days: number | null;
1401
+ max_retention_days: number | null;
1402
+ /** @description The workspace's billing contact. Null unless the caller is an admin or holds the billing right. */
1403
+ billing_email: string | null;
1404
+ /** @description Free-text billing details shown on invoices. Null when none are set, and always null unless the caller is an admin or holds the billing right. */
1405
+ billing_details: string | null;
1406
+ /** @description The buyer's self-declared tax id, shown on invoices. Not validated against any registry. Null unless the caller is an admin or holds the billing right. */
1407
+ tax_id: string | null;
1408
+ /** @description The buyer's own word for tax_id, e.g. VAT, EIN, ABN. Null unless the caller is an admin or holds the billing right. */
1409
+ tax_id_label: string | null;
1410
+ created_at: number;
1411
+ auto_renew: boolean;
1412
+ renewal_failures: number;
1413
+ /** @description Whether renewal_failures has reached the cap the daily renewal lane stops retrying at. */
1414
+ renewal_capped: boolean;
1415
+ /** @description Whether a saved card is on file for the renewal lane to charge. Never the payment method id itself. */
1416
+ renewal_source_stored: boolean;
1417
+ /** @description The id of the member whose saved card the renewal lane charges. Visible to admins only; a non-admin member always sees null here regardless of whether a source is stored (see renewal_source_stored). */
1418
+ renewal_user_id: string | null;
1419
+ /** @description The workspace-wide default per-member monthly spending cap against the pool. Null means no org-wide default. */
1420
+ member_cap_seconds: number | null;
1421
+ /** @description The signed-in caller's own effective monthly cap: their personal override if one is set, else member_cap_seconds, else null for no cap. Also null when the caller is outside the org's current funding window. */
1422
+ caller_effective_cap_seconds: number | null;
1423
+ /** @description The signed-in caller's own month-to-date spend against the pool. Null under the same condition caller_effective_cap_seconds is null. */
1424
+ caller_spent_seconds_this_month: number | null;
1425
+ /** @description Whether the signed-in caller is the workspace's single transferable owner (distinct from is_admin). */
1426
+ is_owner: boolean;
1427
+ /** @description The id of the workspace's transferable owner, visible to every member. Falls back to the org's creator if owner_user_id was never explicitly set on the row. */
1428
+ owner_user_id: string;
1429
+ /** @description private or firm. private: transcripts belong to the member, no reviewer can open them. firm: a transcript created while a member belongs to the workspace is workspace property; is_reviewer members can open it. */
1430
+ custody: string;
1431
+ /** @description Unix seconds the pending private-to-firm switch takes effect, or null when no switch is scheduled. Only ever set while custody is still private. */
1432
+ custody_switch_at: number | null;
1433
+ /** @description Unix seconds the currently armed retention re-clamp takes effect, or null when none is scheduled. Set only while a tightened max_retention_days still has existing transcripts left to pull in. */
1434
+ retention_reclamp_at: number | null;
1435
+ /** @description The retention day count the armed re-clamp will apply, or null when none is scheduled. Mirrors max_retention_days at the moment the re-clamp was armed, not necessarily the current value. */
1436
+ retention_reclamp_days: number | null;
1437
+ };
1438
+ };
1439
+ responses: {
1440
+ /** @description Internal error. The delegated /api result could not be projected into a /v1 body, or an unrelated internal fault was logged; every /v1 operation can reach this. See internal_error in x-error-catalog. */
1441
+ InternalError: {
1442
+ headers: {
1443
+ [name: string]: unknown;
1444
+ };
1445
+ content: {
1446
+ "application/json": components["schemas"]["Error"];
1447
+ };
1448
+ };
1449
+ /** @description Too many requests. Every /v1 operation authenticates through the same chokepoint that enforces a per-token request budget for a PAT caller (PAT_LIMITER, 1200 requests/60s); POST /v1/billing/setup-session, POST /v1/billing/purchase, POST /v1/billing/cards/default and GET /v1/billing/cards (when it has to read the cards from Stripe) additionally enforce a tighter per-account budget (PAT_BILLING_LIMITER, 60 requests/60s) before making any Stripe call, and POST /v1/uploads separately enforces its own burst limiter (UPLOAD_LIMITER), keyed per user and also per IP (a looser budget) for a PAT caller, and per IP for a session caller. A PAT-throttled refusal carries a Retry-After header; the uploads burst limiter does not. POST /v1/billing/purchase can also answer 429 for a distinct reason, for an agent account and for a human account's PAT caller: the purchase cap per rolling window (see agent_purchase_capped in x-error-catalog), carrying details.limit, details.window_seconds and details.retry_after_seconds alongside its own Retry-After header. See rate_limited in x-error-catalog for the ordinary case. */
1450
+ RateLimited: {
1451
+ headers: {
1452
+ /** @description Seconds to wait before retrying. Present on a PAT_LIMITER or PAT_BILLING_LIMITER refusal, and on an agent_purchase_capped refusal; absent on the /v1/uploads burst limiter. */
1453
+ "Retry-After"?: number;
1454
+ [name: string]: unknown;
1455
+ };
1456
+ content: {
1457
+ "application/json": components["schemas"]["Error"];
1458
+ };
1459
+ };
1460
+ };
1461
+ parameters: never;
1462
+ requestBodies: never;
1463
+ headers: never;
1464
+ pathItems: never;
1465
+ }
1466
+ interface operations {
1467
+ get_account: {
1468
+ parameters: {
1469
+ query?: never;
1470
+ header?: never;
1471
+ path?: never;
1472
+ cookie?: never;
1473
+ };
1474
+ requestBody?: never;
1475
+ responses: {
1476
+ /** @description Success. */
1477
+ 200: {
1478
+ headers: {
1479
+ [name: string]: unknown;
1480
+ };
1481
+ content: {
1482
+ "application/json": components["schemas"]["AccountResponse"];
1483
+ };
1484
+ };
1485
+ /** @description Error response. */
1486
+ 401: {
1487
+ headers: {
1488
+ [name: string]: unknown;
1489
+ };
1490
+ content: {
1491
+ "application/json": components["schemas"]["Error"];
1492
+ };
1493
+ };
1494
+ /** @description Error response. */
1495
+ 403: {
1496
+ headers: {
1497
+ [name: string]: unknown;
1498
+ };
1499
+ content: {
1500
+ "application/json": components["schemas"]["Error"];
1501
+ };
1502
+ };
1503
+ 429: components["responses"]["RateLimited"];
1504
+ 500: components["responses"]["InternalError"];
1505
+ };
1506
+ };
1507
+ create_upload: {
1508
+ parameters: {
1509
+ query?: never;
1510
+ header?: never;
1511
+ path?: never;
1512
+ cookie?: never;
1513
+ };
1514
+ requestBody: {
1515
+ content: {
1516
+ "application/json": {
1517
+ /** @description The exact declared byte size of the audio file, up to the 5 GB cap. */
1518
+ size_bytes: number;
1519
+ /** @description The declared duration in seconds, from 15 seconds up to the 10 hour cap. Rechecked against the probed exact duration at complete_upload. */
1520
+ duration_seconds: number;
1521
+ /** @description An optional display title. A value longer than 300 bytes is truncated on a character boundary rather than rejected, and this response does not echo the stored value; read it back from the transcript once the job completes. In `private` mode the title is not stored at all. */
1522
+ title?: string | null;
1523
+ /** @description Optional job mode, e.g. a private-result upload. */
1524
+ mode?: string | null;
1525
+ /** @description Optional smaller part size for a flaky connection. Clamped to this API's supported range; omit for the 32 MiB default. */
1526
+ part_size_bytes?: number | null;
1527
+ /** @description An optional client-minted key, 16 to 128 bytes. Resending the same key returns the same job with no second hold. */
1528
+ idempotency_key?: string | null;
1529
+ /** @description Free text, trimmed, at most 64 characters; blank is valid and clears it. Refused with org_matter_code_required when the caller's workspace sets matter_code_policy to required and this is absent or blank. */
1530
+ matter_code?: string | null;
1531
+ /** @description Free text, trimmed, at most 64 characters; blank is valid. Accepted for backward compatibility: for an org caller the client is always resolved from the matter instead, never from this field. */
1532
+ client_code?: string | null;
1533
+ transcription_options?: {
1534
+ /** @description Force a specific spoken language instead of auto-detection. */
1535
+ language_code?: string | null;
1536
+ /** @description Label distinct speakers in the transcript. Forced on automatically when translation_targets is non-empty. */
1537
+ speaker_detection?: boolean;
1538
+ /** @description Domain vocabulary to bias transcription toward, up to 1000 terms of at most 6 words each. */
1539
+ keyterms_prompt?: string[];
1540
+ /** @description Free-text context to bias transcription toward. */
1541
+ prompt?: string | null;
1542
+ /** @description Bill and transcribe as a medical dictation. Requires language_code to be one of en, es, fr, de; billed at a 100 percent surcharge on the duration. */
1543
+ medical_mode?: boolean;
1544
+ /** @description Transcribe each audio channel independently. Billed per channel: a stereo file counts twice, a 3-channel file three times, up to 8 channels, and the medical surcharge applies on top of that; translation targets stay on a single duration. The channel count is the most channels any audio track of the file carries. A file with more than 8 channels, or one whose channel count cannot be read, falls back to mixed audio with speaker labels and is billed once. Without this option the file is transcribed as one mixed channel and billed once. The initial hold at upload creation is for a single channel; verification raises it to the per-channel amount and fails the job with insufficient_balance if the balance cannot cover it. */
1545
+ multichannel?: boolean;
1546
+ /** @description Locales to additionally translate the transcript into. Each target adds a 25 percent surcharge on the duration and forces speaker_detection on. */
1547
+ translation_targets?: string[];
1548
+ /** @description Override the account's automatic-Insights default for this upload alone. Omit to inherit the account default; an explicit false always suppresses automatic generation for this upload. */
1549
+ auto_generate_insights?: boolean | null;
1550
+ } | null;
1551
+ };
1552
+ };
1553
+ };
1554
+ responses: {
1555
+ /** @description Success. */
1556
+ 200: {
1557
+ headers: {
1558
+ [name: string]: unknown;
1559
+ };
1560
+ content: {
1561
+ "application/json": components["schemas"]["UploadCreateResponse"];
1562
+ };
1563
+ };
1564
+ /** @description Error response. */
1565
+ 400: {
1566
+ headers: {
1567
+ [name: string]: unknown;
1568
+ };
1569
+ content: {
1570
+ "application/json": components["schemas"]["Error"];
1571
+ };
1572
+ };
1573
+ /** @description Error response. */
1574
+ 401: {
1575
+ headers: {
1576
+ [name: string]: unknown;
1577
+ };
1578
+ content: {
1579
+ "application/json": components["schemas"]["Error"];
1580
+ };
1581
+ };
1582
+ /** @description Error response. */
1583
+ 402: {
1584
+ headers: {
1585
+ [name: string]: unknown;
1586
+ };
1587
+ content: {
1588
+ "application/json": components["schemas"]["Error"];
1589
+ };
1590
+ };
1591
+ /** @description Error response. */
1592
+ 403: {
1593
+ headers: {
1594
+ [name: string]: unknown;
1595
+ };
1596
+ content: {
1597
+ "application/json": components["schemas"]["Error"];
1598
+ };
1599
+ };
1600
+ /** @description Error response. */
1601
+ 409: {
1602
+ headers: {
1603
+ [name: string]: unknown;
1604
+ };
1605
+ content: {
1606
+ "application/json": components["schemas"]["Error"];
1607
+ };
1608
+ };
1609
+ /** @description Error response. */
1610
+ 422: {
1611
+ headers: {
1612
+ [name: string]: unknown;
1613
+ };
1614
+ content: {
1615
+ "application/json": components["schemas"]["Error"];
1616
+ };
1617
+ };
1618
+ 429: components["responses"]["RateLimited"];
1619
+ 500: components["responses"]["InternalError"];
1620
+ };
1621
+ };
1622
+ get_upload_part_urls: {
1623
+ parameters: {
1624
+ query?: {
1625
+ /** @description The first part number to return a URL for. */
1626
+ start?: number;
1627
+ };
1628
+ header?: never;
1629
+ path: {
1630
+ /** @description The upload's job id, returned as job_id by create_upload. */
1631
+ job: string;
1632
+ };
1633
+ cookie?: never;
1634
+ };
1635
+ requestBody?: never;
1636
+ responses: {
1637
+ /** @description Success. */
1638
+ 200: {
1639
+ headers: {
1640
+ [name: string]: unknown;
1641
+ };
1642
+ content: {
1643
+ "application/json": {
1644
+ /** @description The byte size of every part except the last. */
1645
+ part_size_bytes: number;
1646
+ /** @description The total number of parts this upload is split into. */
1647
+ total_parts: number;
1648
+ /** @description Presigned URLs for this page's parts, starting at the requested (or first) part number. */
1649
+ part_urls: components["schemas"]["PresignedPartUrl"][];
1650
+ /** @description The next part number not covered by this page, or null once every part has a URL. */
1651
+ next_part_number: number | null;
1652
+ } | null;
1653
+ };
1654
+ };
1655
+ /** @description Error response. */
1656
+ 400: {
1657
+ headers: {
1658
+ [name: string]: unknown;
1659
+ };
1660
+ content: {
1661
+ "application/json": components["schemas"]["Error"];
1662
+ };
1663
+ };
1664
+ /** @description Error response. */
1665
+ 401: {
1666
+ headers: {
1667
+ [name: string]: unknown;
1668
+ };
1669
+ content: {
1670
+ "application/json": components["schemas"]["Error"];
1671
+ };
1672
+ };
1673
+ /** @description Error response. */
1674
+ 403: {
1675
+ headers: {
1676
+ [name: string]: unknown;
1677
+ };
1678
+ content: {
1679
+ "application/json": components["schemas"]["Error"];
1680
+ };
1681
+ };
1682
+ /** @description Error response. */
1683
+ 404: {
1684
+ headers: {
1685
+ [name: string]: unknown;
1686
+ };
1687
+ content: {
1688
+ "application/json": components["schemas"]["Error"];
1689
+ };
1690
+ };
1691
+ /** @description Error response. */
1692
+ 409: {
1693
+ headers: {
1694
+ [name: string]: unknown;
1695
+ };
1696
+ content: {
1697
+ "application/json": components["schemas"]["Error"];
1698
+ };
1699
+ };
1700
+ 429: components["responses"]["RateLimited"];
1701
+ 500: components["responses"]["InternalError"];
1702
+ };
1703
+ };
1704
+ upload_part: {
1705
+ parameters: {
1706
+ query?: never;
1707
+ header?: never;
1708
+ path: {
1709
+ /** @description The upload's job id, returned as job_id by create_upload. */
1710
+ job: string;
1711
+ /** @description The 1-based part number. */
1712
+ n: number;
1713
+ };
1714
+ cookie?: never;
1715
+ };
1716
+ requestBody: {
1717
+ content: {
1718
+ "application/octet-stream": string;
1719
+ };
1720
+ };
1721
+ responses: {
1722
+ /** @description Success. */
1723
+ 200: {
1724
+ headers: {
1725
+ [name: string]: unknown;
1726
+ };
1727
+ content: {
1728
+ "application/json": {
1729
+ ok: boolean;
1730
+ part: number;
1731
+ };
1732
+ };
1733
+ };
1734
+ /** @description Error response. */
1735
+ 400: {
1736
+ headers: {
1737
+ [name: string]: unknown;
1738
+ };
1739
+ content: {
1740
+ "application/json": components["schemas"]["Error"];
1741
+ };
1742
+ };
1743
+ /** @description Error response. */
1744
+ 401: {
1745
+ headers: {
1746
+ [name: string]: unknown;
1747
+ };
1748
+ content: {
1749
+ "application/json": components["schemas"]["Error"];
1750
+ };
1751
+ };
1752
+ /** @description Error response. */
1753
+ 403: {
1754
+ headers: {
1755
+ [name: string]: unknown;
1756
+ };
1757
+ content: {
1758
+ "application/json": components["schemas"]["Error"];
1759
+ };
1760
+ };
1761
+ /** @description Error response. */
1762
+ 404: {
1763
+ headers: {
1764
+ [name: string]: unknown;
1765
+ };
1766
+ content: {
1767
+ "application/json": components["schemas"]["Error"];
1768
+ };
1769
+ };
1770
+ /** @description Error response. */
1771
+ 409: {
1772
+ headers: {
1773
+ [name: string]: unknown;
1774
+ };
1775
+ content: {
1776
+ "application/json": components["schemas"]["Error"];
1777
+ };
1778
+ };
1779
+ /** @description Error response. */
1780
+ 422: {
1781
+ headers: {
1782
+ [name: string]: unknown;
1783
+ };
1784
+ content: {
1785
+ "application/json": components["schemas"]["Error"];
1786
+ };
1787
+ };
1788
+ 429: components["responses"]["RateLimited"];
1789
+ 500: components["responses"]["InternalError"];
1790
+ };
1791
+ };
1792
+ heartbeat_upload: {
1793
+ parameters: {
1794
+ query?: never;
1795
+ header?: never;
1796
+ path: {
1797
+ /** @description The upload's job id, returned as job_id by create_upload. */
1798
+ job: string;
1799
+ };
1800
+ cookie?: never;
1801
+ };
1802
+ requestBody?: never;
1803
+ responses: {
1804
+ /** @description Success. */
1805
+ 200: {
1806
+ headers: {
1807
+ [name: string]: unknown;
1808
+ };
1809
+ content: {
1810
+ "application/json": {
1811
+ ok: boolean;
1812
+ };
1813
+ };
1814
+ };
1815
+ /** @description Error response. */
1816
+ 401: {
1817
+ headers: {
1818
+ [name: string]: unknown;
1819
+ };
1820
+ content: {
1821
+ "application/json": components["schemas"]["Error"];
1822
+ };
1823
+ };
1824
+ /** @description Error response. */
1825
+ 403: {
1826
+ headers: {
1827
+ [name: string]: unknown;
1828
+ };
1829
+ content: {
1830
+ "application/json": components["schemas"]["Error"];
1831
+ };
1832
+ };
1833
+ /** @description Error response. */
1834
+ 409: {
1835
+ headers: {
1836
+ [name: string]: unknown;
1837
+ };
1838
+ content: {
1839
+ "application/json": components["schemas"]["Error"];
1840
+ };
1841
+ };
1842
+ 429: components["responses"]["RateLimited"];
1843
+ 500: components["responses"]["InternalError"];
1844
+ };
1845
+ };
1846
+ complete_upload: {
1847
+ parameters: {
1848
+ query?: never;
1849
+ header?: never;
1850
+ path: {
1851
+ /** @description The upload's job id, returned as job_id by create_upload. */
1852
+ job: string;
1853
+ };
1854
+ cookie?: never;
1855
+ };
1856
+ requestBody?: {
1857
+ content: {
1858
+ "application/json": {
1859
+ /** @description The part number and ETag of every part a direct-to-R2 client uploaded. Omit entirely for a worker-uploaded job. */
1860
+ parts?: {
1861
+ n: number;
1862
+ etag: string;
1863
+ }[] | null;
1864
+ };
1865
+ };
1866
+ };
1867
+ responses: {
1868
+ /** @description Success. */
1869
+ 200: {
1870
+ headers: {
1871
+ [name: string]: unknown;
1872
+ };
1873
+ content: {
1874
+ "application/json": components["schemas"]["UploadCompleteResponse"];
1875
+ };
1876
+ };
1877
+ /** @description Error response. */
1878
+ 400: {
1879
+ headers: {
1880
+ [name: string]: unknown;
1881
+ };
1882
+ content: {
1883
+ "application/json": components["schemas"]["Error"];
1884
+ };
1885
+ };
1886
+ /** @description Error response. */
1887
+ 401: {
1888
+ headers: {
1889
+ [name: string]: unknown;
1890
+ };
1891
+ content: {
1892
+ "application/json": components["schemas"]["Error"];
1893
+ };
1894
+ };
1895
+ /** @description Error response. */
1896
+ 403: {
1897
+ headers: {
1898
+ [name: string]: unknown;
1899
+ };
1900
+ content: {
1901
+ "application/json": components["schemas"]["Error"];
1902
+ };
1903
+ };
1904
+ /** @description Error response. */
1905
+ 404: {
1906
+ headers: {
1907
+ [name: string]: unknown;
1908
+ };
1909
+ content: {
1910
+ "application/json": components["schemas"]["Error"];
1911
+ };
1912
+ };
1913
+ /** @description Error response. */
1914
+ 409: {
1915
+ headers: {
1916
+ [name: string]: unknown;
1917
+ };
1918
+ content: {
1919
+ "application/json": components["schemas"]["Error"];
1920
+ };
1921
+ };
1922
+ /** @description Error response. */
1923
+ 422: {
1924
+ headers: {
1925
+ [name: string]: unknown;
1926
+ };
1927
+ content: {
1928
+ "application/json": components["schemas"]["Error"];
1929
+ };
1930
+ };
1931
+ 429: components["responses"]["RateLimited"];
1932
+ 500: components["responses"]["InternalError"];
1933
+ };
1934
+ };
1935
+ list_jobs: {
1936
+ parameters: {
1937
+ query?: {
1938
+ /** @description When set to 1, true or yes, return only jobs that have not reached a terminal state. Any other value, or omitting the parameter, returns every job. */
1939
+ active?: "1" | "true" | "yes";
1940
+ /** @description An opaque paging token from a previous page's next_cursor. Omit to fetch the first page. */
1941
+ cursor?: string;
1942
+ /** @description Maximum rows to return. */
1943
+ limit?: number;
1944
+ };
1945
+ header?: never;
1946
+ path?: never;
1947
+ cookie?: never;
1948
+ };
1949
+ requestBody?: never;
1950
+ responses: {
1951
+ /** @description Success. */
1952
+ 200: {
1953
+ headers: {
1954
+ [name: string]: unknown;
1955
+ };
1956
+ content: {
1957
+ "application/json": components["schemas"]["JobList"];
1958
+ };
1959
+ };
1960
+ /** @description Error response. */
1961
+ 400: {
1962
+ headers: {
1963
+ [name: string]: unknown;
1964
+ };
1965
+ content: {
1966
+ "application/json": components["schemas"]["Error"];
1967
+ };
1968
+ };
1969
+ /** @description Error response. */
1970
+ 401: {
1971
+ headers: {
1972
+ [name: string]: unknown;
1973
+ };
1974
+ content: {
1975
+ "application/json": components["schemas"]["Error"];
1976
+ };
1977
+ };
1978
+ /** @description Error response. */
1979
+ 403: {
1980
+ headers: {
1981
+ [name: string]: unknown;
1982
+ };
1983
+ content: {
1984
+ "application/json": components["schemas"]["Error"];
1985
+ };
1986
+ };
1987
+ 429: components["responses"]["RateLimited"];
1988
+ 500: components["responses"]["InternalError"];
1989
+ };
1990
+ };
1991
+ get_job: {
1992
+ parameters: {
1993
+ query?: never;
1994
+ header?: never;
1995
+ path: {
1996
+ /** @description The job id. */
1997
+ id: string;
1998
+ };
1999
+ cookie?: never;
2000
+ };
2001
+ requestBody?: never;
2002
+ responses: {
2003
+ /** @description Success. */
2004
+ 200: {
2005
+ headers: {
2006
+ [name: string]: unknown;
2007
+ };
2008
+ content: {
2009
+ "application/json": components["schemas"]["Job"];
2010
+ };
2011
+ };
2012
+ /** @description Error response. */
2013
+ 400: {
2014
+ headers: {
2015
+ [name: string]: unknown;
2016
+ };
2017
+ content: {
2018
+ "application/json": components["schemas"]["Error"];
2019
+ };
2020
+ };
2021
+ /** @description Error response. */
2022
+ 401: {
2023
+ headers: {
2024
+ [name: string]: unknown;
2025
+ };
2026
+ content: {
2027
+ "application/json": components["schemas"]["Error"];
2028
+ };
2029
+ };
2030
+ /** @description Error response. */
2031
+ 403: {
2032
+ headers: {
2033
+ [name: string]: unknown;
2034
+ };
2035
+ content: {
2036
+ "application/json": components["schemas"]["Error"];
2037
+ };
2038
+ };
2039
+ /** @description Error response. */
2040
+ 404: {
2041
+ headers: {
2042
+ [name: string]: unknown;
2043
+ };
2044
+ content: {
2045
+ "application/json": components["schemas"]["Error"];
2046
+ };
2047
+ };
2048
+ 429: components["responses"]["RateLimited"];
2049
+ 500: components["responses"]["InternalError"];
2050
+ };
2051
+ };
2052
+ list_transcripts: {
2053
+ parameters: {
2054
+ query?: {
2055
+ /** @description An opaque paging token from a previous page's next_cursor. Omit to fetch the first page. */
2056
+ cursor?: string;
2057
+ /** @description Maximum rows to return. */
2058
+ limit?: number;
2059
+ };
2060
+ header?: never;
2061
+ path?: never;
2062
+ cookie?: never;
2063
+ };
2064
+ requestBody?: never;
2065
+ responses: {
2066
+ /** @description Success. */
2067
+ 200: {
2068
+ headers: {
2069
+ [name: string]: unknown;
2070
+ };
2071
+ content: {
2072
+ "application/json": components["schemas"]["TranscriptList"];
2073
+ };
2074
+ };
2075
+ /** @description Error response. */
2076
+ 400: {
2077
+ headers: {
2078
+ [name: string]: unknown;
2079
+ };
2080
+ content: {
2081
+ "application/json": components["schemas"]["Error"];
2082
+ };
2083
+ };
2084
+ /** @description Error response. */
2085
+ 401: {
2086
+ headers: {
2087
+ [name: string]: unknown;
2088
+ };
2089
+ content: {
2090
+ "application/json": components["schemas"]["Error"];
2091
+ };
2092
+ };
2093
+ /** @description Error response. */
2094
+ 403: {
2095
+ headers: {
2096
+ [name: string]: unknown;
2097
+ };
2098
+ content: {
2099
+ "application/json": components["schemas"]["Error"];
2100
+ };
2101
+ };
2102
+ 429: components["responses"]["RateLimited"];
2103
+ 500: components["responses"]["InternalError"];
2104
+ };
2105
+ };
2106
+ get_transcript: {
2107
+ parameters: {
2108
+ query?: never;
2109
+ header?: never;
2110
+ path: {
2111
+ /** @description The transcript id. */
2112
+ id: string;
2113
+ };
2114
+ cookie?: never;
2115
+ };
2116
+ requestBody?: never;
2117
+ responses: {
2118
+ /** @description Success. */
2119
+ 200: {
2120
+ headers: {
2121
+ [name: string]: unknown;
2122
+ };
2123
+ content: {
2124
+ "application/json": components["schemas"]["TranscriptDetail"];
2125
+ };
2126
+ };
2127
+ /** @description Error response. */
2128
+ 400: {
2129
+ headers: {
2130
+ [name: string]: unknown;
2131
+ };
2132
+ content: {
2133
+ "application/json": components["schemas"]["Error"];
2134
+ };
2135
+ };
2136
+ /** @description Error response. */
2137
+ 401: {
2138
+ headers: {
2139
+ [name: string]: unknown;
2140
+ };
2141
+ content: {
2142
+ "application/json": components["schemas"]["Error"];
2143
+ };
2144
+ };
2145
+ /** @description Error response. */
2146
+ 403: {
2147
+ headers: {
2148
+ [name: string]: unknown;
2149
+ };
2150
+ content: {
2151
+ "application/json": components["schemas"]["Error"];
2152
+ };
2153
+ };
2154
+ /** @description Error response. */
2155
+ 404: {
2156
+ headers: {
2157
+ [name: string]: unknown;
2158
+ };
2159
+ content: {
2160
+ "application/json": components["schemas"]["Error"];
2161
+ };
2162
+ };
2163
+ 429: components["responses"]["RateLimited"];
2164
+ 500: components["responses"]["InternalError"];
2165
+ };
2166
+ };
2167
+ list_deleted_transcripts: {
2168
+ parameters: {
2169
+ query?: {
2170
+ /** @description An opaque paging token from a previous page's next_cursor. Omit to fetch the first page. */
2171
+ cursor?: string;
2172
+ /** @description Maximum rows to return. */
2173
+ limit?: number;
2174
+ };
2175
+ header?: never;
2176
+ path?: never;
2177
+ cookie?: never;
2178
+ };
2179
+ requestBody?: never;
2180
+ responses: {
2181
+ /** @description Success. */
2182
+ 200: {
2183
+ headers: {
2184
+ [name: string]: unknown;
2185
+ };
2186
+ content: {
2187
+ "application/json": components["schemas"]["DeletedTranscriptsResponse"];
2188
+ };
2189
+ };
2190
+ /** @description Error response. */
2191
+ 400: {
2192
+ headers: {
2193
+ [name: string]: unknown;
2194
+ };
2195
+ content: {
2196
+ "application/json": components["schemas"]["Error"];
2197
+ };
2198
+ };
2199
+ /** @description Error response. */
2200
+ 401: {
2201
+ headers: {
2202
+ [name: string]: unknown;
2203
+ };
2204
+ content: {
2205
+ "application/json": components["schemas"]["Error"];
2206
+ };
2207
+ };
2208
+ /** @description Error response. */
2209
+ 403: {
2210
+ headers: {
2211
+ [name: string]: unknown;
2212
+ };
2213
+ content: {
2214
+ "application/json": components["schemas"]["Error"];
2215
+ };
2216
+ };
2217
+ 429: components["responses"]["RateLimited"];
2218
+ 500: components["responses"]["InternalError"];
2219
+ };
2220
+ };
2221
+ list_packs: {
2222
+ parameters: {
2223
+ query?: never;
2224
+ header?: never;
2225
+ path?: never;
2226
+ cookie?: never;
2227
+ };
2228
+ requestBody?: never;
2229
+ responses: {
2230
+ /** @description Success. */
2231
+ 200: {
2232
+ headers: {
2233
+ [name: string]: unknown;
2234
+ };
2235
+ content: {
2236
+ "application/json": components["schemas"]["PacksResponse"];
2237
+ };
2238
+ };
2239
+ /** @description Error response. */
2240
+ 401: {
2241
+ headers: {
2242
+ [name: string]: unknown;
2243
+ };
2244
+ content: {
2245
+ "application/json": components["schemas"]["Error"];
2246
+ };
2247
+ };
2248
+ /** @description Error response. */
2249
+ 403: {
2250
+ headers: {
2251
+ [name: string]: unknown;
2252
+ };
2253
+ content: {
2254
+ "application/json": components["schemas"]["Error"];
2255
+ };
2256
+ };
2257
+ 429: components["responses"]["RateLimited"];
2258
+ 500: components["responses"]["InternalError"];
2259
+ };
2260
+ };
2261
+ buy_minutes: {
2262
+ parameters: {
2263
+ query?: never;
2264
+ header?: never;
2265
+ path?: never;
2266
+ cookie?: never;
2267
+ };
2268
+ requestBody: {
2269
+ content: {
2270
+ "application/json": {
2271
+ /** @description The id of a pack from list_packs. */
2272
+ pack: string;
2273
+ /** @description A client-minted key preventing a retried request from charging twice. */
2274
+ idempotency_key: string;
2275
+ /** @description The id of a card from list_saved_cards, required on this API. */
2276
+ quick_payment_method_id: string;
2277
+ /** @description Client attestation that the no-refund, instant-delivery notice was shown before this call. Optional; absent is treated as false. */
2278
+ policy_ack?: boolean;
2279
+ };
2280
+ };
2281
+ };
2282
+ responses: {
2283
+ /** @description Success. */
2284
+ 200: {
2285
+ headers: {
2286
+ [name: string]: unknown;
2287
+ };
2288
+ content: {
2289
+ "application/json": components["schemas"]["PurchaseResponse"];
2290
+ };
2291
+ };
2292
+ /** @description Error response. */
2293
+ 400: {
2294
+ headers: {
2295
+ [name: string]: unknown;
2296
+ };
2297
+ content: {
2298
+ "application/json": components["schemas"]["Error"];
2299
+ };
2300
+ };
2301
+ /** @description Error response. */
2302
+ 401: {
2303
+ headers: {
2304
+ [name: string]: unknown;
2305
+ };
2306
+ content: {
2307
+ "application/json": components["schemas"]["Error"];
2308
+ };
2309
+ };
2310
+ /** @description Error response. */
2311
+ 403: {
2312
+ headers: {
2313
+ [name: string]: unknown;
2314
+ };
2315
+ content: {
2316
+ "application/json": components["schemas"]["Error"];
2317
+ };
2318
+ };
2319
+ /** @description Error response. */
2320
+ 422: {
2321
+ headers: {
2322
+ [name: string]: unknown;
2323
+ };
2324
+ content: {
2325
+ "application/json": components["schemas"]["Error"];
2326
+ };
2327
+ };
2328
+ 429: components["responses"]["RateLimited"];
2329
+ 500: components["responses"]["InternalError"];
2330
+ /** @description Error response. */
2331
+ 502: {
2332
+ headers: {
2333
+ [name: string]: unknown;
2334
+ };
2335
+ content: {
2336
+ "application/json": components["schemas"]["Error"];
2337
+ };
2338
+ };
2339
+ };
2340
+ };
2341
+ list_saved_cards: {
2342
+ parameters: {
2343
+ query?: never;
2344
+ header?: never;
2345
+ path?: never;
2346
+ cookie?: never;
2347
+ };
2348
+ requestBody?: never;
2349
+ responses: {
2350
+ /** @description Success. */
2351
+ 200: {
2352
+ headers: {
2353
+ [name: string]: unknown;
2354
+ };
2355
+ content: {
2356
+ "application/json": components["schemas"]["CardsResponse"];
2357
+ };
2358
+ };
2359
+ /** @description Error response. */
2360
+ 401: {
2361
+ headers: {
2362
+ [name: string]: unknown;
2363
+ };
2364
+ content: {
2365
+ "application/json": components["schemas"]["Error"];
2366
+ };
2367
+ };
2368
+ /** @description Error response. */
2369
+ 403: {
2370
+ headers: {
2371
+ [name: string]: unknown;
2372
+ };
2373
+ content: {
2374
+ "application/json": components["schemas"]["Error"];
2375
+ };
2376
+ };
2377
+ 429: components["responses"]["RateLimited"];
2378
+ 500: components["responses"]["InternalError"];
2379
+ };
2380
+ };
2381
+ set_default_card: {
2382
+ parameters: {
2383
+ query?: never;
2384
+ header?: never;
2385
+ path?: never;
2386
+ cookie?: never;
2387
+ };
2388
+ requestBody: {
2389
+ content: {
2390
+ "application/json": {
2391
+ /** @description The id of a card from list_saved_cards to make the new default. */
2392
+ payment_method_id: string;
2393
+ };
2394
+ };
2395
+ };
2396
+ responses: {
2397
+ /** @description Success. */
2398
+ 200: {
2399
+ headers: {
2400
+ [name: string]: unknown;
2401
+ };
2402
+ content: {
2403
+ "application/json": {
2404
+ ok: boolean;
2405
+ };
2406
+ };
2407
+ };
2408
+ /** @description Error response. */
2409
+ 400: {
2410
+ headers: {
2411
+ [name: string]: unknown;
2412
+ };
2413
+ content: {
2414
+ "application/json": components["schemas"]["Error"];
2415
+ };
2416
+ };
2417
+ /** @description Error response. */
2418
+ 401: {
2419
+ headers: {
2420
+ [name: string]: unknown;
2421
+ };
2422
+ content: {
2423
+ "application/json": components["schemas"]["Error"];
2424
+ };
2425
+ };
2426
+ /** @description Error response. */
2427
+ 403: {
2428
+ headers: {
2429
+ [name: string]: unknown;
2430
+ };
2431
+ content: {
2432
+ "application/json": components["schemas"]["Error"];
2433
+ };
2434
+ };
2435
+ /** @description Error response. */
2436
+ 404: {
2437
+ headers: {
2438
+ [name: string]: unknown;
2439
+ };
2440
+ content: {
2441
+ "application/json": components["schemas"]["Error"];
2442
+ };
2443
+ };
2444
+ 429: components["responses"]["RateLimited"];
2445
+ 500: components["responses"]["InternalError"];
2446
+ };
2447
+ };
2448
+ create_setup_session: {
2449
+ parameters: {
2450
+ query?: never;
2451
+ header?: never;
2452
+ path?: never;
2453
+ cookie?: never;
2454
+ };
2455
+ requestBody?: {
2456
+ content: {
2457
+ "application/json": {
2458
+ /** @description Optional client-minted key so a retried request reuses one Session instead of opening a new one. Omit it for a fresh Session on every call. */
2459
+ idempotency_key?: string;
2460
+ };
2461
+ };
2462
+ };
2463
+ responses: {
2464
+ /** @description Success. */
2465
+ 200: {
2466
+ headers: {
2467
+ [name: string]: unknown;
2468
+ };
2469
+ content: {
2470
+ "application/json": components["schemas"]["SetupSessionResponse"];
2471
+ };
2472
+ };
2473
+ /** @description Error response. */
2474
+ 400: {
2475
+ headers: {
2476
+ [name: string]: unknown;
2477
+ };
2478
+ content: {
2479
+ "application/json": components["schemas"]["Error"];
2480
+ };
2481
+ };
2482
+ /** @description Error response. */
2483
+ 401: {
2484
+ headers: {
2485
+ [name: string]: unknown;
2486
+ };
2487
+ content: {
2488
+ "application/json": components["schemas"]["Error"];
2489
+ };
2490
+ };
2491
+ /** @description Error response. */
2492
+ 403: {
2493
+ headers: {
2494
+ [name: string]: unknown;
2495
+ };
2496
+ content: {
2497
+ "application/json": components["schemas"]["Error"];
2498
+ };
2499
+ };
2500
+ 429: components["responses"]["RateLimited"];
2501
+ 500: components["responses"]["InternalError"];
2502
+ /** @description Error response. */
2503
+ 502: {
2504
+ headers: {
2505
+ [name: string]: unknown;
2506
+ };
2507
+ content: {
2508
+ "application/json": components["schemas"]["Error"];
2509
+ };
2510
+ };
2511
+ };
2512
+ };
2513
+ list_transactions: {
2514
+ parameters: {
2515
+ query?: {
2516
+ /** @description An opaque paging token from a previous page's next_cursor. Omit to fetch the first page. */
2517
+ cursor?: string;
2518
+ /** @description Maximum rows to return. */
2519
+ limit?: number;
2520
+ };
2521
+ header?: never;
2522
+ path?: never;
2523
+ cookie?: never;
2524
+ };
2525
+ requestBody?: never;
2526
+ responses: {
2527
+ /** @description Success. */
2528
+ 200: {
2529
+ headers: {
2530
+ [name: string]: unknown;
2531
+ };
2532
+ content: {
2533
+ "application/json": components["schemas"]["TransactionsResponse"];
2534
+ };
2535
+ };
2536
+ /** @description Error response. */
2537
+ 400: {
2538
+ headers: {
2539
+ [name: string]: unknown;
2540
+ };
2541
+ content: {
2542
+ "application/json": components["schemas"]["Error"];
2543
+ };
2544
+ };
2545
+ /** @description Error response. */
2546
+ 401: {
2547
+ headers: {
2548
+ [name: string]: unknown;
2549
+ };
2550
+ content: {
2551
+ "application/json": components["schemas"]["Error"];
2552
+ };
2553
+ };
2554
+ /** @description Error response. */
2555
+ 403: {
2556
+ headers: {
2557
+ [name: string]: unknown;
2558
+ };
2559
+ content: {
2560
+ "application/json": components["schemas"]["Error"];
2561
+ };
2562
+ };
2563
+ 429: components["responses"]["RateLimited"];
2564
+ 500: components["responses"]["InternalError"];
2565
+ };
2566
+ };
2567
+ list_credit_ledger: {
2568
+ parameters: {
2569
+ query?: {
2570
+ /** @description An opaque paging token from a previous page's next_cursor. Omit to fetch the first page. */
2571
+ cursor?: string;
2572
+ /** @description Maximum rows to return. */
2573
+ limit?: number;
2574
+ };
2575
+ header?: never;
2576
+ path?: never;
2577
+ cookie?: never;
2578
+ };
2579
+ requestBody?: never;
2580
+ responses: {
2581
+ /** @description Success. */
2582
+ 200: {
2583
+ headers: {
2584
+ [name: string]: unknown;
2585
+ };
2586
+ content: {
2587
+ "application/json": components["schemas"]["CreditLedgerResponse"];
2588
+ };
2589
+ };
2590
+ /** @description Error response. */
2591
+ 400: {
2592
+ headers: {
2593
+ [name: string]: unknown;
2594
+ };
2595
+ content: {
2596
+ "application/json": components["schemas"]["Error"];
2597
+ };
2598
+ };
2599
+ /** @description Error response. */
2600
+ 401: {
2601
+ headers: {
2602
+ [name: string]: unknown;
2603
+ };
2604
+ content: {
2605
+ "application/json": components["schemas"]["Error"];
2606
+ };
2607
+ };
2608
+ /** @description Error response. */
2609
+ 403: {
2610
+ headers: {
2611
+ [name: string]: unknown;
2612
+ };
2613
+ content: {
2614
+ "application/json": components["schemas"]["Error"];
2615
+ };
2616
+ };
2617
+ 429: components["responses"]["RateLimited"];
2618
+ 500: components["responses"]["InternalError"];
2619
+ };
2620
+ };
2621
+ list_holds: {
2622
+ parameters: {
2623
+ query?: {
2624
+ /** @description An opaque paging token from a previous page's next_cursor. Omit to fetch the first page. */
2625
+ cursor?: string;
2626
+ /** @description Maximum rows to return. */
2627
+ limit?: number;
2628
+ };
2629
+ header?: never;
2630
+ path?: never;
2631
+ cookie?: never;
2632
+ };
2633
+ requestBody?: never;
2634
+ responses: {
2635
+ /** @description Success. */
2636
+ 200: {
2637
+ headers: {
2638
+ [name: string]: unknown;
2639
+ };
2640
+ content: {
2641
+ "application/json": components["schemas"]["HoldsResponse"];
2642
+ };
2643
+ };
2644
+ /** @description Error response. */
2645
+ 400: {
2646
+ headers: {
2647
+ [name: string]: unknown;
2648
+ };
2649
+ content: {
2650
+ "application/json": components["schemas"]["Error"];
2651
+ };
2652
+ };
2653
+ /** @description Error response. */
2654
+ 401: {
2655
+ headers: {
2656
+ [name: string]: unknown;
2657
+ };
2658
+ content: {
2659
+ "application/json": components["schemas"]["Error"];
2660
+ };
2661
+ };
2662
+ /** @description Error response. */
2663
+ 403: {
2664
+ headers: {
2665
+ [name: string]: unknown;
2666
+ };
2667
+ content: {
2668
+ "application/json": components["schemas"]["Error"];
2669
+ };
2670
+ };
2671
+ 429: components["responses"]["RateLimited"];
2672
+ 500: components["responses"]["InternalError"];
2673
+ };
2674
+ };
2675
+ get_org: {
2676
+ parameters: {
2677
+ query?: never;
2678
+ header?: never;
2679
+ path?: never;
2680
+ cookie?: never;
2681
+ };
2682
+ requestBody?: never;
2683
+ responses: {
2684
+ /** @description Success. */
2685
+ 200: {
2686
+ headers: {
2687
+ [name: string]: unknown;
2688
+ };
2689
+ content: {
2690
+ "application/json": components["schemas"]["OrgSummaryResponse"];
2691
+ };
2692
+ };
2693
+ /** @description Error response. */
2694
+ 401: {
2695
+ headers: {
2696
+ [name: string]: unknown;
2697
+ };
2698
+ content: {
2699
+ "application/json": components["schemas"]["Error"];
2700
+ };
2701
+ };
2702
+ /** @description Error response. */
2703
+ 403: {
2704
+ headers: {
2705
+ [name: string]: unknown;
2706
+ };
2707
+ content: {
2708
+ "application/json": components["schemas"]["Error"];
2709
+ };
2710
+ };
2711
+ 429: components["responses"]["RateLimited"];
2712
+ 500: components["responses"]["InternalError"];
2713
+ };
2714
+ };
2715
+ list_org_members: {
2716
+ parameters: {
2717
+ query?: {
2718
+ /** @description An opaque paging token from a previous page's next_cursor. Omit to fetch the first page. */
2719
+ cursor?: string;
2720
+ /** @description Maximum rows to return. */
2721
+ limit?: number;
2722
+ };
2723
+ header?: never;
2724
+ path?: never;
2725
+ cookie?: never;
2726
+ };
2727
+ requestBody?: never;
2728
+ responses: {
2729
+ /** @description Success. */
2730
+ 200: {
2731
+ headers: {
2732
+ [name: string]: unknown;
2733
+ };
2734
+ content: {
2735
+ "application/json": components["schemas"]["OrgMembersResponse"];
2736
+ };
2737
+ };
2738
+ /** @description Error response. */
2739
+ 400: {
2740
+ headers: {
2741
+ [name: string]: unknown;
2742
+ };
2743
+ content: {
2744
+ "application/json": components["schemas"]["Error"];
2745
+ };
2746
+ };
2747
+ /** @description Error response. */
2748
+ 401: {
2749
+ headers: {
2750
+ [name: string]: unknown;
2751
+ };
2752
+ content: {
2753
+ "application/json": components["schemas"]["Error"];
2754
+ };
2755
+ };
2756
+ /** @description Error response. */
2757
+ 403: {
2758
+ headers: {
2759
+ [name: string]: unknown;
2760
+ };
2761
+ content: {
2762
+ "application/json": components["schemas"]["Error"];
2763
+ };
2764
+ };
2765
+ 429: components["responses"]["RateLimited"];
2766
+ 500: components["responses"]["InternalError"];
2767
+ };
2768
+ };
2769
+ list_org_invoices: {
2770
+ parameters: {
2771
+ query?: {
2772
+ /** @description An opaque paging token from a previous page's next_cursor. Omit to fetch the first page. */
2773
+ cursor?: string;
2774
+ /** @description Maximum rows to return. */
2775
+ limit?: number;
2776
+ };
2777
+ header?: never;
2778
+ path?: never;
2779
+ cookie?: never;
2780
+ };
2781
+ requestBody?: never;
2782
+ responses: {
2783
+ /** @description Success. */
2784
+ 200: {
2785
+ headers: {
2786
+ [name: string]: unknown;
2787
+ };
2788
+ content: {
2789
+ "application/json": components["schemas"]["OrgInvoicesResponse"];
2790
+ };
2791
+ };
2792
+ /** @description Error response. */
2793
+ 400: {
2794
+ headers: {
2795
+ [name: string]: unknown;
2796
+ };
2797
+ content: {
2798
+ "application/json": components["schemas"]["Error"];
2799
+ };
2800
+ };
2801
+ /** @description Error response. */
2802
+ 401: {
2803
+ headers: {
2804
+ [name: string]: unknown;
2805
+ };
2806
+ content: {
2807
+ "application/json": components["schemas"]["Error"];
2808
+ };
2809
+ };
2810
+ /** @description Error response. */
2811
+ 403: {
2812
+ headers: {
2813
+ [name: string]: unknown;
2814
+ };
2815
+ content: {
2816
+ "application/json": components["schemas"]["Error"];
2817
+ };
2818
+ };
2819
+ 429: components["responses"]["RateLimited"];
2820
+ 500: components["responses"]["InternalError"];
2821
+ };
2822
+ };
2823
+ list_org_transcripts: {
2824
+ parameters: {
2825
+ query?: {
2826
+ /** @description An opaque paging token from a previous page's next_cursor. Omit to fetch the first page. */
2827
+ cursor?: string;
2828
+ /** @description Maximum rows to return. */
2829
+ limit?: number;
2830
+ };
2831
+ header?: never;
2832
+ path?: never;
2833
+ cookie?: never;
2834
+ };
2835
+ requestBody?: never;
2836
+ responses: {
2837
+ /** @description Success. */
2838
+ 200: {
2839
+ headers: {
2840
+ [name: string]: unknown;
2841
+ };
2842
+ content: {
2843
+ "application/json": components["schemas"]["OrgTranscriptsResponse"];
2844
+ };
2845
+ };
2846
+ /** @description Error response. */
2847
+ 400: {
2848
+ headers: {
2849
+ [name: string]: unknown;
2850
+ };
2851
+ content: {
2852
+ "application/json": components["schemas"]["Error"];
2853
+ };
2854
+ };
2855
+ /** @description Error response. */
2856
+ 401: {
2857
+ headers: {
2858
+ [name: string]: unknown;
2859
+ };
2860
+ content: {
2861
+ "application/json": components["schemas"]["Error"];
2862
+ };
2863
+ };
2864
+ /** @description Error response. */
2865
+ 403: {
2866
+ headers: {
2867
+ [name: string]: unknown;
2868
+ };
2869
+ content: {
2870
+ "application/json": components["schemas"]["Error"];
2871
+ };
2872
+ };
2873
+ 429: components["responses"]["RateLimited"];
2874
+ 500: components["responses"]["InternalError"];
2875
+ };
2876
+ };
2877
+ list_org_ledger: {
2878
+ parameters: {
2879
+ query?: {
2880
+ /** @description An opaque paging token from a previous page's next_cursor. Omit to fetch the first page. */
2881
+ cursor?: string;
2882
+ /** @description Maximum rows to return. */
2883
+ limit?: number;
2884
+ };
2885
+ header?: never;
2886
+ path?: never;
2887
+ cookie?: never;
2888
+ };
2889
+ requestBody?: never;
2890
+ responses: {
2891
+ /** @description Success. */
2892
+ 200: {
2893
+ headers: {
2894
+ [name: string]: unknown;
2895
+ };
2896
+ content: {
2897
+ "application/json": components["schemas"]["OrgLedgerResponse"];
2898
+ };
2899
+ };
2900
+ /** @description Error response. */
2901
+ 400: {
2902
+ headers: {
2903
+ [name: string]: unknown;
2904
+ };
2905
+ content: {
2906
+ "application/json": components["schemas"]["Error"];
2907
+ };
2908
+ };
2909
+ /** @description Error response. */
2910
+ 401: {
2911
+ headers: {
2912
+ [name: string]: unknown;
2913
+ };
2914
+ content: {
2915
+ "application/json": components["schemas"]["Error"];
2916
+ };
2917
+ };
2918
+ /** @description Error response. */
2919
+ 403: {
2920
+ headers: {
2921
+ [name: string]: unknown;
2922
+ };
2923
+ content: {
2924
+ "application/json": components["schemas"]["Error"];
2925
+ };
2926
+ };
2927
+ 429: components["responses"]["RateLimited"];
2928
+ 500: components["responses"]["InternalError"];
2929
+ };
2930
+ };
2931
+ list_org_audit: {
2932
+ parameters: {
2933
+ query?: {
2934
+ /** @description An opaque paging token from a previous page's next_cursor. Omit to fetch the first page. */
2935
+ cursor?: string;
2936
+ /** @description Maximum rows to return. */
2937
+ limit?: number;
2938
+ };
2939
+ header?: never;
2940
+ path?: never;
2941
+ cookie?: never;
2942
+ };
2943
+ requestBody?: never;
2944
+ responses: {
2945
+ /** @description Success. */
2946
+ 200: {
2947
+ headers: {
2948
+ [name: string]: unknown;
2949
+ };
2950
+ content: {
2951
+ "application/json": components["schemas"]["OrgAuditResponse"];
2952
+ };
2953
+ };
2954
+ /** @description Error response. */
2955
+ 400: {
2956
+ headers: {
2957
+ [name: string]: unknown;
2958
+ };
2959
+ content: {
2960
+ "application/json": components["schemas"]["Error"];
2961
+ };
2962
+ };
2963
+ /** @description Error response. */
2964
+ 401: {
2965
+ headers: {
2966
+ [name: string]: unknown;
2967
+ };
2968
+ content: {
2969
+ "application/json": components["schemas"]["Error"];
2970
+ };
2971
+ };
2972
+ /** @description Error response. */
2973
+ 403: {
2974
+ headers: {
2975
+ [name: string]: unknown;
2976
+ };
2977
+ content: {
2978
+ "application/json": components["schemas"]["Error"];
2979
+ };
2980
+ };
2981
+ 429: components["responses"]["RateLimited"];
2982
+ 500: components["responses"]["InternalError"];
2983
+ };
2984
+ };
2985
+ list_org_matters: {
2986
+ parameters: {
2987
+ query?: {
2988
+ /** @description Filter by registry status. An unrecognized value is refused rather than defaulted. */
2989
+ status?: "open" | "closed";
2990
+ /** @description Case-insensitive prefix match against the matter code. */
2991
+ q?: string;
2992
+ /** @description Maximum rows to return. */
2993
+ limit?: number;
2994
+ };
2995
+ header?: never;
2996
+ path?: never;
2997
+ cookie?: never;
2998
+ };
2999
+ requestBody?: never;
3000
+ responses: {
3001
+ /** @description Success. */
3002
+ 200: {
3003
+ headers: {
3004
+ [name: string]: unknown;
3005
+ };
3006
+ content: {
3007
+ "application/json": components["schemas"]["OrgMattersResponse"];
3008
+ };
3009
+ };
3010
+ /** @description Error response. status was not open or closed. */
3011
+ 400: {
3012
+ headers: {
3013
+ [name: string]: unknown;
3014
+ };
3015
+ content: {
3016
+ "application/json": components["schemas"]["Error"];
3017
+ };
3018
+ };
3019
+ /** @description Error response. */
3020
+ 401: {
3021
+ headers: {
3022
+ [name: string]: unknown;
3023
+ };
3024
+ content: {
3025
+ "application/json": components["schemas"]["Error"];
3026
+ };
3027
+ };
3028
+ /** @description Error response. */
3029
+ 403: {
3030
+ headers: {
3031
+ [name: string]: unknown;
3032
+ };
3033
+ content: {
3034
+ "application/json": components["schemas"]["Error"];
3035
+ };
3036
+ };
3037
+ 429: components["responses"]["RateLimited"];
3038
+ 500: components["responses"]["InternalError"];
3039
+ };
3040
+ };
3041
+ org_usage_report: {
3042
+ parameters: {
3043
+ query: {
3044
+ /** @description Range start, Unix seconds, inclusive. */
3045
+ from: number;
3046
+ /** @description Range end, Unix seconds, exclusive. Must be after from and at most 366 days later. */
3047
+ to: number;
3048
+ /** @description How to group the aggregated rows. An unrecognized value is refused rather than defaulted. */
3049
+ group_by?: "member" | "matter" | "client";
3050
+ };
3051
+ header?: never;
3052
+ path?: never;
3053
+ cookie?: never;
3054
+ };
3055
+ requestBody?: never;
3056
+ responses: {
3057
+ /** @description Success. */
3058
+ 200: {
3059
+ headers: {
3060
+ [name: string]: unknown;
3061
+ };
3062
+ content: {
3063
+ "application/json": components["schemas"]["OrgUsageResponse"];
3064
+ };
3065
+ };
3066
+ /** @description Error response. */
3067
+ 401: {
3068
+ headers: {
3069
+ [name: string]: unknown;
3070
+ };
3071
+ content: {
3072
+ "application/json": components["schemas"]["Error"];
3073
+ };
3074
+ };
3075
+ /** @description Error response. */
3076
+ 403: {
3077
+ headers: {
3078
+ [name: string]: unknown;
3079
+ };
3080
+ content: {
3081
+ "application/json": components["schemas"]["Error"];
3082
+ };
3083
+ };
3084
+ /** @description Error response. from/to formed an invalid or oversized range, or group_by was not member, matter or client. */
3085
+ 422: {
3086
+ headers: {
3087
+ [name: string]: unknown;
3088
+ };
3089
+ content: {
3090
+ "application/json": components["schemas"]["Error"];
3091
+ };
3092
+ };
3093
+ 429: components["responses"]["RateLimited"];
3094
+ 500: components["responses"]["InternalError"];
3095
+ };
3096
+ };
3097
+ org_usage_report_csv: {
3098
+ parameters: {
3099
+ query: {
3100
+ /** @description Range start, Unix seconds, inclusive. */
3101
+ from: number;
3102
+ /** @description Range end, Unix seconds, exclusive. Must be after from and at most 366 days later. */
3103
+ to: number;
3104
+ /** @description How to group the aggregated rows. An unrecognized value is refused rather than defaulted. */
3105
+ group_by?: "member" | "matter" | "client";
3106
+ };
3107
+ header?: never;
3108
+ path?: never;
3109
+ cookie?: never;
3110
+ };
3111
+ requestBody?: never;
3112
+ responses: {
3113
+ /** @description Success. A CSV file, one row per group. */
3114
+ 200: {
3115
+ headers: {
3116
+ [name: string]: unknown;
3117
+ };
3118
+ content: {
3119
+ "text/csv": string;
3120
+ };
3121
+ };
3122
+ /** @description Error response. */
3123
+ 401: {
3124
+ headers: {
3125
+ [name: string]: unknown;
3126
+ };
3127
+ content: {
3128
+ "application/json": components["schemas"]["Error"];
3129
+ };
3130
+ };
3131
+ /** @description Error response. */
3132
+ 403: {
3133
+ headers: {
3134
+ [name: string]: unknown;
3135
+ };
3136
+ content: {
3137
+ "application/json": components["schemas"]["Error"];
3138
+ };
3139
+ };
3140
+ /** @description Error response. from/to formed an invalid or oversized range, or group_by was not member, matter or client. */
3141
+ 422: {
3142
+ headers: {
3143
+ [name: string]: unknown;
3144
+ };
3145
+ content: {
3146
+ "application/json": components["schemas"]["Error"];
3147
+ };
3148
+ };
3149
+ 429: components["responses"]["RateLimited"];
3150
+ 500: components["responses"]["InternalError"];
3151
+ };
3152
+ };
3153
+ org_ledger_csv: {
3154
+ parameters: {
3155
+ query?: never;
3156
+ header?: never;
3157
+ path?: never;
3158
+ cookie?: never;
3159
+ };
3160
+ requestBody?: never;
3161
+ responses: {
3162
+ /** @description Success. A CSV file, one row per ledger entry, newest first. */
3163
+ 200: {
3164
+ headers: {
3165
+ [name: string]: unknown;
3166
+ };
3167
+ content: {
3168
+ "text/csv": string;
3169
+ };
3170
+ };
3171
+ /** @description Error response. */
3172
+ 401: {
3173
+ headers: {
3174
+ [name: string]: unknown;
3175
+ };
3176
+ content: {
3177
+ "application/json": components["schemas"]["Error"];
3178
+ };
3179
+ };
3180
+ /** @description Error response. */
3181
+ 403: {
3182
+ headers: {
3183
+ [name: string]: unknown;
3184
+ };
3185
+ content: {
3186
+ "application/json": components["schemas"]["Error"];
3187
+ };
3188
+ };
3189
+ 429: components["responses"]["RateLimited"];
3190
+ 500: components["responses"]["InternalError"];
3191
+ };
3192
+ };
3193
+ org_audit_csv: {
3194
+ parameters: {
3195
+ query?: never;
3196
+ header?: never;
3197
+ path?: never;
3198
+ cookie?: never;
3199
+ };
3200
+ requestBody?: never;
3201
+ responses: {
3202
+ /** @description Success. A CSV file, one row per audit entry, newest first. */
3203
+ 200: {
3204
+ headers: {
3205
+ [name: string]: unknown;
3206
+ };
3207
+ content: {
3208
+ "text/csv": string;
3209
+ };
3210
+ };
3211
+ /** @description Error response. */
3212
+ 401: {
3213
+ headers: {
3214
+ [name: string]: unknown;
3215
+ };
3216
+ content: {
3217
+ "application/json": components["schemas"]["Error"];
3218
+ };
3219
+ };
3220
+ /** @description Error response. */
3221
+ 403: {
3222
+ headers: {
3223
+ [name: string]: unknown;
3224
+ };
3225
+ content: {
3226
+ "application/json": components["schemas"]["Error"];
3227
+ };
3228
+ };
3229
+ 429: components["responses"]["RateLimited"];
3230
+ 500: components["responses"]["InternalError"];
3231
+ };
3232
+ };
3233
+ schedule_org_custody: {
3234
+ parameters: {
3235
+ query?: never;
3236
+ header?: never;
3237
+ path?: never;
3238
+ cookie?: never;
3239
+ };
3240
+ requestBody: {
3241
+ content: {
3242
+ "application/json": {
3243
+ /**
3244
+ * @description Must be firm; this route only schedules the private to firm switch.
3245
+ * @enum {string}
3246
+ */
3247
+ custody: "firm";
3248
+ };
3249
+ };
3250
+ };
3251
+ responses: {
3252
+ /** @description Success. */
3253
+ 200: {
3254
+ headers: {
3255
+ [name: string]: unknown;
3256
+ };
3257
+ content: {
3258
+ "application/json": {
3259
+ ok: boolean;
3260
+ /** @description Unix timestamp when the switch to firm custody takes effect. */
3261
+ switch_at: number;
3262
+ };
3263
+ };
3264
+ };
3265
+ /** @description Error response. */
3266
+ 400: {
3267
+ headers: {
3268
+ [name: string]: unknown;
3269
+ };
3270
+ content: {
3271
+ "application/json": components["schemas"]["Error"];
3272
+ };
3273
+ };
3274
+ /** @description Error response. */
3275
+ 401: {
3276
+ headers: {
3277
+ [name: string]: unknown;
3278
+ };
3279
+ content: {
3280
+ "application/json": components["schemas"]["Error"];
3281
+ };
3282
+ };
3283
+ /** @description Error response. */
3284
+ 403: {
3285
+ headers: {
3286
+ [name: string]: unknown;
3287
+ };
3288
+ content: {
3289
+ "application/json": components["schemas"]["Error"];
3290
+ };
3291
+ };
3292
+ /** @description Error response. The workspace is already firm, a switch is already scheduled, or the request asked for anything other than firm. */
3293
+ 409: {
3294
+ headers: {
3295
+ [name: string]: unknown;
3296
+ };
3297
+ content: {
3298
+ "application/json": components["schemas"]["Error"];
3299
+ };
3300
+ };
3301
+ 429: components["responses"]["RateLimited"];
3302
+ 500: components["responses"]["InternalError"];
3303
+ };
3304
+ };
3305
+ patch_org_member: {
3306
+ parameters: {
3307
+ query?: never;
3308
+ header?: never;
3309
+ path: {
3310
+ /** @description The member's user id. */
3311
+ user_id: string;
3312
+ };
3313
+ cookie?: never;
3314
+ };
3315
+ requestBody: {
3316
+ content: {
3317
+ "application/json": {
3318
+ /** @description Grant or revoke the admin right. Omit to leave unchanged. */
3319
+ is_admin?: boolean;
3320
+ /** @description Grant or revoke the billing right. Omit to leave unchanged. */
3321
+ is_billing?: boolean;
3322
+ /** @description Grant or revoke the reviewer right. Omit to leave unchanged. */
3323
+ is_reviewer?: boolean;
3324
+ /** @description The member's monthly spend cap in seconds against the pool, or null to clear it. Omit to leave unchanged. */
3325
+ monthly_cap_seconds?: number | null;
3326
+ };
3327
+ };
3328
+ };
3329
+ responses: {
3330
+ /** @description Success. */
3331
+ 200: {
3332
+ headers: {
3333
+ [name: string]: unknown;
3334
+ };
3335
+ content: {
3336
+ "application/json": {
3337
+ ok: boolean;
3338
+ };
3339
+ };
3340
+ };
3341
+ /** @description Error response. */
3342
+ 400: {
3343
+ headers: {
3344
+ [name: string]: unknown;
3345
+ };
3346
+ content: {
3347
+ "application/json": components["schemas"]["Error"];
3348
+ };
3349
+ };
3350
+ /** @description Error response. */
3351
+ 401: {
3352
+ headers: {
3353
+ [name: string]: unknown;
3354
+ };
3355
+ content: {
3356
+ "application/json": components["schemas"]["Error"];
3357
+ };
3358
+ };
3359
+ /** @description Error response. */
3360
+ 403: {
3361
+ headers: {
3362
+ [name: string]: unknown;
3363
+ };
3364
+ content: {
3365
+ "application/json": components["schemas"]["Error"];
3366
+ };
3367
+ };
3368
+ /** @description Error response. The target user is not a member of this workspace. */
3369
+ 404: {
3370
+ headers: {
3371
+ [name: string]: unknown;
3372
+ };
3373
+ content: {
3374
+ "application/json": components["schemas"]["Error"];
3375
+ };
3376
+ };
3377
+ /** @description Error response. The change would leave the workspace with no remaining admin. */
3378
+ 409: {
3379
+ headers: {
3380
+ [name: string]: unknown;
3381
+ };
3382
+ content: {
3383
+ "application/json": components["schemas"]["Error"];
3384
+ };
3385
+ };
3386
+ /** @description Error response. No field was present, or monthly_cap_seconds fell outside the allowed range. */
3387
+ 422: {
3388
+ headers: {
3389
+ [name: string]: unknown;
3390
+ };
3391
+ content: {
3392
+ "application/json": components["schemas"]["Error"];
3393
+ };
3394
+ };
3395
+ 429: components["responses"]["RateLimited"];
3396
+ 500: components["responses"]["InternalError"];
3397
+ };
3398
+ };
3399
+ place_transcript_hold: {
3400
+ parameters: {
3401
+ query?: never;
3402
+ header?: never;
3403
+ path: {
3404
+ /** @description The transcript id. */
3405
+ id: string;
3406
+ };
3407
+ cookie?: never;
3408
+ };
3409
+ requestBody?: never;
3410
+ responses: {
3411
+ /** @description Success. */
3412
+ 200: {
3413
+ headers: {
3414
+ [name: string]: unknown;
3415
+ };
3416
+ content: {
3417
+ "application/json": {
3418
+ ok: boolean;
3419
+ };
3420
+ };
3421
+ };
3422
+ /** @description Error response. */
3423
+ 400: {
3424
+ headers: {
3425
+ [name: string]: unknown;
3426
+ };
3427
+ content: {
3428
+ "application/json": components["schemas"]["Error"];
3429
+ };
3430
+ };
3431
+ /** @description Error response. */
3432
+ 401: {
3433
+ headers: {
3434
+ [name: string]: unknown;
3435
+ };
3436
+ content: {
3437
+ "application/json": components["schemas"]["Error"];
3438
+ };
3439
+ };
3440
+ /** @description Error response. */
3441
+ 403: {
3442
+ headers: {
3443
+ [name: string]: unknown;
3444
+ };
3445
+ content: {
3446
+ "application/json": components["schemas"]["Error"];
3447
+ };
3448
+ };
3449
+ /** @description Error response. No such transcript in this workspace. */
3450
+ 404: {
3451
+ headers: {
3452
+ [name: string]: unknown;
3453
+ };
3454
+ content: {
3455
+ "application/json": components["schemas"]["Error"];
3456
+ };
3457
+ };
3458
+ 429: components["responses"]["RateLimited"];
3459
+ 500: components["responses"]["InternalError"];
3460
+ };
3461
+ };
3462
+ lift_transcript_hold: {
3463
+ parameters: {
3464
+ query?: never;
3465
+ header?: never;
3466
+ path: {
3467
+ /** @description The transcript id. */
3468
+ id: string;
3469
+ };
3470
+ cookie?: never;
3471
+ };
3472
+ requestBody?: never;
3473
+ responses: {
3474
+ /** @description Success. */
3475
+ 200: {
3476
+ headers: {
3477
+ [name: string]: unknown;
3478
+ };
3479
+ content: {
3480
+ "application/json": {
3481
+ ok: boolean;
3482
+ };
3483
+ };
3484
+ };
3485
+ /** @description Error response. */
3486
+ 400: {
3487
+ headers: {
3488
+ [name: string]: unknown;
3489
+ };
3490
+ content: {
3491
+ "application/json": components["schemas"]["Error"];
3492
+ };
3493
+ };
3494
+ /** @description Error response. */
3495
+ 401: {
3496
+ headers: {
3497
+ [name: string]: unknown;
3498
+ };
3499
+ content: {
3500
+ "application/json": components["schemas"]["Error"];
3501
+ };
3502
+ };
3503
+ /** @description Error response. */
3504
+ 403: {
3505
+ headers: {
3506
+ [name: string]: unknown;
3507
+ };
3508
+ content: {
3509
+ "application/json": components["schemas"]["Error"];
3510
+ };
3511
+ };
3512
+ /** @description Error response. No such transcript in this workspace. */
3513
+ 404: {
3514
+ headers: {
3515
+ [name: string]: unknown;
3516
+ };
3517
+ content: {
3518
+ "application/json": components["schemas"]["Error"];
3519
+ };
3520
+ };
3521
+ 429: components["responses"]["RateLimited"];
3522
+ 500: components["responses"]["InternalError"];
3523
+ };
3524
+ };
3525
+ get_transcription_context: {
3526
+ parameters: {
3527
+ query?: never;
3528
+ header?: never;
3529
+ path?: never;
3530
+ cookie?: never;
3531
+ };
3532
+ requestBody?: never;
3533
+ responses: {
3534
+ /** @description Success. */
3535
+ 200: {
3536
+ headers: {
3537
+ [name: string]: unknown;
3538
+ };
3539
+ content: {
3540
+ "application/json": components["schemas"]["TranscriptionContextResponse"];
3541
+ };
3542
+ };
3543
+ /** @description Error response. */
3544
+ 401: {
3545
+ headers: {
3546
+ [name: string]: unknown;
3547
+ };
3548
+ content: {
3549
+ "application/json": components["schemas"]["Error"];
3550
+ };
3551
+ };
3552
+ /** @description Error response. */
3553
+ 403: {
3554
+ headers: {
3555
+ [name: string]: unknown;
3556
+ };
3557
+ content: {
3558
+ "application/json": components["schemas"]["Error"];
3559
+ };
3560
+ };
3561
+ 429: components["responses"]["RateLimited"];
3562
+ 500: components["responses"]["InternalError"];
3563
+ };
3564
+ };
3565
+ create_agent_account_signup: {
3566
+ parameters: {
3567
+ query?: never;
3568
+ header?: never;
3569
+ path?: never;
3570
+ cookie?: never;
3571
+ };
3572
+ requestBody: {
3573
+ content: {
3574
+ "application/json": components["schemas"]["AgentSignupRequest"];
3575
+ };
3576
+ };
3577
+ responses: {
3578
+ /** @description Success (dry_run only). Same shape as 201, but no Stripe session was created and no agent_signups row was written; signup_id is prefixed dry_ and can never be claimed. */
3579
+ 200: {
3580
+ headers: {
3581
+ [name: string]: unknown;
3582
+ };
3583
+ content: {
3584
+ "application/json": components["schemas"]["AgentSignupResponse"];
3585
+ };
3586
+ };
3587
+ /** @description Success. */
3588
+ 201: {
3589
+ headers: {
3590
+ [name: string]: unknown;
3591
+ };
3592
+ content: {
3593
+ "application/json": components["schemas"]["AgentSignupResponse"];
3594
+ };
3595
+ };
3596
+ /** @description Error response. */
3597
+ 400: {
3598
+ headers: {
3599
+ [name: string]: unknown;
3600
+ };
3601
+ content: {
3602
+ "application/json": components["schemas"]["Error"];
3603
+ };
3604
+ };
3605
+ /** @description Error response. */
3606
+ 403: {
3607
+ headers: {
3608
+ [name: string]: unknown;
3609
+ };
3610
+ content: {
3611
+ "application/json": components["schemas"]["Error"];
3612
+ };
3613
+ };
3614
+ /** @description Error response. */
3615
+ 409: {
3616
+ headers: {
3617
+ [name: string]: unknown;
3618
+ };
3619
+ content: {
3620
+ "application/json": components["schemas"]["Error"];
3621
+ };
3622
+ };
3623
+ /** @description Error response. */
3624
+ 422: {
3625
+ headers: {
3626
+ [name: string]: unknown;
3627
+ };
3628
+ content: {
3629
+ "application/json": components["schemas"]["Error"];
3630
+ };
3631
+ };
3632
+ 429: components["responses"]["RateLimited"];
3633
+ 500: components["responses"]["InternalError"];
3634
+ /** @description Error response. */
3635
+ 502: {
3636
+ headers: {
3637
+ [name: string]: unknown;
3638
+ };
3639
+ content: {
3640
+ "application/json": components["schemas"]["Error"];
3641
+ };
3642
+ };
3643
+ };
3644
+ };
3645
+ claim_agent_account: {
3646
+ parameters: {
3647
+ query?: never;
3648
+ header?: never;
3649
+ path?: never;
3650
+ cookie?: never;
3651
+ };
3652
+ requestBody: {
3653
+ content: {
3654
+ "application/json": components["schemas"]["AgentClaimRequest"];
3655
+ };
3656
+ };
3657
+ responses: {
3658
+ /** @description Success. */
3659
+ 201: {
3660
+ headers: {
3661
+ [name: string]: unknown;
3662
+ };
3663
+ content: {
3664
+ "application/json": components["schemas"]["AgentClaimResponse"];
3665
+ };
3666
+ };
3667
+ /** @description Error response. */
3668
+ 400: {
3669
+ headers: {
3670
+ [name: string]: unknown;
3671
+ };
3672
+ content: {
3673
+ "application/json": components["schemas"]["Error"];
3674
+ };
3675
+ };
3676
+ /** @description Error response. */
3677
+ 401: {
3678
+ headers: {
3679
+ [name: string]: unknown;
3680
+ };
3681
+ content: {
3682
+ "application/json": components["schemas"]["Error"];
3683
+ };
3684
+ };
3685
+ /** @description Error response. */
3686
+ 409: {
3687
+ headers: {
3688
+ [name: string]: unknown;
3689
+ };
3690
+ content: {
3691
+ "application/json": components["schemas"]["Error"];
3692
+ };
3693
+ };
3694
+ 429: components["responses"]["RateLimited"];
3695
+ 500: components["responses"]["InternalError"];
3696
+ };
3697
+ };
3698
+ rotate_agent_credentials: {
3699
+ parameters: {
3700
+ query?: never;
3701
+ header?: never;
3702
+ path?: never;
3703
+ cookie?: never;
3704
+ };
3705
+ requestBody?: never;
3706
+ responses: {
3707
+ /** @description Success. */
3708
+ 201: {
3709
+ headers: {
3710
+ [name: string]: unknown;
3711
+ };
3712
+ content: {
3713
+ "application/json": components["schemas"]["AgentCredentialsRotateResponse"];
3714
+ };
3715
+ };
3716
+ /** @description Error response. */
3717
+ 401: {
3718
+ headers: {
3719
+ [name: string]: unknown;
3720
+ };
3721
+ content: {
3722
+ "application/json": components["schemas"]["Error"];
3723
+ };
3724
+ };
3725
+ /** @description Error response. */
3726
+ 403: {
3727
+ headers: {
3728
+ [name: string]: unknown;
3729
+ };
3730
+ content: {
3731
+ "application/json": components["schemas"]["Error"];
3732
+ };
3733
+ };
3734
+ 429: components["responses"]["RateLimited"];
3735
+ 500: components["responses"]["InternalError"];
3736
+ };
3737
+ };
3738
+ }
3739
+
3740
+ /** A price as the API states it, with a display string in the `en` locale. */
3741
+ interface Money {
3742
+ /** Minor units of `currency`, from the API. */
3743
+ amount: number;
3744
+ /** ISO 4217 code, from the API. */
3745
+ currency: string;
3746
+ /** For example `$5.99`. */
3747
+ formatted: string;
3748
+ }
3749
+
3750
+ /** The caller's current upload admission limits (the API's `limits` object, camelCased). */
3751
+ interface UploadLimits {
3752
+ /** The daily transcription cap, in seconds. */
3753
+ maxDailySeconds: number;
3754
+ /** The most pipeline jobs in flight at once. */
3755
+ maxActiveJobs: number;
3756
+ /** Pipeline jobs in flight now. */
3757
+ activeJobs: number;
3758
+ /** Billable seconds used today. */
3759
+ usedTodaySeconds: number;
3760
+ }
3761
+ /** The account: balance, limits, card and region. A field the API adds later is kept on the object at run time, camelCased. */
3762
+ interface Account {
3763
+ /** Net of holds and clawback debt; may be negative. */
3764
+ balanceSeconds: number;
3765
+ /** Committed to in-flight jobs; already deducted from `balanceSeconds`. */
3766
+ heldSeconds: number;
3767
+ creditsExpireAt: Date | null;
3768
+ cardOnFile: boolean;
3769
+ /** For example `us`, `eu`, `apac` or `oc`. */
3770
+ dataRegion: string;
3771
+ limits: UploadLimits;
3772
+ /** Agent accounts only, else null. */
3773
+ purchasesRemainingInWindow: number | null;
3774
+ }
3775
+ /** The balance, with the same run-time extras as `Account`. */
3776
+ interface Balance {
3777
+ /** Spendable now; may be negative (clawback debt). Holds for in-flight jobs are already deducted. */
3778
+ seconds: number;
3779
+ /** `seconds / 60` rounded toward zero. */
3780
+ minutes: number;
3781
+ /** Committed to in-flight jobs; already deducted from `seconds`. */
3782
+ heldSeconds: number;
3783
+ expiresAt: Date | null;
3784
+ /** Agent accounts only, else null. */
3785
+ purchasesRemaining: number | null;
3786
+ }
3787
+
3788
+ interface AgentSignupRequest {
3789
+ /** For receipts and notices only; it never signs in. */
3790
+ email: string;
3791
+ /** New agent accounts can buy only these two until earlier purchases settle. */
3792
+ pack: "45min" | "300min";
3793
+ /** The policy version being accepted. Never defaulted: a stale one is refused with the current version in the hint. */
3794
+ acceptTerms: string;
3795
+ agent: {
3796
+ name: string;
3797
+ platform: string;
3798
+ contactUrl?: string | undefined;
3799
+ };
3800
+ dataRegion?: string | undefined;
3801
+ /** Validates the request without opening a checkout; the result cannot be claimed. */
3802
+ dryRun?: boolean | undefined;
3803
+ /** Falls back to HUSHSCRIPT_BASE_URL, then the production host. */
3804
+ baseUrl?: string | null | undefined;
3805
+ }
3806
+ /**
3807
+ * The signup answer. A field the API adds later is kept on the object at run time, camelCased.
3808
+ */
3809
+ interface AgentSignup {
3810
+ /** Pass it back to `claim` verbatim. */
3811
+ signupId: string;
3812
+ /** Shown once; `claim` needs it. */
3813
+ claimSecret: string;
3814
+ /** Where the account is paid for: a hosted checkout page that expires at `expiresAt`. */
3815
+ checkoutUrl: string;
3816
+ price: Money;
3817
+ expiresAt: Date;
3818
+ }
3819
+ /**
3820
+ * The claim answer. A field the API adds later is kept on the object at run time, camelCased.
3821
+ */
3822
+ interface AgentClaim {
3823
+ /** The account's token, shown once. */
3824
+ token: string;
3825
+ userId: string;
3826
+ scopes: string[];
3827
+ /** The pack just granted; a new account holds nothing, and the expiry is not part of the answer. */
3828
+ balance: Balance;
3829
+ }
3830
+ /**
3831
+ * The rotation answer. A field the API adds later is kept on the object at run time, camelCased.
3832
+ */
3833
+ interface RotatedToken {
3834
+ /** The successor token, shown once; the client already uses it. */
3835
+ token: string;
3836
+ tokenId: string;
3837
+ scopes: string[];
3838
+ expiresAt: Date | null;
3839
+ }
3840
+ /** `Hushscript.agent`: the two calls that need no token. */
3841
+ interface AgentStatic {
3842
+ signup(request: AgentSignupRequest): Promise<AgentSignup>;
3843
+ claim(signupId: string, claimSecret: string, options?: {
3844
+ baseUrl?: string | null | undefined;
3845
+ }): Promise<AgentClaim>;
3846
+ }
3847
+ /** `hs.agent`: calls an agent account makes with its own token. */
3848
+ declare class AgentResource {
3849
+ #private;
3850
+ constructor(api: Client<paths>, config: ResolvedConfig);
3851
+ /**
3852
+ * Mints a successor token and revokes the one in use. The client starts using the new token at
3853
+ * once; store the returned one. A lost answer raises `OutcomeUnknownError` and is never retried.
3854
+ */
3855
+ rotateToken(): Promise<RotatedToken>;
3856
+ }
3857
+
3858
+ /** A minute pack as the account can see it. A field the API adds later is kept on the object at run time, camelCased. */
3859
+ interface Pack {
3860
+ /** `45min`, `300min`, `900min`, `1800min` or `6000min`. */
3861
+ id: string;
3862
+ seconds: number;
3863
+ /** `seconds / 60` rounded toward zero. */
3864
+ minutes: number;
3865
+ /** The price in the account's own currency, as the API states it. */
3866
+ price: Money;
3867
+ /** Extra minutes an available referral bonus would add to this purchase; 0 when none. */
3868
+ bonusMinutes: number;
3869
+ /** False only for an agent account's tier-locked pack. */
3870
+ available: boolean;
3871
+ }
3872
+ /** A saved payment method. A field the API adds later is kept on the object at run time, camelCased. */
3873
+ interface Card {
3874
+ id: string;
3875
+ type: string;
3876
+ brand: string;
3877
+ last4: string;
3878
+ expMonth: number;
3879
+ expYear: number;
3880
+ email: string | null;
3881
+ isDefault: boolean;
3882
+ /** Whether `buy()` may charge it without the buyer present. */
3883
+ fastCheckoutEligible: boolean;
3884
+ }
3885
+ /** The saved payment methods. A field the API adds later is kept on the object at run time, camelCased. */
3886
+ interface Cards {
3887
+ defaultId: string | null;
3888
+ cards: Card[];
3889
+ }
3890
+ /** One purchase, as the API reports it (keys camelCased, timestamps as dates). A field the API adds later is kept on the object at run time, camelCased. */
3891
+ interface Transaction {
3892
+ id: number;
3893
+ seconds: number;
3894
+ amountCents: number;
3895
+ amountRefundedCents: number;
3896
+ currency: string;
3897
+ status: string;
3898
+ createdAt: Date;
3899
+ paymentMethodType: string | null;
3900
+ paymentMethodBrand: string | null;
3901
+ paymentMethodLast4: string | null;
3902
+ /** The public receipt reference. */
3903
+ receiptNumber: string | null;
3904
+ initiatedVia: string | null;
3905
+ }
3906
+ /** One movement of the credit balance. A field the API adds later is kept on the object at run time, camelCased. */
3907
+ interface LedgerEntry {
3908
+ id: number;
3909
+ deltaSeconds: number;
3910
+ kind: string;
3911
+ jobId: string | null;
3912
+ note: string | null;
3913
+ createdAt: Date;
3914
+ }
3915
+ /** Seconds reserved by work still running; already deducted from the balance. A field the API adds later is kept on the object at run time, camelCased. */
3916
+ interface Hold {
3917
+ id: string;
3918
+ kind: "transcription" | "translation" | "insights" | "qa";
3919
+ seconds: number;
3920
+ createdAt: Date;
3921
+ }
3922
+ /** What a purchase left the account with, from the purchase answer alone. A field the API adds later is kept on the object at run time, camelCased. */
3923
+ interface Purchase {
3924
+ /** The balance after the purchase settled: spendable seconds, holds already deducted. */
3925
+ seconds: number;
3926
+ /** `seconds / 60` rounded toward zero. */
3927
+ minutes: number;
3928
+ }
3929
+ interface BuyOptions {
3930
+ /** Records that the no-refund, instant-delivery notice was shown to the buyer. It never gates the charge. */
3931
+ acknowledgeNoRefund?: boolean | undefined;
3932
+ /** 1 to 128 of `A-Za-z0-9_-`. Left out, a fresh key is minted for the call. */
3933
+ idempotencyKey?: string | undefined;
3934
+ }
3935
+ declare class BillingResource {
3936
+ #private;
3937
+ constructor(api: Client<paths>);
3938
+ /** The minute packs this account can buy, priced in its own currency. Needs the `billing` scope. */
3939
+ packs(): Promise<Pack[]>;
3940
+ cards(): Promise<Cards>;
3941
+ setDefaultCard(cardId: string): Promise<void>;
3942
+ /**
3943
+ * The hosted page where a card is saved; open it in a browser. The request carries a key, so
3944
+ * the single retry after a 502 lands on the same page.
3945
+ */
3946
+ addCardUrl(): Promise<string>;
3947
+ /**
3948
+ * Buys `packId` with the default card and returns the balance the purchase answer reports. It
3949
+ * makes no follow-up request. A lost or unusable response can still raise an error after payment.
3950
+ * Every error raised once the purchase request may have been sent carries `idempotencyKey`; pass it back as
3951
+ * `idempotencyKey` to retry without any chance of a second charge. One raised before any attempt
3952
+ * was sent carries none: nothing can have been charged.
3953
+ */
3954
+ buy(packId: string, options?: BuyOptions): Promise<Purchase>;
3955
+ /** Purchases, newest first. */
3956
+ transactions(options?: {
3957
+ signal?: AbortSignal | undefined;
3958
+ }): AsyncIterable<Transaction>;
3959
+ /** Every hold, settle, release, purchase and refund that moved the balance, newest first. */
3960
+ ledger(options?: {
3961
+ signal?: AbortSignal | undefined;
3962
+ }): AsyncIterable<LedgerEntry>;
3963
+ /** The seconds currently reserved by work in flight, newest first. */
3964
+ holds(options?: {
3965
+ signal?: AbortSignal | undefined;
3966
+ }): AsyncIterable<Hold>;
3967
+ }
3968
+
3969
+ interface TextFormatOptions {
3970
+ /** Prefix each block with its speaker (default true). */
3971
+ speakers?: boolean | undefined;
3972
+ /** Prefix each block with `[M:SS] ` or `[H:MM:SS] ` (default false). */
3973
+ timestamps?: boolean | undefined;
3974
+ /** Merge consecutive utterances of the same speaker label (default true). */
3975
+ merge?: boolean | undefined;
3976
+ }
3977
+
3978
+ type TranscriptBody = components["schemas"]["TranscriptDetail"];
3979
+ interface Utterance {
3980
+ /** The provider's raw label; empty for a transcript without speaker labels. */
3981
+ speaker: string;
3982
+ /** The saved name, else "Speaker {label}", else "" for an empty label. */
3983
+ speakerName: string;
3984
+ startMs: number;
3985
+ endMs: number;
3986
+ text: string;
3987
+ }
3988
+ interface LanguageOptions {
3989
+ /** A translation locale or "cleaned"; the original when absent or unknown. */
3990
+ language?: string | undefined;
3991
+ }
3992
+ interface CaptionOptions extends LanguageOptions {
3993
+ /** Readable cues of at most 2 lines of 42 characters (default true); false gives one cue per utterance. */
3994
+ captions?: boolean | undefined;
3995
+ }
3996
+ interface TextOptions extends LanguageOptions, TextFormatOptions {
3997
+ }
3998
+ /** A finished transcript with its formatters. */
3999
+ declare class Transcript {
4000
+ #private;
4001
+ readonly id: string;
4002
+ readonly title: string;
4003
+ readonly language: string | null;
4004
+ readonly durationSeconds: number;
4005
+ readonly createdAt: Date;
4006
+ readonly updatedAt: Date;
4007
+ readonly autoDeleteAt: Date | null;
4008
+ readonly tags: string[];
4009
+ readonly edited: boolean;
4010
+ /** Label to display name, for the speakers that were renamed. */
4011
+ readonly speakers: Record<string, string>;
4012
+ /** The original language. */
4013
+ readonly utterances: Utterance[];
4014
+ /** Translation locales, without the reserved "cleaned". */
4015
+ readonly languages: string[];
4016
+ /** The AI-cleaned body, when there is one. */
4017
+ readonly cleaned: Utterance[] | null;
4018
+ private constructor();
4019
+ /** Builds a transcript from a `GET /v1/transcripts/{id}` body, which `toJSON()` returns again. */
4020
+ static fromApi(body: TranscriptBody): Transcript;
4021
+ /** The plain text, the same as `toText()`. */
4022
+ get text(): string;
4023
+ /** The translation (or "cleaned" body) for `language`; the original when there is none. */
4024
+ utterancesFor(language?: string): Utterance[];
4025
+ toSRT(options?: CaptionOptions): string;
4026
+ toVTT(options?: CaptionOptions): string;
4027
+ toText(options?: TextOptions): string;
4028
+ /** The API body this transcript was built from, unknown fields included. */
4029
+ toJSON(): TranscriptBody;
4030
+ }
4031
+
4032
+ interface ErrorInit {
4033
+ /** Slug: the API's own for API errors, the SDK's for SDK-side ones. */
4034
+ code: string;
4035
+ message: string;
4036
+ numericCode?: number | null;
4037
+ status?: number | null;
4038
+ /** Explicit hint text, or null for none. Left out, it comes from the shared hints table. */
4039
+ hint?: string | null;
4040
+ details?: Record<string, unknown>;
4041
+ retryAfter?: number | null;
4042
+ cause?: unknown;
4043
+ /** Values for `{placeholders}` in the shared hint text. */
4044
+ hintValues?: Record<string, unknown>;
4045
+ }
4046
+ type WithDefaultCode = Omit<ErrorInit, "code"> & {
4047
+ code?: string;
4048
+ };
4049
+ declare class HushscriptError extends Error {
4050
+ code: string;
4051
+ numericCode: number | null;
4052
+ status: number | null;
4053
+ hint: string | null;
4054
+ details: Record<string, unknown>;
4055
+ retryAfter: number | null;
4056
+ /** Set on an error `transcribe()` raised after its create was sent, or `buy()` after its purchase may have been sent (a failure provably before any attempt went out carries none): passing it back replays the same job or purchase instead of making a second one. */
4057
+ idempotencyKey: string | null;
4058
+ /** Set once the job id is known; `resume()` takes it. */
4059
+ resumeToken: string | null;
4060
+ constructor(init: ErrorInit);
4061
+ }
4062
+ declare class ConfigurationError extends HushscriptError {
4063
+ constructor(init: WithDefaultCode);
4064
+ static missingToken(): ConfigurationError;
4065
+ }
4066
+ /** Raised before any request that holds credit; no hold was placed. */
4067
+ declare class PreflightError extends HushscriptError {
4068
+ }
4069
+ declare class UnsupportedMediaError extends PreflightError {
4070
+ }
4071
+ declare class FileLimitError extends PreflightError {
4072
+ }
4073
+ declare class DailyLimitError extends PreflightError {
4074
+ }
4075
+ declare class ResumeMismatchError extends PreflightError {
4076
+ }
4077
+ /** Any non-2xx response not listed below; `status` is set. */
4078
+ declare class ApiError extends HushscriptError {
4079
+ }
4080
+ declare class AuthenticationError extends ApiError {
4081
+ }
4082
+ declare class PermissionDeniedError extends ApiError {
4083
+ }
4084
+ declare class InsufficientBalanceError extends ApiError {
4085
+ }
4086
+ declare class NotFoundError extends ApiError {
4087
+ }
4088
+ declare class ConflictError extends ApiError {
4089
+ }
4090
+ declare class ValidationError extends ApiError {
4091
+ }
4092
+ declare class RateLimitError extends ApiError {
4093
+ }
4094
+ declare class PaymentMethodRequiredError extends HushscriptError {
4095
+ constructor(init: WithDefaultCode);
4096
+ }
4097
+ declare class UploadError extends HushscriptError {
4098
+ }
4099
+ declare class JobFailedError extends HushscriptError {
4100
+ error: string | null;
4101
+ failureKind: "media_unreadable" | "media_undecodable" | null;
4102
+ jobId: string;
4103
+ constructor(init: WithDefaultCode & {
4104
+ error: string | null;
4105
+ failureKind: "media_unreadable" | "media_undecodable" | null;
4106
+ jobId: string;
4107
+ });
4108
+ }
4109
+ declare class WaitTimeoutError extends HushscriptError {
4110
+ /** `resumeToken` is null only for `jobs.wait`, which has no idempotency key to build a token from. */
4111
+ constructor(init: WithDefaultCode & {
4112
+ resumeToken: string | null;
4113
+ });
4114
+ }
4115
+ declare class AbortError extends HushscriptError {
4116
+ constructor(init: WithDefaultCode & {
4117
+ resumeToken?: string | null;
4118
+ });
4119
+ }
4120
+ /** Raised after retries ran out on network errors or timeouts. */
4121
+ declare class NetworkError extends HushscriptError {
4122
+ constructor(init: WithDefaultCode);
4123
+ }
4124
+ /** The request was sent and no response arrived, for a call the server cannot repeat. */
4125
+ declare class OutcomeUnknownError extends HushscriptError {
4126
+ #private;
4127
+ constructor(init: WithDefaultCode & {
4128
+ receivedToken?: string;
4129
+ });
4130
+ /**
4131
+ * The string a rotate answer carried as the new token when it was not a usable one, so a caller
4132
+ * can still look at (or rescue) it. A getter over a private field: it is left out of `inspect`,
4133
+ * `JSON.stringify` and every message. Null for every other outcome.
4134
+ */
4135
+ get receivedToken(): string | null;
4136
+ static hintFor(operation: string): string | null;
4137
+ }
4138
+
4139
+ /** Opaque base64url JSON `{v:1, jobId, idempotencyKey, size, durationSeconds}`. */
4140
+ type ResumeToken = string;
4141
+
4142
+ type FileInput = string | Blob | Uint8Array | ReadableStream<Uint8Array>;
4143
+
4144
+ type Progress = {
4145
+ stage: "uploading";
4146
+ percent: number;
4147
+ bytesSent: number;
4148
+ bytesTotal: number;
4149
+ } | {
4150
+ stage: "processing";
4151
+ state: "queued" | "processing";
4152
+ };
4153
+ interface TranscribeOptions {
4154
+ /** At most 300 bytes; the server truncates. */
4155
+ title?: string | undefined;
4156
+ /** Forces language_code; default auto-detect. */
4157
+ language?: string | undefined;
4158
+ /** speaker_detection; default true. */
4159
+ speakers?: boolean | undefined;
4160
+ /** translation_targets; +25% each, forces speakers. */
4161
+ translateTo?: string[] | undefined;
4162
+ /**
4163
+ * keyterms_prompt. Terms are trimmed and blanks dropped; an empty list is not sent. At most 1000
4164
+ * unique terms, each at most 6 words and 128 characters (Unicode code points). With a prompt,
4165
+ * the two are compiled into one provider prompt and count together toward the prompt limit.
4166
+ */
4167
+ keyterms?: string[] | undefined;
4168
+ /**
4169
+ * Free-text context, trimmed; a blank prompt is not sent. At most 2000 characters (Unicode code
4170
+ * points). With key terms the limit applies to the compiled prompt:
4171
+ * 203 + prompt + the sum of (term + 2) for each unique term + (terms - 1).
4172
+ */
4173
+ prompt?: string | undefined;
4174
+ /** medical_mode; language must be en, es, fr or de; 2x. */
4175
+ medical?: boolean | undefined;
4176
+ /** Billed per channel, up to 8. */
4177
+ multichannel?: boolean | undefined;
4178
+ /** auto_generate_insights override. */
4179
+ autoInsights?: boolean | undefined;
4180
+ /** At most 64 characters (org accounts). */
4181
+ matterCode?: string | undefined;
4182
+ /** Overrides the probe. */
4183
+ durationSeconds?: number | undefined;
4184
+ /** Bytes; required with a stream input. */
4185
+ size?: number | undefined;
4186
+ /** Default: minted once per call. */
4187
+ idempotencyKey?: string | undefined;
4188
+ /** Parallel part uploads; default 4, at most 8. */
4189
+ concurrency?: number | undefined;
4190
+ /** Seconds to wait for processing; default 3600. */
4191
+ waitTimeout?: number | undefined;
4192
+ onProgress?: ((progress: Progress) => void) | undefined;
4193
+ /** Called once the job exists. */
4194
+ onResumeToken?: ((token: ResumeToken) => void) | undefined;
4195
+ signal?: AbortSignal | undefined;
4196
+ }
4197
+ interface ResumeOptions {
4198
+ onProgress?: ((progress: Progress) => void) | undefined;
4199
+ signal?: AbortSignal | undefined;
4200
+ waitTimeout?: number | undefined;
4201
+ concurrency?: number | undefined;
4202
+ }
4203
+
4204
+ /** A job as the API sends it; `hs.jobs` hands out the camelCase `Job`. */
4205
+ type RawJob = components["schemas"]["Job"];
4206
+
4207
+ interface JobWaitOptions {
4208
+ waitTimeout?: number | undefined;
4209
+ onProgress?: ((progress: Progress) => void) | undefined;
4210
+ signal?: AbortSignal | undefined;
4211
+ }
4212
+
4213
+ type JobState = "uploading" | "fetching" | "queued" | "processing" | "done" | "failed";
4214
+ /** What the job was submitted with, from the API's content-free options summary (camelCased). */
4215
+ interface JobOptions {
4216
+ /** The forced language, or null for auto-detection. */
4217
+ languageCode: string | null;
4218
+ speakerDetection: boolean;
4219
+ medicalMode: boolean;
4220
+ multichannel: boolean;
4221
+ translationTargets: string[];
4222
+ /** Whether keyterms were set; the terms themselves are not returned. */
4223
+ keyterms: boolean;
4224
+ /** Whether a context prompt was set; the prompt itself is not returned. */
4225
+ prompt: boolean;
4226
+ /** The upload's insights override, or null when it used the account default. */
4227
+ autoGenerateInsights: boolean | null;
4228
+ }
4229
+ /**
4230
+ * A job: camelCase fields and options. Private-result and from-url fetch fields are left out; `hs.api`
4231
+ * still returns them. A field the API adds later is kept on the object at run time, camelCased.
4232
+ */
4233
+ interface Job {
4234
+ id: string;
4235
+ /** A state the SDK does not know yet passes through as the API's own string. */
4236
+ state: JobState | (string & Record<never, never>);
4237
+ transcriptId: string | null;
4238
+ /** A short failure reason when the job failed; opaque. */
4239
+ error: string | null;
4240
+ failureKind: "media_unreadable" | "media_undecodable" | null;
4241
+ mode: string;
4242
+ declaredSeconds: number | null;
4243
+ verifiedSeconds: number | null;
4244
+ actualSeconds: number | null;
4245
+ billableSeconds: number | null;
4246
+ retryOf: string | null;
4247
+ createdAt: Date;
4248
+ options: JobOptions;
4249
+ }
4250
+ declare class JobsResource {
4251
+ #private;
4252
+ constructor(api: Client<paths>, wait: (id: string, options?: JobWaitOptions) => Promise<RawJob>);
4253
+ /** Every job, newest first; `active` keeps only the ones that have not finished. `signal` stops the walk between and during pages. */
4254
+ list(options?: {
4255
+ active?: boolean | undefined;
4256
+ signal?: AbortSignal | undefined;
4257
+ }): AsyncIterable<Job>;
4258
+ get(id: string): Promise<Job>;
4259
+ /** Polls until the job is done or failed; times out with a `WaitTimeoutError` that has no resume token. */
4260
+ wait(id: string, options?: JobWaitOptions): Promise<Job>;
4261
+ }
4262
+
4263
+ interface Page<T> {
4264
+ items: T[];
4265
+ /** Opaque; null on the last page. */
4266
+ nextCursor: string | null;
4267
+ }
4268
+ /**
4269
+ * Walks a cursor-paged list one page at a time, yielding every item in order. `signal` is checked
4270
+ * before every page and every item, so an abort between pages or mid-page stops the walk with the
4271
+ * SDK's `AbortError`; the page request itself is the caller's to cancel with the same signal. A page
4272
+ * that hands back the cursor it was asked with would repeat forever, so it raises `pagination_loop`.
4273
+ */
4274
+ declare function paginate<T>(fetchPage: (cursor: string | null) => Promise<Page<T>>, signal?: AbortSignal): AsyncIterable<T>;
4275
+
4276
+ /** A field the API adds later is kept on the object at run time, camelCased. */
4277
+ interface TranscriptSummary {
4278
+ id: string;
4279
+ title: string;
4280
+ language: string | null;
4281
+ durationSeconds: number;
4282
+ createdAt: Date;
4283
+ autoDeleteAt: Date | null;
4284
+ tags: string[];
4285
+ }
4286
+ /** The record kept after a transcript was removed; its content is gone. A field the API adds later is kept on the object at run time, camelCased. */
4287
+ interface DeletedTranscript {
4288
+ id: string;
4289
+ title: string;
4290
+ durationSeconds: number;
4291
+ /** When the transcript was uploaded. */
4292
+ createdAt: Date;
4293
+ deletedAt: Date;
4294
+ /** A cause the SDK does not know yet passes through as the API's own string. */
4295
+ cause: "manual" | "scheduled" | "dormant" | "expired" | (string & Record<never, never>);
4296
+ /** The stored deletion receipt, opaque and as the API sends it (snake_case keys, string timestamps); null when it could not be read back. */
4297
+ receipt: Record<string, unknown> | null;
4298
+ }
4299
+ interface PageOptions {
4300
+ /** Rows per page; the API defaults to 50 and clamps at 100. */
4301
+ pageSize?: number | undefined;
4302
+ /** Stops the request in flight and, for `list()`, the walk between pages. */
4303
+ signal?: AbortSignal | undefined;
4304
+ }
4305
+ interface PageRequest extends PageOptions {
4306
+ /** From a previous page's `nextCursor`; absent for the first page. */
4307
+ cursor?: string | undefined;
4308
+ }
4309
+ declare class TranscriptsResource {
4310
+ #private;
4311
+ constructor(api: Client<paths>);
4312
+ /**
4313
+ * Every finished transcript, newest first, fetching pages as it goes. Jobs still running are in `jobs.list({ active: true })`.
4314
+ * A page whose `next_cursor` repeats the cursor sent is yielded whole, then the walk raises `pagination_loop`.
4315
+ */
4316
+ list(options?: PageOptions): AsyncIterable<TranscriptSummary>;
4317
+ /** One page of `list()`. Raises `pagination_loop` when the answer's `next_cursor` is the cursor sent. */
4318
+ page(options?: PageRequest): Promise<Page<TranscriptSummary>>;
4319
+ get(id: string): Promise<Transcript>;
4320
+ /** Deletion records, by upload time, newest first. */
4321
+ deleted(options?: {
4322
+ signal?: AbortSignal | undefined;
4323
+ }): AsyncIterable<DeletedTranscript>;
4324
+ }
4325
+
4326
+ declare class Hushscript {
4327
+ #private;
4328
+ /** Every `/v1` operation, typed from the OpenAPI document, with the SDK's retries, timeouts and redaction. */
4329
+ readonly api: Client<paths>;
4330
+ /** Jobs, including those still processing; `wait` polls until one is done or failed. */
4331
+ readonly jobs: JobsResource;
4332
+ /** Finished transcripts: list, read and the deletion records. */
4333
+ readonly transcripts: TranscriptsResource;
4334
+ /** Packs, saved cards and purchase history. Buying also needs the token's own purchase switch and the account-wide one, both in the app under Account → MCP. */
4335
+ readonly billing: BillingResource;
4336
+ /** Calls an agent account makes with its own token. */
4337
+ readonly agent: AgentResource;
4338
+ /** Signup and claim for agent accounts: no token needed, so they are static. */
4339
+ static readonly agent: AgentStatic;
4340
+ constructor(options?: HushscriptOptions);
4341
+ /** Uploads `file`, waits for the transcript and returns it. */
4342
+ transcribe(file: FileInput, options?: TranscribeOptions): Promise<Transcript>;
4343
+ /** Finishes a transcription from the token an `AbortError`, `WaitTimeoutError` or `onResumeToken` gave. */
4344
+ resume(token: ResumeToken, file?: FileInput, options?: ResumeOptions): Promise<Transcript>;
4345
+ /** Buys a pack with the saved default card and returns what the purchase left you with (alias of `hs.billing.buy`). */
4346
+ buy(packId: string, options?: BuyOptions): Promise<Purchase>;
4347
+ /** What can be spent now. Held minutes are already deducted from it, so do not subtract them again. */
4348
+ balance(): Promise<Balance>;
4349
+ /** The account in camelCase: balance, holds, expiry, limits, `cardOnFile` and `dataRegion`. */
4350
+ account(): Promise<Account>;
4351
+ toJSON(): Record<string, unknown>;
4352
+ toString(): string;
4353
+ }
4354
+
4355
+ interface ErrorCatalogEntry {
4356
+ code: number;
4357
+ status: number;
4358
+ meaning: string;
4359
+ }
4360
+ declare const ERROR_CATALOG: Record<string, ErrorCatalogEntry>;
4361
+
4362
+ declare const HINTS: Record<string, string>;
4363
+
4364
+ declare const OPERATION_SCOPES: Record<string, string>;
4365
+
4366
+ export { AbortError, type Account, type AgentClaim, type AgentSignup, type AgentSignupRequest, type AgentStatic, ApiError, AuthenticationError, type Balance, type BuyOptions, type CaptionOptions, type Card, type Cards, type Clock, ConfigurationError, ConflictError, DailyLimitError, type DeletedTranscript, ERROR_CATALOG, type ErrorCatalogEntry, type FileInput, FileLimitError, HINTS, type Hold, Hushscript, HushscriptError, type HushscriptOptions, InsufficientBalanceError, type Job, JobFailedError, type JobOptions, type JobState, type JobWaitOptions, type LanguageOptions, type LedgerEntry, type Money, NetworkError, NotFoundError, OPERATION_SCOPES, OutcomeUnknownError, type Pack, type Page, type PageOptions, type PageRequest, PaymentMethodRequiredError, PermissionDeniedError, PreflightError, type Progress, type Purchase, RateLimitError, ResumeMismatchError, type ResumeOptions, type ResumeToken, type RotatedToken, type TextOptions, type Transaction, type TranscribeOptions, Transcript, type TranscriptSummary, UnsupportedMediaError, UploadError, type UploadLimits, type Utterance, ValidationError, WaitTimeoutError, type components, type operations, paginate, type paths };