@oxy.so/contracts 4.8.0 → 4.9.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.
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/accountGraph.js +13 -5
- package/dist/cjs/accountSubject.js +189 -0
- package/dist/cjs/agency.js +56 -4
- package/dist/cjs/agentKeys.js +67 -0
- package/dist/cjs/capabilityBindings.js +72 -0
- package/dist/cjs/index.js +60 -13
- package/dist/cjs/inference/decisions.js +41 -0
- package/dist/cjs/inference/economics.js +135 -0
- package/dist/cjs/products/access.js +60 -0
- package/dist/cjs/products/billing.js +32 -0
- package/dist/cjs/signIn.js +1 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/accountGraph.js +13 -5
- package/dist/esm/accountSubject.js +182 -0
- package/dist/esm/agency.js +55 -3
- package/dist/esm/agentKeys.js +63 -0
- package/dist/esm/capabilityBindings.js +67 -0
- package/dist/esm/index.js +10 -1
- package/dist/esm/inference/decisions.js +41 -0
- package/dist/esm/inference/economics.js +132 -0
- package/dist/esm/products/access.js +57 -0
- package/dist/esm/products/billing.js +29 -0
- package/dist/esm/signIn.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/accountGraph.d.ts +23 -8
- package/dist/types/accountSubject.d.ts +210 -0
- package/dist/types/agency.d.ts +956 -190
- package/dist/types/agentKeys.d.ts +525 -0
- package/dist/types/capabilityBindings.d.ts +6 -0
- package/dist/types/deviceDirectory.d.ts +50 -50
- package/dist/types/deviceSession.d.ts +14 -14
- package/dist/types/externalIdentity.d.ts +4 -4
- package/dist/types/identity.d.ts +2 -2
- package/dist/types/index.d.ts +12 -2
- package/dist/types/inference/accountBilling.d.ts +30 -30
- package/dist/types/inference/aliaModelRelease.d.ts +83 -83
- package/dist/types/inference/catalogue.d.ts +180 -180
- package/dist/types/inference/economics.d.ts +376 -0
- package/dist/types/inference/entitlement.d.ts +47 -47
- package/dist/types/inference/inbox.d.ts +12 -12
- package/dist/types/inference/modelDocumentation.d.ts +231 -231
- package/dist/types/inference/priceVersion.d.ts +4 -4
- package/dist/types/inference/providerConnection.d.ts +38 -38
- package/dist/types/inference/realtime.d.ts +802 -802
- package/dist/types/inference/request.d.ts +844 -844
- package/dist/types/inference/routingPolicy.d.ts +4 -4
- package/dist/types/inference/scopedExecution.d.ts +38 -38
- package/dist/types/inference/streamEvents.d.ts +4 -4
- package/dist/types/inference/usage.d.ts +12 -12
- package/dist/types/keyRotation.d.ts +2 -2
- package/dist/types/notifications.d.ts +4 -4
- package/dist/types/oauth.d.ts +30 -30
- package/dist/types/products/access.d.ts +487 -0
- package/dist/types/products/billing.d.ts +563 -0
- package/dist/types/recommendations.d.ts +2 -2
- package/dist/types/sessionStatus.d.ts +10 -10
- package/dist/types/signIn.d.ts +6 -6
- package/dist/types/transparency.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Economic treatment and durable usage/cost reporting for inference
|
|
3
|
+
* (issue #1526, plan item I09).
|
|
4
|
+
*
|
|
5
|
+
* ## Two treatments, decided by the server
|
|
6
|
+
*
|
|
7
|
+
* - `commercial` — the default for every caller. Reserve → settle → refund
|
|
8
|
+
* (ADR 0009), when this deployment charges at all.
|
|
9
|
+
* - `internal_metered` — a product relationship Oxy itself configured and
|
|
10
|
+
* versioned (e.g. Alia consuming Kaana through the Oxy edge). No hold, no
|
|
11
|
+
* receipt, no promotional grant, no `platform_revenue` entry and no transfer
|
|
12
|
+
* between products; usage and cost are still recorded durably, and scopes,
|
|
13
|
+
* revocation, technical capacity, model eligibility, privacy and
|
|
14
|
+
* idempotency all still apply.
|
|
15
|
+
*
|
|
16
|
+
* The treatment is derived from the AUTHENTICATED application, its environment
|
|
17
|
+
* and lane, against a versioned policy. Nothing a caller sends — body, header,
|
|
18
|
+
* bot kind, agent id, delegated user — can select it, so neither value is ever
|
|
19
|
+
* accepted on a request shape.
|
|
20
|
+
*
|
|
21
|
+
* ## Four numbers that never merge
|
|
22
|
+
*
|
|
23
|
+
* A usage report separates what was consumed (units), upstream cost evidence
|
|
24
|
+
* (`providerCost`, reported or rate-card-estimated by Kaana's operator feed), what the published
|
|
25
|
+
* tariff would have charged (`tariff`) and what a customer was actually charged
|
|
26
|
+
* (`customerCharge`, from settled receipts only). A tariff is not a cost, and an
|
|
27
|
+
* UNKNOWN cost is reported as unknown — counted, never summed as zero.
|
|
28
|
+
*/
|
|
29
|
+
import { z } from 'zod';
|
|
30
|
+
/** How a request is treated economically. The first entry is the default. */
|
|
31
|
+
export declare const INFERENCE_ECONOMIC_TREATMENTS: readonly ["commercial", "internal_metered"];
|
|
32
|
+
export declare const inferenceEconomicTreatmentSchema: z.ZodEnum<["commercial", "internal_metered"]>;
|
|
33
|
+
/**
|
|
34
|
+
* Where an upstream attempt's cost came from, exactly as Kaana's operator feed
|
|
35
|
+
* states it: an exact provider billing fact, a versioned rate-card estimate, or
|
|
36
|
+
* nothing known. `unknown` carries no amount, so it cannot be summed as free.
|
|
37
|
+
*/
|
|
38
|
+
export declare const PROVIDER_COST_SOURCES: readonly ["provider_reported", "rate_card", "unknown"];
|
|
39
|
+
export declare const providerCostSourceSchema: z.ZodEnum<["provider_reported", "rate_card", "unknown"]>;
|
|
40
|
+
/**
|
|
41
|
+
* What one cost centre consumed over a window under one economic treatment.
|
|
42
|
+
*
|
|
43
|
+
* `customerCharge` is always zero with zero receipts for `internal_metered`:
|
|
44
|
+
* those requests have no receipt by construction, and saying so is the point.
|
|
45
|
+
*/
|
|
46
|
+
export declare const costCenterUsageSchema: z.ZodObject<{
|
|
47
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
48
|
+
/** `null` for usage booked to an account with no cost centre above it. */
|
|
49
|
+
costCenter: z.ZodNullable<z.ZodObject<{
|
|
50
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
51
|
+
accountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
|
|
52
|
+
slug: z.ZodString;
|
|
53
|
+
label: z.ZodString;
|
|
54
|
+
status: z.ZodEnum<["active", "retired"]>;
|
|
55
|
+
createdAt: z.ZodString;
|
|
56
|
+
updatedAt: z.ZodString;
|
|
57
|
+
}, "strict", z.ZodTypeAny, {
|
|
58
|
+
status: "active" | "retired";
|
|
59
|
+
schemaVersion: 1;
|
|
60
|
+
accountId: string & z.BRAND<"OxyAccountId">;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
updatedAt: string;
|
|
63
|
+
label: string;
|
|
64
|
+
slug: string;
|
|
65
|
+
}, {
|
|
66
|
+
status: "active" | "retired";
|
|
67
|
+
schemaVersion: 1;
|
|
68
|
+
accountId: string;
|
|
69
|
+
createdAt: string;
|
|
70
|
+
updatedAt: string;
|
|
71
|
+
label: string;
|
|
72
|
+
slug: string;
|
|
73
|
+
}>>;
|
|
74
|
+
treatment: z.ZodEnum<["commercial", "internal_metered"]>;
|
|
75
|
+
currency: z.ZodString;
|
|
76
|
+
periodStart: z.ZodString;
|
|
77
|
+
periodEnd: z.ZodString;
|
|
78
|
+
/** Requests settled in the window (completed, failed, cancelled or partial). */
|
|
79
|
+
requestCount: z.ZodNumber;
|
|
80
|
+
/** Requests admitted and not yet settled when the report was read. */
|
|
81
|
+
inFlightCount: z.ZodNumber;
|
|
82
|
+
/** Expired admissions with no authoritative terminal usage; never called in-flight. */
|
|
83
|
+
expiredCount: z.ZodDefault<z.ZodNumber>;
|
|
84
|
+
/** Metered units, by unit name, summed over the settled requests. */
|
|
85
|
+
units: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
86
|
+
/** The published tariff at each request's pinned price version. Not a cost. */
|
|
87
|
+
tariff: z.ZodObject<{
|
|
88
|
+
/** Sum of the rows whose amount is known, in `currency`. */
|
|
89
|
+
amount: z.ZodBranded<z.ZodString, "ExactDecimal">;
|
|
90
|
+
/** Rows (requests or attempts) whose amount is known. */
|
|
91
|
+
knownCount: z.ZodNumber;
|
|
92
|
+
/** Rows that exist and have NO amount. Never folded into `amount` as zero. */
|
|
93
|
+
unknownCount: z.ZodNumber;
|
|
94
|
+
}, "strict", z.ZodTypeAny, {
|
|
95
|
+
amount: string & z.BRAND<"ExactDecimal">;
|
|
96
|
+
knownCount: number;
|
|
97
|
+
unknownCount: number;
|
|
98
|
+
}, {
|
|
99
|
+
amount: string;
|
|
100
|
+
knownCount: number;
|
|
101
|
+
unknownCount: number;
|
|
102
|
+
}>;
|
|
103
|
+
/** Upstream cost evidence, reported or estimated, per attempt including failed failovers. */
|
|
104
|
+
providerCost: z.ZodObject<{
|
|
105
|
+
/** Sum of the rows whose amount is known, in `currency`. */
|
|
106
|
+
amount: z.ZodBranded<z.ZodString, "ExactDecimal">;
|
|
107
|
+
/** Rows (requests or attempts) whose amount is known. */
|
|
108
|
+
knownCount: z.ZodNumber;
|
|
109
|
+
/** Rows that exist and have NO amount. Never folded into `amount` as zero. */
|
|
110
|
+
unknownCount: z.ZodNumber;
|
|
111
|
+
} & {
|
|
112
|
+
/** Attempts with a known subtotal and incomplete upstream cost coverage. */
|
|
113
|
+
partialCount: z.ZodDefault<z.ZodNumber>;
|
|
114
|
+
/** Requests with no ingested provider-cost attempt yet; never measured zero. */
|
|
115
|
+
missingRequestCount: z.ZodDefault<z.ZodNumber>;
|
|
116
|
+
/** Attempts priced in a different currency, excluded without currency conversion. */
|
|
117
|
+
otherCurrencyCount: z.ZodDefault<z.ZodNumber>;
|
|
118
|
+
/** Amount stated by the provider; this is not a copy of its invoice. */
|
|
119
|
+
providerReportedAmount: z.ZodDefault<z.ZodBranded<z.ZodString, "ExactDecimal">>;
|
|
120
|
+
providerReportedCount: z.ZodDefault<z.ZodNumber>;
|
|
121
|
+
/** Amount estimated from Kaana's immutable rate card, never described as invoiced. */
|
|
122
|
+
estimatedAmount: z.ZodDefault<z.ZodBranded<z.ZodString, "ExactDecimal">>;
|
|
123
|
+
estimatedCount: z.ZodDefault<z.ZodNumber>;
|
|
124
|
+
}, "strict", z.ZodTypeAny, {
|
|
125
|
+
amount: string & z.BRAND<"ExactDecimal">;
|
|
126
|
+
knownCount: number;
|
|
127
|
+
unknownCount: number;
|
|
128
|
+
partialCount: number;
|
|
129
|
+
missingRequestCount: number;
|
|
130
|
+
otherCurrencyCount: number;
|
|
131
|
+
providerReportedAmount: string & z.BRAND<"ExactDecimal">;
|
|
132
|
+
providerReportedCount: number;
|
|
133
|
+
estimatedAmount: string & z.BRAND<"ExactDecimal">;
|
|
134
|
+
estimatedCount: number;
|
|
135
|
+
}, {
|
|
136
|
+
amount: string;
|
|
137
|
+
knownCount: number;
|
|
138
|
+
unknownCount: number;
|
|
139
|
+
partialCount?: number | undefined;
|
|
140
|
+
missingRequestCount?: number | undefined;
|
|
141
|
+
otherCurrencyCount?: number | undefined;
|
|
142
|
+
providerReportedAmount?: string | undefined;
|
|
143
|
+
providerReportedCount?: number | undefined;
|
|
144
|
+
estimatedAmount?: string | undefined;
|
|
145
|
+
estimatedCount?: number | undefined;
|
|
146
|
+
}>;
|
|
147
|
+
/**
|
|
148
|
+
* What customers were actually charged, from settled receipts only. A
|
|
149
|
+
* request with no receipt was not charged — an internal one by
|
|
150
|
+
* construction, a shadow-metered one because charging is off.
|
|
151
|
+
*/
|
|
152
|
+
customerCharge: z.ZodObject<{
|
|
153
|
+
amount: z.ZodBranded<z.ZodString, "ExactDecimal">;
|
|
154
|
+
receiptCount: z.ZodNumber;
|
|
155
|
+
}, "strict", z.ZodTypeAny, {
|
|
156
|
+
amount: string & z.BRAND<"ExactDecimal">;
|
|
157
|
+
receiptCount: number;
|
|
158
|
+
}, {
|
|
159
|
+
amount: string;
|
|
160
|
+
receiptCount: number;
|
|
161
|
+
}>;
|
|
162
|
+
}, "strict", z.ZodTypeAny, {
|
|
163
|
+
schemaVersion: 1;
|
|
164
|
+
currency: string;
|
|
165
|
+
periodEnd: string;
|
|
166
|
+
units: Record<string, number>;
|
|
167
|
+
periodStart: string;
|
|
168
|
+
costCenter: {
|
|
169
|
+
status: "active" | "retired";
|
|
170
|
+
schemaVersion: 1;
|
|
171
|
+
accountId: string & z.BRAND<"OxyAccountId">;
|
|
172
|
+
createdAt: string;
|
|
173
|
+
updatedAt: string;
|
|
174
|
+
label: string;
|
|
175
|
+
slug: string;
|
|
176
|
+
} | null;
|
|
177
|
+
requestCount: number;
|
|
178
|
+
treatment: "commercial" | "internal_metered";
|
|
179
|
+
inFlightCount: number;
|
|
180
|
+
expiredCount: number;
|
|
181
|
+
tariff: {
|
|
182
|
+
amount: string & z.BRAND<"ExactDecimal">;
|
|
183
|
+
knownCount: number;
|
|
184
|
+
unknownCount: number;
|
|
185
|
+
};
|
|
186
|
+
providerCost: {
|
|
187
|
+
amount: string & z.BRAND<"ExactDecimal">;
|
|
188
|
+
knownCount: number;
|
|
189
|
+
unknownCount: number;
|
|
190
|
+
partialCount: number;
|
|
191
|
+
missingRequestCount: number;
|
|
192
|
+
otherCurrencyCount: number;
|
|
193
|
+
providerReportedAmount: string & z.BRAND<"ExactDecimal">;
|
|
194
|
+
providerReportedCount: number;
|
|
195
|
+
estimatedAmount: string & z.BRAND<"ExactDecimal">;
|
|
196
|
+
estimatedCount: number;
|
|
197
|
+
};
|
|
198
|
+
customerCharge: {
|
|
199
|
+
amount: string & z.BRAND<"ExactDecimal">;
|
|
200
|
+
receiptCount: number;
|
|
201
|
+
};
|
|
202
|
+
}, {
|
|
203
|
+
schemaVersion: 1;
|
|
204
|
+
currency: string;
|
|
205
|
+
periodEnd: string;
|
|
206
|
+
units: Record<string, number>;
|
|
207
|
+
periodStart: string;
|
|
208
|
+
costCenter: {
|
|
209
|
+
status: "active" | "retired";
|
|
210
|
+
schemaVersion: 1;
|
|
211
|
+
accountId: string;
|
|
212
|
+
createdAt: string;
|
|
213
|
+
updatedAt: string;
|
|
214
|
+
label: string;
|
|
215
|
+
slug: string;
|
|
216
|
+
} | null;
|
|
217
|
+
requestCount: number;
|
|
218
|
+
treatment: "commercial" | "internal_metered";
|
|
219
|
+
inFlightCount: number;
|
|
220
|
+
tariff: {
|
|
221
|
+
amount: string;
|
|
222
|
+
knownCount: number;
|
|
223
|
+
unknownCount: number;
|
|
224
|
+
};
|
|
225
|
+
providerCost: {
|
|
226
|
+
amount: string;
|
|
227
|
+
knownCount: number;
|
|
228
|
+
unknownCount: number;
|
|
229
|
+
partialCount?: number | undefined;
|
|
230
|
+
missingRequestCount?: number | undefined;
|
|
231
|
+
otherCurrencyCount?: number | undefined;
|
|
232
|
+
providerReportedAmount?: string | undefined;
|
|
233
|
+
providerReportedCount?: number | undefined;
|
|
234
|
+
estimatedAmount?: string | undefined;
|
|
235
|
+
estimatedCount?: number | undefined;
|
|
236
|
+
};
|
|
237
|
+
customerCharge: {
|
|
238
|
+
amount: string;
|
|
239
|
+
receiptCount: number;
|
|
240
|
+
};
|
|
241
|
+
expiredCount?: number | undefined;
|
|
242
|
+
}>;
|
|
243
|
+
export type InferenceEconomicTreatment = z.infer<typeof inferenceEconomicTreatmentSchema>;
|
|
244
|
+
export type ProviderCostSource = z.infer<typeof providerCostSourceSchema>;
|
|
245
|
+
export type CostCenterUsage = z.infer<typeof costCenterUsageSchema>;
|
|
246
|
+
/** A technical generation record for an internal request, never a financial receipt. */
|
|
247
|
+
export declare const meteredGenerationSchema: z.ZodObject<{
|
|
248
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
249
|
+
kind: z.ZodLiteral<"metered_usage">;
|
|
250
|
+
meteredUsageId: z.ZodString;
|
|
251
|
+
requestId: z.ZodString;
|
|
252
|
+
generationId: z.ZodOptional<z.ZodString>;
|
|
253
|
+
parentRequestId: z.ZodOptional<z.ZodString>;
|
|
254
|
+
applicationId: z.ZodString;
|
|
255
|
+
credentialId: z.ZodString;
|
|
256
|
+
delegatedUserId: z.ZodOptional<z.ZodString>;
|
|
257
|
+
environment: z.ZodEnum<["development", "staging", "production"]>;
|
|
258
|
+
economicTreatment: z.ZodLiteral<"internal_metered">;
|
|
259
|
+
economicPolicyVersion: z.ZodString;
|
|
260
|
+
outcome: z.ZodEnum<["completed", "partial", "cancelled", "failed"]>;
|
|
261
|
+
usageSource: z.ZodEnum<["provider_reported", "oxy_measured", "estimated"]>;
|
|
262
|
+
units: z.ZodArray<z.ZodObject<{
|
|
263
|
+
unit: z.ZodEnum<["input_tokens", "cached_input_tokens", "output_tokens", "reasoning_tokens", "requests", "images", "audio_input_milliseconds", "audio_output_milliseconds", "video_milliseconds", "characters", "embeddings", "audio_input_tokens", "cached_audio_input_tokens", "audio_output_tokens", "session_milliseconds"]>;
|
|
264
|
+
quantity: z.ZodNumber;
|
|
265
|
+
}, "strict", z.ZodTypeAny, {
|
|
266
|
+
unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
|
|
267
|
+
quantity: number;
|
|
268
|
+
}, {
|
|
269
|
+
unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
|
|
270
|
+
quantity: number;
|
|
271
|
+
}>, "many">;
|
|
272
|
+
resolvedModelReference: z.ZodString;
|
|
273
|
+
servingProvider: z.ZodString;
|
|
274
|
+
tariff: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
275
|
+
status: z.ZodLiteral<"quoted">;
|
|
276
|
+
amount: z.ZodBranded<z.ZodString, "ExactDecimal">;
|
|
277
|
+
currency: z.ZodString;
|
|
278
|
+
priceVersionId: z.ZodString;
|
|
279
|
+
}, "strict", z.ZodTypeAny, {
|
|
280
|
+
status: "quoted";
|
|
281
|
+
currency: string;
|
|
282
|
+
amount: string & z.BRAND<"ExactDecimal">;
|
|
283
|
+
priceVersionId: string;
|
|
284
|
+
}, {
|
|
285
|
+
status: "quoted";
|
|
286
|
+
currency: string;
|
|
287
|
+
amount: string;
|
|
288
|
+
priceVersionId: string;
|
|
289
|
+
}>, z.ZodObject<{
|
|
290
|
+
status: z.ZodLiteral<"unpriced">;
|
|
291
|
+
priceVersionId: z.ZodNullable<z.ZodString>;
|
|
292
|
+
}, "strict", z.ZodTypeAny, {
|
|
293
|
+
status: "unpriced";
|
|
294
|
+
priceVersionId: string | null;
|
|
295
|
+
}, {
|
|
296
|
+
status: "unpriced";
|
|
297
|
+
priceVersionId: string | null;
|
|
298
|
+
}>]>;
|
|
299
|
+
customerCharge: z.ZodObject<{
|
|
300
|
+
status: z.ZodLiteral<"not_charged">;
|
|
301
|
+
}, "strict", z.ZodTypeAny, {
|
|
302
|
+
status: "not_charged";
|
|
303
|
+
}, {
|
|
304
|
+
status: "not_charged";
|
|
305
|
+
}>;
|
|
306
|
+
settledAt: z.ZodString;
|
|
307
|
+
}, "strict", z.ZodTypeAny, {
|
|
308
|
+
environment: "development" | "staging" | "production";
|
|
309
|
+
kind: "metered_usage";
|
|
310
|
+
schemaVersion: 2;
|
|
311
|
+
applicationId: string;
|
|
312
|
+
credentialId: string;
|
|
313
|
+
requestId: string;
|
|
314
|
+
settledAt: string;
|
|
315
|
+
outcome: "failed" | "completed" | "cancelled" | "partial";
|
|
316
|
+
resolvedModelReference: string;
|
|
317
|
+
servingProvider: string;
|
|
318
|
+
units: {
|
|
319
|
+
unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
|
|
320
|
+
quantity: number;
|
|
321
|
+
}[];
|
|
322
|
+
usageSource: "provider_reported" | "oxy_measured" | "estimated";
|
|
323
|
+
tariff: {
|
|
324
|
+
status: "quoted";
|
|
325
|
+
currency: string;
|
|
326
|
+
amount: string & z.BRAND<"ExactDecimal">;
|
|
327
|
+
priceVersionId: string;
|
|
328
|
+
} | {
|
|
329
|
+
status: "unpriced";
|
|
330
|
+
priceVersionId: string | null;
|
|
331
|
+
};
|
|
332
|
+
customerCharge: {
|
|
333
|
+
status: "not_charged";
|
|
334
|
+
};
|
|
335
|
+
meteredUsageId: string;
|
|
336
|
+
economicTreatment: "internal_metered";
|
|
337
|
+
economicPolicyVersion: string;
|
|
338
|
+
generationId?: string | undefined;
|
|
339
|
+
parentRequestId?: string | undefined;
|
|
340
|
+
delegatedUserId?: string | undefined;
|
|
341
|
+
}, {
|
|
342
|
+
environment: "development" | "staging" | "production";
|
|
343
|
+
kind: "metered_usage";
|
|
344
|
+
schemaVersion: 2;
|
|
345
|
+
applicationId: string;
|
|
346
|
+
credentialId: string;
|
|
347
|
+
requestId: string;
|
|
348
|
+
settledAt: string;
|
|
349
|
+
outcome: "failed" | "completed" | "cancelled" | "partial";
|
|
350
|
+
resolvedModelReference: string;
|
|
351
|
+
servingProvider: string;
|
|
352
|
+
units: {
|
|
353
|
+
unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
|
|
354
|
+
quantity: number;
|
|
355
|
+
}[];
|
|
356
|
+
usageSource: "provider_reported" | "oxy_measured" | "estimated";
|
|
357
|
+
tariff: {
|
|
358
|
+
status: "quoted";
|
|
359
|
+
currency: string;
|
|
360
|
+
amount: string;
|
|
361
|
+
priceVersionId: string;
|
|
362
|
+
} | {
|
|
363
|
+
status: "unpriced";
|
|
364
|
+
priceVersionId: string | null;
|
|
365
|
+
};
|
|
366
|
+
customerCharge: {
|
|
367
|
+
status: "not_charged";
|
|
368
|
+
};
|
|
369
|
+
meteredUsageId: string;
|
|
370
|
+
economicTreatment: "internal_metered";
|
|
371
|
+
economicPolicyVersion: string;
|
|
372
|
+
generationId?: string | undefined;
|
|
373
|
+
parentRequestId?: string | undefined;
|
|
374
|
+
delegatedUserId?: string | undefined;
|
|
375
|
+
}>;
|
|
376
|
+
export type MeteredGeneration = z.infer<typeof meteredGenerationSchema>;
|
|
@@ -198,20 +198,20 @@ export declare const costCenterSchema: z.ZodObject<{
|
|
|
198
198
|
updatedAt: z.ZodString;
|
|
199
199
|
}, "strict", z.ZodTypeAny, {
|
|
200
200
|
status: "active" | "retired";
|
|
201
|
+
schemaVersion: 1;
|
|
201
202
|
accountId: string & z.BRAND<"OxyAccountId">;
|
|
202
203
|
createdAt: string;
|
|
203
204
|
updatedAt: string;
|
|
204
|
-
schemaVersion: 1;
|
|
205
|
-
slug: string;
|
|
206
205
|
label: string;
|
|
206
|
+
slug: string;
|
|
207
207
|
}, {
|
|
208
208
|
status: "active" | "retired";
|
|
209
|
+
schemaVersion: 1;
|
|
209
210
|
accountId: string;
|
|
210
211
|
createdAt: string;
|
|
211
212
|
updatedAt: string;
|
|
212
|
-
schemaVersion: 1;
|
|
213
|
-
slug: string;
|
|
214
213
|
label: string;
|
|
214
|
+
slug: string;
|
|
215
215
|
}>;
|
|
216
216
|
/**
|
|
217
217
|
* What one cost centre spent over a window.
|
|
@@ -234,20 +234,20 @@ export declare const costCenterSpendSchema: z.ZodObject<{
|
|
|
234
234
|
updatedAt: z.ZodString;
|
|
235
235
|
}, "strict", z.ZodTypeAny, {
|
|
236
236
|
status: "active" | "retired";
|
|
237
|
+
schemaVersion: 1;
|
|
237
238
|
accountId: string & z.BRAND<"OxyAccountId">;
|
|
238
239
|
createdAt: string;
|
|
239
240
|
updatedAt: string;
|
|
240
|
-
schemaVersion: 1;
|
|
241
|
-
slug: string;
|
|
242
241
|
label: string;
|
|
242
|
+
slug: string;
|
|
243
243
|
}, {
|
|
244
244
|
status: "active" | "retired";
|
|
245
|
+
schemaVersion: 1;
|
|
245
246
|
accountId: string;
|
|
246
247
|
createdAt: string;
|
|
247
248
|
updatedAt: string;
|
|
248
|
-
schemaVersion: 1;
|
|
249
|
-
slug: string;
|
|
250
249
|
label: string;
|
|
250
|
+
slug: string;
|
|
251
251
|
}>;
|
|
252
252
|
currency: z.ZodString;
|
|
253
253
|
periodStart: z.ZodString;
|
|
@@ -262,12 +262,12 @@ export declare const costCenterSpendSchema: z.ZodObject<{
|
|
|
262
262
|
periodStart: string;
|
|
263
263
|
costCenter: {
|
|
264
264
|
status: "active" | "retired";
|
|
265
|
+
schemaVersion: 1;
|
|
265
266
|
accountId: string & z.BRAND<"OxyAccountId">;
|
|
266
267
|
createdAt: string;
|
|
267
268
|
updatedAt: string;
|
|
268
|
-
schemaVersion: 1;
|
|
269
|
-
slug: string;
|
|
270
269
|
label: string;
|
|
270
|
+
slug: string;
|
|
271
271
|
};
|
|
272
272
|
requestCount: number;
|
|
273
273
|
}, {
|
|
@@ -278,12 +278,12 @@ export declare const costCenterSpendSchema: z.ZodObject<{
|
|
|
278
278
|
periodStart: string;
|
|
279
279
|
costCenter: {
|
|
280
280
|
status: "active" | "retired";
|
|
281
|
+
schemaVersion: 1;
|
|
281
282
|
accountId: string;
|
|
282
283
|
createdAt: string;
|
|
283
284
|
updatedAt: string;
|
|
284
|
-
schemaVersion: 1;
|
|
285
|
-
slug: string;
|
|
286
285
|
label: string;
|
|
286
|
+
slug: string;
|
|
287
287
|
};
|
|
288
288
|
requestCount: number;
|
|
289
289
|
}>;
|
|
@@ -409,40 +409,24 @@ export declare const productEntitlementSchema: z.ZodObject<{
|
|
|
409
409
|
updatedAt: z.ZodString;
|
|
410
410
|
}, "strict", z.ZodTypeAny, {
|
|
411
411
|
status: "active" | "retired";
|
|
412
|
+
schemaVersion: 1;
|
|
412
413
|
accountId: string & z.BRAND<"OxyAccountId">;
|
|
413
414
|
createdAt: string;
|
|
414
415
|
updatedAt: string;
|
|
415
|
-
schemaVersion: 1;
|
|
416
|
-
slug: string;
|
|
417
416
|
label: string;
|
|
417
|
+
slug: string;
|
|
418
418
|
}, {
|
|
419
419
|
status: "active" | "retired";
|
|
420
|
+
schemaVersion: 1;
|
|
420
421
|
accountId: string;
|
|
421
422
|
createdAt: string;
|
|
422
423
|
updatedAt: string;
|
|
423
|
-
schemaVersion: 1;
|
|
424
|
-
slug: string;
|
|
425
424
|
label: string;
|
|
425
|
+
slug: string;
|
|
426
426
|
}>>;
|
|
427
427
|
/** When this view was computed. Entitlements are eventually consistent. */
|
|
428
428
|
resolvedAt: z.ZodString;
|
|
429
429
|
}, "strict", z.ZodTypeAny, {
|
|
430
|
-
accountId: string & z.BRAND<"OxyAccountId">;
|
|
431
|
-
schemaVersion: 1;
|
|
432
|
-
allowances: {
|
|
433
|
-
key: string;
|
|
434
|
-
included: number;
|
|
435
|
-
remaining?: number | undefined;
|
|
436
|
-
}[];
|
|
437
|
-
costCenter: {
|
|
438
|
-
status: "active" | "retired";
|
|
439
|
-
accountId: string & z.BRAND<"OxyAccountId">;
|
|
440
|
-
createdAt: string;
|
|
441
|
-
updatedAt: string;
|
|
442
|
-
schemaVersion: 1;
|
|
443
|
-
slug: string;
|
|
444
|
-
label: string;
|
|
445
|
-
} | null;
|
|
446
430
|
plan: {
|
|
447
431
|
status: "active" | "incomplete" | "canceled" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
|
|
448
432
|
name: string;
|
|
@@ -457,19 +441,8 @@ export declare const productEntitlementSchema: z.ZodObject<{
|
|
|
457
441
|
remaining?: number | undefined;
|
|
458
442
|
}[];
|
|
459
443
|
} | null;
|
|
460
|
-
payAsYouGo: {
|
|
461
|
-
currency: string;
|
|
462
|
-
billingMode: "prepaid" | "invoiced";
|
|
463
|
-
billingAccountId: string & z.BRAND<"OxyAccountId">;
|
|
464
|
-
purchasedBalance: string & z.BRAND<"ExactDecimal">;
|
|
465
|
-
promotionalBalance: string & z.BRAND<"ExactDecimal">;
|
|
466
|
-
availableToSpend: string & z.BRAND<"ExactDecimal">;
|
|
467
|
-
canSpend: boolean;
|
|
468
|
-
} | null;
|
|
469
|
-
resolvedAt: string;
|
|
470
|
-
}, {
|
|
471
|
-
accountId: string;
|
|
472
444
|
schemaVersion: 1;
|
|
445
|
+
accountId: string & z.BRAND<"OxyAccountId">;
|
|
473
446
|
allowances: {
|
|
474
447
|
key: string;
|
|
475
448
|
included: number;
|
|
@@ -477,13 +450,24 @@ export declare const productEntitlementSchema: z.ZodObject<{
|
|
|
477
450
|
}[];
|
|
478
451
|
costCenter: {
|
|
479
452
|
status: "active" | "retired";
|
|
480
|
-
|
|
453
|
+
schemaVersion: 1;
|
|
454
|
+
accountId: string & z.BRAND<"OxyAccountId">;
|
|
481
455
|
createdAt: string;
|
|
482
456
|
updatedAt: string;
|
|
483
|
-
schemaVersion: 1;
|
|
484
|
-
slug: string;
|
|
485
457
|
label: string;
|
|
458
|
+
slug: string;
|
|
486
459
|
} | null;
|
|
460
|
+
payAsYouGo: {
|
|
461
|
+
currency: string;
|
|
462
|
+
billingMode: "prepaid" | "invoiced";
|
|
463
|
+
billingAccountId: string & z.BRAND<"OxyAccountId">;
|
|
464
|
+
purchasedBalance: string & z.BRAND<"ExactDecimal">;
|
|
465
|
+
promotionalBalance: string & z.BRAND<"ExactDecimal">;
|
|
466
|
+
availableToSpend: string & z.BRAND<"ExactDecimal">;
|
|
467
|
+
canSpend: boolean;
|
|
468
|
+
} | null;
|
|
469
|
+
resolvedAt: string;
|
|
470
|
+
}, {
|
|
487
471
|
plan: {
|
|
488
472
|
status: "active" | "incomplete" | "canceled" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
|
|
489
473
|
name: string;
|
|
@@ -498,6 +482,22 @@ export declare const productEntitlementSchema: z.ZodObject<{
|
|
|
498
482
|
remaining?: number | undefined;
|
|
499
483
|
}[];
|
|
500
484
|
} | null;
|
|
485
|
+
schemaVersion: 1;
|
|
486
|
+
accountId: string;
|
|
487
|
+
allowances: {
|
|
488
|
+
key: string;
|
|
489
|
+
included: number;
|
|
490
|
+
remaining?: number | undefined;
|
|
491
|
+
}[];
|
|
492
|
+
costCenter: {
|
|
493
|
+
status: "active" | "retired";
|
|
494
|
+
schemaVersion: 1;
|
|
495
|
+
accountId: string;
|
|
496
|
+
createdAt: string;
|
|
497
|
+
updatedAt: string;
|
|
498
|
+
label: string;
|
|
499
|
+
slug: string;
|
|
500
|
+
} | null;
|
|
501
501
|
payAsYouGo: {
|
|
502
502
|
currency: string;
|
|
503
503
|
billingMode: "prepaid" | "invoiced";
|
|
@@ -5,57 +5,57 @@ export declare const inboxComposeRequestSchema: z.ZodDiscriminatedUnion<"operati
|
|
|
5
5
|
tone: z.ZodEnum<["professional", "casual", "friendly", "formal"]>;
|
|
6
6
|
stream: z.ZodOptional<z.ZodBoolean>;
|
|
7
7
|
}, "strict", z.ZodTypeAny, {
|
|
8
|
-
prompt: string;
|
|
9
8
|
operation: "draft";
|
|
9
|
+
prompt: string;
|
|
10
10
|
tone: "professional" | "casual" | "friendly" | "formal";
|
|
11
11
|
stream?: boolean | undefined;
|
|
12
12
|
}, {
|
|
13
|
-
prompt: string;
|
|
14
13
|
operation: "draft";
|
|
14
|
+
prompt: string;
|
|
15
15
|
tone: "professional" | "casual" | "friendly" | "formal";
|
|
16
16
|
stream?: boolean | undefined;
|
|
17
17
|
}>, z.ZodObject<{
|
|
18
18
|
operation: z.ZodLiteral<"polish">;
|
|
19
19
|
text: z.ZodString;
|
|
20
20
|
}, "strict", z.ZodTypeAny, {
|
|
21
|
-
text: string;
|
|
22
21
|
operation: "polish";
|
|
23
|
-
}, {
|
|
24
22
|
text: string;
|
|
23
|
+
}, {
|
|
25
24
|
operation: "polish";
|
|
25
|
+
text: string;
|
|
26
26
|
}>, z.ZodObject<{
|
|
27
27
|
operation: z.ZodLiteral<"change_tone">;
|
|
28
28
|
text: z.ZodString;
|
|
29
29
|
tone: z.ZodEnum<["professional", "casual", "friendly", "formal"]>;
|
|
30
30
|
}, "strict", z.ZodTypeAny, {
|
|
31
|
-
text: string;
|
|
32
31
|
operation: "change_tone";
|
|
32
|
+
text: string;
|
|
33
33
|
tone: "professional" | "casual" | "friendly" | "formal";
|
|
34
34
|
}, {
|
|
35
|
-
text: string;
|
|
36
35
|
operation: "change_tone";
|
|
36
|
+
text: string;
|
|
37
37
|
tone: "professional" | "casual" | "friendly" | "formal";
|
|
38
38
|
}>, z.ZodObject<{
|
|
39
39
|
operation: z.ZodLiteral<"adjust_length">;
|
|
40
40
|
text: z.ZodString;
|
|
41
41
|
direction: z.ZodEnum<["shorter", "longer"]>;
|
|
42
42
|
}, "strict", z.ZodTypeAny, {
|
|
43
|
-
text: string;
|
|
44
|
-
operation: "adjust_length";
|
|
45
43
|
direction: "shorter" | "longer";
|
|
46
|
-
}, {
|
|
47
|
-
text: string;
|
|
48
44
|
operation: "adjust_length";
|
|
45
|
+
text: string;
|
|
46
|
+
}, {
|
|
49
47
|
direction: "shorter" | "longer";
|
|
48
|
+
operation: "adjust_length";
|
|
49
|
+
text: string;
|
|
50
50
|
}>, z.ZodObject<{
|
|
51
51
|
operation: z.ZodLiteral<"suggest_subject">;
|
|
52
52
|
body: z.ZodString;
|
|
53
53
|
}, "strict", z.ZodTypeAny, {
|
|
54
|
-
body: string;
|
|
55
54
|
operation: "suggest_subject";
|
|
56
|
-
}, {
|
|
57
55
|
body: string;
|
|
56
|
+
}, {
|
|
58
57
|
operation: "suggest_subject";
|
|
58
|
+
body: string;
|
|
59
59
|
}>]>;
|
|
60
60
|
/**
|
|
61
61
|
* The client owns the user's timezone and therefore supplies the UTC instants
|