@limitry/sdk 1.0.0-rc.7 → 1.0.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +122 -0
- package/README.md +15 -13
- package/dist/index.d.ts +35 -32
- package/dist/index.js +2 -2
- package/dist/product/index.d.ts +4 -4
- package/dist/product/index.js +7 -3
- package/dist/product/limits.d.ts +72 -45
- package/dist/product/limits.js +139 -62
- package/dist/resources.gen.d.ts +35 -32
- package/dist/resources.gen.js +7 -7
- package/dist/retry.d.ts +38 -0
- package/dist/retry.js +85 -1
- package/dist/v1.gen.d.ts +202 -171
- package/package.json +1 -1
package/dist/v1.gen.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface paths {
|
|
|
10
10
|
put?: never;
|
|
11
11
|
/**
|
|
12
12
|
* Check whether a subject may act
|
|
13
|
-
* @description Asks whether `subject` may do `action` at `cost`, given every enabled limit that applies, and — in `consume` mode — uses it. Always 200 for a decision: read `allowed`; `
|
|
13
|
+
* @description Asks whether `subject` may do `action` at `cost`, given every enabled limit that applies, and — in `consume` mode — uses it. Always 200 for a decision, allowed or refused: read `allowed`; `limits` shows what is left on each limit and `retryAfterSeconds` when to try again. An `Idempotency-Key` header makes a retried check return the same decision without using twice. Its API-key check is cached briefly for speed: a revoked key can keep working here for up to 60 seconds.
|
|
14
14
|
*/
|
|
15
15
|
post: operations["checks.create"];
|
|
16
16
|
delete?: never;
|
|
@@ -34,7 +34,7 @@ export interface paths {
|
|
|
34
34
|
put?: never;
|
|
35
35
|
/**
|
|
36
36
|
* Create a limit
|
|
37
|
-
* @description Limits how much
|
|
37
|
+
* @description Limits how much a subject may use per window — for example 200 cents a month for every `user`. Only `subject.kind`, `amount` and `window` are needed: `action` defaults to every action (`*`), `unit` to units, and `name` to the sentence the limit reads as. Checks enforce it from then on. What it counts (subject, action, unit, window, every, start, rolling) is fixed once created. Owners and admins only, for a person's token.
|
|
38
38
|
*/
|
|
39
39
|
post: operations["limits.create"];
|
|
40
40
|
delete?: never;
|
|
@@ -62,7 +62,7 @@ export interface paths {
|
|
|
62
62
|
head?: never;
|
|
63
63
|
/**
|
|
64
64
|
* Change a limit
|
|
65
|
-
* @description Changes
|
|
65
|
+
* @description Changes a limit's name, amount, fail mode or whether it is enabled; checks use the new rule at once. What a limit counts (subject, action, unit, window, every, start, rolling) is fixed: a different value is refused (400) — create a new limit and archive this one. Owners and admins only, for a person's token.
|
|
66
66
|
*/
|
|
67
67
|
patch: operations["limits.update"];
|
|
68
68
|
trace?: never;
|
|
@@ -78,7 +78,7 @@ export interface paths {
|
|
|
78
78
|
put?: never;
|
|
79
79
|
/**
|
|
80
80
|
* Archive a limit
|
|
81
|
-
* @description Stops a limit: checks stop enforcing it
|
|
81
|
+
* @description Stops a limit: checks stop enforcing it at once, and it leaves the list. It is archived, not erased — its usage history and credits stay, and `POST /v1/limits/{limitId}/restore` brings it back. Owners and admins only, for a person's token.
|
|
82
82
|
*/
|
|
83
83
|
post: operations["limits.archive"];
|
|
84
84
|
delete?: never;
|
|
@@ -87,7 +87,7 @@ export interface paths {
|
|
|
87
87
|
patch?: never;
|
|
88
88
|
trace?: never;
|
|
89
89
|
};
|
|
90
|
-
"/limits/{limitId}/
|
|
90
|
+
"/limits/{limitId}/credits": {
|
|
91
91
|
parameters: {
|
|
92
92
|
query?: never;
|
|
93
93
|
header?: never;
|
|
@@ -95,16 +95,16 @@ export interface paths {
|
|
|
95
95
|
cookie?: never;
|
|
96
96
|
};
|
|
97
97
|
/**
|
|
98
|
-
* List a balance's
|
|
99
|
-
* @description Credits added to subjects' balances for this limit, newest first.
|
|
98
|
+
* List a balance's credits
|
|
99
|
+
* @description Credits added to (or taken back from) subjects' balances for this limit, newest first.
|
|
100
100
|
*/
|
|
101
|
-
get: operations["limits.
|
|
101
|
+
get: operations["limits.credits.list"];
|
|
102
102
|
put?: never;
|
|
103
103
|
/**
|
|
104
104
|
* Add credits to a balance
|
|
105
|
-
* @description Adds `amount` to one subject's balance — a limit whose window is `total`. A negative `amount` takes credits back (a refund, a chargeback) and needs a `note` saying why; the balance may go below zero, and checks are refused until
|
|
105
|
+
* @description Adds `amount` credits to one subject's balance — a limit whose window is `total`. A negative `amount` takes credits back (a refund, a chargeback) and needs a `note` saying why; the balance may go below zero, and checks are refused until more credits are added. Owners and admins, or a workspace API key; an agent asks a person (the `limit.credit` approval).
|
|
106
106
|
*/
|
|
107
|
-
post: operations["limits.
|
|
107
|
+
post: operations["limits.credits.create"];
|
|
108
108
|
delete?: never;
|
|
109
109
|
options?: never;
|
|
110
110
|
head?: never;
|
|
@@ -142,7 +142,7 @@ export interface paths {
|
|
|
142
142
|
put?: never;
|
|
143
143
|
/**
|
|
144
144
|
* Sync limits from a list
|
|
145
|
-
* @description Makes the environment's limits match `limits`, by name: creates the missing, changes those that differ (an omitted field means its default) and, with `archiveMissing`, archives active limits the list doesn't name. Running it twice changes nothing the second time. Limitry checks the whole list first, and a problem anywhere changes nothing (400, each problem in `details`); then it writes every change at once. `
|
|
145
|
+
* @description Makes the environment's limits match `limits`, by name: creates the missing, changes those that differ (an omitted field means its default) and, with `archiveMissing`, archives active limits the list doesn't name. Running it twice changes nothing the second time. Limitry checks the whole list first, and a problem anywhere changes nothing (400, each problem in `details`); then it writes every change at once. What a limit counts is fixed: a different subject, action, unit or window under an existing name is refused until the entry is renamed. `preview` answers what it would do without writing. For keeping limits in a file in your repository (`limitry sync`). Owners and admins only, for a person's token.
|
|
146
146
|
*/
|
|
147
147
|
post: operations["limits.sync"];
|
|
148
148
|
delete?: never;
|
|
@@ -162,7 +162,7 @@ export interface paths {
|
|
|
162
162
|
put?: never;
|
|
163
163
|
/**
|
|
164
164
|
* Commit a reservation
|
|
165
|
-
* @description
|
|
165
|
+
* @description Commits a reservation with the ACTUAL amount used (`cost`): less than reserved gives the rest back at once; more is charged in full — the work happened. A commit after the reservation expired still charges `cost`. Repeating a commit answers the same. Its API-key check is cached briefly for speed: a revoked key can keep working here for up to 60 seconds.
|
|
166
166
|
*/
|
|
167
167
|
post: operations["reservations.commit"];
|
|
168
168
|
delete?: never;
|
|
@@ -182,7 +182,7 @@ export interface paths {
|
|
|
182
182
|
put?: never;
|
|
183
183
|
/**
|
|
184
184
|
* Extend a reservation
|
|
185
|
-
* @description Keeps a
|
|
185
|
+
* @description Keeps a reservation for longer work: it now expires `ttlSeconds` from now (default 300, at most 3600) — call it again as a heartbeat. Only an open reservation can be extended. Its API-key check is cached briefly for speed: a revoked key can keep working here for up to 60 seconds.
|
|
186
186
|
*/
|
|
187
187
|
post: operations["reservations.extend"];
|
|
188
188
|
delete?: never;
|
|
@@ -202,7 +202,7 @@ export interface paths {
|
|
|
202
202
|
put?: never;
|
|
203
203
|
/**
|
|
204
204
|
* Release a reservation
|
|
205
|
-
* @description Gives the whole
|
|
205
|
+
* @description Gives the whole reservation back — the work did not happen. Repeating a release answers the same; releasing a committed reservation is refused. Its API-key check is cached briefly for speed: a revoked key can keep working here for up to 60 seconds.
|
|
206
206
|
*/
|
|
207
207
|
post: operations["reservations.release"];
|
|
208
208
|
delete?: never;
|
|
@@ -220,7 +220,7 @@ export interface paths {
|
|
|
220
220
|
};
|
|
221
221
|
/**
|
|
222
222
|
* Get a subject
|
|
223
|
-
* @description A subject's
|
|
223
|
+
* @description A subject's billing date: when its `billing_date` limits' periods start from. A subject is yours (a user, a team, an agent) and exists once a check names it.
|
|
224
224
|
*/
|
|
225
225
|
get: operations["subjects.get"];
|
|
226
226
|
put?: never;
|
|
@@ -229,8 +229,8 @@ export interface paths {
|
|
|
229
229
|
options?: never;
|
|
230
230
|
head?: never;
|
|
231
231
|
/**
|
|
232
|
-
* Set a subject's
|
|
233
|
-
* @description Sets when a subject's `
|
|
232
|
+
* Set a subject's billing date
|
|
233
|
+
* @description Sets when a subject's `billing_date` limits' periods start from: typically its subscription's start date, from your billing system's webhook, so its allowance resets on its own billing day (monthly for an annual plan, too). Owners and admins only, for a person's token.
|
|
234
234
|
*/
|
|
235
235
|
patch: operations["subjects.update"];
|
|
236
236
|
trace?: never;
|
|
@@ -246,7 +246,7 @@ export interface paths {
|
|
|
246
246
|
put?: never;
|
|
247
247
|
/**
|
|
248
248
|
* Reset a subject's limits
|
|
249
|
-
* @description
|
|
249
|
+
* @description Resets one limit on a subject (`limitId`), or every limit on it (`{}`), at once: for goodwill, a promotion or support. The schedule doesn't move: the next reset is still the usual one. A balance goes back to its amount; a concurrent limit is skipped. Send an Idempotency-Key and a repeat resets once. Owners and admins only, for a person's token.
|
|
250
250
|
*/
|
|
251
251
|
post: operations["subjects.reset"];
|
|
252
252
|
delete?: never;
|
|
@@ -264,7 +264,7 @@ export interface paths {
|
|
|
264
264
|
};
|
|
265
265
|
/**
|
|
266
266
|
* Get a limit's usage over time
|
|
267
|
-
* @description Units used, checks allowed and
|
|
267
|
+
* @description Units used, checks allowed and refused for one limit — across all subjects, or one (`subject`, as `kind:id`) — per hour or per day (UTC), every bucket in the range included. Up to about a minute behind live checks. Default: the last 30 days, by day.
|
|
268
268
|
*/
|
|
269
269
|
get: operations["usage.query"];
|
|
270
270
|
put?: never;
|
|
@@ -284,7 +284,7 @@ export interface paths {
|
|
|
284
284
|
};
|
|
285
285
|
/**
|
|
286
286
|
* Get where a subject stands
|
|
287
|
-
* @description Every enabled limit on one subject — and on its shared subjects (`shared`, comma-separated `kind:id`, such as `team:team_42`) — with what is used, what is left and when it resets, exact as of now. For showing an end user where they stand: call it from your server with your key, never from a browser. Not a check: nothing is counted. A subject with no limit here answers an empty `limits` list.
|
|
287
|
+
* @description Every enabled limit on one subject (`subject`, as `kind:id`, such as `user:usr_123`) — and on its shared subjects (`shared`, comma-separated `kind:id`, such as `team:team_42`) — with what is used, what is left and when it resets, exact as of now. For showing an end user where they stand: call it from your server with your key, never from a browser. Not a check: nothing is counted. A subject with no limit here answers an empty `limits` list.
|
|
288
288
|
*/
|
|
289
289
|
get: operations["usage.standing"];
|
|
290
290
|
put?: never;
|
|
@@ -304,7 +304,7 @@ export interface paths {
|
|
|
304
304
|
};
|
|
305
305
|
/**
|
|
306
306
|
* List who is using a limit now
|
|
307
|
-
* @description A limit's subjects in its CURRENT window, most used first: units used, what is left, how many checks
|
|
307
|
+
* @description A limit's subjects in its CURRENT window, most used first: units used, what is left, and how many checks it refused. Up to about a minute behind live checks.
|
|
308
308
|
*/
|
|
309
309
|
get: operations["usage.subjects"];
|
|
310
310
|
put?: never;
|
|
@@ -772,21 +772,21 @@ export interface components {
|
|
|
772
772
|
allowed: boolean;
|
|
773
773
|
/** @example chk_9d2e… */
|
|
774
774
|
id: string;
|
|
775
|
-
/** @description
|
|
775
|
+
/** @description Every limit that applied, and what is left on each (`limits[0].remaining`). */
|
|
776
|
+
limits: components["schemas"]["CheckLimit"][];
|
|
777
|
+
/** @description Why it was refused, when `allowed` is false: `limit_reached` — a limit is used up (`limitId` names it) — or `too_many_reservations` — the subject already holds the most open reservations (1,000). */
|
|
776
778
|
reason: {
|
|
777
779
|
/** @enum {string} */
|
|
778
|
-
code: "
|
|
779
|
-
/** @example
|
|
780
|
-
|
|
780
|
+
code: "limit_reached" | "too_many_reservations";
|
|
781
|
+
/** @example lmt_3f0c… */
|
|
782
|
+
limitId: string | null;
|
|
781
783
|
/**
|
|
782
784
|
* @description The refusal in one sentence, for people and logs: show it, never parse it (its wording may change). Branch on `allowed` and `code`.
|
|
783
785
|
* @example Refused by AI replies per day: 0 replies left, resets 2026-11-01T00:00:00.000Z. Try again in 3600 s.
|
|
784
786
|
*/
|
|
785
787
|
message: string;
|
|
786
788
|
} | null;
|
|
787
|
-
/** @description
|
|
788
|
-
remaining: components["schemas"]["CheckRemaining"][];
|
|
789
|
-
/** @description With `mode: reserve`, when allowed: the hold — commit or release it before `expiresAt`, or it releases itself. */
|
|
789
|
+
/** @description With `mode: reserve`, when allowed: the reservation — commit or release it before `expiresAt`, or it releases itself. */
|
|
790
790
|
reservation?: {
|
|
791
791
|
expiresAt: string;
|
|
792
792
|
/** @example rsv_WyJ1c2VyIiwidV80MiJd_9f… */
|
|
@@ -795,14 +795,14 @@ export interface components {
|
|
|
795
795
|
/** @description When `allowed` is false: seconds until it could be allowed. */
|
|
796
796
|
retryAfterSeconds: number | null;
|
|
797
797
|
};
|
|
798
|
-
|
|
798
|
+
CheckLimit: {
|
|
799
799
|
/**
|
|
800
800
|
* @description What to do if Limitry cannot be reached next time: `open` allows, `closed` denies. SDKs remember it.
|
|
801
801
|
* @enum {string}
|
|
802
802
|
*/
|
|
803
803
|
failMode: "open" | "closed";
|
|
804
|
-
/** @example
|
|
805
|
-
|
|
804
|
+
/** @example lmt_3f0c… */
|
|
805
|
+
limitId: string;
|
|
806
806
|
/** @example AI budget */
|
|
807
807
|
name: string;
|
|
808
808
|
/** @example 195 */
|
|
@@ -831,7 +831,7 @@ export interface components {
|
|
|
831
831
|
*/
|
|
832
832
|
cost?: number;
|
|
833
833
|
/**
|
|
834
|
-
* @description `consume` (default) decides and uses; `preview` decides without using; `reserve` decides and
|
|
834
|
+
* @description `consume` (default) decides and uses; `preview` decides without using; `reserve` decides and reserves `cost` (what it will probably use) until you commit the actual amount or release it — see `reservation` in the answer. Only a reservation takes a slot of a `concurrent` limit.
|
|
835
835
|
* @example consume
|
|
836
836
|
* @enum {string}
|
|
837
837
|
*/
|
|
@@ -851,7 +851,7 @@ export interface components {
|
|
|
851
851
|
}[];
|
|
852
852
|
subject: components["schemas"]["CheckSubject"];
|
|
853
853
|
/**
|
|
854
|
-
* @description With `reserve`: how long the
|
|
854
|
+
* @description With `reserve`: how long the reservation lasts before it releases itself. Default 300, at most 3600.
|
|
855
855
|
* @example 300
|
|
856
856
|
*/
|
|
857
857
|
ttlSeconds?: number;
|
|
@@ -869,6 +869,42 @@ export interface components {
|
|
|
869
869
|
*/
|
|
870
870
|
kind: string;
|
|
871
871
|
};
|
|
872
|
+
Credit: {
|
|
873
|
+
amount: number;
|
|
874
|
+
createdAt: string;
|
|
875
|
+
createdByUserId: string | null;
|
|
876
|
+
/** @example crd_… */
|
|
877
|
+
id: string;
|
|
878
|
+
limitId: string;
|
|
879
|
+
note: string;
|
|
880
|
+
subject: {
|
|
881
|
+
id: string;
|
|
882
|
+
kind: string;
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
CreditInput: {
|
|
886
|
+
/**
|
|
887
|
+
* @description Credits to add; negative to take them back. Not 0.
|
|
888
|
+
* @example 5000
|
|
889
|
+
*/
|
|
890
|
+
amount: number;
|
|
891
|
+
/**
|
|
892
|
+
* @description Required when `amount` is negative.
|
|
893
|
+
* @example October credits
|
|
894
|
+
*/
|
|
895
|
+
note?: string;
|
|
896
|
+
/**
|
|
897
|
+
* @description Who gets the credits, as `{"kind": "team", "id": "team_42"}`.
|
|
898
|
+
* @example {
|
|
899
|
+
* "kind": "team",
|
|
900
|
+
* "id": "team_42"
|
|
901
|
+
* }
|
|
902
|
+
*/
|
|
903
|
+
subject: {
|
|
904
|
+
id: string;
|
|
905
|
+
kind: string;
|
|
906
|
+
};
|
|
907
|
+
};
|
|
872
908
|
ErrorEnvelope: {
|
|
873
909
|
error: {
|
|
874
910
|
/** @example unauthorized */
|
|
@@ -915,7 +951,7 @@ export interface components {
|
|
|
915
951
|
* @example 200
|
|
916
952
|
*/
|
|
917
953
|
amount: number;
|
|
918
|
-
/** @description When it was archived
|
|
954
|
+
/** @description When it was archived; null while active. An archived limit isn't enforced; its usage history and credits stay. */
|
|
919
955
|
archivedAt: string | null;
|
|
920
956
|
/** @example 2026-10-04T12:00:00.000Z */
|
|
921
957
|
createdAt: string;
|
|
@@ -931,18 +967,23 @@ export interface components {
|
|
|
931
967
|
* @enum {string}
|
|
932
968
|
*/
|
|
933
969
|
failMode: "open" | "closed";
|
|
934
|
-
/** @example
|
|
970
|
+
/** @example lmt_3f0c… */
|
|
935
971
|
id: string;
|
|
936
|
-
/**
|
|
972
|
+
/**
|
|
973
|
+
* @description The hour a check last reached this limit, from usage history (up to about a minute behind); null if none has. A limit no check reaches isn't being enforced: check the subject kind and action your checks send.
|
|
974
|
+
* @example 2026-10-04T12:00:00.000Z
|
|
975
|
+
*/
|
|
976
|
+
lastCheckedAt: string | null;
|
|
977
|
+
/** @example 200 cents per user per month */
|
|
937
978
|
name: string;
|
|
938
979
|
/** @description Counts the last minute, hour or day at the moment of the check instead of the calendar window. */
|
|
939
980
|
rolling: boolean;
|
|
940
981
|
/**
|
|
941
|
-
* @description Where a period begins. `calendar`: UTC boundaries (midnight, Monday, the 1st, 1 January). `
|
|
982
|
+
* @description Where a period begins. `calendar`: UTC boundaries (midnight, Monday, the 1st, 1 January). `billing_date`: from the subject's billing date, set with `subjects.update` (its first check until then), so an annual plan can reset monthly from its start day. `first_use`: at the first check after the previous period ended. Default: calendar.
|
|
942
983
|
* @example calendar
|
|
943
984
|
* @enum {string}
|
|
944
985
|
*/
|
|
945
|
-
start: "calendar" | "
|
|
986
|
+
start: "calendar" | "billing_date" | "first_use";
|
|
946
987
|
subject: components["schemas"]["LimitSubject"];
|
|
947
988
|
/** @example cents */
|
|
948
989
|
unit: string;
|
|
@@ -951,54 +992,18 @@ export interface components {
|
|
|
951
992
|
/** @description Increases on every change. */
|
|
952
993
|
version: number;
|
|
953
994
|
/**
|
|
954
|
-
* @description `minute`, `hour`, `day`, `week`, `month` or `year`: a period of `every` of them,
|
|
995
|
+
* @description `minute`, `hour`, `day`, `week`, `month` or `year`: a period of `every` of them, reset where `start` says (or rolling: see `rolling`). `total`: a balance that never resets, raised by credits. `concurrent`: at most `amount` open reservations at once.
|
|
955
996
|
* @example month
|
|
956
997
|
* @enum {string}
|
|
957
998
|
*/
|
|
958
999
|
window: "minute" | "hour" | "day" | "week" | "month" | "year" | "total" | "concurrent";
|
|
959
1000
|
};
|
|
960
|
-
LimitGrant: {
|
|
961
|
-
amount: number;
|
|
962
|
-
createdAt: string;
|
|
963
|
-
createdByUserId: string | null;
|
|
964
|
-
/** @example grt_… */
|
|
965
|
-
id: string;
|
|
966
|
-
limitId: string;
|
|
967
|
-
note: string;
|
|
968
|
-
subject: {
|
|
969
|
-
id: string;
|
|
970
|
-
kind: string;
|
|
971
|
-
};
|
|
972
|
-
};
|
|
973
|
-
LimitGrantInput: {
|
|
974
|
-
/**
|
|
975
|
-
* @description Credits to add; negative to take them back. Not 0.
|
|
976
|
-
* @example 5000
|
|
977
|
-
*/
|
|
978
|
-
amount: number;
|
|
979
|
-
/**
|
|
980
|
-
* @description Required when `amount` is negative.
|
|
981
|
-
* @example October top-up
|
|
982
|
-
*/
|
|
983
|
-
note?: string;
|
|
984
|
-
/**
|
|
985
|
-
* @description Who gets the credits, as `{"kind": "team", "id": "team_42"}`.
|
|
986
|
-
* @example {
|
|
987
|
-
* "kind": "team",
|
|
988
|
-
* "id": "team_42"
|
|
989
|
-
* }
|
|
990
|
-
*/
|
|
991
|
-
subject: {
|
|
992
|
-
id: string;
|
|
993
|
-
kind: string;
|
|
994
|
-
};
|
|
995
|
-
};
|
|
996
1001
|
LimitInput: {
|
|
997
1002
|
/**
|
|
998
|
-
* @description The action to limit
|
|
1003
|
+
* @description The action to limit. Default: `*`, every action.
|
|
999
1004
|
* @example ai-call
|
|
1000
1005
|
*/
|
|
1001
|
-
action
|
|
1006
|
+
action?: string;
|
|
1002
1007
|
/**
|
|
1003
1008
|
* @description How many units each subject may use per window.
|
|
1004
1009
|
* @example 200
|
|
@@ -1017,93 +1022,89 @@ export interface components {
|
|
|
1017
1022
|
*/
|
|
1018
1023
|
failMode?: "open" | "closed";
|
|
1019
1024
|
/**
|
|
1020
|
-
* @description A name
|
|
1025
|
+
* @description A name, unique among the environment's active limits. Default: the sentence the limit reads as, such as "200 cents per user per month". If a limit already has that name, the answer is 409: give this one a name.
|
|
1021
1026
|
* @example AI budget
|
|
1022
1027
|
*/
|
|
1023
|
-
name
|
|
1028
|
+
name?: string;
|
|
1024
1029
|
/** @description Count the last window instead of the calendar one (minute, hour or day only). Default: false. */
|
|
1025
1030
|
rolling?: boolean;
|
|
1026
1031
|
/**
|
|
1027
|
-
* @description Where a period begins. `calendar`: UTC boundaries (midnight, Monday, the 1st, 1 January). `
|
|
1032
|
+
* @description Where a period begins. `calendar`: UTC boundaries (midnight, Monday, the 1st, 1 January). `billing_date`: from the subject's billing date, set with `subjects.update` (its first check until then), so an annual plan can reset monthly from its start day. `first_use`: at the first check after the previous period ended. Default: calendar.
|
|
1028
1033
|
* @example calendar
|
|
1029
1034
|
* @enum {string}
|
|
1030
1035
|
*/
|
|
1031
|
-
start?: "calendar" | "
|
|
1032
|
-
|
|
1033
|
-
subjectId?: string | null;
|
|
1036
|
+
start?: "calendar" | "billing_date" | "first_use";
|
|
1037
|
+
subject: components["schemas"]["LimitInputSubject"];
|
|
1034
1038
|
/**
|
|
1035
|
-
* @description
|
|
1036
|
-
* @example user
|
|
1037
|
-
*/
|
|
1038
|
-
subjectKind: string;
|
|
1039
|
-
/**
|
|
1040
|
-
* @description What the amount counts (display only). Default: units.
|
|
1039
|
+
* @description What the amount counts, in words. Default: units.
|
|
1041
1040
|
* @example cents
|
|
1042
1041
|
*/
|
|
1043
1042
|
unit?: string;
|
|
1044
1043
|
/**
|
|
1045
|
-
* @description `minute`, `hour`, `day`, `week`, `month` or `year`: a period of `every` of them,
|
|
1044
|
+
* @description `minute`, `hour`, `day`, `week`, `month` or `year`: a period of `every` of them, reset where `start` says (or rolling: see `rolling`). `total`: a balance that never resets, raised by credits. `concurrent`: at most `amount` open reservations at once.
|
|
1046
1045
|
* @example month
|
|
1047
1046
|
* @enum {string}
|
|
1048
1047
|
*/
|
|
1049
1048
|
window: "minute" | "hour" | "day" | "week" | "month" | "year" | "total" | "concurrent";
|
|
1050
1049
|
};
|
|
1050
|
+
/** @description Who it applies to: `{"kind": "user"}` for every user, `{"kind": "user", "id": "usr_123"}` for one. */
|
|
1051
|
+
LimitInputSubject: {
|
|
1052
|
+
/** @description One subject; omit or null for every subject of the kind. A subject's own limit replaces the kind's limits with the same action and window. */
|
|
1053
|
+
id?: string | null;
|
|
1054
|
+
/**
|
|
1055
|
+
* @description Your own label for who is checked: user, team, apikey …
|
|
1056
|
+
* @example user
|
|
1057
|
+
*/
|
|
1058
|
+
kind: string;
|
|
1059
|
+
};
|
|
1051
1060
|
LimitPage: {
|
|
1052
1061
|
items: components["schemas"]["Limit"][];
|
|
1053
1062
|
/** @description Pass as ?cursor= to fetch the next page. */
|
|
1054
1063
|
nextCursor: string | null;
|
|
1055
1064
|
};
|
|
1056
1065
|
LimitPatch: {
|
|
1057
|
-
/**
|
|
1058
|
-
* @description The action to limit; `*` for every action.
|
|
1059
|
-
* @example ai-call
|
|
1060
|
-
*/
|
|
1066
|
+
/** @description The action. Fixed once the limit is created: to change it, create a new limit and archive this one. */
|
|
1061
1067
|
action?: string;
|
|
1062
1068
|
/**
|
|
1063
1069
|
* @description How many units each subject may use per window.
|
|
1064
|
-
* @example
|
|
1070
|
+
* @example 300
|
|
1065
1071
|
*/
|
|
1066
1072
|
amount?: number;
|
|
1067
|
-
/** @description Whether checks enforce it.
|
|
1073
|
+
/** @description Whether checks enforce it. */
|
|
1068
1074
|
enabled?: boolean;
|
|
1069
|
-
/**
|
|
1070
|
-
* @description How many `window` units a period lasts: `window: "month", every: 3` is a quarter, `window: "hour", every: 5` five hours. Default: 1.
|
|
1071
|
-
* @example 1
|
|
1072
|
-
*/
|
|
1075
|
+
/** @description How many windows a period lasts. Fixed once the limit is created: to change it, create a new limit and archive this one. */
|
|
1073
1076
|
every?: number;
|
|
1074
1077
|
/**
|
|
1075
|
-
* @description What your code should do when Limitry can't be reached: `open` (allow) or `closed` (deny).
|
|
1078
|
+
* @description What your code should do when Limitry can't be reached: `open` (allow) or `closed` (deny).
|
|
1076
1079
|
* @enum {string}
|
|
1077
1080
|
*/
|
|
1078
1081
|
failMode?: "open" | "closed";
|
|
1079
1082
|
/**
|
|
1080
|
-
* @description A name
|
|
1083
|
+
* @description A new name, unique among the environment's active limits.
|
|
1081
1084
|
* @example AI budget
|
|
1082
1085
|
*/
|
|
1083
1086
|
name?: string;
|
|
1084
|
-
/** @description
|
|
1087
|
+
/** @description Whether it counts the last window. Fixed once the limit is created: to change it, create a new limit and archive this one. */
|
|
1085
1088
|
rolling?: boolean;
|
|
1086
1089
|
/**
|
|
1087
|
-
* @description Where a period begins.
|
|
1088
|
-
* @example calendar
|
|
1090
|
+
* @description Where a period begins. Fixed once the limit is created: to change it, create a new limit and archive this one.
|
|
1089
1091
|
* @enum {string}
|
|
1090
1092
|
*/
|
|
1091
|
-
start?: "calendar" | "
|
|
1092
|
-
/** @description
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1093
|
+
start?: "calendar" | "billing_date" | "first_use";
|
|
1094
|
+
/** @description Who it applies to. Fixed once the limit is created: to change it, create a new limit and archive this one. */
|
|
1095
|
+
subject?: {
|
|
1096
|
+
/** @description One subject; omit or null for every subject of the kind. A subject's own limit replaces the kind's limits with the same action and window. */
|
|
1097
|
+
id?: string | null;
|
|
1098
|
+
/**
|
|
1099
|
+
* @description Your own label for who is checked: user, team, apikey …
|
|
1100
|
+
* @example user
|
|
1101
|
+
*/
|
|
1102
|
+
kind?: string;
|
|
1103
|
+
};
|
|
1104
|
+
/** @description What the amount counts. Fixed once the limit is created: to change it, create a new limit and archive this one. */
|
|
1103
1105
|
unit?: string;
|
|
1104
1106
|
/**
|
|
1105
|
-
* @description
|
|
1106
|
-
* @example month
|
|
1107
|
+
* @description The window. Fixed once the limit is created: to change it, create a new limit and archive this one.
|
|
1107
1108
|
* @enum {string}
|
|
1108
1109
|
*/
|
|
1109
1110
|
window?: "minute" | "hour" | "day" | "week" | "month" | "year" | "total" | "concurrent";
|
|
@@ -1120,17 +1121,24 @@ export interface components {
|
|
|
1120
1121
|
*/
|
|
1121
1122
|
kind: string;
|
|
1122
1123
|
};
|
|
1124
|
+
LimitSyncEntry: components["schemas"]["LimitInput"] & {
|
|
1125
|
+
/**
|
|
1126
|
+
* @description The limit's name: the key a sync matches on, unique in the list.
|
|
1127
|
+
* @example AI budget
|
|
1128
|
+
*/
|
|
1129
|
+
name: string;
|
|
1130
|
+
};
|
|
1123
1131
|
LimitSyncInput: {
|
|
1124
1132
|
/** @description Archive the environment's active limits whose names aren't in `limits` (restorable). Default: false, which leaves them alone. */
|
|
1125
1133
|
archiveMissing?: boolean;
|
|
1126
|
-
/** @description Answer what the sync would do and change nothing. Default: false. */
|
|
1127
|
-
dryRun?: boolean;
|
|
1128
1134
|
/**
|
|
1129
|
-
* @description Every limit you want, each described whole: an omitted field is its default, as on create. Names are the key and must be unique in the list. At most 200.
|
|
1135
|
+
* @description Every limit you want, each described whole: an omitted field is its default, as on create. Names are the key and must be unique in the list. What a limit counts (subject, action, unit, window, every, start, rolling) is fixed: to change it, rename the entry, which creates a new limit. At most 200.
|
|
1130
1136
|
* @example [
|
|
1131
1137
|
* {
|
|
1132
1138
|
* "name": "AI budget",
|
|
1133
|
-
* "
|
|
1139
|
+
* "subject": {
|
|
1140
|
+
* "kind": "user"
|
|
1141
|
+
* },
|
|
1134
1142
|
* "action": "ai-call",
|
|
1135
1143
|
* "amount": 200,
|
|
1136
1144
|
* "unit": "cents",
|
|
@@ -1138,7 +1146,9 @@ export interface components {
|
|
|
1138
1146
|
* }
|
|
1139
1147
|
* ]
|
|
1140
1148
|
*/
|
|
1141
|
-
limits: components["schemas"]["
|
|
1149
|
+
limits: components["schemas"]["LimitSyncEntry"][];
|
|
1150
|
+
/** @description Answer what the sync would do and change nothing. Default: false. */
|
|
1151
|
+
preview?: boolean;
|
|
1142
1152
|
};
|
|
1143
1153
|
LimitSyncResult: {
|
|
1144
1154
|
/** @description Names of the limits archived (with `archiveMissing`). */
|
|
@@ -1150,8 +1160,8 @@ export interface components {
|
|
|
1150
1160
|
* ]
|
|
1151
1161
|
*/
|
|
1152
1162
|
created: string[];
|
|
1153
|
-
/** @description True when nothing was written: this is
|
|
1154
|
-
|
|
1163
|
+
/** @description True when nothing was written: this is what a sync would do. */
|
|
1164
|
+
preview: boolean;
|
|
1155
1165
|
/** @description Names of the limits that already matched. */
|
|
1156
1166
|
unchanged: string[];
|
|
1157
1167
|
/** @description The limits changed, field by field. */
|
|
@@ -1198,10 +1208,10 @@ export interface components {
|
|
|
1198
1208
|
cost: number;
|
|
1199
1209
|
expiresAt: string;
|
|
1200
1210
|
id: string;
|
|
1201
|
-
/** @description The amount
|
|
1211
|
+
/** @description The amount reserved. */
|
|
1202
1212
|
reserved: number;
|
|
1203
1213
|
/**
|
|
1204
|
-
* @description `expired`: nobody
|
|
1214
|
+
* @description `expired`: nobody committed or released it in time, so it released itself.
|
|
1205
1215
|
* @enum {string}
|
|
1206
1216
|
*/
|
|
1207
1217
|
status: "held" | "committed" | "released" | "expired";
|
|
@@ -1222,10 +1232,10 @@ export interface components {
|
|
|
1222
1232
|
};
|
|
1223
1233
|
Subject: {
|
|
1224
1234
|
/**
|
|
1225
|
-
* @description When its `
|
|
1235
|
+
* @description When its `billing_date` limits' periods start from: the billing date you set, else its first counted check. Null until it has one.
|
|
1226
1236
|
* @example 2026-03-17T14:30:00.000Z
|
|
1227
1237
|
*/
|
|
1228
|
-
|
|
1238
|
+
billingDate: string | null;
|
|
1229
1239
|
subject: components["schemas"]["SubjectRef"];
|
|
1230
1240
|
};
|
|
1231
1241
|
SubjectRef: {
|
|
@@ -1235,12 +1245,12 @@ export interface components {
|
|
|
1235
1245
|
SubjectReset: {
|
|
1236
1246
|
/**
|
|
1237
1247
|
* @description Just this limit. Default: every limit on the subject.
|
|
1238
|
-
* @example
|
|
1248
|
+
* @example lmt_3f0c…
|
|
1239
1249
|
*/
|
|
1240
1250
|
limitId?: string;
|
|
1241
1251
|
};
|
|
1242
1252
|
SubjectResetResult: {
|
|
1243
|
-
/** @description The limits that were
|
|
1253
|
+
/** @description The limits that were reset. */
|
|
1244
1254
|
reset: string[];
|
|
1245
1255
|
subject: components["schemas"]["SubjectRef"];
|
|
1246
1256
|
};
|
|
@@ -1250,7 +1260,7 @@ export interface components {
|
|
|
1250
1260
|
* @description The date and time its periods start from (ISO 8601), such as a subscription's start.
|
|
1251
1261
|
* @example 2026-03-17T14:30:00Z
|
|
1252
1262
|
*/
|
|
1253
|
-
|
|
1263
|
+
billingDate: string;
|
|
1254
1264
|
};
|
|
1255
1265
|
Team: {
|
|
1256
1266
|
/** @example 2026-08-19T12:00:00.000Z */
|
|
@@ -1269,8 +1279,8 @@ export interface components {
|
|
|
1269
1279
|
};
|
|
1270
1280
|
UsageBySubject: {
|
|
1271
1281
|
items: {
|
|
1272
|
-
|
|
1273
|
-
|
|
1282
|
+
/** @description Checks this limit refused in the window. */
|
|
1283
|
+
refused: number;
|
|
1274
1284
|
remaining: number;
|
|
1275
1285
|
subject: {
|
|
1276
1286
|
id: string;
|
|
@@ -1287,7 +1297,7 @@ export interface components {
|
|
|
1287
1297
|
limitId: string;
|
|
1288
1298
|
points: {
|
|
1289
1299
|
allowed: number;
|
|
1290
|
-
|
|
1300
|
+
refused: number;
|
|
1291
1301
|
start: string;
|
|
1292
1302
|
used: number;
|
|
1293
1303
|
}[];
|
|
@@ -1298,9 +1308,9 @@ export interface components {
|
|
|
1298
1308
|
limits: {
|
|
1299
1309
|
action: string;
|
|
1300
1310
|
amount: number;
|
|
1301
|
-
|
|
1311
|
+
limitId: string;
|
|
1302
1312
|
name: string;
|
|
1303
|
-
/** @description A balance's can exceed `amount` once credits are
|
|
1313
|
+
/** @description A balance's can exceed `amount` once credits are added. */
|
|
1304
1314
|
remaining: number;
|
|
1305
1315
|
resetsAt: string | null;
|
|
1306
1316
|
rolling: boolean;
|
|
@@ -1460,6 +1470,13 @@ export interface operations {
|
|
|
1460
1470
|
"application/json": components["schemas"]["CheckDecision"];
|
|
1461
1471
|
};
|
|
1462
1472
|
};
|
|
1473
|
+
/** @description Sent with `limitry-finish-only: 1` (a client finishing an earlier try with the same Idempotency-Key, after a timeout), and there was no earlier try to finish: nothing was decided or charged. */
|
|
1474
|
+
204: {
|
|
1475
|
+
headers: {
|
|
1476
|
+
[name: string]: unknown;
|
|
1477
|
+
};
|
|
1478
|
+
content?: never;
|
|
1479
|
+
};
|
|
1463
1480
|
/** @description Invalid request (code: invalid_request). */
|
|
1464
1481
|
400: {
|
|
1465
1482
|
headers: {
|
|
@@ -1514,7 +1531,7 @@ export interface operations {
|
|
|
1514
1531
|
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
1515
1532
|
};
|
|
1516
1533
|
};
|
|
1517
|
-
/** @description
|
|
1534
|
+
/** @description The subject is moving between Limitry's servers, a few seconds (code: moving, with Retry-After): retry with the same Idempotency-Key — nothing was charged (anything held is given back, or finished by the retry). Or too many checks for these subjects are being decided at once (code: busy, with Retry-After): nothing was charged — retry with the same Idempotency-Key after Retry-After, with backoff. Or checks are unavailable, or a check across Limitry's servers couldn't be confirmed in time and may have been charged (code: internal_error): retry with the same Idempotency-Key. */
|
|
1518
1535
|
503: {
|
|
1519
1536
|
headers: {
|
|
1520
1537
|
[name: string]: unknown;
|
|
@@ -1624,7 +1641,7 @@ export interface operations {
|
|
|
1624
1641
|
"application/json": components["schemas"]["Limit"];
|
|
1625
1642
|
};
|
|
1626
1643
|
};
|
|
1627
|
-
/** @description Invalid request, such as a
|
|
1644
|
+
/** @description Invalid request, such as a change to a field fixed once the limit is created (code: invalid_request). */
|
|
1628
1645
|
400: {
|
|
1629
1646
|
headers: {
|
|
1630
1647
|
[name: string]: unknown;
|
|
@@ -1651,6 +1668,15 @@ export interface operations {
|
|
|
1651
1668
|
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
1652
1669
|
};
|
|
1653
1670
|
};
|
|
1671
|
+
/** @description An active limit already has this name — or, with no `name` sent, the one the limit would get (code: invalid_request): send a `name` of its own. */
|
|
1672
|
+
409: {
|
|
1673
|
+
headers: {
|
|
1674
|
+
[name: string]: unknown;
|
|
1675
|
+
};
|
|
1676
|
+
content: {
|
|
1677
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
1678
|
+
};
|
|
1679
|
+
};
|
|
1654
1680
|
/** @description Per-key quota exhausted (code: rate_limited); retry after the Retry-After header. */
|
|
1655
1681
|
429: {
|
|
1656
1682
|
headers: {
|
|
@@ -1754,7 +1780,7 @@ export interface operations {
|
|
|
1754
1780
|
"application/json": components["schemas"]["Limit"];
|
|
1755
1781
|
};
|
|
1756
1782
|
};
|
|
1757
|
-
/** @description Invalid request, such as a
|
|
1783
|
+
/** @description Invalid request, such as a change to a field fixed once the limit is created (code: invalid_request). */
|
|
1758
1784
|
400: {
|
|
1759
1785
|
headers: {
|
|
1760
1786
|
[name: string]: unknown;
|
|
@@ -1790,6 +1816,15 @@ export interface operations {
|
|
|
1790
1816
|
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
1791
1817
|
};
|
|
1792
1818
|
};
|
|
1819
|
+
/** @description An active limit already has this name — or, with no `name` sent, the one the limit would get (code: invalid_request): send a `name` of its own. */
|
|
1820
|
+
409: {
|
|
1821
|
+
headers: {
|
|
1822
|
+
[name: string]: unknown;
|
|
1823
|
+
};
|
|
1824
|
+
content: {
|
|
1825
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
1826
|
+
};
|
|
1827
|
+
};
|
|
1793
1828
|
/** @description Per-key quota exhausted (code: rate_limited); retry after the Retry-After header. */
|
|
1794
1829
|
429: {
|
|
1795
1830
|
headers: {
|
|
@@ -1862,7 +1897,7 @@ export interface operations {
|
|
|
1862
1897
|
};
|
|
1863
1898
|
};
|
|
1864
1899
|
};
|
|
1865
|
-
"limits.
|
|
1900
|
+
"limits.credits.list": {
|
|
1866
1901
|
parameters: {
|
|
1867
1902
|
query?: never;
|
|
1868
1903
|
header?: {
|
|
@@ -1878,14 +1913,14 @@ export interface operations {
|
|
|
1878
1913
|
};
|
|
1879
1914
|
requestBody?: never;
|
|
1880
1915
|
responses: {
|
|
1881
|
-
/** @description The
|
|
1916
|
+
/** @description The credits. */
|
|
1882
1917
|
200: {
|
|
1883
1918
|
headers: {
|
|
1884
1919
|
[name: string]: unknown;
|
|
1885
1920
|
};
|
|
1886
1921
|
content: {
|
|
1887
1922
|
"application/json": {
|
|
1888
|
-
items: components["schemas"]["
|
|
1923
|
+
items: components["schemas"]["Credit"][];
|
|
1889
1924
|
};
|
|
1890
1925
|
};
|
|
1891
1926
|
};
|
|
@@ -1927,7 +1962,7 @@ export interface operations {
|
|
|
1927
1962
|
};
|
|
1928
1963
|
};
|
|
1929
1964
|
};
|
|
1930
|
-
"limits.
|
|
1965
|
+
"limits.credits.create": {
|
|
1931
1966
|
parameters: {
|
|
1932
1967
|
query?: never;
|
|
1933
1968
|
header?: {
|
|
@@ -1943,20 +1978,20 @@ export interface operations {
|
|
|
1943
1978
|
};
|
|
1944
1979
|
requestBody: {
|
|
1945
1980
|
content: {
|
|
1946
|
-
"application/json": components["schemas"]["
|
|
1981
|
+
"application/json": components["schemas"]["CreditInput"];
|
|
1947
1982
|
};
|
|
1948
1983
|
};
|
|
1949
1984
|
responses: {
|
|
1950
|
-
/** @description The
|
|
1985
|
+
/** @description The credit — the balance is raised. */
|
|
1951
1986
|
201: {
|
|
1952
1987
|
headers: {
|
|
1953
1988
|
[name: string]: unknown;
|
|
1954
1989
|
};
|
|
1955
1990
|
content: {
|
|
1956
|
-
"application/json": components["schemas"]["
|
|
1991
|
+
"application/json": components["schemas"]["Credit"];
|
|
1957
1992
|
};
|
|
1958
1993
|
};
|
|
1959
|
-
/** @description Invalid request, such as a
|
|
1994
|
+
/** @description Invalid request, such as a change to a field fixed once the limit is created (code: invalid_request). */
|
|
1960
1995
|
400: {
|
|
1961
1996
|
headers: {
|
|
1962
1997
|
[name: string]: unknown;
|
|
@@ -2037,7 +2072,7 @@ export interface operations {
|
|
|
2037
2072
|
"application/json": components["schemas"]["Limit"];
|
|
2038
2073
|
};
|
|
2039
2074
|
};
|
|
2040
|
-
/** @description Invalid request, such as a
|
|
2075
|
+
/** @description Invalid request, such as a change to a field fixed once the limit is created (code: invalid_request). */
|
|
2041
2076
|
400: {
|
|
2042
2077
|
headers: {
|
|
2043
2078
|
[name: string]: unknown;
|
|
@@ -2102,7 +2137,7 @@ export interface operations {
|
|
|
2102
2137
|
};
|
|
2103
2138
|
};
|
|
2104
2139
|
responses: {
|
|
2105
|
-
/** @description What changed, or with `
|
|
2140
|
+
/** @description What changed, or with `preview`, what would. */
|
|
2106
2141
|
200: {
|
|
2107
2142
|
headers: {
|
|
2108
2143
|
[name: string]: unknown;
|
|
@@ -2111,7 +2146,7 @@ export interface operations {
|
|
|
2111
2146
|
"application/json": components["schemas"]["LimitSyncResult"];
|
|
2112
2147
|
};
|
|
2113
2148
|
};
|
|
2114
|
-
/** @description Something in the list is invalid, such as a name twice; nothing was changed (code: invalid_request, each problem in `details`). */
|
|
2149
|
+
/** @description Something in the list is invalid, such as a name twice or a change to what a limit counts; nothing was changed (code: invalid_request, each problem in `details`). */
|
|
2115
2150
|
400: {
|
|
2116
2151
|
headers: {
|
|
2117
2152
|
[name: string]: unknown;
|
|
@@ -2169,7 +2204,7 @@ export interface operations {
|
|
|
2169
2204
|
};
|
|
2170
2205
|
};
|
|
2171
2206
|
responses: {
|
|
2172
|
-
/** @description The reservation
|
|
2207
|
+
/** @description The reservation. */
|
|
2173
2208
|
200: {
|
|
2174
2209
|
headers: {
|
|
2175
2210
|
[name: string]: unknown;
|
|
@@ -2178,7 +2213,7 @@ export interface operations {
|
|
|
2178
2213
|
"application/json": components["schemas"]["Reservation"];
|
|
2179
2214
|
};
|
|
2180
2215
|
};
|
|
2181
|
-
/** @description Already
|
|
2216
|
+
/** @description Already committed or released the other way, or an invalid cost (code: invalid_request). */
|
|
2182
2217
|
400: {
|
|
2183
2218
|
headers: {
|
|
2184
2219
|
[name: string]: unknown;
|
|
@@ -2223,7 +2258,7 @@ export interface operations {
|
|
|
2223
2258
|
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
2224
2259
|
};
|
|
2225
2260
|
};
|
|
2226
|
-
/** @description
|
|
2261
|
+
/** @description The reservation's subject is moving between Limitry's servers, a few seconds (code: moving, with Retry-After): retry — the same settle answers the same. Or checks are unavailable (code: internal_error). */
|
|
2227
2262
|
503: {
|
|
2228
2263
|
headers: {
|
|
2229
2264
|
[name: string]: unknown;
|
|
@@ -2254,7 +2289,7 @@ export interface operations {
|
|
|
2254
2289
|
};
|
|
2255
2290
|
};
|
|
2256
2291
|
responses: {
|
|
2257
|
-
/** @description The reservation
|
|
2292
|
+
/** @description The reservation. */
|
|
2258
2293
|
200: {
|
|
2259
2294
|
headers: {
|
|
2260
2295
|
[name: string]: unknown;
|
|
@@ -2263,7 +2298,7 @@ export interface operations {
|
|
|
2263
2298
|
"application/json": components["schemas"]["Reservation"];
|
|
2264
2299
|
};
|
|
2265
2300
|
};
|
|
2266
|
-
/** @description Already
|
|
2301
|
+
/** @description Already committed or released the other way, or an invalid cost (code: invalid_request). */
|
|
2267
2302
|
400: {
|
|
2268
2303
|
headers: {
|
|
2269
2304
|
[name: string]: unknown;
|
|
@@ -2308,7 +2343,7 @@ export interface operations {
|
|
|
2308
2343
|
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
2309
2344
|
};
|
|
2310
2345
|
};
|
|
2311
|
-
/** @description
|
|
2346
|
+
/** @description The reservation's subject is moving between Limitry's servers, a few seconds (code: moving, with Retry-After): retry — the same settle answers the same. Or checks are unavailable (code: internal_error). */
|
|
2312
2347
|
503: {
|
|
2313
2348
|
headers: {
|
|
2314
2349
|
[name: string]: unknown;
|
|
@@ -2335,7 +2370,7 @@ export interface operations {
|
|
|
2335
2370
|
};
|
|
2336
2371
|
requestBody?: never;
|
|
2337
2372
|
responses: {
|
|
2338
|
-
/** @description The reservation
|
|
2373
|
+
/** @description The reservation. */
|
|
2339
2374
|
200: {
|
|
2340
2375
|
headers: {
|
|
2341
2376
|
[name: string]: unknown;
|
|
@@ -2344,7 +2379,7 @@ export interface operations {
|
|
|
2344
2379
|
"application/json": components["schemas"]["Reservation"];
|
|
2345
2380
|
};
|
|
2346
2381
|
};
|
|
2347
|
-
/** @description Already
|
|
2382
|
+
/** @description Already committed or released the other way, or an invalid cost (code: invalid_request). */
|
|
2348
2383
|
400: {
|
|
2349
2384
|
headers: {
|
|
2350
2385
|
[name: string]: unknown;
|
|
@@ -2389,7 +2424,7 @@ export interface operations {
|
|
|
2389
2424
|
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
2390
2425
|
};
|
|
2391
2426
|
};
|
|
2392
|
-
/** @description
|
|
2427
|
+
/** @description The reservation's subject is moving between Limitry's servers, a few seconds (code: moving, with Retry-After): retry — the same settle answers the same. Or checks are unavailable (code: internal_error). */
|
|
2393
2428
|
503: {
|
|
2394
2429
|
headers: {
|
|
2395
2430
|
[name: string]: unknown;
|
|
@@ -2494,7 +2529,7 @@ export interface operations {
|
|
|
2494
2529
|
};
|
|
2495
2530
|
};
|
|
2496
2531
|
responses: {
|
|
2497
|
-
/** @description The subject, with its new
|
|
2532
|
+
/** @description The subject, with its new billing date. */
|
|
2498
2533
|
200: {
|
|
2499
2534
|
headers: {
|
|
2500
2535
|
[name: string]: unknown;
|
|
@@ -2503,7 +2538,7 @@ export interface operations {
|
|
|
2503
2538
|
"application/json": components["schemas"]["Subject"];
|
|
2504
2539
|
};
|
|
2505
2540
|
};
|
|
2506
|
-
/** @description Invalid
|
|
2541
|
+
/** @description Invalid billing date (code: invalid_request). */
|
|
2507
2542
|
400: {
|
|
2508
2543
|
headers: {
|
|
2509
2544
|
[name: string]: unknown;
|
|
@@ -2636,10 +2671,8 @@ export interface operations {
|
|
|
2636
2671
|
granularity?: "hour" | "day";
|
|
2637
2672
|
/** @description The limit. */
|
|
2638
2673
|
limitId: string;
|
|
2639
|
-
/** @description
|
|
2640
|
-
|
|
2641
|
-
/** @description With `subjectId`: one subject's usage, not every subject's. */
|
|
2642
|
-
subjectKind?: string;
|
|
2674
|
+
/** @description One subject's usage, not every subject's, as `kind:id`. */
|
|
2675
|
+
subject?: string;
|
|
2643
2676
|
/** @description End of the range (ISO 8601). Default: now. */
|
|
2644
2677
|
to?: string;
|
|
2645
2678
|
};
|
|
@@ -2713,12 +2746,10 @@ export interface operations {
|
|
|
2713
2746
|
"usage.standing": {
|
|
2714
2747
|
parameters: {
|
|
2715
2748
|
query: {
|
|
2716
|
-
/** @description The subject's id, as your checks send it. */
|
|
2717
|
-
id: string;
|
|
2718
|
-
/** @description The subject's kind, as your checks send it. */
|
|
2719
|
-
kind: string;
|
|
2720
2749
|
/** @description Shared subjects to include, comma-separated `kind:id` (up to 4). */
|
|
2721
2750
|
shared?: string;
|
|
2751
|
+
/** @description The subject, as `kind:id`: its kind and id as your checks send them. */
|
|
2752
|
+
subject: string;
|
|
2722
2753
|
};
|
|
2723
2754
|
header?: {
|
|
2724
2755
|
/** @description The environment the request acts in; without it, the product's default. An API key bound to an environment always acts in its own (403 naming another); an unknown environment is 400. */
|