@leaflow/sdk 0.0.0-dev.11.g7f2d603 → 0.0.0-dev.111.g0e20563

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,2648 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ export interface paths {
6
+ "/account/v1/billing-accounts": {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ /**
14
+ * List my billing accounts
15
+ * @description Every billing account belonging to the caller, with the projects each one currently pays for.
16
+ *
17
+ * Not paginated: how many accounts one person holds is bounded by how many they bothered to
18
+ * create, and that is a small number.
19
+ */
20
+ get: operations["list-billing-accounts"];
21
+ put?: never;
22
+ /**
23
+ * Create a billing account
24
+ * @description Creates a billing account for the caller.
25
+ *
26
+ * **`seq` is supplied by the client, not assigned here.** Assigning it would mean reading the
27
+ * existing accounts and adding one, which is a read-modify-write race: two concurrent "create"
28
+ * clicks compute the same `seq`. Having the client name it turns that race into a plain
29
+ * idempotent repeat — the second request returns the first account instead of failing.
30
+ *
31
+ * The new account pays for nothing. Binding a project is a separate, deliberate act; doing it
32
+ * here would quietly turn "I want to add a card" into "I have changed who pays".
33
+ */
34
+ post: operations["create-billing-account"];
35
+ delete?: never;
36
+ options?: never;
37
+ head?: never;
38
+ patch?: never;
39
+ trace?: never;
40
+ };
41
+ "/account/v1/billing-accounts/{accountKey}": {
42
+ parameters: {
43
+ query?: never;
44
+ header?: never;
45
+ path?: never;
46
+ cookie?: never;
47
+ };
48
+ /**
49
+ * Read one of my billing accounts
50
+ * @description One account, with the projects it currently pays for.
51
+ *
52
+ * The list returns the same objects, so this exists for the case the list cannot serve: a link
53
+ * straight to one account. Making the caller fetch every account and filter turns a bookmarked
54
+ * page into a request whose cost grows with how many accounts they hold.
55
+ */
56
+ get: operations["get-billing-account"];
57
+ /**
58
+ * Rename a billing account
59
+ * @description Changes the display name. Nothing else about the account can be changed here.
60
+ *
61
+ * The key is not among the fields and never will be: ownership is stated by the key, and
62
+ * invoices already issued refer to it. The name is what tells two accounts apart in a list, so
63
+ * a mistake made while creating one is otherwise permanent.
64
+ */
65
+ put: operations["update-billing-account"];
66
+ post?: never;
67
+ delete?: never;
68
+ options?: never;
69
+ head?: never;
70
+ patch?: never;
71
+ trace?: never;
72
+ };
73
+ "/account/v1/billing-accounts/{accountKey}/credit-transactions": {
74
+ parameters: {
75
+ query?: never;
76
+ header?: never;
77
+ path?: never;
78
+ cookie?: never;
79
+ };
80
+ /**
81
+ * How the balance got to where it is
82
+ * @description Every movement of credit on this account: what was added, what was spent, what expired, what
83
+ * was voided. Newest first.
84
+ *
85
+ * The balance on its own is a number with no account of itself. Asked why it is lower than
86
+ * expected, it cannot answer, and the holder is left to guess between "I was charged" and
87
+ * "something expired" — which lead to different next steps.
88
+ */
89
+ get: operations["list-credit-transactions"];
90
+ put?: never;
91
+ post?: never;
92
+ delete?: never;
93
+ options?: never;
94
+ head?: never;
95
+ patch?: never;
96
+ trace?: never;
97
+ };
98
+ "/account/v1/billing-accounts/{accountKey}/balance": {
99
+ parameters: {
100
+ query?: never;
101
+ header?: never;
102
+ path?: never;
103
+ cookie?: never;
104
+ };
105
+ /**
106
+ * Read an account's balance
107
+ * @description What is left on the account.
108
+ *
109
+ * The figure is the **live** balance: usage that has been reported but not yet settled is
110
+ * already subtracted. The settled figure is larger, and the difference is precisely what the
111
+ * holder has just spent — showing that instead would tell them they can afford something they
112
+ * cannot.
113
+ *
114
+ * An account that has never been topped up reports `"0"` — not an absent field, and not an
115
+ * empty string.
116
+ */
117
+ get: operations["read-billing-account-balance"];
118
+ put?: never;
119
+ post?: never;
120
+ delete?: never;
121
+ options?: never;
122
+ head?: never;
123
+ patch?: never;
124
+ trace?: never;
125
+ };
126
+ "/account/v1/billing-accounts/{accountKey}/projects/{projectId}": {
127
+ parameters: {
128
+ query?: never;
129
+ header?: never;
130
+ path?: never;
131
+ cookie?: never;
132
+ };
133
+ get?: never;
134
+ /**
135
+ * Make this account pay for a project
136
+ * @description Binds a project to this account. A project bound to another account is moved.
137
+ *
138
+ * **Both the account and the project must belong to the caller.** Either one failing refuses the
139
+ * request. Requiring the project as well as the account is what stops somebody attaching a
140
+ * project that is not theirs — which sounds generous, since they would be paying for it, but it
141
+ * would also expose that project's usage to them, and let them detach it again at any moment,
142
+ * leaving the project with no account and therefore unable to allocate anything.
143
+ *
144
+ * Idempotent: binding a project already bound to this account changes nothing.
145
+ *
146
+ * Only subsequent usage is affected; see the hard constraint on rebinding.
147
+ */
148
+ put: operations["bind-project-to-billing-account"];
149
+ post?: never;
150
+ /**
151
+ * Stop paying for a project
152
+ * @description Unbinds the project from this account. Nothing pays for it afterwards, and **everything in it
153
+ * is refused admission** until some account takes it on — no new machines, no forwarded
154
+ * requests.
155
+ *
156
+ * That consequence is the reason this exists rather than an argument against it: a project
157
+ * bound to the wrong account has no other way out, and moving it to another of the caller's
158
+ * accounts is not a correction when the answer is that this account should not be paying for
159
+ * it at all.
160
+ *
161
+ * Charges already accrued stay where they are. They were incurred while this account held the
162
+ * project, and an invoice has to keep pointing at what it was based on.
163
+ */
164
+ delete: operations["unbind-project-from-billing-account"];
165
+ options?: never;
166
+ head?: never;
167
+ patch?: never;
168
+ trace?: never;
169
+ };
170
+ "/account/v1/billing-accounts/{accountKey}/orders": {
171
+ parameters: {
172
+ query?: never;
173
+ header?: never;
174
+ path?: never;
175
+ cookie?: never;
176
+ };
177
+ /**
178
+ * My orders
179
+ * @description Every provisioning request made against the projects this account pays for, newest first.
180
+ *
181
+ * An order that never went through stays here on purpose. Removing it would leave nothing to
182
+ * look at in exactly the case someone wants to look: a resource was asked for, was not
183
+ * delivered, and the question is what happened.
184
+ *
185
+ * The list carries no lines. An order has only a handful, but shipping them on every page
186
+ * means carrying data no column shows.
187
+ */
188
+ get: operations["list-orders"];
189
+ put?: never;
190
+ post?: never;
191
+ delete?: never;
192
+ options?: never;
193
+ head?: never;
194
+ patch?: never;
195
+ trace?: never;
196
+ };
197
+ "/account/v1/billing-accounts/{accountKey}/orders/{orderId}": {
198
+ parameters: {
199
+ query?: never;
200
+ header?: never;
201
+ path?: never;
202
+ cookie?: never;
203
+ };
204
+ /**
205
+ * One order, with its lines
206
+ * @description Each line names what was asked for and how much of it. This is the only route that carries
207
+ * them.
208
+ */
209
+ get: operations["get-order"];
210
+ put?: never;
211
+ post?: never;
212
+ delete?: never;
213
+ options?: never;
214
+ head?: never;
215
+ patch?: never;
216
+ trace?: never;
217
+ };
218
+ "/account/v1/billing-accounts/{accountKey}/top-ups": {
219
+ parameters: {
220
+ query?: never;
221
+ header?: never;
222
+ path?: never;
223
+ cookie?: never;
224
+ };
225
+ /**
226
+ * My top-ups
227
+ * @description Every top-up this account has made, newest first.
228
+ *
229
+ * Reading one top-up requires already holding its identifier, and the only place that
230
+ * identifier appears is the redirect that started it — so without this list a top-up becomes
231
+ * unfindable the moment the browser tab is closed, which is exactly when somebody wants to
232
+ * check whether their money arrived.
233
+ */
234
+ get: operations["list-top-ups"];
235
+ put?: never;
236
+ /**
237
+ * Start a top-up
238
+ * @description Begins adding money to this account. Returns a URL to send the browser to; the card is
239
+ * entered there, on the payment provider's own page.
240
+ *
241
+ * **No card data ever reaches this platform**, in any field, in any log. That is the entire
242
+ * reason this returns a redirect instead of accepting card details.
243
+ *
244
+ * **Credit is not added here.** It is added once the payment provider confirms the money
245
+ * arrived, which happens out of band and usually within seconds. The balance is unchanged when
246
+ * this call returns, and polling it immediately will show the old figure.
247
+ *
248
+ * That ordering is deliberate. Credit is spendable as soon as it exists, so anything added
249
+ * before the charge succeeds is money the holder can spend against a payment that then fails.
250
+ *
251
+ * Abandoning the page costs nothing; nothing is created on the account until the money arrives.
252
+ */
253
+ post: operations["start-top-up"];
254
+ delete?: never;
255
+ options?: never;
256
+ head?: never;
257
+ patch?: never;
258
+ trace?: never;
259
+ };
260
+ "/account/v1/billing-accounts/{accountKey}/charges": {
261
+ parameters: {
262
+ query?: never;
263
+ header?: never;
264
+ path?: never;
265
+ cookie?: never;
266
+ };
267
+ /**
268
+ * What this period has run up so far
269
+ * @description The itemised version of `unsettled`: what has been used this period and not yet billed.
270
+ *
271
+ * It has to come from charges rather than from invoices. An invoice only exists once a period has
272
+ * been billed, and the one for the period in progress is in a state that does not appear in the
273
+ * invoice list at all — reading invoices would show nothing and suggest the account has used
274
+ * nothing, while the spend keeps climbing.
275
+ */
276
+ get: operations["list-charges"];
277
+ put?: never;
278
+ post?: never;
279
+ delete?: never;
280
+ options?: never;
281
+ head?: never;
282
+ patch?: never;
283
+ trace?: never;
284
+ };
285
+ "/account/v1/billing-accounts/{accountKey}/charges/{chargeId}/usage": {
286
+ parameters: {
287
+ query?: never;
288
+ header?: never;
289
+ path?: never;
290
+ cookie?: never;
291
+ };
292
+ /**
293
+ * What produced this charge
294
+ * @description Splits one charge back into the projects that produced it, and lists the resources it could
295
+ * have come from.
296
+ *
297
+ * ## Why this is not a field on the charge
298
+ *
299
+ * A charge has no project, and that is not an omission: the billing subject is the **account**,
300
+ * and the project is a dimension on each usage event. When three of an account's projects use
301
+ * the same product, their usage aggregates into one charge — that charge genuinely spans three
302
+ * projects, and stamping any single project id on it would be wrong.
303
+ *
304
+ * A split is also more useful than a label would be: it gives proportions, and proportions are
305
+ * what decide which project's resources to switch off.
306
+ *
307
+ * ## The quantity here is what was reported, not what was billed
308
+ *
309
+ * Conversion (machine-seconds to machine-hours) happens on the pricing side, and the engine
310
+ * does not echo `unit_config` back on a charge. So this figure times the unit price does not
311
+ * equal the total — a step is missing in between, and that step only becomes visible on the
312
+ * invoice, where the whole pricing configuration is frozen onto each line.
313
+ *
314
+ * Reported quantity is still the right number for "which project is burning this", which is
315
+ * what the split is for.
316
+ *
317
+ * ## The resource list says which, not how much
318
+ *
319
+ * Usage events carry no resource id — it is not a grouping dimension, and making it one would
320
+ * mean one time series per machine per hour. So the engine cannot attribute a charge to a
321
+ * machine. What it can be attributed to is a product, and which resources of that product
322
+ * exist is something billing knows from its own records.
323
+ *
324
+ * Destroyed resources are listed too: this period's charge includes the part they ran for.
325
+ * Leaving them out is what makes the numbers fail to add up for someone who deleted a machine
326
+ * mid-month — which is exactly the case they are trying to explain.
327
+ *
328
+ * ## A flat fee answers with an empty split
329
+ *
330
+ * There is no meter behind it, so there is nothing to attribute. That is an answer, not an
331
+ * error.
332
+ */
333
+ get: operations["get-charge-usage"];
334
+ put?: never;
335
+ post?: never;
336
+ delete?: never;
337
+ options?: never;
338
+ head?: never;
339
+ patch?: never;
340
+ trace?: never;
341
+ };
342
+ "/account/v1/billing-accounts/{accountKey}/invoices": {
343
+ parameters: {
344
+ query?: never;
345
+ header?: never;
346
+ path?: never;
347
+ cookie?: never;
348
+ };
349
+ /**
350
+ * List this account's invoices
351
+ * @description Past periods, most recent first. The period in progress is not here — see the charges
352
+ * endpoint for that.
353
+ */
354
+ get: operations["list-invoices"];
355
+ put?: never;
356
+ post?: never;
357
+ delete?: never;
358
+ options?: never;
359
+ head?: never;
360
+ patch?: never;
361
+ trace?: never;
362
+ };
363
+ "/account/v1/billing-accounts/{accountKey}/invoices/{invoiceId}": {
364
+ parameters: {
365
+ query?: never;
366
+ header?: never;
367
+ path?: never;
368
+ cookie?: never;
369
+ };
370
+ /**
371
+ * Read one invoice with its lines
372
+ * @description A total does not answer "why is it this much", and that is the question a bill provokes. Each
373
+ * line carries its service period, without which lines of the same name — hundreds of them on an
374
+ * hourly bill — cannot be told apart, and how much of it credit covered, which is the answer to
375
+ * "I have a balance, why am I being charged".
376
+ */
377
+ get: operations["get-invoice"];
378
+ put?: never;
379
+ post?: never;
380
+ delete?: never;
381
+ options?: never;
382
+ head?: never;
383
+ patch?: never;
384
+ trace?: never;
385
+ };
386
+ "/account/v1/projects/{projectId}/billing-account": {
387
+ parameters: {
388
+ query?: never;
389
+ header?: never;
390
+ path?: never;
391
+ cookie?: never;
392
+ };
393
+ /**
394
+ * Which account pays for this project
395
+ * @description The account a project's resources are charged to, resolved from the project rather than
396
+ * guessed.
397
+ *
398
+ * ## Why a console needs this
399
+ *
400
+ * Everything in a console happens inside a project, while billing accounts belong to a person —
401
+ * and a person can have many. Showing "the first one" next to a sentence like *you are
402
+ * overdrawn, new resources will be refused* pairs one account's balance with another account's
403
+ * rule. Both directions are wrong and one of them is silent: the figures look healthy while
404
+ * creating anything is refused, and the refusal names a reason the page just contradicted.
405
+ *
406
+ * ## Being a member is enough to ask, but not to see the money
407
+ *
408
+ * The answer is the account's identity, not its balance. A project's members are not
409
+ * necessarily the people paying for it — a company account can pay for a project someone else
410
+ * works in — and their balance is not those members' business. Whoever owns the account reads
411
+ * the figures from the balance route as before; `owned_by_me` says which case this is, so a
412
+ * page can tell "you are overdrawn" apart from "ask whoever pays for this project".
413
+ *
414
+ * ## A project with no account is a normal state, and it answers 404
415
+ *
416
+ * A project nobody has bound yet cannot create resources at all — admission refuses it. That is
417
+ * worth saying plainly ("this project has no billing account, bind one") rather than falling
418
+ * back to some other account of theirs, which is how the wrong-account problem started.
419
+ */
420
+ get: operations["read-project-billing-account"];
421
+ put?: never;
422
+ post?: never;
423
+ delete?: never;
424
+ options?: never;
425
+ head?: never;
426
+ patch?: never;
427
+ trace?: never;
428
+ };
429
+ "/account/v1/projects/{projectId}/quote": {
430
+ parameters: {
431
+ query?: never;
432
+ header?: never;
433
+ path?: never;
434
+ cookie?: never;
435
+ };
436
+ get?: never;
437
+ put?: never;
438
+ /**
439
+ * What a usage would cost in this project
440
+ * @description Prices a set of usages against whatever plan pays for this project, and returns **every
441
+ * intermediate step** rather than a single number.
442
+ *
443
+ * # Why by project rather than by billing account
444
+ *
445
+ * The page that needs this is the one where somebody is about to create a machine, and all it has
446
+ * is a project. Which account pays for that project is billing's own bookkeeping — asking the
447
+ * caller to resolve it first would put that mapping into a page that otherwise has no business
448
+ * knowing accounts exist.
449
+ *
450
+ * # Quantities are raw
451
+ *
452
+ * Seconds, token counts, GiB-seconds: the amount a service reports. Conversion happens here, which
453
+ * is why services keep no conversion tables of their own and why the caller must not do the
454
+ * arithmetic itself.
455
+ *
456
+ * Name each usage by `service` and `product_id` rather than by key: the key is a hash of a
457
+ * convention that has exactly one implementation on purpose.
458
+ *
459
+ * # It is an estimate
460
+ *
461
+ * The engine computes the real amount; this reproduces the same rules. Every step comes back for
462
+ * that reason — a single number that disagrees with the bill says nothing about which step was
463
+ * wrong.
464
+ *
465
+ * `404` means the project has no billing account, or its account is on no plan. Both are worth
466
+ * showing: nothing can be created in either case, because admission refuses it.
467
+ */
468
+ post: operations["quote-project-usage"];
469
+ delete?: never;
470
+ options?: never;
471
+ head?: never;
472
+ patch?: never;
473
+ trace?: never;
474
+ };
475
+ "/account/v1/billing-accounts/{accountKey}/quote": {
476
+ parameters: {
477
+ query?: never;
478
+ header?: never;
479
+ path?: never;
480
+ cookie?: never;
481
+ };
482
+ get?: never;
483
+ put?: never;
484
+ /**
485
+ * What a usage would cost on this account's plan
486
+ * @description Prices a set of usages against whatever plan this account is currently on, and returns **every
487
+ * intermediate step** rather than a single number.
488
+ *
489
+ * # What it is for
490
+ *
491
+ * Showing someone what a machine will cost before they create it. The console asks for the usage a
492
+ * machine of that shape produces in an hour, and gets back what that hour costs them — on their
493
+ * plan, with their discounts.
494
+ *
495
+ * # Quantities are raw
496
+ *
497
+ * Seconds, token counts, GiB-seconds: the amount a service reports. Conversion happens here, which
498
+ * is why services keep no conversion tables of their own and why the console must not do the
499
+ * arithmetic itself.
500
+ *
501
+ * # It is an estimate
502
+ *
503
+ * The engine computes the real amount; this reproduces the same rules. Every step comes back for
504
+ * that reason — a single number that disagrees with the bill says nothing about which step was
505
+ * wrong.
506
+ *
507
+ * `404` means this account is not on any plan, and there is therefore nothing to price against.
508
+ */
509
+ post: operations["quote-usage"];
510
+ delete?: never;
511
+ options?: never;
512
+ head?: never;
513
+ patch?: never;
514
+ trace?: never;
515
+ };
516
+ "/account/v1/billing-accounts/{accountKey}/subscription": {
517
+ parameters: {
518
+ query?: never;
519
+ header?: never;
520
+ path?: never;
521
+ cookie?: never;
522
+ };
523
+ /**
524
+ * Which plan this account is on
525
+ * @description `404` means no plan, which is worth showing rather than hiding: an account without one is
526
+ * refused admission, so nothing can be allocated in it.
527
+ *
528
+ * A subscription that has been cancelled but has not reached the end of its period still counts
529
+ * as being on a plan — it is still serving, still billing, and the period has already been paid
530
+ * for.
531
+ */
532
+ get: operations["read-subscription"];
533
+ put?: never;
534
+ post?: never;
535
+ delete?: never;
536
+ options?: never;
537
+ head?: never;
538
+ patch?: never;
539
+ trace?: never;
540
+ };
541
+ "/account/v1/billing-accounts/{accountKey}/subscription/cancel": {
542
+ parameters: {
543
+ query?: never;
544
+ header?: never;
545
+ path?: never;
546
+ cookie?: never;
547
+ };
548
+ get?: never;
549
+ put?: never;
550
+ /**
551
+ * Come off the paid plan
552
+ * @description Moves the account off whatever plan it is on.
553
+ *
554
+ * Where a default plan is configured this is a switch to it rather than a cancellation — an
555
+ * account with no plan is refused admission, so cancelling outright would cut off someone who
556
+ * only meant to drop back to the free tier. Without a default plan it is a real cancellation and
557
+ * the account is left with no plan on purpose.
558
+ *
559
+ * `timing` has to be stated. Ending immediately on an account that has already paid for the
560
+ * current period takes back what they paid for; ending at the end of the period does not. There
561
+ * is no default because the two are materially different and picking one silently would make the
562
+ * wrong one happen whenever the field is forgotten.
563
+ *
564
+ * Without this, someone who bought a paid plan can only stop paying by contacting support —
565
+ * which is how a cancellation becomes a chargeback.
566
+ */
567
+ post: operations["cancel-subscription"];
568
+ delete?: never;
569
+ options?: never;
570
+ head?: never;
571
+ patch?: never;
572
+ trace?: never;
573
+ };
574
+ "/account/v1/billing-accounts/{accountKey}/top-ups/{paymentId}": {
575
+ parameters: {
576
+ query?: never;
577
+ header?: never;
578
+ path?: never;
579
+ cookie?: never;
580
+ };
581
+ /**
582
+ * How far along a top-up is
583
+ * @description Credit arrives asynchronously, shortly after the payment provider confirms the money. Coming
584
+ * back from the payment page the balance has usually not moved yet, and without this there is no
585
+ * way to tell "it is on its way" from "it failed" — the only recourse is refreshing the balance
586
+ * and guessing.
587
+ *
588
+ * `settled` means the credit has landed. `pending` means the money arrived and the credit has
589
+ * not been issued yet, or the payment method is an asynchronous one and the money itself is
590
+ * still in transit.
591
+ */
592
+ get: operations["read-top-up"];
593
+ put?: never;
594
+ post?: never;
595
+ delete?: never;
596
+ options?: never;
597
+ head?: never;
598
+ patch?: never;
599
+ trace?: never;
600
+ };
601
+ "/account/v1/billing-accounts/{accountKey}/payment-methods": {
602
+ parameters: {
603
+ query?: never;
604
+ header?: never;
605
+ path?: never;
606
+ cookie?: never;
607
+ };
608
+ /**
609
+ * The payment methods on file
610
+ * @description Every method saved against this account, and which one an invoice will be charged to.
611
+ *
612
+ * ## Why the brand, last four and expiry are here
613
+ *
614
+ * They were deliberately absent while the billing engine held the card, because the answer
615
+ * that mattered — can money be collected — came from the engine, and a page built on the
616
+ * provider's answer could show a method the engine had not recorded. Collection now runs from
617
+ * this service against the provider directly, so there is one answer, and it is the one shown.
618
+ *
619
+ * Expiry is the reason this is worth showing at all: a card expires, the invoice then fails,
620
+ * dunning runs out, and the project stops — with the account holder watching it happen and no
621
+ * indication that a card was the cause.
622
+ *
623
+ * No other card data exists here. The number, the expiry entered by the holder and the CVC go
624
+ * from the browser to the provider and never reach this platform.
625
+ *
626
+ * An account that has never added one returns an empty list. That is the normal state of a new
627
+ * account, not an error.
628
+ */
629
+ get: operations["list-payment-methods"];
630
+ put?: never;
631
+ /**
632
+ * Begin adding a payment method
633
+ * @description Starts a session for adding a method, and returns the secret the browser needs to mount the
634
+ * provider's own form.
635
+ *
636
+ * ## The form is embedded, not a redirect
637
+ *
638
+ * The returned `client_secret` initialises the provider's JavaScript, which renders its form
639
+ * inside an iframe on this platform's own page. **No card data reaches this platform** — the
640
+ * number goes from the browser straight to the provider, exactly as it would on a redirect —
641
+ * but the account holder never leaves the console.
642
+ *
643
+ * A redirect would take them to a page with someone else's branding in the middle of adding a
644
+ * payment method, which is the moment they are most likely to abandon it.
645
+ *
646
+ * ## This is a prerequisite for buying a plan, not a convenience
647
+ *
648
+ * A plan is charged by invoice, and the invoice is collected from a method on file. Discovering
649
+ * that none exists at purchase time turns a missing payment method into a rejection whose
650
+ * wording is about something else entirely.
651
+ *
652
+ * It is *not* a prerequisite for topping up: a top-up collects the money there and then.
653
+ */
654
+ post: operations["start-payment-method-setup"];
655
+ delete?: never;
656
+ options?: never;
657
+ head?: never;
658
+ patch?: never;
659
+ trace?: never;
660
+ };
661
+ "/account/v1/billing-accounts/{accountKey}/payment-methods/{paymentMethodId}": {
662
+ parameters: {
663
+ query?: never;
664
+ header?: never;
665
+ path?: never;
666
+ cookie?: never;
667
+ };
668
+ get?: never;
669
+ put?: never;
670
+ post?: never;
671
+ /**
672
+ * Remove a payment method
673
+ * @description Detaches it from this account. Removing the last one is allowed.
674
+ *
675
+ * ## Why removing the last one is not blocked
676
+ *
677
+ * Blocking it leaves an account holder who wants to stop paying with no way out. The cost of
678
+ * allowing it is that later invoices cannot be collected — and that path has notice, a grace
679
+ * period and a way back. A card that cannot be removed is a dead end.
680
+ */
681
+ delete: operations["remove-payment-method"];
682
+ options?: never;
683
+ head?: never;
684
+ patch?: never;
685
+ trace?: never;
686
+ };
687
+ "/account/v1/billing-accounts/{accountKey}/payment-methods/{paymentMethodId}/default": {
688
+ parameters: {
689
+ query?: never;
690
+ header?: never;
691
+ path?: never;
692
+ cookie?: never;
693
+ };
694
+ get?: never;
695
+ /**
696
+ * Charge invoices to this one
697
+ * @description Makes this the method an invoice is collected from.
698
+ *
699
+ * ## It is stored at the provider, not here
700
+ *
701
+ * The charge itself reads that setting from the provider, so keeping a second copy here would
702
+ * create two answers to the same question. When they disagree the visible symptom is that the
703
+ * account holder changed the default and the charge still went to the old one.
704
+ */
705
+ put: operations["set-default-payment-method"];
706
+ post?: never;
707
+ delete?: never;
708
+ options?: never;
709
+ head?: never;
710
+ patch?: never;
711
+ trace?: never;
712
+ };
713
+ "/account/v1/billing-accounts/{accountKey}/offers": {
714
+ parameters: {
715
+ query?: never;
716
+ header?: never;
717
+ path?: never;
718
+ cookie?: never;
719
+ };
720
+ /**
721
+ * List the offers this account can buy
722
+ * @description Lists what is actually purchasable by this account, right now.
723
+ *
724
+ * ## Every offer here has passed the full eligibility check
725
+ *
726
+ * The list is not "everything on sale" filtered by status. A promotion whose places are gone, a
727
+ * first-month discount this person already used, a beta price they are not on the list for —
728
+ * none of them appear. Returning them and rejecting the purchase afterwards reads as a broken
729
+ * system rather than as a rule.
730
+ *
731
+ * The price is not here, and not because it was left out: an offer states **who may buy, and
732
+ * when**. What it costs comes from the plan it points at, and is reported by the offers list.
733
+ */
734
+ get: operations["list-offers"];
735
+ put?: never;
736
+ post?: never;
737
+ delete?: never;
738
+ options?: never;
739
+ head?: never;
740
+ patch?: never;
741
+ trace?: never;
742
+ };
743
+ "/account/v1/billing-accounts/{accountKey}/offers/{offerKey}/purchase": {
744
+ parameters: {
745
+ query?: never;
746
+ header?: never;
747
+ path?: never;
748
+ cookie?: never;
749
+ };
750
+ get?: never;
751
+ put?: never;
752
+ /**
753
+ * Buy an offer
754
+ * @description Puts the account on the plan this offer points at, taking one of its places if it has a limit.
755
+ *
756
+ * ## A card has to be on file first
757
+ *
758
+ * Unless the offer points at a free plan. A paid plan is collected from the card on file
759
+ * and refuses to start the subscription without one; that refusal arrives here as a
760
+ * precondition error rather than as a conflict.
761
+ *
762
+ * ## `timing` is required only when the account already has a plan
763
+ *
764
+ * Moving between plans immediately is what an upgrade wants — the customer paid more and wants
765
+ * it now. Waiting for the end of the period is what a downgrade wants — they already paid for
766
+ * this one. Neither is a safe default, and picking one silently gets the money wrong whenever
767
+ * the field is forgotten.
768
+ *
769
+ * ## Being refused says which rule refused
770
+ *
771
+ * Places gone, window closed, already used, not on the list — each needs the customer to do
772
+ * something different, and several of them need them to do nothing at all. A single "not
773
+ * eligible" sends everyone to support.
774
+ *
775
+ * ## Retrying is safe
776
+ *
777
+ * A place is taken before the subscription is created, so a failure in between leaves the place
778
+ * held rather than the discount given away. Retrying the same purchase finishes it instead of
779
+ * taking a second place.
780
+ */
781
+ post: operations["purchase-offer"];
782
+ delete?: never;
783
+ options?: never;
784
+ head?: never;
785
+ patch?: never;
786
+ trace?: never;
787
+ };
788
+ "/account/v1/billing-accounts/{accountKey}/prepaid-assets": {
789
+ parameters: {
790
+ query?: never;
791
+ header?: never;
792
+ path?: never;
793
+ cookie?: never;
794
+ };
795
+ /**
796
+ * What I bought outright
797
+ * @description Everything this account holds on a term, across every product.
798
+ *
799
+ * ## Nothing here expires on its own
800
+ *
801
+ * A term renews for as long as the seat is held: the engine charges the next period, prorates
802
+ * any change to the second, and stops the moment the seat is given up. So there is no renewal
803
+ * to remember and no expiry to warn about — giving it up means deleting the resource, in the
804
+ * console that owns it.
805
+ *
806
+ * What the next period costs and when it falls due is on the charges route. That is read
807
+ * straight from the engine rather than copied here, because a copy is a second answer that
808
+ * drifts without saying so.
809
+ *
810
+ * ## Metered resources are not here
811
+ *
812
+ * They have no term. Listing them would invite renewing something that is already billed by
813
+ * the hour until it is deleted.
814
+ *
815
+ * ## `state` and `desired_state` are both reported
816
+ *
817
+ * A machine stopped for arrears reads `suspended` for both. One being brought back reads
818
+ * `suspended` and `active` — it is on its way. Without the second field those look identical,
819
+ * and a customer who just paid concludes it did not work and pays again.
820
+ */
821
+ get: operations["list-prepaid-assets"];
822
+ put?: never;
823
+ post?: never;
824
+ delete?: never;
825
+ options?: never;
826
+ head?: never;
827
+ patch?: never;
828
+ trace?: never;
829
+ };
830
+ }
831
+ export type webhooks = Record<string, never>;
832
+ export interface components {
833
+ schemas: {
834
+ /**
835
+ * @description The usages to price. Quantities are the **raw amounts a service reports** — seconds, token
836
+ * counts, GiB-seconds. Conversion happens on the billing side, which is why services keep no
837
+ * conversion tables of their own.
838
+ */
839
+ QuoteRequest: {
840
+ lines: components["schemas"]["QuoteUsage"][];
841
+ };
842
+ /**
843
+ * @description One usage to price. Name the thing **either** by its rate card key **or** by the service and
844
+ * product it belongs to — exactly one of the two.
845
+ *
846
+ * # Why the second form exists
847
+ *
848
+ * A meter's key is a hash of `(service, product_id, variant)`, computed by a function that lives in
849
+ * one place on purpose: get it wrong and usage lands in the wrong bucket, or in none, and nothing
850
+ * reports it. A caller that derived the key itself would be a second copy of that convention.
851
+ *
852
+ * So callers that know what they are buying — a machine of a given type, a model's input tokens —
853
+ * give the service and product, and this side derives the key.
854
+ */
855
+ QuoteUsage: {
856
+ /**
857
+ * @description The rate card's key. For a card tied to a meter that is the meter's key, because the engine
858
+ * requires the two to be identical.
859
+ *
860
+ * Leave it out when giving `service` and `product_id` instead
861
+ */
862
+ key?: string;
863
+ /** @description The service that owns the product, as it appears in its usage events */
864
+ service?: string;
865
+ /** @description That service's own catalogue id for the thing being bought */
866
+ product_id?: string;
867
+ /**
868
+ * @description The fixed dimension values that split one product into several meters — canopy's token kind,
869
+ * for instance. Part of the key, so leaving it out names a different meter
870
+ */
871
+ variant?: {
872
+ [key: string]: string;
873
+ };
874
+ /** @description The raw amount, before any conversion. A decimal string */
875
+ quantity: string;
876
+ };
877
+ /**
878
+ * @description One rate card priced, with every intermediate step.
879
+ *
880
+ * Each step is here on purpose: a single total that disagrees with the bill says nothing about
881
+ * which step went wrong, and this is a second implementation of the engine's rules
882
+ */
883
+ QuoteLine: {
884
+ key: string;
885
+ name: string;
886
+ /** @description False for a flat fee, which ignores usage entirely */
887
+ metered: boolean;
888
+ /** @description The quantity as given */
889
+ raw: string;
890
+ /** @description After unit conversion, before rounding */
891
+ converted: string;
892
+ /**
893
+ * @description After rounding. `unit_config.rounding` applies to this step only — entitlement uses the
894
+ * exact converted value, which is the engine's documented behaviour
895
+ */
896
+ billable: string;
897
+ /** @description Units covered by the usage discount */
898
+ free_units: string;
899
+ charged: string;
900
+ unit_price: string;
901
+ /** @description Before the percentage discount */
902
+ gross: string;
903
+ discount: string;
904
+ /**
905
+ * @description Rounded to the currency's minor unit, **per line**. Not by rounding the sum: the engine
906
+ * rounds each line, and the difference grows with the number of lines
907
+ */
908
+ total: string;
909
+ };
910
+ Quote: {
911
+ lines: components["schemas"]["QuoteLine"][];
912
+ /** @description The sum of the already-rounded lines */
913
+ total: string;
914
+ /**
915
+ * @description Keys that were given a usage but have no rate card on this plan.
916
+ *
917
+ * **Reported rather than ignored**, because ignoring them yields a smaller but entirely
918
+ * normal-looking number — and that is the most expensive misconfiguration there is: usage
919
+ * lands, the usage chart shows it, and the bill has no line for it
920
+ */
921
+ unpriced?: string[];
922
+ };
923
+ /**
924
+ * @description When a plan change takes effect. There is no default: an upgrade and a downgrade want opposite
925
+ * answers, and the difference is money
926
+ * @enum {string}
927
+ */
928
+ PlanChangeTiming: "immediate" | "next_billing_cycle";
929
+ OfferList: {
930
+ offers: components["schemas"]["Offer"][];
931
+ };
932
+ /**
933
+ * @description One thing this account can buy. It carries no price — the price is on the plan it points at,
934
+ * recorded in exactly one place
935
+ */
936
+ Offer: {
937
+ /** @description The stable identifier operations and support use for this offer */
938
+ offer_key: string;
939
+ name: string;
940
+ description?: string;
941
+ /** @description A short label for the pricing page, e.g. the one marking the recommended tier */
942
+ badge?: string;
943
+ /**
944
+ * Format: date-time
945
+ * @description When this offer stops being purchasable. Absent means it does not expire
946
+ */
947
+ valid_until?: string;
948
+ /** @description Present on offers that sell a plan */
949
+ pricing?: components["schemas"]["Pricing"];
950
+ /** @description Present on offers that sell credit */
951
+ top_up?: components["schemas"]["TopUpPricing"];
952
+ };
953
+ /**
954
+ * @description What this offer costs, as a structure rather than a number.
955
+ *
956
+ * A plan is rarely one number: an introductory period at one price followed by another, a monthly
957
+ * fee alongside metered usage, an allowance of free units before metering starts. Flattening that
958
+ * into a single figure means deciding which part to show, and every such decision is wrong for
959
+ * some plan.
960
+ *
961
+ * This is read on each request rather than stored alongside the offer. The plan owns
962
+ * prices; a second copy would be a second answer, and the two would drift without anything saying
963
+ * so — the visible symptom being a pricing page that disagrees with the invoice.
964
+ */
965
+ Pricing: {
966
+ currency: components["schemas"]["Currency"];
967
+ /** @description How often this recurs, as an ISO 8601 duration. `P1M` is monthly */
968
+ billing_period?: string;
969
+ /**
970
+ * @description In order. A phase with no `duration` runs until the subscription ends, and there is at most
971
+ * one of those, last
972
+ */
973
+ phases: components["schemas"]["PricingPhase"][];
974
+ };
975
+ PricingPhase: {
976
+ name: string;
977
+ /** @description How long this phase lasts, as an ISO 8601 duration. Absent means "until the end" */
978
+ duration?: string;
979
+ lines: components["schemas"]["PricingLine"][];
980
+ };
981
+ /** @description One charge within a phase — a fee, or a rate for something metered */
982
+ PricingLine: {
983
+ name: string;
984
+ /**
985
+ * @description `free` costs nothing. `flat` is charged once per period regardless of use. `unit` is charged
986
+ * per unit consumed
987
+ * @enum {string}
988
+ */
989
+ type: "free" | "flat" | "unit";
990
+ /** @description A decimal string. Money is never a float */
991
+ amount?: string;
992
+ /**
993
+ * @description For `unit` lines whose meter counts something finer than what is charged for: how many
994
+ * metered units one charge covers. A price of `10` with `units_per_charge` of `1000000` is
995
+ * ten currency units per million.
996
+ *
997
+ * Absent means one for one. **Showing the amount without this is wrong by whatever this
998
+ * factor is**, which for token pricing is six orders of magnitude
999
+ */
1000
+ units_per_charge?: string;
1001
+ /** @description How many units are not charged for before charging starts */
1002
+ free_units?: string;
1003
+ /**
1004
+ * Format: float
1005
+ * @description A reduction applied to this line, 0 to 100
1006
+ */
1007
+ percent_off?: number;
1008
+ /**
1009
+ * @description True when this is charged once at the start rather than every period. Absent or false means
1010
+ * it recurs
1011
+ */
1012
+ one_time?: boolean;
1013
+ };
1014
+ UpdateBillingAccountRequestBody: {
1015
+ display_name: string;
1016
+ };
1017
+ Order: {
1018
+ id: string;
1019
+ project_id: string;
1020
+ placed_by: string;
1021
+ /**
1022
+ * @description Whether the request went through. It is not the state of what was provisioned: that
1023
+ * belongs to each resource and outlives the order.
1024
+ * @enum {string}
1025
+ */
1026
+ state: "pending" | "fulfilled" | "failed";
1027
+ failure_reason?: string;
1028
+ /**
1029
+ * @description What was taken, as a decimal string. Absent on a metered order, where the amount is not
1030
+ * known when the order is placed: it comes from usage afterwards. Absent must be read as
1031
+ * "billed by usage" — writing zero would make a metered order and a genuinely free one
1032
+ * look the same.
1033
+ */
1034
+ amount?: string;
1035
+ currency?: string;
1036
+ /**
1037
+ * @description Always `none` on a metered order.
1038
+ * @enum {string}
1039
+ */
1040
+ payment_state?: "none" | "paid" | "refunded";
1041
+ /** Format: date-time */
1042
+ created_at: string;
1043
+ /** @description Only present on the single-order route. */
1044
+ lines?: components["schemas"]["OrderLine"][];
1045
+ };
1046
+ OrderLine: {
1047
+ id: string;
1048
+ /** @enum {string} */
1049
+ action: "add" | "renew" | "modify" | "remove";
1050
+ /** @description Which service holds the thing, for example `compute`. */
1051
+ service: string;
1052
+ /** @description That service's own catalogue identifier for what was asked for. */
1053
+ product_id: string;
1054
+ /** Format: int64 */
1055
+ quantity: number;
1056
+ };
1057
+ PrepaidAsset: {
1058
+ id: string;
1059
+ project_id: string;
1060
+ /** @description Which service holds it. Also which console it is managed from. */
1061
+ service: string;
1062
+ /**
1063
+ * @description That service's own catalogue id, not a billing sku. The price of a machine is made of
1064
+ * finer parts than the machine type — the type does not appear in the rate card at all.
1065
+ */
1066
+ product_id: string;
1067
+ /** @description The id that service knows it by, so the two consoles can be lined up. */
1068
+ resource_id?: string;
1069
+ /**
1070
+ * Format: int64
1071
+ * @description GiB for a disk, 1 for a machine or an address.
1072
+ */
1073
+ quantity: number;
1074
+ /**
1075
+ * @description How long one period buys, as an ISO 8601 duration (P1M, P1Y).
1076
+ *
1077
+ * There is no expiry to report. The engine keeps renewing this for as long as the seat is
1078
+ * held, so what runs out is not the term but the customer's decision to keep it. What the
1079
+ * next period costs, and when it is charged, is on the charges route — that is the engine's
1080
+ * own answer rather than a copy of it.
1081
+ */
1082
+ term: string;
1083
+ /** @enum {string} */
1084
+ state: "pending" | "active" | "suspended" | "terminated";
1085
+ /**
1086
+ * @description What it is being moved to. Differs from `state` while a change is still being applied,
1087
+ * which is the moment a customer is most likely to conclude that nothing happened.
1088
+ * @enum {string}
1089
+ */
1090
+ desired_state: "active" | "suspended" | "terminated";
1091
+ };
1092
+ PrepaidAssetList: {
1093
+ assets: components["schemas"]["PrepaidAsset"][];
1094
+ };
1095
+ RenewRequestBody: {
1096
+ /**
1097
+ * @description How long to renew for, as an ISO 8601 duration (P1M, P1Y). It does not have to match the
1098
+ * term originally bought.
1099
+ */
1100
+ term: string;
1101
+ /**
1102
+ * @description Generate one per renewal the customer starts — when the dialog opens, not when it is
1103
+ * submitted — and send the same one on every retry of that renewal.
1104
+ */
1105
+ idempotency_key: string;
1106
+ };
1107
+ OrderList: {
1108
+ orders: components["schemas"]["Order"][];
1109
+ };
1110
+ TopUpList: {
1111
+ top_ups: components["schemas"]["TopUpStatus"][];
1112
+ };
1113
+ CreditTransactionList: {
1114
+ transactions: components["schemas"]["CreditTransaction"][];
1115
+ };
1116
+ /**
1117
+ * @description One movement of credit. Immutable — a correction is another movement, never an edit of this
1118
+ * one, which is what lets the balance be recomputed from the list at any time
1119
+ */
1120
+ CreditTransaction: {
1121
+ id: string;
1122
+ type: components["schemas"]["CreditTransactionType"];
1123
+ /** @description A decimal string. Never a float — a balance that rounds is a balance that drifts */
1124
+ amount: string;
1125
+ currency: string;
1126
+ /**
1127
+ * Format: date-time
1128
+ * @description When it landed on the ledger, which is not always when it was requested
1129
+ */
1130
+ booked_at: string;
1131
+ /**
1132
+ * @description What the balance became. Recorded by the metering engine rather than recomputed here —
1133
+ * recomputing assumes our understanding of the burn-down order matches its own, and this
1134
+ * is its own account of it
1135
+ */
1136
+ balance_after: string;
1137
+ };
1138
+ /**
1139
+ * @description `funded` is credit arriving, `consumed` is it being spent, `expired` is a grant reaching the
1140
+ * end of its life unspent, and `voided` is one cancelled — a refund, or a correction
1141
+ * @enum {string}
1142
+ */
1143
+ CreditTransactionType: "funded" | "consumed" | "expired" | "voided";
1144
+ /**
1145
+ * @description What a top-up bundle costs and what it grants. Present only on offers that sell credit.
1146
+ *
1147
+ * Unlike a plan price, this is stated on the bundle itself: credit is granted per
1148
+ * transaction and has no catalog of bundles to read from. There is no second copy to drift
1149
+ * against, because there is no first one anywhere else
1150
+ */
1151
+ TopUpPricing: {
1152
+ /** @description What is charged, as a decimal string */
1153
+ pay: string;
1154
+ /** @description How much credit is granted. Equal to `pay` when there is no bonus */
1155
+ credit: string;
1156
+ };
1157
+ Purchase: {
1158
+ offer_key: string;
1159
+ /**
1160
+ * @description The subscription now serving this account. When the change was set to take effect at the
1161
+ * end of the period, this is the one that takes over then, and its status says `scheduled`
1162
+ */
1163
+ subscription_id: string;
1164
+ };
1165
+ Error: {
1166
+ code?: string;
1167
+ message: string;
1168
+ meta?: {
1169
+ [key: string]: unknown;
1170
+ };
1171
+ /** Format: int64 */
1172
+ status: number;
1173
+ };
1174
+ /**
1175
+ * @description A billing account.
1176
+ *
1177
+ * Any internal identifier is deliberately absent: the key addresses everything on
1178
+ * this API, and a second identifier is one more thing a client can pass in the wrong place, for
1179
+ * no benefit to anyone reading the page.
1180
+ */
1181
+ BillingAccount: {
1182
+ /** @description Addresses the account and states who owns it. Of the form `u_<user_id>_<seq>` */
1183
+ key: string;
1184
+ /** @description What the holder called it. Not unique, and it addresses nothing */
1185
+ display_name: string;
1186
+ currency: components["schemas"]["Currency"];
1187
+ /** @description The projects this account pays for. Empty when it pays for none, never `null` */
1188
+ project_ids: string[];
1189
+ };
1190
+ BillingAccountList: {
1191
+ /** @description Every account belonging to the caller. Empty when they hold none */
1192
+ accounts: components["schemas"]["BillingAccount"][];
1193
+ };
1194
+ CreateBillingAccountRequestBody: {
1195
+ /**
1196
+ * Format: int32
1197
+ * @description Which of the caller's accounts this is. Two requests carrying the same `seq` describe the
1198
+ * same account, so a retry is safe; a different `seq` creates a different account.
1199
+ *
1200
+ * It is not optional. Defaulting it would mean that a client which forgot the field
1201
+ * silently receives the account it already had, and reads that as a successful creation.
1202
+ */
1203
+ seq: number;
1204
+ /** @description A name for the holder's own benefit */
1205
+ display_name: string;
1206
+ currency?: components["schemas"]["Currency"];
1207
+ /**
1208
+ * @description Buy one of the top-up bundles from `/offers` instead of an arbitrary amount. When given,
1209
+ * `amount` is ignored: the bundle says what is charged and how much credit it grants.
1210
+ *
1211
+ * How much credit arrives is decided when the money does, not now — and only if the amount
1212
+ * collected matches what the bundle costs. A bundle whose places ran out, or whose window
1213
+ * closed, in between still grants what was paid for; it just does not grant the bonus.
1214
+ */
1215
+ offer_key?: string;
1216
+ };
1217
+ /**
1218
+ * @description The three numbers a billing page needs, which are not the same number.
1219
+ *
1220
+ * `balance` answers "can I start another one" and is floored at zero, so it cannot express
1221
+ * being past zero. `unsettled` is what the current period has run up. `available` is the
1222
+ * difference between the two and **may be negative**.
1223
+ *
1224
+ * Reporting only the first would make an account that has overspent indistinguishable from one
1225
+ * that spent exactly what it had, and those two call for different actions.
1226
+ */
1227
+ Balance: {
1228
+ currency: components["schemas"]["Currency"];
1229
+ /**
1230
+ * @description What is spendable right now, with usage reported but not yet settled already subtracted.
1231
+ * Never negative — it is floored at zero, so it answers "can I start another machine" but
1232
+ * not "how much do I owe". A decimal string; `"0"` when the account has never been topped up
1233
+ */
1234
+ balance: string;
1235
+ /** @description The amount booked to the ledger, before this period's usage is taken off */
1236
+ cash: string;
1237
+ /**
1238
+ * @description What this period has run up and not yet been billed for. It keeps growing past the cash
1239
+ * balance, which is precisely the case the live figure cannot show
1240
+ */
1241
+ unsettled: string;
1242
+ /**
1243
+ * @description `cash` minus `unsettled`. **Negative means already in arrears**, and being able to say that
1244
+ * is the whole reason this field exists — the positive range is already covered by `balance`
1245
+ */
1246
+ available: string;
1247
+ };
1248
+ /** @description The account a project's resources are charged to */
1249
+ ProjectBillingAccount: {
1250
+ account_key: string;
1251
+ project_id: string;
1252
+ display_name: string;
1253
+ currency: components["schemas"]["Currency"];
1254
+ /**
1255
+ * @description Whether the caller owns this account, and therefore whether the balance routes will
1256
+ * answer for it. False means someone else pays for this project: the figures are theirs,
1257
+ * not the caller's, and a page should say so rather than showing nothing.
1258
+ */
1259
+ owned_by_me: boolean;
1260
+ };
1261
+ /** @description Which account pays for which project, as it stands once the request has been applied */
1262
+ ProjectBinding: {
1263
+ account_key: string;
1264
+ /** Format: uuid */
1265
+ project_id: string;
1266
+ };
1267
+ StartTopUpRequestBody: {
1268
+ /**
1269
+ * @description How much to add, as a decimal string — `"20"`, `"19.99"`.
1270
+ *
1271
+ * **Anything below one cent is rejected rather than rounded.** Rounding up overcharges and
1272
+ * rounding down undercharges; both alter the amount somewhere the payer cannot see it, and
1273
+ * this is the one number on this API where being wrong means money is wrong.
1274
+ */
1275
+ amount: string;
1276
+ currency?: components["schemas"]["Currency"];
1277
+ /**
1278
+ * @description Buy one of the top-up bundles from `/offers` instead of an arbitrary amount. When given,
1279
+ * `amount` is ignored: the bundle says what is charged and how much credit it grants.
1280
+ *
1281
+ * How much credit arrives is decided when the money does, not now — and only if the amount
1282
+ * collected matches what the bundle costs. A bundle whose places ran out, or whose window
1283
+ * closed, in between still grants what was paid for; it just does not grant the bonus.
1284
+ */
1285
+ offer_key?: string;
1286
+ };
1287
+ PaymentMethodSetupSession: {
1288
+ /**
1289
+ * @description Initialises the provider's JavaScript, which mounts its form in an iframe on this page.
1290
+ *
1291
+ * Not a URL: the form is embedded rather than redirected to, so the account holder stays
1292
+ * on the console. It expires, so fetch it when the form is about to be shown rather than
1293
+ * when the page loads.
1294
+ */
1295
+ client_secret: string;
1296
+ /**
1297
+ * @description The provider's id for this attempt.
1298
+ *
1299
+ * The browser does not need it — the callback carries the same id and is what actually
1300
+ * records the method. It is here so that a support conversation about one failed attempt
1301
+ * has something to look it up by.
1302
+ */
1303
+ session_id?: string;
1304
+ };
1305
+ /**
1306
+ * @description One saved way of collecting money later, without the account holder present.
1307
+ *
1308
+ * Deliberately not called a card: a card is one kind, and direct debit and the recurring
1309
+ * mandates offered by regional wallets occupy the same slot.
1310
+ */
1311
+ PaymentMethod: {
1312
+ /** @description The provider's id for it. Used to remove it or make it the default */
1313
+ id: string;
1314
+ /** @description Visa, Mastercard, and so on. Empty for kinds that have no brand */
1315
+ brand?: string;
1316
+ /**
1317
+ * @description The last four digits, for telling two saved methods apart.
1318
+ *
1319
+ * This and the expiry are the only parts of the instrument that exist here. The number,
1320
+ * the expiry the holder typed and the CVC never reach this platform.
1321
+ */
1322
+ last4?: string;
1323
+ /** Format: int32 */
1324
+ exp_month?: number;
1325
+ /**
1326
+ * Format: int32
1327
+ * @description Together with `exp_month`, when this stops working.
1328
+ *
1329
+ * Worth showing because the failure is otherwise invisible: the card expires, the invoice
1330
+ * fails, dunning runs out, and the project stops — with nothing pointing at the card.
1331
+ */
1332
+ exp_year?: number;
1333
+ /**
1334
+ * @description True for the one an invoice is collected from.
1335
+ *
1336
+ * Exactly one is the default while any exist. An account whose only method was removed
1337
+ * has none, and its next invoice cannot be collected.
1338
+ */
1339
+ default: boolean;
1340
+ };
1341
+ PaymentMethodList: {
1342
+ payment_methods: components["schemas"]["PaymentMethod"][];
1343
+ };
1344
+ TopUpSession: {
1345
+ /**
1346
+ * @description Identifies this attempt. Quote it in a support conversation — it is what ties the payment
1347
+ * provider's record to the credit that was granted
1348
+ */
1349
+ payment_id: string;
1350
+ /**
1351
+ * Format: uri
1352
+ * @description Send the browser here. It expires, so do not store it
1353
+ */
1354
+ url: string;
1355
+ };
1356
+ /** @description One thing this period has been charged for */
1357
+ Charge: {
1358
+ id: string;
1359
+ name: string;
1360
+ /**
1361
+ * @description Decimal string, the real-time figure. The booked figure would show a machine that only
1362
+ * just started as zero
1363
+ */
1364
+ total: string;
1365
+ /**
1366
+ * @description Which meter it is for, when the charge came from usage. A hash, not something to show —
1367
+ * it is here so two rows can be told apart programmatically and so support can line a row
1368
+ * up with the catalogue.
1369
+ */
1370
+ feature_key?: string;
1371
+ /**
1372
+ * @description Whether this figure moves. A usage charge climbs through the period; a flat fee does not.
1373
+ * Without it, the same number on two refreshes could mean "nobody used it" or "it never
1374
+ * moves", and those need different next steps.
1375
+ * @enum {string}
1376
+ */
1377
+ type: "usage_based" | "flat_fee";
1378
+ /**
1379
+ * Format: date-time
1380
+ * @description Start of the service period this charge covers.
1381
+ *
1382
+ * This is what tells two same-named rows apart. Something billed by the hour produces
1383
+ * hundreds of identically named charges in a month, and a list carrying only a name and an
1384
+ * amount shows them as a wall of duplicates — which is what it looks like today.
1385
+ */
1386
+ period_from: string;
1387
+ /**
1388
+ * Format: date-time
1389
+ * @description End of the service period this charge covers.
1390
+ */
1391
+ period_to: string;
1392
+ /**
1393
+ * @description How much of this charge was covered by credit, as a decimal string.
1394
+ *
1395
+ * It is the answer to "I have a balance, why am I still being charged". Without it the
1396
+ * customer sees a number that disagrees with what they expected and the only thing that
1397
+ * explains it is on our side.
1398
+ */
1399
+ credits?: string;
1400
+ /**
1401
+ * @description How much was taken off by a discount, as a decimal string. A usage allowance (the first N
1402
+ * units free) lands here too.
1403
+ */
1404
+ discounts?: string;
1405
+ /** @description Free text from the charge, usually empty. Set on charges raised by hand. */
1406
+ description?: string;
1407
+ /**
1408
+ * @description What one unit costs, as a decimal string. Absent when the line has no single unit price
1409
+ * — a flat fee, or a tiered price whose rate changes with volume.
1410
+ *
1411
+ * The conversion between reported and billed quantity is deliberately not here: the engine
1412
+ * does not echo it back on a charge, only on an invoice line. So a charge answers "what
1413
+ * does a unit cost", and an invoice answers "how the total was reached".
1414
+ */
1415
+ unit_price?: string;
1416
+ };
1417
+ /** @description What produced one charge */
1418
+ ChargeUsage: {
1419
+ charge_id: string;
1420
+ /**
1421
+ * @description Total reported quantity for the period, as a decimal string. Empty on a charge with no
1422
+ * meter behind it.
1423
+ *
1424
+ * Reported, not billed: see the route's description.
1425
+ */
1426
+ quantity: string;
1427
+ /**
1428
+ * @description The same quantity split by project. Empty when the charge has no meter behind it — a
1429
+ * flat fee has nothing to attribute.
1430
+ */
1431
+ by_project: components["schemas"]["ProjectUsage"][];
1432
+ /**
1433
+ * @description Resources of this product in the account's projects — candidates for what produced the
1434
+ * charge, not a per-resource breakdown. Absent when billing could not look them up; the
1435
+ * charge itself is still answered.
1436
+ */
1437
+ resources?: components["schemas"]["ChargeResource"][];
1438
+ };
1439
+ ProjectUsage: {
1440
+ project_id: string;
1441
+ /** @description Decimal string. */
1442
+ quantity: string;
1443
+ };
1444
+ ChargeResource: {
1445
+ project_id: string;
1446
+ /** @description Which service holds it, and therefore which console manages it. */
1447
+ service: string;
1448
+ product_id: string;
1449
+ resource_id: string;
1450
+ /** @enum {string} */
1451
+ state: "pending" | "active" | "suspended" | "terminated";
1452
+ };
1453
+ ChargeList: {
1454
+ currency: components["schemas"]["Currency"];
1455
+ charges: components["schemas"]["Charge"][];
1456
+ /**
1457
+ * Format: int64
1458
+ * @description How many charges there are in total, across every page.
1459
+ *
1460
+ * Without it, "is there another page" has to be guessed from whether this one came back
1461
+ * full — and that guess turns into one extra fetch of an empty page whenever the last page
1462
+ * happens to be exactly full.
1463
+ */
1464
+ total_count?: number;
1465
+ /**
1466
+ * @description The sum over the **whole period**, not this page — it is the same number as `unsettled`
1467
+ * on the balance, and paging must not change it. A page-scoped sum would disagree with the
1468
+ * balance card sitting next to it, and there would be no way to tell which one to believe.
1469
+ */
1470
+ total: string;
1471
+ };
1472
+ /** @enum {string} */
1473
+ InvoiceStatus: "draft" | "issuing" | "issued" | "payment_processing" | "overdue" | "paid" | "uncollectible" | "voided";
1474
+ Invoice: {
1475
+ id: string;
1476
+ number?: string;
1477
+ status: components["schemas"]["InvoiceStatus"];
1478
+ currency: components["schemas"]["Currency"];
1479
+ total: string;
1480
+ /** Format: date-time */
1481
+ due_at?: string;
1482
+ /** Format: date-time */
1483
+ issued_at?: string;
1484
+ /** Format: date-time */
1485
+ created_at: string;
1486
+ };
1487
+ InvoiceList: {
1488
+ invoices: components["schemas"]["Invoice"][];
1489
+ };
1490
+ InvoiceLine: {
1491
+ name: string;
1492
+ description?: string;
1493
+ /**
1494
+ * Format: date-time
1495
+ * @description Required. Lines of the same name repeat many times on one invoice — hundreds on an hourly
1496
+ * bill — and without the period they cannot be told apart
1497
+ */
1498
+ period_from: string;
1499
+ /** Format: date-time */
1500
+ period_to: string;
1501
+ /** @description Before discounts and credit */
1502
+ amount: string;
1503
+ discounts_total?: string;
1504
+ /**
1505
+ * @description The billed quantity for this line, as a decimal string — after conversion. A machine
1506
+ * billed by the hour reports machine-seconds; this is machine-hours.
1507
+ *
1508
+ * It comes from the line's detailed segments summed together: the engine splits a line
1509
+ * into segments (different cost categories, different sub-periods) and the quantity lives
1510
+ * on those.
1511
+ */
1512
+ quantity?: string;
1513
+ /**
1514
+ * @description What one unit cost, as a decimal string, frozen at billing time. Absent on a flat fee,
1515
+ * whose amount is the amount, and on tiered prices, whose rate changes with volume.
1516
+ */
1517
+ unit_price?: string;
1518
+ /**
1519
+ * @description How reported quantity became billed quantity — 3600 for a machine billed by the hour
1520
+ * from machine-seconds, 1000000 for a price per million tokens.
1521
+ *
1522
+ * Without it, `quantity` disagrees with what the customer remembers doing, by whole orders
1523
+ * of magnitude, and there is nothing on the page that explains the gap.
1524
+ */
1525
+ conversion_factor?: string;
1526
+ /**
1527
+ * @description What was done with the factor.
1528
+ * @enum {string}
1529
+ */
1530
+ conversion_operation?: "divide" | "multiply";
1531
+ /** @description How much of this line credit covered */
1532
+ credits_total?: string;
1533
+ total: string;
1534
+ };
1535
+ InvoiceDetail: {
1536
+ id: string;
1537
+ number?: string;
1538
+ status: components["schemas"]["InvoiceStatus"];
1539
+ currency: components["schemas"]["Currency"];
1540
+ total: string;
1541
+ charges_total?: string;
1542
+ discounts_total?: string;
1543
+ credits_total?: string;
1544
+ taxes_total?: string;
1545
+ /** Format: date-time */
1546
+ period_from?: string;
1547
+ /** Format: date-time */
1548
+ period_to?: string;
1549
+ /** Format: date-time */
1550
+ due_at?: string;
1551
+ /** Format: date-time */
1552
+ issued_at?: string;
1553
+ /** Format: date-time */
1554
+ created_at: string;
1555
+ lines: components["schemas"]["InvoiceLine"][];
1556
+ };
1557
+ Subscription: {
1558
+ id: string;
1559
+ plan_key: string;
1560
+ plan_version?: number;
1561
+ /**
1562
+ * @description `canceled` still counts as being on a plan — it is serving until the end of the period,
1563
+ * which has already been paid for
1564
+ */
1565
+ status: string;
1566
+ };
1567
+ TopUpStatus: {
1568
+ payment_id: string;
1569
+ /**
1570
+ * @description `settled` means the credit has landed. `pending` means it has not yet — the payment is
1571
+ * still being confirmed, or the money itself is still in transit
1572
+ * @enum {string}
1573
+ */
1574
+ state: "settled" | "pending";
1575
+ /** @description The credit that was issued, present once settled */
1576
+ amount?: string;
1577
+ currency?: components["schemas"]["Currency"];
1578
+ };
1579
+ /**
1580
+ * @description ISO 4217, uppercase. `USD` is the only value the platform issues today, and a request
1581
+ * naming any other is refused with `BILLING_CURRENCY_UNSUPPORTED`.
1582
+ *
1583
+ * Deliberately not an enumeration. The set of currency codes is governed outside this API, so
1584
+ * a client generated today must still be able to read a response naming a code added later —
1585
+ * an enumeration turns that response into a decode failure in a client nobody can redeploy.
1586
+ * Restricting what may be *sent* is a rule about what the platform supports, and it lives
1587
+ * where that rule can change without regenerating anything.
1588
+ */
1589
+ Currency: string;
1590
+ };
1591
+ responses: never;
1592
+ parameters: {
1593
+ /** @description Which asset, from the prepaid list */
1594
+ ProvisionId: string;
1595
+ /**
1596
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1597
+ * which is why the key is what addresses the account.
1598
+ */
1599
+ AccountKey: string;
1600
+ };
1601
+ requestBodies: never;
1602
+ headers: never;
1603
+ pathItems: never;
1604
+ }
1605
+ export type $defs = Record<string, never>;
1606
+ export interface operations {
1607
+ "list-billing-accounts": {
1608
+ parameters: {
1609
+ query?: never;
1610
+ header?: never;
1611
+ path?: never;
1612
+ cookie?: never;
1613
+ };
1614
+ requestBody?: never;
1615
+ responses: {
1616
+ /** @description OK */
1617
+ 200: {
1618
+ headers: {
1619
+ [name: string]: unknown;
1620
+ };
1621
+ content: {
1622
+ "application/json": components["schemas"]["BillingAccountList"];
1623
+ };
1624
+ };
1625
+ /** @description Error */
1626
+ default: {
1627
+ headers: {
1628
+ [name: string]: unknown;
1629
+ };
1630
+ content: {
1631
+ "application/json": components["schemas"]["Error"];
1632
+ };
1633
+ };
1634
+ };
1635
+ };
1636
+ "create-billing-account": {
1637
+ parameters: {
1638
+ query?: never;
1639
+ header?: never;
1640
+ path?: never;
1641
+ cookie?: never;
1642
+ };
1643
+ requestBody: {
1644
+ content: {
1645
+ "application/json": components["schemas"]["CreateBillingAccountRequestBody"];
1646
+ };
1647
+ };
1648
+ responses: {
1649
+ /** @description OK */
1650
+ 200: {
1651
+ headers: {
1652
+ [name: string]: unknown;
1653
+ };
1654
+ content: {
1655
+ "application/json": components["schemas"]["BillingAccount"];
1656
+ };
1657
+ };
1658
+ /** @description Error */
1659
+ default: {
1660
+ headers: {
1661
+ [name: string]: unknown;
1662
+ };
1663
+ content: {
1664
+ "application/json": components["schemas"]["Error"];
1665
+ };
1666
+ };
1667
+ };
1668
+ };
1669
+ "get-billing-account": {
1670
+ parameters: {
1671
+ query?: never;
1672
+ header?: never;
1673
+ path: {
1674
+ /**
1675
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1676
+ * which is why the key is what addresses the account.
1677
+ */
1678
+ accountKey: components["parameters"]["AccountKey"];
1679
+ };
1680
+ cookie?: never;
1681
+ };
1682
+ requestBody?: never;
1683
+ responses: {
1684
+ /** @description OK */
1685
+ 200: {
1686
+ headers: {
1687
+ [name: string]: unknown;
1688
+ };
1689
+ content: {
1690
+ "application/json": components["schemas"]["BillingAccount"];
1691
+ };
1692
+ };
1693
+ /** @description Error */
1694
+ default: {
1695
+ headers: {
1696
+ [name: string]: unknown;
1697
+ };
1698
+ content: {
1699
+ "application/json": components["schemas"]["Error"];
1700
+ };
1701
+ };
1702
+ };
1703
+ };
1704
+ "update-billing-account": {
1705
+ parameters: {
1706
+ query?: never;
1707
+ header?: never;
1708
+ path: {
1709
+ /**
1710
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1711
+ * which is why the key is what addresses the account.
1712
+ */
1713
+ accountKey: components["parameters"]["AccountKey"];
1714
+ };
1715
+ cookie?: never;
1716
+ };
1717
+ requestBody: {
1718
+ content: {
1719
+ "application/json": components["schemas"]["UpdateBillingAccountRequestBody"];
1720
+ };
1721
+ };
1722
+ responses: {
1723
+ /** @description OK */
1724
+ 200: {
1725
+ headers: {
1726
+ [name: string]: unknown;
1727
+ };
1728
+ content: {
1729
+ "application/json": components["schemas"]["BillingAccount"];
1730
+ };
1731
+ };
1732
+ /** @description Error */
1733
+ default: {
1734
+ headers: {
1735
+ [name: string]: unknown;
1736
+ };
1737
+ content: {
1738
+ "application/json": components["schemas"]["Error"];
1739
+ };
1740
+ };
1741
+ };
1742
+ };
1743
+ "list-credit-transactions": {
1744
+ parameters: {
1745
+ query?: never;
1746
+ header?: never;
1747
+ path: {
1748
+ /**
1749
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1750
+ * which is why the key is what addresses the account.
1751
+ */
1752
+ accountKey: components["parameters"]["AccountKey"];
1753
+ };
1754
+ cookie?: never;
1755
+ };
1756
+ requestBody?: never;
1757
+ responses: {
1758
+ /** @description OK */
1759
+ 200: {
1760
+ headers: {
1761
+ [name: string]: unknown;
1762
+ };
1763
+ content: {
1764
+ "application/json": components["schemas"]["CreditTransactionList"];
1765
+ };
1766
+ };
1767
+ /** @description Error */
1768
+ default: {
1769
+ headers: {
1770
+ [name: string]: unknown;
1771
+ };
1772
+ content: {
1773
+ "application/json": components["schemas"]["Error"];
1774
+ };
1775
+ };
1776
+ };
1777
+ };
1778
+ "read-billing-account-balance": {
1779
+ parameters: {
1780
+ query?: never;
1781
+ header?: never;
1782
+ path: {
1783
+ /**
1784
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1785
+ * which is why the key is what addresses the account.
1786
+ */
1787
+ accountKey: components["parameters"]["AccountKey"];
1788
+ };
1789
+ cookie?: never;
1790
+ };
1791
+ requestBody?: never;
1792
+ responses: {
1793
+ /** @description OK */
1794
+ 200: {
1795
+ headers: {
1796
+ [name: string]: unknown;
1797
+ };
1798
+ content: {
1799
+ "application/json": components["schemas"]["Balance"];
1800
+ };
1801
+ };
1802
+ /** @description Error */
1803
+ default: {
1804
+ headers: {
1805
+ [name: string]: unknown;
1806
+ };
1807
+ content: {
1808
+ "application/json": components["schemas"]["Error"];
1809
+ };
1810
+ };
1811
+ };
1812
+ };
1813
+ "bind-project-to-billing-account": {
1814
+ parameters: {
1815
+ query?: never;
1816
+ header?: never;
1817
+ path: {
1818
+ /**
1819
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1820
+ * which is why the key is what addresses the account.
1821
+ */
1822
+ accountKey: components["parameters"]["AccountKey"];
1823
+ /** @description The project this account should pay for */
1824
+ projectId: string;
1825
+ };
1826
+ cookie?: never;
1827
+ };
1828
+ requestBody?: never;
1829
+ responses: {
1830
+ /** @description OK */
1831
+ 200: {
1832
+ headers: {
1833
+ [name: string]: unknown;
1834
+ };
1835
+ content: {
1836
+ "application/json": components["schemas"]["ProjectBinding"];
1837
+ };
1838
+ };
1839
+ /** @description Error */
1840
+ default: {
1841
+ headers: {
1842
+ [name: string]: unknown;
1843
+ };
1844
+ content: {
1845
+ "application/json": components["schemas"]["Error"];
1846
+ };
1847
+ };
1848
+ };
1849
+ };
1850
+ "unbind-project-from-billing-account": {
1851
+ parameters: {
1852
+ query?: never;
1853
+ header?: never;
1854
+ path: {
1855
+ /**
1856
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1857
+ * which is why the key is what addresses the account.
1858
+ */
1859
+ accountKey: components["parameters"]["AccountKey"];
1860
+ /** @description The project to stop paying for */
1861
+ projectId: string;
1862
+ };
1863
+ cookie?: never;
1864
+ };
1865
+ requestBody?: never;
1866
+ responses: {
1867
+ /** @description Unbound */
1868
+ 204: {
1869
+ headers: {
1870
+ [name: string]: unknown;
1871
+ };
1872
+ content?: never;
1873
+ };
1874
+ /** @description Error */
1875
+ default: {
1876
+ headers: {
1877
+ [name: string]: unknown;
1878
+ };
1879
+ content: {
1880
+ "application/json": components["schemas"]["Error"];
1881
+ };
1882
+ };
1883
+ };
1884
+ };
1885
+ "list-orders": {
1886
+ parameters: {
1887
+ query?: never;
1888
+ header?: never;
1889
+ path: {
1890
+ /**
1891
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1892
+ * which is why the key is what addresses the account.
1893
+ */
1894
+ accountKey: components["parameters"]["AccountKey"];
1895
+ };
1896
+ cookie?: never;
1897
+ };
1898
+ requestBody?: never;
1899
+ responses: {
1900
+ /** @description OK */
1901
+ 200: {
1902
+ headers: {
1903
+ [name: string]: unknown;
1904
+ };
1905
+ content: {
1906
+ "application/json": components["schemas"]["OrderList"];
1907
+ };
1908
+ };
1909
+ /** @description Error */
1910
+ default: {
1911
+ headers: {
1912
+ [name: string]: unknown;
1913
+ };
1914
+ content: {
1915
+ "application/json": components["schemas"]["Error"];
1916
+ };
1917
+ };
1918
+ };
1919
+ };
1920
+ "get-order": {
1921
+ parameters: {
1922
+ query?: never;
1923
+ header?: never;
1924
+ path: {
1925
+ /**
1926
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1927
+ * which is why the key is what addresses the account.
1928
+ */
1929
+ accountKey: components["parameters"]["AccountKey"];
1930
+ orderId: string;
1931
+ };
1932
+ cookie?: never;
1933
+ };
1934
+ requestBody?: never;
1935
+ responses: {
1936
+ /** @description OK */
1937
+ 200: {
1938
+ headers: {
1939
+ [name: string]: unknown;
1940
+ };
1941
+ content: {
1942
+ "application/json": components["schemas"]["Order"];
1943
+ };
1944
+ };
1945
+ /** @description Error */
1946
+ default: {
1947
+ headers: {
1948
+ [name: string]: unknown;
1949
+ };
1950
+ content: {
1951
+ "application/json": components["schemas"]["Error"];
1952
+ };
1953
+ };
1954
+ };
1955
+ };
1956
+ "list-top-ups": {
1957
+ parameters: {
1958
+ query?: never;
1959
+ header?: never;
1960
+ path: {
1961
+ /**
1962
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1963
+ * which is why the key is what addresses the account.
1964
+ */
1965
+ accountKey: components["parameters"]["AccountKey"];
1966
+ };
1967
+ cookie?: never;
1968
+ };
1969
+ requestBody?: never;
1970
+ responses: {
1971
+ /** @description OK */
1972
+ 200: {
1973
+ headers: {
1974
+ [name: string]: unknown;
1975
+ };
1976
+ content: {
1977
+ "application/json": components["schemas"]["TopUpList"];
1978
+ };
1979
+ };
1980
+ /** @description Error */
1981
+ default: {
1982
+ headers: {
1983
+ [name: string]: unknown;
1984
+ };
1985
+ content: {
1986
+ "application/json": components["schemas"]["Error"];
1987
+ };
1988
+ };
1989
+ };
1990
+ };
1991
+ "start-top-up": {
1992
+ parameters: {
1993
+ query?: never;
1994
+ header?: never;
1995
+ path: {
1996
+ /**
1997
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1998
+ * which is why the key is what addresses the account.
1999
+ */
2000
+ accountKey: components["parameters"]["AccountKey"];
2001
+ };
2002
+ cookie?: never;
2003
+ };
2004
+ requestBody: {
2005
+ content: {
2006
+ "application/json": components["schemas"]["StartTopUpRequestBody"];
2007
+ };
2008
+ };
2009
+ responses: {
2010
+ /** @description OK */
2011
+ 200: {
2012
+ headers: {
2013
+ [name: string]: unknown;
2014
+ };
2015
+ content: {
2016
+ "application/json": components["schemas"]["TopUpSession"];
2017
+ };
2018
+ };
2019
+ /** @description Error */
2020
+ default: {
2021
+ headers: {
2022
+ [name: string]: unknown;
2023
+ };
2024
+ content: {
2025
+ "application/json": components["schemas"]["Error"];
2026
+ };
2027
+ };
2028
+ };
2029
+ };
2030
+ "list-charges": {
2031
+ parameters: {
2032
+ query?: {
2033
+ /** @description 1-based page number; the first page when omitted. */
2034
+ page?: number;
2035
+ /**
2036
+ * @description How many charges per page. Defaults to a full page.
2037
+ *
2038
+ * Charge count grows with resource count — an account running dozens of machines produces
2039
+ * hundreds of lines in a period, and a screen shows a dozen. Fetching all of them on every
2040
+ * visit carries data nothing displays.
2041
+ */
2042
+ page_size?: number;
2043
+ };
2044
+ header?: never;
2045
+ path: {
2046
+ /**
2047
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2048
+ * which is why the key is what addresses the account.
2049
+ */
2050
+ accountKey: components["parameters"]["AccountKey"];
2051
+ };
2052
+ cookie?: never;
2053
+ };
2054
+ requestBody?: never;
2055
+ responses: {
2056
+ /** @description OK */
2057
+ 200: {
2058
+ headers: {
2059
+ [name: string]: unknown;
2060
+ };
2061
+ content: {
2062
+ "application/json": components["schemas"]["ChargeList"];
2063
+ };
2064
+ };
2065
+ /** @description Error */
2066
+ default: {
2067
+ headers: {
2068
+ [name: string]: unknown;
2069
+ };
2070
+ content: {
2071
+ "application/json": components["schemas"]["Error"];
2072
+ };
2073
+ };
2074
+ };
2075
+ };
2076
+ "get-charge-usage": {
2077
+ parameters: {
2078
+ query?: never;
2079
+ header?: never;
2080
+ path: {
2081
+ /**
2082
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2083
+ * which is why the key is what addresses the account.
2084
+ */
2085
+ accountKey: components["parameters"]["AccountKey"];
2086
+ /** @description Which charge, from the charges list */
2087
+ chargeId: string;
2088
+ };
2089
+ cookie?: never;
2090
+ };
2091
+ requestBody?: never;
2092
+ responses: {
2093
+ /** @description OK */
2094
+ 200: {
2095
+ headers: {
2096
+ [name: string]: unknown;
2097
+ };
2098
+ content: {
2099
+ "application/json": components["schemas"]["ChargeUsage"];
2100
+ };
2101
+ };
2102
+ /** @description Error */
2103
+ default: {
2104
+ headers: {
2105
+ [name: string]: unknown;
2106
+ };
2107
+ content: {
2108
+ "application/json": components["schemas"]["Error"];
2109
+ };
2110
+ };
2111
+ };
2112
+ };
2113
+ "list-invoices": {
2114
+ parameters: {
2115
+ query?: never;
2116
+ header?: never;
2117
+ path: {
2118
+ /**
2119
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2120
+ * which is why the key is what addresses the account.
2121
+ */
2122
+ accountKey: components["parameters"]["AccountKey"];
2123
+ };
2124
+ cookie?: never;
2125
+ };
2126
+ requestBody?: never;
2127
+ responses: {
2128
+ /** @description OK */
2129
+ 200: {
2130
+ headers: {
2131
+ [name: string]: unknown;
2132
+ };
2133
+ content: {
2134
+ "application/json": components["schemas"]["InvoiceList"];
2135
+ };
2136
+ };
2137
+ /** @description Error */
2138
+ default: {
2139
+ headers: {
2140
+ [name: string]: unknown;
2141
+ };
2142
+ content: {
2143
+ "application/json": components["schemas"]["Error"];
2144
+ };
2145
+ };
2146
+ };
2147
+ };
2148
+ "get-invoice": {
2149
+ parameters: {
2150
+ query?: never;
2151
+ header?: never;
2152
+ path: {
2153
+ /**
2154
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2155
+ * which is why the key is what addresses the account.
2156
+ */
2157
+ accountKey: components["parameters"]["AccountKey"];
2158
+ invoiceId: string;
2159
+ };
2160
+ cookie?: never;
2161
+ };
2162
+ requestBody?: never;
2163
+ responses: {
2164
+ /** @description OK */
2165
+ 200: {
2166
+ headers: {
2167
+ [name: string]: unknown;
2168
+ };
2169
+ content: {
2170
+ "application/json": components["schemas"]["InvoiceDetail"];
2171
+ };
2172
+ };
2173
+ /** @description Error */
2174
+ default: {
2175
+ headers: {
2176
+ [name: string]: unknown;
2177
+ };
2178
+ content: {
2179
+ "application/json": components["schemas"]["Error"];
2180
+ };
2181
+ };
2182
+ };
2183
+ };
2184
+ "read-project-billing-account": {
2185
+ parameters: {
2186
+ query?: never;
2187
+ header?: never;
2188
+ path: {
2189
+ /** @description The project being worked in */
2190
+ projectId: string;
2191
+ };
2192
+ cookie?: never;
2193
+ };
2194
+ requestBody?: never;
2195
+ responses: {
2196
+ /** @description OK */
2197
+ 200: {
2198
+ headers: {
2199
+ [name: string]: unknown;
2200
+ };
2201
+ content: {
2202
+ "application/json": components["schemas"]["ProjectBillingAccount"];
2203
+ };
2204
+ };
2205
+ /** @description Error */
2206
+ default: {
2207
+ headers: {
2208
+ [name: string]: unknown;
2209
+ };
2210
+ content: {
2211
+ "application/json": components["schemas"]["Error"];
2212
+ };
2213
+ };
2214
+ };
2215
+ };
2216
+ "quote-project-usage": {
2217
+ parameters: {
2218
+ query?: never;
2219
+ header?: never;
2220
+ path: {
2221
+ projectId: string;
2222
+ };
2223
+ cookie?: never;
2224
+ };
2225
+ requestBody: {
2226
+ content: {
2227
+ "application/json": components["schemas"]["QuoteRequest"];
2228
+ };
2229
+ };
2230
+ responses: {
2231
+ /** @description OK */
2232
+ 200: {
2233
+ headers: {
2234
+ [name: string]: unknown;
2235
+ };
2236
+ content: {
2237
+ "application/json": components["schemas"]["Quote"];
2238
+ };
2239
+ };
2240
+ /** @description Error */
2241
+ default: {
2242
+ headers: {
2243
+ [name: string]: unknown;
2244
+ };
2245
+ content: {
2246
+ "application/json": components["schemas"]["Error"];
2247
+ };
2248
+ };
2249
+ };
2250
+ };
2251
+ "quote-usage": {
2252
+ parameters: {
2253
+ query?: never;
2254
+ header?: never;
2255
+ path: {
2256
+ /**
2257
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2258
+ * which is why the key is what addresses the account.
2259
+ */
2260
+ accountKey: components["parameters"]["AccountKey"];
2261
+ };
2262
+ cookie?: never;
2263
+ };
2264
+ requestBody: {
2265
+ content: {
2266
+ "application/json": components["schemas"]["QuoteRequest"];
2267
+ };
2268
+ };
2269
+ responses: {
2270
+ /** @description OK */
2271
+ 200: {
2272
+ headers: {
2273
+ [name: string]: unknown;
2274
+ };
2275
+ content: {
2276
+ "application/json": components["schemas"]["Quote"];
2277
+ };
2278
+ };
2279
+ /** @description Error */
2280
+ default: {
2281
+ headers: {
2282
+ [name: string]: unknown;
2283
+ };
2284
+ content: {
2285
+ "application/json": components["schemas"]["Error"];
2286
+ };
2287
+ };
2288
+ };
2289
+ };
2290
+ "read-subscription": {
2291
+ parameters: {
2292
+ query?: never;
2293
+ header?: never;
2294
+ path: {
2295
+ /**
2296
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2297
+ * which is why the key is what addresses the account.
2298
+ */
2299
+ accountKey: components["parameters"]["AccountKey"];
2300
+ };
2301
+ cookie?: never;
2302
+ };
2303
+ requestBody?: never;
2304
+ responses: {
2305
+ /** @description OK */
2306
+ 200: {
2307
+ headers: {
2308
+ [name: string]: unknown;
2309
+ };
2310
+ content: {
2311
+ "application/json": components["schemas"]["Subscription"];
2312
+ };
2313
+ };
2314
+ /** @description Error */
2315
+ default: {
2316
+ headers: {
2317
+ [name: string]: unknown;
2318
+ };
2319
+ content: {
2320
+ "application/json": components["schemas"]["Error"];
2321
+ };
2322
+ };
2323
+ };
2324
+ };
2325
+ "cancel-subscription": {
2326
+ parameters: {
2327
+ query: {
2328
+ /** @description When it takes effect */
2329
+ timing: "immediate" | "next_billing_cycle";
2330
+ };
2331
+ header?: never;
2332
+ path: {
2333
+ /**
2334
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2335
+ * which is why the key is what addresses the account.
2336
+ */
2337
+ accountKey: components["parameters"]["AccountKey"];
2338
+ };
2339
+ cookie?: never;
2340
+ };
2341
+ requestBody?: never;
2342
+ responses: {
2343
+ /** @description OK */
2344
+ 200: {
2345
+ headers: {
2346
+ [name: string]: unknown;
2347
+ };
2348
+ content: {
2349
+ "application/json": components["schemas"]["Subscription"];
2350
+ };
2351
+ };
2352
+ /** @description Error */
2353
+ default: {
2354
+ headers: {
2355
+ [name: string]: unknown;
2356
+ };
2357
+ content: {
2358
+ "application/json": components["schemas"]["Error"];
2359
+ };
2360
+ };
2361
+ };
2362
+ };
2363
+ "read-top-up": {
2364
+ parameters: {
2365
+ query?: never;
2366
+ header?: never;
2367
+ path: {
2368
+ /**
2369
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2370
+ * which is why the key is what addresses the account.
2371
+ */
2372
+ accountKey: components["parameters"]["AccountKey"];
2373
+ /** @description The payment id returned when the top-up was started */
2374
+ paymentId: string;
2375
+ };
2376
+ cookie?: never;
2377
+ };
2378
+ requestBody?: never;
2379
+ responses: {
2380
+ /** @description OK */
2381
+ 200: {
2382
+ headers: {
2383
+ [name: string]: unknown;
2384
+ };
2385
+ content: {
2386
+ "application/json": components["schemas"]["TopUpStatus"];
2387
+ };
2388
+ };
2389
+ /** @description Error */
2390
+ default: {
2391
+ headers: {
2392
+ [name: string]: unknown;
2393
+ };
2394
+ content: {
2395
+ "application/json": components["schemas"]["Error"];
2396
+ };
2397
+ };
2398
+ };
2399
+ };
2400
+ "list-payment-methods": {
2401
+ parameters: {
2402
+ query?: never;
2403
+ header?: never;
2404
+ path: {
2405
+ /**
2406
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2407
+ * which is why the key is what addresses the account.
2408
+ */
2409
+ accountKey: components["parameters"]["AccountKey"];
2410
+ };
2411
+ cookie?: never;
2412
+ };
2413
+ requestBody?: never;
2414
+ responses: {
2415
+ /** @description OK */
2416
+ 200: {
2417
+ headers: {
2418
+ [name: string]: unknown;
2419
+ };
2420
+ content: {
2421
+ "application/json": components["schemas"]["PaymentMethodList"];
2422
+ };
2423
+ };
2424
+ /** @description Error */
2425
+ default: {
2426
+ headers: {
2427
+ [name: string]: unknown;
2428
+ };
2429
+ content: {
2430
+ "application/json": components["schemas"]["Error"];
2431
+ };
2432
+ };
2433
+ };
2434
+ };
2435
+ "start-payment-method-setup": {
2436
+ parameters: {
2437
+ query?: never;
2438
+ header?: never;
2439
+ path: {
2440
+ /**
2441
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2442
+ * which is why the key is what addresses the account.
2443
+ */
2444
+ accountKey: components["parameters"]["AccountKey"];
2445
+ };
2446
+ cookie?: never;
2447
+ };
2448
+ requestBody?: never;
2449
+ responses: {
2450
+ /** @description OK */
2451
+ 200: {
2452
+ headers: {
2453
+ [name: string]: unknown;
2454
+ };
2455
+ content: {
2456
+ "application/json": components["schemas"]["PaymentMethodSetupSession"];
2457
+ };
2458
+ };
2459
+ /** @description Error */
2460
+ default: {
2461
+ headers: {
2462
+ [name: string]: unknown;
2463
+ };
2464
+ content: {
2465
+ "application/json": components["schemas"]["Error"];
2466
+ };
2467
+ };
2468
+ };
2469
+ };
2470
+ "remove-payment-method": {
2471
+ parameters: {
2472
+ query?: never;
2473
+ header?: never;
2474
+ path: {
2475
+ /**
2476
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2477
+ * which is why the key is what addresses the account.
2478
+ */
2479
+ accountKey: components["parameters"]["AccountKey"];
2480
+ paymentMethodId: string;
2481
+ };
2482
+ cookie?: never;
2483
+ };
2484
+ requestBody?: never;
2485
+ responses: {
2486
+ /** @description Removed */
2487
+ 204: {
2488
+ headers: {
2489
+ [name: string]: unknown;
2490
+ };
2491
+ content?: never;
2492
+ };
2493
+ /** @description Error */
2494
+ default: {
2495
+ headers: {
2496
+ [name: string]: unknown;
2497
+ };
2498
+ content: {
2499
+ "application/json": components["schemas"]["Error"];
2500
+ };
2501
+ };
2502
+ };
2503
+ };
2504
+ "set-default-payment-method": {
2505
+ parameters: {
2506
+ query?: never;
2507
+ header?: never;
2508
+ path: {
2509
+ /**
2510
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2511
+ * which is why the key is what addresses the account.
2512
+ */
2513
+ accountKey: components["parameters"]["AccountKey"];
2514
+ paymentMethodId: string;
2515
+ };
2516
+ cookie?: never;
2517
+ };
2518
+ requestBody?: never;
2519
+ responses: {
2520
+ /** @description Updated */
2521
+ 204: {
2522
+ headers: {
2523
+ [name: string]: unknown;
2524
+ };
2525
+ content?: never;
2526
+ };
2527
+ /** @description Error */
2528
+ default: {
2529
+ headers: {
2530
+ [name: string]: unknown;
2531
+ };
2532
+ content: {
2533
+ "application/json": components["schemas"]["Error"];
2534
+ };
2535
+ };
2536
+ };
2537
+ };
2538
+ "list-offers": {
2539
+ parameters: {
2540
+ query?: never;
2541
+ header?: never;
2542
+ path: {
2543
+ /**
2544
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2545
+ * which is why the key is what addresses the account.
2546
+ */
2547
+ accountKey: components["parameters"]["AccountKey"];
2548
+ };
2549
+ cookie?: never;
2550
+ };
2551
+ requestBody?: never;
2552
+ responses: {
2553
+ /** @description OK */
2554
+ 200: {
2555
+ headers: {
2556
+ [name: string]: unknown;
2557
+ };
2558
+ content: {
2559
+ "application/json": components["schemas"]["OfferList"];
2560
+ };
2561
+ };
2562
+ /** @description Error */
2563
+ default: {
2564
+ headers: {
2565
+ [name: string]: unknown;
2566
+ };
2567
+ content: {
2568
+ "application/json": components["schemas"]["Error"];
2569
+ };
2570
+ };
2571
+ };
2572
+ };
2573
+ "purchase-offer": {
2574
+ parameters: {
2575
+ query?: {
2576
+ /** @description When the switch takes effect. Required if the account already has a plan, ignored otherwise */
2577
+ timing?: components["schemas"]["PlanChangeTiming"];
2578
+ };
2579
+ header?: never;
2580
+ path: {
2581
+ /**
2582
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2583
+ * which is why the key is what addresses the account.
2584
+ */
2585
+ accountKey: components["parameters"]["AccountKey"];
2586
+ /** @description Which offer */
2587
+ offerKey: string;
2588
+ };
2589
+ cookie?: never;
2590
+ };
2591
+ requestBody?: never;
2592
+ responses: {
2593
+ /** @description OK */
2594
+ 200: {
2595
+ headers: {
2596
+ [name: string]: unknown;
2597
+ };
2598
+ content: {
2599
+ "application/json": components["schemas"]["Purchase"];
2600
+ };
2601
+ };
2602
+ /** @description Error */
2603
+ default: {
2604
+ headers: {
2605
+ [name: string]: unknown;
2606
+ };
2607
+ content: {
2608
+ "application/json": components["schemas"]["Error"];
2609
+ };
2610
+ };
2611
+ };
2612
+ };
2613
+ "list-prepaid-assets": {
2614
+ parameters: {
2615
+ query?: never;
2616
+ header?: never;
2617
+ path: {
2618
+ /**
2619
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2620
+ * which is why the key is what addresses the account.
2621
+ */
2622
+ accountKey: components["parameters"]["AccountKey"];
2623
+ };
2624
+ cookie?: never;
2625
+ };
2626
+ requestBody?: never;
2627
+ responses: {
2628
+ /** @description OK */
2629
+ 200: {
2630
+ headers: {
2631
+ [name: string]: unknown;
2632
+ };
2633
+ content: {
2634
+ "application/json": components["schemas"]["PrepaidAssetList"];
2635
+ };
2636
+ };
2637
+ /** @description Error */
2638
+ default: {
2639
+ headers: {
2640
+ [name: string]: unknown;
2641
+ };
2642
+ content: {
2643
+ "application/json": components["schemas"]["Error"];
2644
+ };
2645
+ };
2646
+ };
2647
+ };
2648
+ }