@leaflow/sdk 0.126.0 → 0.127.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/billing/type/order/v1/generated/models.d.ts +26 -1
  2. package/dist/billing/type/order/v1/generated/validators/accountBalance.zod.js +1 -1
  3. package/dist/billing/type/order/v1/generated/validators/monthlyStatement.zod.d.ts +36 -0
  4. package/dist/billing/type/order/v1/generated/validators/monthlyStatement.zod.js +30 -0
  5. package/dist/billing/type/order/v1/generated/validators/monthlyStatementList.zod.d.ts +43 -0
  6. package/dist/billing/type/order/v1/generated/validators/monthlyStatementList.zod.js +14 -0
  7. package/dist/billing/v1/generated/functions.d.ts +32 -6
  8. package/dist/billing/v1/generated/functions.js +35 -5
  9. package/dist/billing/v1/generated/models.d.ts +49 -1
  10. package/dist/billing/v1/generated/schemas.zod.d.ts +25 -5
  11. package/dist/billing/v1/generated/schemas.zod.js +35 -5
  12. package/dist/billing/v1/generated/validators/accountBalance.zod.js +1 -1
  13. package/dist/billing/v1/generated/validators/listMonthlyStatementsParams.zod.d.ts +21 -0
  14. package/dist/billing/v1/generated/validators/listMonthlyStatementsParams.zod.js +27 -0
  15. package/dist/billing/v1/generated/validators/monthlyStatement.zod.d.ts +36 -0
  16. package/dist/billing/v1/generated/validators/monthlyStatement.zod.js +30 -0
  17. package/dist/billing/v1/generated/validators/monthlyStatementList.zod.d.ts +43 -0
  18. package/dist/billing/v1/generated/validators/monthlyStatementList.zod.js +14 -0
  19. package/dist/canopy/v1/generated/models.d.ts +26 -1
  20. package/dist/canopy/v1/generated/validators/accountBalance.zod.js +1 -1
  21. package/dist/canopy/v1/generated/validators/monthlyStatement.zod.d.ts +59 -0
  22. package/dist/canopy/v1/generated/validators/monthlyStatement.zod.js +53 -0
  23. package/dist/canopy/v1/generated/validators/monthlyStatementList.zod.d.ts +66 -0
  24. package/dist/canopy/v1/generated/validators/monthlyStatementList.zod.js +37 -0
  25. package/dist/compute/v1/generated/models.d.ts +26 -1
  26. package/dist/compute/v1/generated/validators/accountBalance.zod.js +1 -1
  27. package/dist/compute/v1/generated/validators/monthlyStatement.zod.d.ts +52 -0
  28. package/dist/compute/v1/generated/validators/monthlyStatement.zod.js +46 -0
  29. package/dist/compute/v1/generated/validators/monthlyStatementList.zod.d.ts +59 -0
  30. package/dist/compute/v1/generated/validators/monthlyStatementList.zod.js +30 -0
  31. package/dist/membership/v1/generated/models.d.ts +26 -1
  32. package/dist/membership/v1/generated/validators/accountBalance.zod.js +1 -1
  33. package/dist/membership/v1/generated/validators/monthlyStatement.zod.d.ts +36 -0
  34. package/dist/membership/v1/generated/validators/monthlyStatement.zod.js +30 -0
  35. package/dist/membership/v1/generated/validators/monthlyStatementList.zod.d.ts +43 -0
  36. package/dist/membership/v1/generated/validators/monthlyStatementList.zod.js +14 -0
  37. package/dist/routes.d.ts +8 -0
  38. package/dist/routes.js +9 -0
  39. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ import { Money } from "./money.zod.js";
10
+ import { StatementAmounts } from "./statementAmounts.zod.js";
11
+ export const MonthlyStatement = zod
12
+ .strictObject({
13
+ billing_account_id: zod.int(),
14
+ currency: zod.string(),
15
+ period_start: zod.iso.datetime({ offset: true }),
16
+ period_end: zod.iso.datetime({ offset: true }),
17
+ finalized: zod
18
+ .boolean()
19
+ .describe("True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here."),
20
+ finalized_at: zod.iso.datetime({ offset: true }).optional(),
21
+ statement_count: zod.int().describe("Statements of the period, including the open one."),
22
+ billed: StatementAmounts,
23
+ credited_amount: Money,
24
+ unbilled: StatementAmounts.optional(),
25
+ credit_applied: Money,
26
+ amount_paid: Money,
27
+ amount_due: Money,
28
+ amount_refunded: Money,
29
+ })
30
+ .describe("One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.");
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const MonthlyStatementList: zod.ZodObject<{
10
+ items: zod.ZodArray<zod.ZodObject<{
11
+ billing_account_id: zod.ZodInt;
12
+ currency: zod.ZodString;
13
+ period_start: zod.z.ZodISODateTime;
14
+ period_end: zod.z.ZodISODateTime;
15
+ finalized: zod.ZodBoolean;
16
+ finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
17
+ statement_count: zod.ZodInt;
18
+ billed: zod.ZodObject<{
19
+ subtotal: zod.ZodString;
20
+ discount_amount: zod.ZodString;
21
+ tax_amount: zod.ZodString;
22
+ total: zod.ZodString;
23
+ }, zod.z.core.$strict>;
24
+ credited_amount: zod.ZodString;
25
+ unbilled: zod.ZodOptional<zod.ZodObject<{
26
+ subtotal: zod.ZodString;
27
+ discount_amount: zod.ZodString;
28
+ tax_amount: zod.ZodString;
29
+ total: zod.ZodString;
30
+ }, zod.z.core.$strict>>;
31
+ credit_applied: zod.ZodString;
32
+ amount_paid: zod.ZodString;
33
+ amount_due: zod.ZodString;
34
+ amount_refunded: zod.ZodString;
35
+ }, zod.z.core.$strict>>;
36
+ pagination: zod.ZodObject<{
37
+ page: zod.ZodInt;
38
+ page_size: zod.ZodInt;
39
+ total_count: zod.ZodOptional<zod.ZodInt>;
40
+ }, zod.z.core.$strict>;
41
+ }, zod.z.core.$strict>;
42
+ export type MonthlyStatementList = zod.input<typeof MonthlyStatementList>;
43
+ export type MonthlyStatementListOutput = zod.output<typeof MonthlyStatementList>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ import { MonthlyStatement } from "./monthlyStatement.zod.js";
10
+ import { OffsetPagination } from "./offsetPagination.zod.js";
11
+ export const MonthlyStatementList = zod.strictObject({
12
+ items: zod.array(MonthlyStatement),
13
+ pagination: OffsetPagination,
14
+ });
@@ -1359,7 +1359,7 @@ export interface AccountBalance {
1359
1359
  * spendable balance and may differ from the recorded credits total.
1360
1360
  */
1361
1361
  credit_groups: CreditGroup[];
1362
- /** Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
1362
+ /** Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
1363
1363
  due: Money;
1364
1364
  pending_returns_amount: Money;
1365
1365
  }
@@ -3342,6 +3342,31 @@ export interface StatementAmounts {
3342
3342
  tax_amount: Money;
3343
3343
  total: Money;
3344
3344
  }
3345
+ /**
3346
+ * One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.
3347
+ */
3348
+ export interface MonthlyStatement {
3349
+ billing_account_id: number;
3350
+ currency: string;
3351
+ period_start: string;
3352
+ period_end: string;
3353
+ /** True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here. */
3354
+ finalized: boolean;
3355
+ finalized_at?: string;
3356
+ /** Statements of the period, including the open one. */
3357
+ statement_count: number;
3358
+ billed: StatementAmounts;
3359
+ credited_amount: Money;
3360
+ unbilled?: StatementAmounts;
3361
+ credit_applied: Money;
3362
+ amount_paid: Money;
3363
+ amount_due: Money;
3364
+ amount_refunded: Money;
3365
+ }
3366
+ export interface MonthlyStatementList {
3367
+ items: MonthlyStatement[];
3368
+ pagination: OffsetPagination;
3369
+ }
3345
3370
  export type StatementStatus = (typeof StatementStatus)[keyof typeof StatementStatus];
3346
3371
  export declare const StatementStatus: {
3347
3372
  readonly open: "open";
@@ -44,7 +44,7 @@ export const AccountBalance = zod
44
44
  credit_groups: zod
45
45
  .array(CreditGroup)
46
46
  .describe("Currently valid, unspent credit grouped by permitted use. Restrictions and\nvalidity dates determine which charges a group can cover, so these groups are not a general\nspendable balance and may differ from the recorded credits total."),
47
- due: Money.describe("Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
47
+ due: Money.describe("Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
48
48
  pending_returns_amount: Money,
49
49
  })
50
50
  .describe("Account balance, credits, and unpaid charges are reported separately.");
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ export declare const MonthlyStatement: zod.ZodObject<{
33
+ billing_account_id: zod.ZodInt;
34
+ currency: zod.ZodString;
35
+ period_start: zod.z.ZodISODateTime;
36
+ period_end: zod.z.ZodISODateTime;
37
+ finalized: zod.ZodBoolean;
38
+ finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
39
+ statement_count: zod.ZodInt;
40
+ billed: zod.ZodObject<{
41
+ subtotal: zod.ZodString;
42
+ discount_amount: zod.ZodString;
43
+ tax_amount: zod.ZodString;
44
+ total: zod.ZodString;
45
+ }, zod.z.core.$strict>;
46
+ credited_amount: zod.ZodString;
47
+ unbilled: zod.ZodOptional<zod.ZodObject<{
48
+ subtotal: zod.ZodString;
49
+ discount_amount: zod.ZodString;
50
+ tax_amount: zod.ZodString;
51
+ total: zod.ZodString;
52
+ }, zod.z.core.$strict>>;
53
+ credit_applied: zod.ZodString;
54
+ amount_paid: zod.ZodString;
55
+ amount_due: zod.ZodString;
56
+ amount_refunded: zod.ZodString;
57
+ }, zod.z.core.$strict>;
58
+ export type MonthlyStatement = zod.input<typeof MonthlyStatement>;
59
+ export type MonthlyStatementOutput = zod.output<typeof MonthlyStatement>;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ import { Money } from "./money.zod.js";
33
+ import { StatementAmounts } from "./statementAmounts.zod.js";
34
+ export const MonthlyStatement = zod
35
+ .strictObject({
36
+ billing_account_id: zod.int(),
37
+ currency: zod.string(),
38
+ period_start: zod.iso.datetime({ offset: true }),
39
+ period_end: zod.iso.datetime({ offset: true }),
40
+ finalized: zod
41
+ .boolean()
42
+ .describe("True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here."),
43
+ finalized_at: zod.iso.datetime({ offset: true }).optional(),
44
+ statement_count: zod.int().describe("Statements of the period, including the open one."),
45
+ billed: StatementAmounts,
46
+ credited_amount: Money,
47
+ unbilled: StatementAmounts.optional(),
48
+ credit_applied: Money,
49
+ amount_paid: Money,
50
+ amount_due: Money,
51
+ amount_refunded: Money,
52
+ })
53
+ .describe("One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.");
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ export declare const MonthlyStatementList: zod.ZodObject<{
33
+ items: zod.ZodArray<zod.ZodObject<{
34
+ billing_account_id: zod.ZodInt;
35
+ currency: zod.ZodString;
36
+ period_start: zod.z.ZodISODateTime;
37
+ period_end: zod.z.ZodISODateTime;
38
+ finalized: zod.ZodBoolean;
39
+ finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
40
+ statement_count: zod.ZodInt;
41
+ billed: zod.ZodObject<{
42
+ subtotal: zod.ZodString;
43
+ discount_amount: zod.ZodString;
44
+ tax_amount: zod.ZodString;
45
+ total: zod.ZodString;
46
+ }, zod.z.core.$strict>;
47
+ credited_amount: zod.ZodString;
48
+ unbilled: zod.ZodOptional<zod.ZodObject<{
49
+ subtotal: zod.ZodString;
50
+ discount_amount: zod.ZodString;
51
+ tax_amount: zod.ZodString;
52
+ total: zod.ZodString;
53
+ }, zod.z.core.$strict>>;
54
+ credit_applied: zod.ZodString;
55
+ amount_paid: zod.ZodString;
56
+ amount_due: zod.ZodString;
57
+ amount_refunded: zod.ZodString;
58
+ }, zod.z.core.$strict>>;
59
+ pagination: zod.ZodObject<{
60
+ page: zod.ZodInt;
61
+ page_size: zod.ZodInt;
62
+ total_count: zod.ZodOptional<zod.ZodInt>;
63
+ }, zod.z.core.$strict>;
64
+ }, zod.z.core.$strict>;
65
+ export type MonthlyStatementList = zod.input<typeof MonthlyStatementList>;
66
+ export type MonthlyStatementListOutput = zod.output<typeof MonthlyStatementList>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ import { MonthlyStatement } from "./monthlyStatement.zod.js";
33
+ import { OffsetPagination } from "./offsetPagination.zod.js";
34
+ export const MonthlyStatementList = zod.strictObject({
35
+ items: zod.array(MonthlyStatement),
36
+ pagination: OffsetPagination,
37
+ });
@@ -3305,7 +3305,7 @@ export interface AccountBalance {
3305
3305
  * spendable balance and may differ from the recorded credits total.
3306
3306
  */
3307
3307
  credit_groups: CreditGroup[];
3308
- /** Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
3308
+ /** Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
3309
3309
  due: Money;
3310
3310
  pending_returns_amount: Money;
3311
3311
  }
@@ -5288,6 +5288,31 @@ export interface StatementAmounts {
5288
5288
  tax_amount: Money;
5289
5289
  total: Money;
5290
5290
  }
5291
+ /**
5292
+ * One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.
5293
+ */
5294
+ export interface MonthlyStatement {
5295
+ billing_account_id: number;
5296
+ currency: string;
5297
+ period_start: string;
5298
+ period_end: string;
5299
+ /** True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here. */
5300
+ finalized: boolean;
5301
+ finalized_at?: string;
5302
+ /** Statements of the period, including the open one. */
5303
+ statement_count: number;
5304
+ billed: StatementAmounts;
5305
+ credited_amount: Money;
5306
+ unbilled?: StatementAmounts;
5307
+ credit_applied: Money;
5308
+ amount_paid: Money;
5309
+ amount_due: Money;
5310
+ amount_refunded: Money;
5311
+ }
5312
+ export interface MonthlyStatementList {
5313
+ items: MonthlyStatement[];
5314
+ pagination: OffsetPagination;
5315
+ }
5291
5316
  export type StatementStatus = (typeof StatementStatus)[keyof typeof StatementStatus];
5292
5317
  export declare const StatementStatus: {
5293
5318
  readonly open: "open";
@@ -37,7 +37,7 @@ export const AccountBalance = zod
37
37
  credit_groups: zod
38
38
  .array(CreditGroup)
39
39
  .describe("Currently valid, unspent credit grouped by permitted use. Restrictions and\nvalidity dates determine which charges a group can cover, so these groups are not a general\nspendable balance and may differ from the recorded credits total."),
40
- due: Money.describe("Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
40
+ due: Money.describe("Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
41
41
  pending_returns_amount: Money,
42
42
  })
43
43
  .describe("Account balance, credits, and unpaid charges are reported separately.");
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Compute API
5
+ * Leaflow Compute user API for managing instances, disks, snapshots, backups, images, private networks, subnets, routes, security groups, network interfaces and floating IPs.
6
+ *
7
+ * ## Authentication
8
+ *
9
+ * Every request carries a scoped token; see the `scopedTokenAuth` security scheme.
10
+ *
11
+ * ## Conventions
12
+ *
13
+ * - **Purchases.** A purchase that creates resources returns them together with a PlacedOrder. They are readable at once and start as `pending`: the order has not been accepted, nothing exists in the cloud, no inventory such as an address is held, and fields known only after allocation, such as addresses, are null. Once Billing accepts the order, a resource becomes `provisioning` and then reaches its usual status, such as `active` or `available`. When the order is declined, canceled or expires, or creation fails, the resource ends `failed` and `failure_reason` states why; the charge for a resource that failed after acceptance is refunded. Read the order in Billing for checkout and payment progress.
14
+ * - **Pricing.** Catalog items, such as instance types, disk types and public IP pools, carry `pricing`: the prepaid and postpaid options Billing offers for them, in the currency of the project's current billing account, or null when the project has no billing account. They are list amounts before promotion codes, not a checkout guarantee. A purchase chooses one option with `billing`, which applies to all of its components. Every purchase and change has a quote operation beside it, at the same path followed by `/quote`, which returns what checkout would collect without ordering anything.
15
+ * - **Checkout.** Omit `checkout` for automatic checkout, which pays from eligible credit grants and balance when the order is placed; insufficient funds refuse the request with HTTP 422 `BILLING_INSUFFICIENT_FUNDS`, and nothing is created. With `checkout.mode` set to `deferred`, the resources are returned `pending` and nothing is created until checkout is confirmed and paid through Billing. An order whose total is zero, such as a postpaid purchase with nothing due now, completes checkout at placement in either mode and proceeds to provisioning.
16
+ * - **Operations.** Requests such as starting, stopping, attaching or deleting return HTTP 202 with the resource as it is when the request is accepted. While an operation runs, the resource's `operation` field names it; the field is null once the operation has finished, and the resource then shows the result. A resource with an operation in progress refuses another operation with HTTP 409 `COMPUTE_RESOURCE_BUSY`; an operation involving two resources, such as attaching a disk, is refused when either has one. A purchased change, such as a resize, is an operation from the moment its order is placed until it is applied or its order is canceled, including while it awaits checkout. Renaming and replacing labels or notes are not operations and are accepted at any time.
17
+ * - **Billing relationships.** A purchased resource records its `order_id`, `order_item_id` and `subscription_id`. The subscription is `pending` until the order is accepted, `provisioning` while the resource is created, and `active` once it is delivered. Bandwidth is a property of its floating IP, not a separate resource. Snapshots use a purchased per-region count quota, and backups are metered on the region's backup service; neither has an order or subscription of its own.
18
+ * - **Availability zones.** A disk and an instance must reside in the same availability zone to be attached. Instance types and disk types are each bound to one availability zone, so choosing a type determines the zone.
19
+ * - **IPv6 is not sold separately.** Once enabled on a private network, IPv6 addresses are assigned to the instances in that network automatically; they can be neither requested nor released individually.
20
+ * - **Floating IPs have a cooldown period.** A released address is neither available for re-allocation nor handed to another user for some time, so that DNS records and allow-lists still pointing at it do not break immediately.
21
+ * - **Passwords are returned once.** A password generated by the platform during creation or rebuild appears only in that response. Store it immediately.
22
+ * OpenAPI spec version: 1.0.0
23
+ */
24
+ import * as zod from "zod";
25
+ export declare const MonthlyStatement: zod.ZodObject<{
26
+ billing_account_id: zod.ZodInt;
27
+ currency: zod.ZodString;
28
+ period_start: zod.z.ZodISODateTime;
29
+ period_end: zod.z.ZodISODateTime;
30
+ finalized: zod.ZodBoolean;
31
+ finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
32
+ statement_count: zod.ZodInt;
33
+ billed: zod.ZodObject<{
34
+ subtotal: zod.ZodString;
35
+ discount_amount: zod.ZodString;
36
+ tax_amount: zod.ZodString;
37
+ total: zod.ZodString;
38
+ }, zod.z.core.$strict>;
39
+ credited_amount: zod.ZodString;
40
+ unbilled: zod.ZodOptional<zod.ZodObject<{
41
+ subtotal: zod.ZodString;
42
+ discount_amount: zod.ZodString;
43
+ tax_amount: zod.ZodString;
44
+ total: zod.ZodString;
45
+ }, zod.z.core.$strict>>;
46
+ credit_applied: zod.ZodString;
47
+ amount_paid: zod.ZodString;
48
+ amount_due: zod.ZodString;
49
+ amount_refunded: zod.ZodString;
50
+ }, zod.z.core.$strict>;
51
+ export type MonthlyStatement = zod.input<typeof MonthlyStatement>;
52
+ export type MonthlyStatementOutput = zod.output<typeof MonthlyStatement>;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Compute API
5
+ * Leaflow Compute user API for managing instances, disks, snapshots, backups, images, private networks, subnets, routes, security groups, network interfaces and floating IPs.
6
+ *
7
+ * ## Authentication
8
+ *
9
+ * Every request carries a scoped token; see the `scopedTokenAuth` security scheme.
10
+ *
11
+ * ## Conventions
12
+ *
13
+ * - **Purchases.** A purchase that creates resources returns them together with a PlacedOrder. They are readable at once and start as `pending`: the order has not been accepted, nothing exists in the cloud, no inventory such as an address is held, and fields known only after allocation, such as addresses, are null. Once Billing accepts the order, a resource becomes `provisioning` and then reaches its usual status, such as `active` or `available`. When the order is declined, canceled or expires, or creation fails, the resource ends `failed` and `failure_reason` states why; the charge for a resource that failed after acceptance is refunded. Read the order in Billing for checkout and payment progress.
14
+ * - **Pricing.** Catalog items, such as instance types, disk types and public IP pools, carry `pricing`: the prepaid and postpaid options Billing offers for them, in the currency of the project's current billing account, or null when the project has no billing account. They are list amounts before promotion codes, not a checkout guarantee. A purchase chooses one option with `billing`, which applies to all of its components. Every purchase and change has a quote operation beside it, at the same path followed by `/quote`, which returns what checkout would collect without ordering anything.
15
+ * - **Checkout.** Omit `checkout` for automatic checkout, which pays from eligible credit grants and balance when the order is placed; insufficient funds refuse the request with HTTP 422 `BILLING_INSUFFICIENT_FUNDS`, and nothing is created. With `checkout.mode` set to `deferred`, the resources are returned `pending` and nothing is created until checkout is confirmed and paid through Billing. An order whose total is zero, such as a postpaid purchase with nothing due now, completes checkout at placement in either mode and proceeds to provisioning.
16
+ * - **Operations.** Requests such as starting, stopping, attaching or deleting return HTTP 202 with the resource as it is when the request is accepted. While an operation runs, the resource's `operation` field names it; the field is null once the operation has finished, and the resource then shows the result. A resource with an operation in progress refuses another operation with HTTP 409 `COMPUTE_RESOURCE_BUSY`; an operation involving two resources, such as attaching a disk, is refused when either has one. A purchased change, such as a resize, is an operation from the moment its order is placed until it is applied or its order is canceled, including while it awaits checkout. Renaming and replacing labels or notes are not operations and are accepted at any time.
17
+ * - **Billing relationships.** A purchased resource records its `order_id`, `order_item_id` and `subscription_id`. The subscription is `pending` until the order is accepted, `provisioning` while the resource is created, and `active` once it is delivered. Bandwidth is a property of its floating IP, not a separate resource. Snapshots use a purchased per-region count quota, and backups are metered on the region's backup service; neither has an order or subscription of its own.
18
+ * - **Availability zones.** A disk and an instance must reside in the same availability zone to be attached. Instance types and disk types are each bound to one availability zone, so choosing a type determines the zone.
19
+ * - **IPv6 is not sold separately.** Once enabled on a private network, IPv6 addresses are assigned to the instances in that network automatically; they can be neither requested nor released individually.
20
+ * - **Floating IPs have a cooldown period.** A released address is neither available for re-allocation nor handed to another user for some time, so that DNS records and allow-lists still pointing at it do not break immediately.
21
+ * - **Passwords are returned once.** A password generated by the platform during creation or rebuild appears only in that response. Store it immediately.
22
+ * OpenAPI spec version: 1.0.0
23
+ */
24
+ import * as zod from "zod";
25
+ import { Money } from "./money.zod.js";
26
+ import { StatementAmounts } from "./statementAmounts.zod.js";
27
+ export const MonthlyStatement = zod
28
+ .strictObject({
29
+ billing_account_id: zod.int(),
30
+ currency: zod.string(),
31
+ period_start: zod.iso.datetime({ offset: true }),
32
+ period_end: zod.iso.datetime({ offset: true }),
33
+ finalized: zod
34
+ .boolean()
35
+ .describe("True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here."),
36
+ finalized_at: zod.iso.datetime({ offset: true }).optional(),
37
+ statement_count: zod.int().describe("Statements of the period, including the open one."),
38
+ billed: StatementAmounts,
39
+ credited_amount: Money,
40
+ unbilled: StatementAmounts.optional(),
41
+ credit_applied: Money,
42
+ amount_paid: Money,
43
+ amount_due: Money,
44
+ amount_refunded: Money,
45
+ })
46
+ .describe("One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.");
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Compute API
5
+ * Leaflow Compute user API for managing instances, disks, snapshots, backups, images, private networks, subnets, routes, security groups, network interfaces and floating IPs.
6
+ *
7
+ * ## Authentication
8
+ *
9
+ * Every request carries a scoped token; see the `scopedTokenAuth` security scheme.
10
+ *
11
+ * ## Conventions
12
+ *
13
+ * - **Purchases.** A purchase that creates resources returns them together with a PlacedOrder. They are readable at once and start as `pending`: the order has not been accepted, nothing exists in the cloud, no inventory such as an address is held, and fields known only after allocation, such as addresses, are null. Once Billing accepts the order, a resource becomes `provisioning` and then reaches its usual status, such as `active` or `available`. When the order is declined, canceled or expires, or creation fails, the resource ends `failed` and `failure_reason` states why; the charge for a resource that failed after acceptance is refunded. Read the order in Billing for checkout and payment progress.
14
+ * - **Pricing.** Catalog items, such as instance types, disk types and public IP pools, carry `pricing`: the prepaid and postpaid options Billing offers for them, in the currency of the project's current billing account, or null when the project has no billing account. They are list amounts before promotion codes, not a checkout guarantee. A purchase chooses one option with `billing`, which applies to all of its components. Every purchase and change has a quote operation beside it, at the same path followed by `/quote`, which returns what checkout would collect without ordering anything.
15
+ * - **Checkout.** Omit `checkout` for automatic checkout, which pays from eligible credit grants and balance when the order is placed; insufficient funds refuse the request with HTTP 422 `BILLING_INSUFFICIENT_FUNDS`, and nothing is created. With `checkout.mode` set to `deferred`, the resources are returned `pending` and nothing is created until checkout is confirmed and paid through Billing. An order whose total is zero, such as a postpaid purchase with nothing due now, completes checkout at placement in either mode and proceeds to provisioning.
16
+ * - **Operations.** Requests such as starting, stopping, attaching or deleting return HTTP 202 with the resource as it is when the request is accepted. While an operation runs, the resource's `operation` field names it; the field is null once the operation has finished, and the resource then shows the result. A resource with an operation in progress refuses another operation with HTTP 409 `COMPUTE_RESOURCE_BUSY`; an operation involving two resources, such as attaching a disk, is refused when either has one. A purchased change, such as a resize, is an operation from the moment its order is placed until it is applied or its order is canceled, including while it awaits checkout. Renaming and replacing labels or notes are not operations and are accepted at any time.
17
+ * - **Billing relationships.** A purchased resource records its `order_id`, `order_item_id` and `subscription_id`. The subscription is `pending` until the order is accepted, `provisioning` while the resource is created, and `active` once it is delivered. Bandwidth is a property of its floating IP, not a separate resource. Snapshots use a purchased per-region count quota, and backups are metered on the region's backup service; neither has an order or subscription of its own.
18
+ * - **Availability zones.** A disk and an instance must reside in the same availability zone to be attached. Instance types and disk types are each bound to one availability zone, so choosing a type determines the zone.
19
+ * - **IPv6 is not sold separately.** Once enabled on a private network, IPv6 addresses are assigned to the instances in that network automatically; they can be neither requested nor released individually.
20
+ * - **Floating IPs have a cooldown period.** A released address is neither available for re-allocation nor handed to another user for some time, so that DNS records and allow-lists still pointing at it do not break immediately.
21
+ * - **Passwords are returned once.** A password generated by the platform during creation or rebuild appears only in that response. Store it immediately.
22
+ * OpenAPI spec version: 1.0.0
23
+ */
24
+ import * as zod from "zod";
25
+ export declare const MonthlyStatementList: zod.ZodObject<{
26
+ items: zod.ZodArray<zod.ZodObject<{
27
+ billing_account_id: zod.ZodInt;
28
+ currency: zod.ZodString;
29
+ period_start: zod.z.ZodISODateTime;
30
+ period_end: zod.z.ZodISODateTime;
31
+ finalized: zod.ZodBoolean;
32
+ finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
33
+ statement_count: zod.ZodInt;
34
+ billed: zod.ZodObject<{
35
+ subtotal: zod.ZodString;
36
+ discount_amount: zod.ZodString;
37
+ tax_amount: zod.ZodString;
38
+ total: zod.ZodString;
39
+ }, zod.z.core.$strict>;
40
+ credited_amount: zod.ZodString;
41
+ unbilled: zod.ZodOptional<zod.ZodObject<{
42
+ subtotal: zod.ZodString;
43
+ discount_amount: zod.ZodString;
44
+ tax_amount: zod.ZodString;
45
+ total: zod.ZodString;
46
+ }, zod.z.core.$strict>>;
47
+ credit_applied: zod.ZodString;
48
+ amount_paid: zod.ZodString;
49
+ amount_due: zod.ZodString;
50
+ amount_refunded: zod.ZodString;
51
+ }, zod.z.core.$strict>>;
52
+ pagination: zod.ZodObject<{
53
+ page: zod.ZodInt;
54
+ page_size: zod.ZodInt;
55
+ total_count: zod.ZodOptional<zod.ZodInt>;
56
+ }, zod.z.core.$strict>;
57
+ }, zod.z.core.$strict>;
58
+ export type MonthlyStatementList = zod.input<typeof MonthlyStatementList>;
59
+ export type MonthlyStatementListOutput = zod.output<typeof MonthlyStatementList>;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Compute API
5
+ * Leaflow Compute user API for managing instances, disks, snapshots, backups, images, private networks, subnets, routes, security groups, network interfaces and floating IPs.
6
+ *
7
+ * ## Authentication
8
+ *
9
+ * Every request carries a scoped token; see the `scopedTokenAuth` security scheme.
10
+ *
11
+ * ## Conventions
12
+ *
13
+ * - **Purchases.** A purchase that creates resources returns them together with a PlacedOrder. They are readable at once and start as `pending`: the order has not been accepted, nothing exists in the cloud, no inventory such as an address is held, and fields known only after allocation, such as addresses, are null. Once Billing accepts the order, a resource becomes `provisioning` and then reaches its usual status, such as `active` or `available`. When the order is declined, canceled or expires, or creation fails, the resource ends `failed` and `failure_reason` states why; the charge for a resource that failed after acceptance is refunded. Read the order in Billing for checkout and payment progress.
14
+ * - **Pricing.** Catalog items, such as instance types, disk types and public IP pools, carry `pricing`: the prepaid and postpaid options Billing offers for them, in the currency of the project's current billing account, or null when the project has no billing account. They are list amounts before promotion codes, not a checkout guarantee. A purchase chooses one option with `billing`, which applies to all of its components. Every purchase and change has a quote operation beside it, at the same path followed by `/quote`, which returns what checkout would collect without ordering anything.
15
+ * - **Checkout.** Omit `checkout` for automatic checkout, which pays from eligible credit grants and balance when the order is placed; insufficient funds refuse the request with HTTP 422 `BILLING_INSUFFICIENT_FUNDS`, and nothing is created. With `checkout.mode` set to `deferred`, the resources are returned `pending` and nothing is created until checkout is confirmed and paid through Billing. An order whose total is zero, such as a postpaid purchase with nothing due now, completes checkout at placement in either mode and proceeds to provisioning.
16
+ * - **Operations.** Requests such as starting, stopping, attaching or deleting return HTTP 202 with the resource as it is when the request is accepted. While an operation runs, the resource's `operation` field names it; the field is null once the operation has finished, and the resource then shows the result. A resource with an operation in progress refuses another operation with HTTP 409 `COMPUTE_RESOURCE_BUSY`; an operation involving two resources, such as attaching a disk, is refused when either has one. A purchased change, such as a resize, is an operation from the moment its order is placed until it is applied or its order is canceled, including while it awaits checkout. Renaming and replacing labels or notes are not operations and are accepted at any time.
17
+ * - **Billing relationships.** A purchased resource records its `order_id`, `order_item_id` and `subscription_id`. The subscription is `pending` until the order is accepted, `provisioning` while the resource is created, and `active` once it is delivered. Bandwidth is a property of its floating IP, not a separate resource. Snapshots use a purchased per-region count quota, and backups are metered on the region's backup service; neither has an order or subscription of its own.
18
+ * - **Availability zones.** A disk and an instance must reside in the same availability zone to be attached. Instance types and disk types are each bound to one availability zone, so choosing a type determines the zone.
19
+ * - **IPv6 is not sold separately.** Once enabled on a private network, IPv6 addresses are assigned to the instances in that network automatically; they can be neither requested nor released individually.
20
+ * - **Floating IPs have a cooldown period.** A released address is neither available for re-allocation nor handed to another user for some time, so that DNS records and allow-lists still pointing at it do not break immediately.
21
+ * - **Passwords are returned once.** A password generated by the platform during creation or rebuild appears only in that response. Store it immediately.
22
+ * OpenAPI spec version: 1.0.0
23
+ */
24
+ import * as zod from "zod";
25
+ import { MonthlyStatement } from "./monthlyStatement.zod.js";
26
+ import { OffsetPagination } from "./offsetPagination.zod.js";
27
+ export const MonthlyStatementList = zod.strictObject({
28
+ items: zod.array(MonthlyStatement),
29
+ pagination: OffsetPagination,
30
+ });