@oxy.so/contracts 4.25.0 → 5.0.0

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.
@@ -1,1853 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const decisionEffortSchema: z.ZodEnum<["instant", "low", "medium", "high", "xhigh"]>;
3
- export declare const decisionQuestionSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
4
- kind: z.ZodLiteral<"choice">;
5
- options: z.ZodArray<z.ZodString, "many">;
6
- id: z.ZodString;
7
- question: z.ZodString;
8
- criteria: z.ZodOptional<z.ZodString>;
9
- }, "strict", z.ZodTypeAny, {
10
- options: string[];
11
- kind: "choice";
12
- id: string;
13
- question: string;
14
- criteria?: string | undefined;
15
- }, {
16
- options: string[];
17
- kind: "choice";
18
- id: string;
19
- question: string;
20
- criteria?: string | undefined;
21
- }>, z.ZodObject<{
22
- kind: z.ZodLiteral<"score">;
23
- levels: z.ZodArray<z.ZodString, "many">;
24
- id: z.ZodString;
25
- question: z.ZodString;
26
- criteria: z.ZodOptional<z.ZodString>;
27
- }, "strict", z.ZodTypeAny, {
28
- kind: "score";
29
- id: string;
30
- question: string;
31
- levels: string[];
32
- criteria?: string | undefined;
33
- }, {
34
- kind: "score";
35
- id: string;
36
- question: string;
37
- levels: string[];
38
- criteria?: string | undefined;
39
- }>, z.ZodObject<{
40
- kind: z.ZodLiteral<"noul">;
41
- id: z.ZodString;
42
- question: z.ZodString;
43
- criteria: z.ZodOptional<z.ZodString>;
44
- }, "strict", z.ZodTypeAny, {
45
- kind: "noul";
46
- id: string;
47
- question: string;
48
- criteria?: string | undefined;
49
- }, {
50
- kind: "noul";
51
- id: string;
52
- question: string;
53
- criteria?: string | undefined;
54
- }>]>;
55
- /**
56
- * Conservative serialized input accounting, including escaping and structure.
57
- * Measures both the normalized payload and the provider's structured-question
58
- * representation. Common instructions repeat per question there. A 255-byte
59
- * model identity and 4096-byte gateway-policy allowance bound adapter metadata.
60
- * Kaana must also check its final serialized body before sending it.
61
- */
62
- export declare function decisionInputBudget(payload: DecisionInput): {
63
- total: number;
64
- context: number;
65
- gateway: number;
66
- };
67
- /** OpenRouter's TOTAL limit is separate from direct state-plus-longest context. */
68
- export declare function decisionFitsGateway(payload: DecisionInput): boolean;
69
- export declare const decisionInputSchema: z.ZodEffects<z.ZodObject<{
70
- state: z.ZodString;
71
- instructions: z.ZodOptional<z.ZodString>;
72
- questions: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
73
- kind: z.ZodLiteral<"choice">;
74
- options: z.ZodArray<z.ZodString, "many">;
75
- id: z.ZodString;
76
- question: z.ZodString;
77
- criteria: z.ZodOptional<z.ZodString>;
78
- }, "strict", z.ZodTypeAny, {
79
- options: string[];
80
- kind: "choice";
81
- id: string;
82
- question: string;
83
- criteria?: string | undefined;
84
- }, {
85
- options: string[];
86
- kind: "choice";
87
- id: string;
88
- question: string;
89
- criteria?: string | undefined;
90
- }>, z.ZodObject<{
91
- kind: z.ZodLiteral<"score">;
92
- levels: z.ZodArray<z.ZodString, "many">;
93
- id: z.ZodString;
94
- question: z.ZodString;
95
- criteria: z.ZodOptional<z.ZodString>;
96
- }, "strict", z.ZodTypeAny, {
97
- kind: "score";
98
- id: string;
99
- question: string;
100
- levels: string[];
101
- criteria?: string | undefined;
102
- }, {
103
- kind: "score";
104
- id: string;
105
- question: string;
106
- levels: string[];
107
- criteria?: string | undefined;
108
- }>, z.ZodObject<{
109
- kind: z.ZodLiteral<"noul">;
110
- id: z.ZodString;
111
- question: z.ZodString;
112
- criteria: z.ZodOptional<z.ZodString>;
113
- }, "strict", z.ZodTypeAny, {
114
- kind: "noul";
115
- id: string;
116
- question: string;
117
- criteria?: string | undefined;
118
- }, {
119
- kind: "noul";
120
- id: string;
121
- question: string;
122
- criteria?: string | undefined;
123
- }>]>, "many">;
124
- effort: z.ZodOptional<z.ZodEnum<["instant", "low", "medium", "high", "xhigh"]>>;
125
- }, "strict", z.ZodTypeAny, {
126
- state: string;
127
- questions: ({
128
- options: string[];
129
- kind: "choice";
130
- id: string;
131
- question: string;
132
- criteria?: string | undefined;
133
- } | {
134
- kind: "score";
135
- id: string;
136
- question: string;
137
- levels: string[];
138
- criteria?: string | undefined;
139
- } | {
140
- kind: "noul";
141
- id: string;
142
- question: string;
143
- criteria?: string | undefined;
144
- })[];
145
- instructions?: string | undefined;
146
- effort?: "low" | "medium" | "high" | "instant" | "xhigh" | undefined;
147
- }, {
148
- state: string;
149
- questions: ({
150
- options: string[];
151
- kind: "choice";
152
- id: string;
153
- question: string;
154
- criteria?: string | undefined;
155
- } | {
156
- kind: "score";
157
- id: string;
158
- question: string;
159
- levels: string[];
160
- criteria?: string | undefined;
161
- } | {
162
- kind: "noul";
163
- id: string;
164
- question: string;
165
- criteria?: string | undefined;
166
- })[];
167
- instructions?: string | undefined;
168
- effort?: "low" | "medium" | "high" | "instant" | "xhigh" | undefined;
169
- }>, {
170
- state: string;
171
- questions: ({
172
- options: string[];
173
- kind: "choice";
174
- id: string;
175
- question: string;
176
- criteria?: string | undefined;
177
- } | {
178
- kind: "score";
179
- id: string;
180
- question: string;
181
- levels: string[];
182
- criteria?: string | undefined;
183
- } | {
184
- kind: "noul";
185
- id: string;
186
- question: string;
187
- criteria?: string | undefined;
188
- })[];
189
- instructions?: string | undefined;
190
- effort?: "low" | "medium" | "high" | "instant" | "xhigh" | undefined;
191
- }, {
192
- state: string;
193
- questions: ({
194
- options: string[];
195
- kind: "choice";
196
- id: string;
197
- question: string;
198
- criteria?: string | undefined;
199
- } | {
200
- kind: "score";
201
- id: string;
202
- question: string;
203
- levels: string[];
204
- criteria?: string | undefined;
205
- } | {
206
- kind: "noul";
207
- id: string;
208
- question: string;
209
- criteria?: string | undefined;
210
- })[];
211
- instructions?: string | undefined;
212
- effort?: "low" | "medium" | "high" | "instant" | "xhigh" | undefined;
213
- }>;
214
- export declare const decisionRequestSchema: z.ZodEffects<z.ZodObject<{
215
- state: z.ZodString;
216
- instructions: z.ZodOptional<z.ZodString>;
217
- questions: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
218
- kind: z.ZodLiteral<"choice">;
219
- options: z.ZodArray<z.ZodString, "many">;
220
- id: z.ZodString;
221
- question: z.ZodString;
222
- criteria: z.ZodOptional<z.ZodString>;
223
- }, "strict", z.ZodTypeAny, {
224
- options: string[];
225
- kind: "choice";
226
- id: string;
227
- question: string;
228
- criteria?: string | undefined;
229
- }, {
230
- options: string[];
231
- kind: "choice";
232
- id: string;
233
- question: string;
234
- criteria?: string | undefined;
235
- }>, z.ZodObject<{
236
- kind: z.ZodLiteral<"score">;
237
- levels: z.ZodArray<z.ZodString, "many">;
238
- id: z.ZodString;
239
- question: z.ZodString;
240
- criteria: z.ZodOptional<z.ZodString>;
241
- }, "strict", z.ZodTypeAny, {
242
- kind: "score";
243
- id: string;
244
- question: string;
245
- levels: string[];
246
- criteria?: string | undefined;
247
- }, {
248
- kind: "score";
249
- id: string;
250
- question: string;
251
- levels: string[];
252
- criteria?: string | undefined;
253
- }>, z.ZodObject<{
254
- kind: z.ZodLiteral<"noul">;
255
- id: z.ZodString;
256
- question: z.ZodString;
257
- criteria: z.ZodOptional<z.ZodString>;
258
- }, "strict", z.ZodTypeAny, {
259
- kind: "noul";
260
- id: string;
261
- question: string;
262
- criteria?: string | undefined;
263
- }, {
264
- kind: "noul";
265
- id: string;
266
- question: string;
267
- criteria?: string | undefined;
268
- }>]>, "many">;
269
- effort: z.ZodOptional<z.ZodEnum<["instant", "low", "medium", "high", "xhigh"]>>;
270
- model: z.ZodEffects<z.ZodString, string, string>;
271
- }, "strict", z.ZodTypeAny, {
272
- state: string;
273
- model: string;
274
- questions: ({
275
- options: string[];
276
- kind: "choice";
277
- id: string;
278
- question: string;
279
- criteria?: string | undefined;
280
- } | {
281
- kind: "score";
282
- id: string;
283
- question: string;
284
- levels: string[];
285
- criteria?: string | undefined;
286
- } | {
287
- kind: "noul";
288
- id: string;
289
- question: string;
290
- criteria?: string | undefined;
291
- })[];
292
- instructions?: string | undefined;
293
- effort?: "low" | "medium" | "high" | "instant" | "xhigh" | undefined;
294
- }, {
295
- state: string;
296
- model: string;
297
- questions: ({
298
- options: string[];
299
- kind: "choice";
300
- id: string;
301
- question: string;
302
- criteria?: string | undefined;
303
- } | {
304
- kind: "score";
305
- id: string;
306
- question: string;
307
- levels: string[];
308
- criteria?: string | undefined;
309
- } | {
310
- kind: "noul";
311
- id: string;
312
- question: string;
313
- criteria?: string | undefined;
314
- })[];
315
- instructions?: string | undefined;
316
- effort?: "low" | "medium" | "high" | "instant" | "xhigh" | undefined;
317
- }>, {
318
- state: string;
319
- model: string;
320
- questions: ({
321
- options: string[];
322
- kind: "choice";
323
- id: string;
324
- question: string;
325
- criteria?: string | undefined;
326
- } | {
327
- kind: "score";
328
- id: string;
329
- question: string;
330
- levels: string[];
331
- criteria?: string | undefined;
332
- } | {
333
- kind: "noul";
334
- id: string;
335
- question: string;
336
- criteria?: string | undefined;
337
- })[];
338
- instructions?: string | undefined;
339
- effort?: "low" | "medium" | "high" | "instant" | "xhigh" | undefined;
340
- }, {
341
- state: string;
342
- model: string;
343
- questions: ({
344
- options: string[];
345
- kind: "choice";
346
- id: string;
347
- question: string;
348
- criteria?: string | undefined;
349
- } | {
350
- kind: "score";
351
- id: string;
352
- question: string;
353
- levels: string[];
354
- criteria?: string | undefined;
355
- } | {
356
- kind: "noul";
357
- id: string;
358
- question: string;
359
- criteria?: string | undefined;
360
- })[];
361
- instructions?: string | undefined;
362
- effort?: "low" | "medium" | "high" | "instant" | "xhigh" | undefined;
363
- }>;
364
- export declare const decisionAnswerSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
365
- id: z.ZodString;
366
- kind: z.ZodLiteral<"choice">;
367
- /** Actual provider-selected option. Never reconstructed from probabilities. */
368
- reply: z.ZodString;
369
- /** Provider-returned confidence, not a correctness probability. */
370
- confidence: z.ZodNumber;
371
- probabilities: z.ZodArray<z.ZodNumber, "many">;
372
- }, "strict", z.ZodTypeAny, {
373
- kind: "choice";
374
- id: string;
375
- reply: string;
376
- confidence: number;
377
- probabilities: number[];
378
- }, {
379
- kind: "choice";
380
- id: string;
381
- reply: string;
382
- confidence: number;
383
- probabilities: number[];
384
- }>, z.ZodObject<{
385
- id: z.ZodString;
386
- kind: z.ZodLiteral<"score">;
387
- /** Actual provider score. Kept separate from the validated expected index. */
388
- reply: z.ZodNumber;
389
- confidence: z.ZodNumber;
390
- mean: z.ZodNumber;
391
- distribution: z.ZodArray<z.ZodNumber, "many">;
392
- }, "strict", z.ZodTypeAny, {
393
- kind: "score";
394
- id: string;
395
- reply: number;
396
- confidence: number;
397
- mean: number;
398
- distribution: number[];
399
- }, {
400
- kind: "score";
401
- id: string;
402
- reply: number;
403
- confidence: number;
404
- mean: number;
405
- distribution: number[];
406
- }>, z.ZodObject<{
407
- id: z.ZodString;
408
- kind: z.ZodLiteral<"noul">;
409
- probability: z.ZodNumber;
410
- }, "strict", z.ZodTypeAny, {
411
- kind: "noul";
412
- id: string;
413
- probability: number;
414
- }, {
415
- kind: "noul";
416
- id: string;
417
- probability: number;
418
- }>]>, {
419
- kind: "choice";
420
- id: string;
421
- reply: string;
422
- confidence: number;
423
- probabilities: number[];
424
- } | {
425
- kind: "score";
426
- id: string;
427
- reply: number;
428
- confidence: number;
429
- mean: number;
430
- distribution: number[];
431
- } | {
432
- kind: "noul";
433
- id: string;
434
- probability: number;
435
- }, {
436
- kind: "choice";
437
- id: string;
438
- reply: string;
439
- confidence: number;
440
- probabilities: number[];
441
- } | {
442
- kind: "score";
443
- id: string;
444
- reply: number;
445
- confidence: number;
446
- mean: number;
447
- distribution: number[];
448
- } | {
449
- kind: "noul";
450
- id: string;
451
- probability: number;
452
- }>;
453
- export declare const decisionResultSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
454
- usage: z.ZodEffects<z.ZodObject<{
455
- schemaVersion: z.ZodLiteral<2>;
456
- requestId: z.ZodString;
457
- generationId: z.ZodOptional<z.ZodString>;
458
- attribution: z.ZodObject<{
459
- principal: z.ZodObject<{
460
- billing: z.ZodObject<{
461
- accountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
462
- }, "strict", z.ZodTypeAny, {
463
- accountId: string & z.BRAND<"OxyAccountId">;
464
- }, {
465
- accountId: string;
466
- }>;
467
- applicationId: z.ZodString;
468
- credentialId: z.ZodString;
469
- environment: z.ZodEnum<["development", "staging", "production"]>;
470
- inferenceScopes: z.ZodArray<z.ZodEnum<["inference:invoke", "inference:models:read", "inference:usage:read", "inference:routing:read", "inference:routing:write", "inference:providers:read", "inference:providers:write"]>, "many">;
471
- }, "strip", z.ZodTypeAny, {
472
- environment: "development" | "staging" | "production";
473
- applicationId: string;
474
- credentialId: string;
475
- billing: {
476
- accountId: string & z.BRAND<"OxyAccountId">;
477
- };
478
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
479
- }, {
480
- environment: "development" | "staging" | "production";
481
- applicationId: string;
482
- credentialId: string;
483
- billing: {
484
- accountId: string;
485
- };
486
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
487
- }>;
488
- userId: z.ZodOptional<z.ZodBranded<z.ZodString, "DelegatedUserId">>;
489
- requestId: z.ZodString;
490
- generationId: z.ZodOptional<z.ZodString>;
491
- }, "strip", z.ZodTypeAny, {
492
- requestId: string;
493
- principal: {
494
- environment: "development" | "staging" | "production";
495
- applicationId: string;
496
- credentialId: string;
497
- billing: {
498
- accountId: string & z.BRAND<"OxyAccountId">;
499
- };
500
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
501
- };
502
- userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
503
- generationId?: string | undefined;
504
- }, {
505
- requestId: string;
506
- principal: {
507
- environment: "development" | "staging" | "production";
508
- applicationId: string;
509
- credentialId: string;
510
- billing: {
511
- accountId: string;
512
- };
513
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
514
- };
515
- userId?: string | undefined;
516
- generationId?: string | undefined;
517
- }>;
518
- outcome: z.ZodEnum<["completed", "partial", "cancelled", "failed"]>;
519
- units: z.ZodArray<z.ZodObject<{
520
- 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", "input_transcription_milliseconds"]>;
521
- quantity: z.ZodNumber;
522
- }, "strict", z.ZodTypeAny, {
523
- 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" | "input_transcription_milliseconds";
524
- quantity: number;
525
- }, {
526
- 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" | "input_transcription_milliseconds";
527
- quantity: number;
528
- }>, "many">;
529
- usageSource: z.ZodEnum<["provider_reported", "oxy_measured", "estimated"]>;
530
- resolvedModelReference: z.ZodString;
531
- servingProvider: z.ZodString;
532
- deploymentId: z.ZodString;
533
- routeSwitches: z.ZodNumber;
534
- fundingTier: z.ZodOptional<z.ZodEnum<["free", "credit", "paid"]>>;
535
- startedAt: z.ZodString;
536
- completedAt: z.ZodString;
537
- timeToFirstTokenMs: z.ZodOptional<z.ZodNumber>;
538
- }, "strip", z.ZodTypeAny, {
539
- schemaVersion: 2;
540
- requestId: string;
541
- outcome: "failed" | "completed" | "cancelled" | "partial";
542
- resolvedModelReference: string;
543
- servingProvider: string;
544
- attribution: {
545
- requestId: string;
546
- principal: {
547
- environment: "development" | "staging" | "production";
548
- applicationId: string;
549
- credentialId: string;
550
- billing: {
551
- accountId: string & z.BRAND<"OxyAccountId">;
552
- };
553
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
554
- };
555
- userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
556
- generationId?: string | undefined;
557
- };
558
- deploymentId: string;
559
- completedAt: string;
560
- units: {
561
- 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" | "input_transcription_milliseconds";
562
- quantity: number;
563
- }[];
564
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
565
- routeSwitches: number;
566
- startedAt: string;
567
- generationId?: string | undefined;
568
- fundingTier?: "free" | "credit" | "paid" | undefined;
569
- timeToFirstTokenMs?: number | undefined;
570
- }, {
571
- schemaVersion: 2;
572
- requestId: string;
573
- outcome: "failed" | "completed" | "cancelled" | "partial";
574
- resolvedModelReference: string;
575
- servingProvider: string;
576
- attribution: {
577
- requestId: string;
578
- principal: {
579
- environment: "development" | "staging" | "production";
580
- applicationId: string;
581
- credentialId: string;
582
- billing: {
583
- accountId: string;
584
- };
585
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
586
- };
587
- userId?: string | undefined;
588
- generationId?: string | undefined;
589
- };
590
- deploymentId: string;
591
- completedAt: string;
592
- units: {
593
- 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" | "input_transcription_milliseconds";
594
- quantity: number;
595
- }[];
596
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
597
- routeSwitches: number;
598
- startedAt: string;
599
- generationId?: string | undefined;
600
- fundingTier?: "free" | "credit" | "paid" | undefined;
601
- timeToFirstTokenMs?: number | undefined;
602
- }>, {
603
- schemaVersion: 2;
604
- requestId: string;
605
- outcome: "failed" | "completed" | "cancelled" | "partial";
606
- resolvedModelReference: string;
607
- servingProvider: string;
608
- attribution: {
609
- requestId: string;
610
- principal: {
611
- environment: "development" | "staging" | "production";
612
- applicationId: string;
613
- credentialId: string;
614
- billing: {
615
- accountId: string & z.BRAND<"OxyAccountId">;
616
- };
617
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
618
- };
619
- userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
620
- generationId?: string | undefined;
621
- };
622
- deploymentId: string;
623
- completedAt: string;
624
- units: {
625
- 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" | "input_transcription_milliseconds";
626
- quantity: number;
627
- }[];
628
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
629
- routeSwitches: number;
630
- startedAt: string;
631
- generationId?: string | undefined;
632
- fundingTier?: "free" | "credit" | "paid" | undefined;
633
- timeToFirstTokenMs?: number | undefined;
634
- }, {
635
- schemaVersion: 2;
636
- requestId: string;
637
- outcome: "failed" | "completed" | "cancelled" | "partial";
638
- resolvedModelReference: string;
639
- servingProvider: string;
640
- attribution: {
641
- requestId: string;
642
- principal: {
643
- environment: "development" | "staging" | "production";
644
- applicationId: string;
645
- credentialId: string;
646
- billing: {
647
- accountId: string;
648
- };
649
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
650
- };
651
- userId?: string | undefined;
652
- generationId?: string | undefined;
653
- };
654
- deploymentId: string;
655
- completedAt: string;
656
- units: {
657
- 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" | "input_transcription_milliseconds";
658
- quantity: number;
659
- }[];
660
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
661
- routeSwitches: number;
662
- startedAt: string;
663
- generationId?: string | undefined;
664
- fundingTier?: "free" | "credit" | "paid" | undefined;
665
- timeToFirstTokenMs?: number | undefined;
666
- }>;
667
- schemaVersion: z.ZodLiteral<1>;
668
- requestId: z.ZodString;
669
- model: z.ZodEffects<z.ZodString, string, string>;
670
- data: z.ZodArray<z.ZodEffects<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
671
- id: z.ZodString;
672
- kind: z.ZodLiteral<"choice">;
673
- /** Actual provider-selected option. Never reconstructed from probabilities. */
674
- reply: z.ZodString;
675
- /** Provider-returned confidence, not a correctness probability. */
676
- confidence: z.ZodNumber;
677
- probabilities: z.ZodArray<z.ZodNumber, "many">;
678
- }, "strict", z.ZodTypeAny, {
679
- kind: "choice";
680
- id: string;
681
- reply: string;
682
- confidence: number;
683
- probabilities: number[];
684
- }, {
685
- kind: "choice";
686
- id: string;
687
- reply: string;
688
- confidence: number;
689
- probabilities: number[];
690
- }>, z.ZodObject<{
691
- id: z.ZodString;
692
- kind: z.ZodLiteral<"score">;
693
- /** Actual provider score. Kept separate from the validated expected index. */
694
- reply: z.ZodNumber;
695
- confidence: z.ZodNumber;
696
- mean: z.ZodNumber;
697
- distribution: z.ZodArray<z.ZodNumber, "many">;
698
- }, "strict", z.ZodTypeAny, {
699
- kind: "score";
700
- id: string;
701
- reply: number;
702
- confidence: number;
703
- mean: number;
704
- distribution: number[];
705
- }, {
706
- kind: "score";
707
- id: string;
708
- reply: number;
709
- confidence: number;
710
- mean: number;
711
- distribution: number[];
712
- }>, z.ZodObject<{
713
- id: z.ZodString;
714
- kind: z.ZodLiteral<"noul">;
715
- probability: z.ZodNumber;
716
- }, "strict", z.ZodTypeAny, {
717
- kind: "noul";
718
- id: string;
719
- probability: number;
720
- }, {
721
- kind: "noul";
722
- id: string;
723
- probability: number;
724
- }>]>, {
725
- kind: "choice";
726
- id: string;
727
- reply: string;
728
- confidence: number;
729
- probabilities: number[];
730
- } | {
731
- kind: "score";
732
- id: string;
733
- reply: number;
734
- confidence: number;
735
- mean: number;
736
- distribution: number[];
737
- } | {
738
- kind: "noul";
739
- id: string;
740
- probability: number;
741
- }, {
742
- kind: "choice";
743
- id: string;
744
- reply: string;
745
- confidence: number;
746
- probabilities: number[];
747
- } | {
748
- kind: "score";
749
- id: string;
750
- reply: number;
751
- confidence: number;
752
- mean: number;
753
- distribution: number[];
754
- } | {
755
- kind: "noul";
756
- id: string;
757
- probability: number;
758
- }>, "many">;
759
- }, "strict", z.ZodTypeAny, {
760
- schemaVersion: 1;
761
- data: ({
762
- kind: "choice";
763
- id: string;
764
- reply: string;
765
- confidence: number;
766
- probabilities: number[];
767
- } | {
768
- kind: "score";
769
- id: string;
770
- reply: number;
771
- confidence: number;
772
- mean: number;
773
- distribution: number[];
774
- } | {
775
- kind: "noul";
776
- id: string;
777
- probability: number;
778
- })[];
779
- requestId: string;
780
- model: string;
781
- usage: {
782
- schemaVersion: 2;
783
- requestId: string;
784
- outcome: "failed" | "completed" | "cancelled" | "partial";
785
- resolvedModelReference: string;
786
- servingProvider: string;
787
- attribution: {
788
- requestId: string;
789
- principal: {
790
- environment: "development" | "staging" | "production";
791
- applicationId: string;
792
- credentialId: string;
793
- billing: {
794
- accountId: string & z.BRAND<"OxyAccountId">;
795
- };
796
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
797
- };
798
- userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
799
- generationId?: string | undefined;
800
- };
801
- deploymentId: string;
802
- completedAt: string;
803
- units: {
804
- 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" | "input_transcription_milliseconds";
805
- quantity: number;
806
- }[];
807
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
808
- routeSwitches: number;
809
- startedAt: string;
810
- generationId?: string | undefined;
811
- fundingTier?: "free" | "credit" | "paid" | undefined;
812
- timeToFirstTokenMs?: number | undefined;
813
- };
814
- }, {
815
- schemaVersion: 1;
816
- data: ({
817
- kind: "choice";
818
- id: string;
819
- reply: string;
820
- confidence: number;
821
- probabilities: number[];
822
- } | {
823
- kind: "score";
824
- id: string;
825
- reply: number;
826
- confidence: number;
827
- mean: number;
828
- distribution: number[];
829
- } | {
830
- kind: "noul";
831
- id: string;
832
- probability: number;
833
- })[];
834
- requestId: string;
835
- model: string;
836
- usage: {
837
- schemaVersion: 2;
838
- requestId: string;
839
- outcome: "failed" | "completed" | "cancelled" | "partial";
840
- resolvedModelReference: string;
841
- servingProvider: string;
842
- attribution: {
843
- requestId: string;
844
- principal: {
845
- environment: "development" | "staging" | "production";
846
- applicationId: string;
847
- credentialId: string;
848
- billing: {
849
- accountId: string;
850
- };
851
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
852
- };
853
- userId?: string | undefined;
854
- generationId?: string | undefined;
855
- };
856
- deploymentId: string;
857
- completedAt: string;
858
- units: {
859
- 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" | "input_transcription_milliseconds";
860
- quantity: number;
861
- }[];
862
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
863
- routeSwitches: number;
864
- startedAt: string;
865
- generationId?: string | undefined;
866
- fundingTier?: "free" | "credit" | "paid" | undefined;
867
- timeToFirstTokenMs?: number | undefined;
868
- };
869
- }>, {
870
- schemaVersion: 1;
871
- data: ({
872
- kind: "choice";
873
- id: string;
874
- reply: string;
875
- confidence: number;
876
- probabilities: number[];
877
- } | {
878
- kind: "score";
879
- id: string;
880
- reply: number;
881
- confidence: number;
882
- mean: number;
883
- distribution: number[];
884
- } | {
885
- kind: "noul";
886
- id: string;
887
- probability: number;
888
- })[];
889
- requestId: string;
890
- model: string;
891
- usage: {
892
- schemaVersion: 2;
893
- requestId: string;
894
- outcome: "failed" | "completed" | "cancelled" | "partial";
895
- resolvedModelReference: string;
896
- servingProvider: string;
897
- attribution: {
898
- requestId: string;
899
- principal: {
900
- environment: "development" | "staging" | "production";
901
- applicationId: string;
902
- credentialId: string;
903
- billing: {
904
- accountId: string & z.BRAND<"OxyAccountId">;
905
- };
906
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
907
- };
908
- userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
909
- generationId?: string | undefined;
910
- };
911
- deploymentId: string;
912
- completedAt: string;
913
- units: {
914
- 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" | "input_transcription_milliseconds";
915
- quantity: number;
916
- }[];
917
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
918
- routeSwitches: number;
919
- startedAt: string;
920
- generationId?: string | undefined;
921
- fundingTier?: "free" | "credit" | "paid" | undefined;
922
- timeToFirstTokenMs?: number | undefined;
923
- };
924
- }, {
925
- schemaVersion: 1;
926
- data: ({
927
- kind: "choice";
928
- id: string;
929
- reply: string;
930
- confidence: number;
931
- probabilities: number[];
932
- } | {
933
- kind: "score";
934
- id: string;
935
- reply: number;
936
- confidence: number;
937
- mean: number;
938
- distribution: number[];
939
- } | {
940
- kind: "noul";
941
- id: string;
942
- probability: number;
943
- })[];
944
- requestId: string;
945
- model: string;
946
- usage: {
947
- schemaVersion: 2;
948
- requestId: string;
949
- outcome: "failed" | "completed" | "cancelled" | "partial";
950
- resolvedModelReference: string;
951
- servingProvider: string;
952
- attribution: {
953
- requestId: string;
954
- principal: {
955
- environment: "development" | "staging" | "production";
956
- applicationId: string;
957
- credentialId: string;
958
- billing: {
959
- accountId: string;
960
- };
961
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
962
- };
963
- userId?: string | undefined;
964
- generationId?: string | undefined;
965
- };
966
- deploymentId: string;
967
- completedAt: string;
968
- units: {
969
- 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" | "input_transcription_milliseconds";
970
- quantity: number;
971
- }[];
972
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
973
- routeSwitches: number;
974
- startedAt: string;
975
- generationId?: string | undefined;
976
- fundingTier?: "free" | "credit" | "paid" | undefined;
977
- timeToFirstTokenMs?: number | undefined;
978
- };
979
- }>, {
980
- schemaVersion: 1;
981
- data: ({
982
- kind: "choice";
983
- id: string;
984
- reply: string;
985
- confidence: number;
986
- probabilities: number[];
987
- } | {
988
- kind: "score";
989
- id: string;
990
- reply: number;
991
- confidence: number;
992
- mean: number;
993
- distribution: number[];
994
- } | {
995
- kind: "noul";
996
- id: string;
997
- probability: number;
998
- })[];
999
- requestId: string;
1000
- model: string;
1001
- usage: {
1002
- schemaVersion: 2;
1003
- requestId: string;
1004
- outcome: "failed" | "completed" | "cancelled" | "partial";
1005
- resolvedModelReference: string;
1006
- servingProvider: string;
1007
- attribution: {
1008
- requestId: string;
1009
- principal: {
1010
- environment: "development" | "staging" | "production";
1011
- applicationId: string;
1012
- credentialId: string;
1013
- billing: {
1014
- accountId: string & z.BRAND<"OxyAccountId">;
1015
- };
1016
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1017
- };
1018
- userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
1019
- generationId?: string | undefined;
1020
- };
1021
- deploymentId: string;
1022
- completedAt: string;
1023
- units: {
1024
- 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" | "input_transcription_milliseconds";
1025
- quantity: number;
1026
- }[];
1027
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
1028
- routeSwitches: number;
1029
- startedAt: string;
1030
- generationId?: string | undefined;
1031
- fundingTier?: "free" | "credit" | "paid" | undefined;
1032
- timeToFirstTokenMs?: number | undefined;
1033
- };
1034
- }, {
1035
- schemaVersion: 1;
1036
- data: ({
1037
- kind: "choice";
1038
- id: string;
1039
- reply: string;
1040
- confidence: number;
1041
- probabilities: number[];
1042
- } | {
1043
- kind: "score";
1044
- id: string;
1045
- reply: number;
1046
- confidence: number;
1047
- mean: number;
1048
- distribution: number[];
1049
- } | {
1050
- kind: "noul";
1051
- id: string;
1052
- probability: number;
1053
- })[];
1054
- requestId: string;
1055
- model: string;
1056
- usage: {
1057
- schemaVersion: 2;
1058
- requestId: string;
1059
- outcome: "failed" | "completed" | "cancelled" | "partial";
1060
- resolvedModelReference: string;
1061
- servingProvider: string;
1062
- attribution: {
1063
- requestId: string;
1064
- principal: {
1065
- environment: "development" | "staging" | "production";
1066
- applicationId: string;
1067
- credentialId: string;
1068
- billing: {
1069
- accountId: string;
1070
- };
1071
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1072
- };
1073
- userId?: string | undefined;
1074
- generationId?: string | undefined;
1075
- };
1076
- deploymentId: string;
1077
- completedAt: string;
1078
- units: {
1079
- 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" | "input_transcription_milliseconds";
1080
- quantity: number;
1081
- }[];
1082
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
1083
- routeSwitches: number;
1084
- startedAt: string;
1085
- generationId?: string | undefined;
1086
- fundingTier?: "free" | "credit" | "paid" | undefined;
1087
- timeToFirstTokenMs?: number | undefined;
1088
- };
1089
- }>;
1090
- /**
1091
- * Kaana's typed decisions failure. `usage` is present only when the provider
1092
- * measured something before failing; its absence means nothing was measured,
1093
- * never that the cost was zero. A failure carrying usage did execute.
1094
- */
1095
- export declare const decisionFailureSchema: z.ZodEffects<z.ZodObject<{
1096
- schemaVersion: z.ZodLiteral<1>;
1097
- requestId: z.ZodString;
1098
- error: z.ZodEffects<z.ZodObject<{
1099
- schemaVersion: z.ZodLiteral<1>;
1100
- code: z.ZodEnum<["invalid_request", "authentication_failed", "permission_denied", "insufficient_scope", "model_not_found", "unsupported_modality", "context_length_exceeded", "request_too_large", "output_limit_exceeded", "idempotency_conflict", "insufficient_balance", "spending_limit_exceeded", "quota_exceeded", "byok_credential_invalid", "policy_violation", "commercial_permission_denied", "no_route_available", "upstream_content_filtered", "cancelled", "rate_limited", "deployment_unavailable", "provider_error", "provider_timeout", "provider_overloaded", "provider_credential_invalid", "provider_billing_refused", "service_unavailable", "internal_error"]>;
1101
- message: z.ZodEffects<z.ZodString, string, string>;
1102
- retryable: z.ZodBoolean;
1103
- requestId: z.ZodString;
1104
- retryAfterMs: z.ZodOptional<z.ZodNumber>;
1105
- param: z.ZodOptional<z.ZodString>;
1106
- upstreamCategory: z.ZodOptional<z.ZodEnum<["rate_limit", "quota", "timeout", "overloaded", "server_error", "content_filter", "invalid_request", "authentication", "unknown"]>>;
1107
- providerError: z.ZodOptional<z.ZodObject<{
1108
- provider: z.ZodString;
1109
- status: z.ZodOptional<z.ZodNumber>;
1110
- code: z.ZodOptional<z.ZodString>;
1111
- message: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1112
- }, "strict", z.ZodTypeAny, {
1113
- provider: string;
1114
- code?: string | undefined;
1115
- message?: string | undefined;
1116
- status?: number | undefined;
1117
- }, {
1118
- provider: string;
1119
- code?: string | undefined;
1120
- message?: string | undefined;
1121
- status?: number | undefined;
1122
- }>>;
1123
- }, "strip", z.ZodTypeAny, {
1124
- code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
1125
- message: string;
1126
- schemaVersion: 1;
1127
- requestId: string;
1128
- retryable: boolean;
1129
- retryAfterMs?: number | undefined;
1130
- param?: string | undefined;
1131
- upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
1132
- providerError?: {
1133
- provider: string;
1134
- code?: string | undefined;
1135
- message?: string | undefined;
1136
- status?: number | undefined;
1137
- } | undefined;
1138
- }, {
1139
- code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
1140
- message: string;
1141
- schemaVersion: 1;
1142
- requestId: string;
1143
- retryable: boolean;
1144
- retryAfterMs?: number | undefined;
1145
- param?: string | undefined;
1146
- upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
1147
- providerError?: {
1148
- provider: string;
1149
- code?: string | undefined;
1150
- message?: string | undefined;
1151
- status?: number | undefined;
1152
- } | undefined;
1153
- }>, {
1154
- code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
1155
- message: string;
1156
- schemaVersion: 1;
1157
- requestId: string;
1158
- retryable: boolean;
1159
- retryAfterMs?: number | undefined;
1160
- param?: string | undefined;
1161
- upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
1162
- providerError?: {
1163
- provider: string;
1164
- code?: string | undefined;
1165
- message?: string | undefined;
1166
- status?: number | undefined;
1167
- } | undefined;
1168
- }, {
1169
- code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
1170
- message: string;
1171
- schemaVersion: 1;
1172
- requestId: string;
1173
- retryable: boolean;
1174
- retryAfterMs?: number | undefined;
1175
- param?: string | undefined;
1176
- upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
1177
- providerError?: {
1178
- provider: string;
1179
- code?: string | undefined;
1180
- message?: string | undefined;
1181
- status?: number | undefined;
1182
- } | undefined;
1183
- }>;
1184
- usage: z.ZodOptional<z.ZodEffects<z.ZodObject<{
1185
- schemaVersion: z.ZodLiteral<2>;
1186
- requestId: z.ZodString;
1187
- generationId: z.ZodOptional<z.ZodString>;
1188
- attribution: z.ZodObject<{
1189
- principal: z.ZodObject<{
1190
- billing: z.ZodObject<{
1191
- accountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
1192
- }, "strict", z.ZodTypeAny, {
1193
- accountId: string & z.BRAND<"OxyAccountId">;
1194
- }, {
1195
- accountId: string;
1196
- }>;
1197
- applicationId: z.ZodString;
1198
- credentialId: z.ZodString;
1199
- environment: z.ZodEnum<["development", "staging", "production"]>;
1200
- inferenceScopes: z.ZodArray<z.ZodEnum<["inference:invoke", "inference:models:read", "inference:usage:read", "inference:routing:read", "inference:routing:write", "inference:providers:read", "inference:providers:write"]>, "many">;
1201
- }, "strip", z.ZodTypeAny, {
1202
- environment: "development" | "staging" | "production";
1203
- applicationId: string;
1204
- credentialId: string;
1205
- billing: {
1206
- accountId: string & z.BRAND<"OxyAccountId">;
1207
- };
1208
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1209
- }, {
1210
- environment: "development" | "staging" | "production";
1211
- applicationId: string;
1212
- credentialId: string;
1213
- billing: {
1214
- accountId: string;
1215
- };
1216
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1217
- }>;
1218
- userId: z.ZodOptional<z.ZodBranded<z.ZodString, "DelegatedUserId">>;
1219
- requestId: z.ZodString;
1220
- generationId: z.ZodOptional<z.ZodString>;
1221
- }, "strip", z.ZodTypeAny, {
1222
- requestId: string;
1223
- principal: {
1224
- environment: "development" | "staging" | "production";
1225
- applicationId: string;
1226
- credentialId: string;
1227
- billing: {
1228
- accountId: string & z.BRAND<"OxyAccountId">;
1229
- };
1230
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1231
- };
1232
- userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
1233
- generationId?: string | undefined;
1234
- }, {
1235
- requestId: string;
1236
- principal: {
1237
- environment: "development" | "staging" | "production";
1238
- applicationId: string;
1239
- credentialId: string;
1240
- billing: {
1241
- accountId: string;
1242
- };
1243
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1244
- };
1245
- userId?: string | undefined;
1246
- generationId?: string | undefined;
1247
- }>;
1248
- outcome: z.ZodEnum<["completed", "partial", "cancelled", "failed"]>;
1249
- units: z.ZodArray<z.ZodObject<{
1250
- 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", "input_transcription_milliseconds"]>;
1251
- quantity: z.ZodNumber;
1252
- }, "strict", z.ZodTypeAny, {
1253
- 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" | "input_transcription_milliseconds";
1254
- quantity: number;
1255
- }, {
1256
- 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" | "input_transcription_milliseconds";
1257
- quantity: number;
1258
- }>, "many">;
1259
- usageSource: z.ZodEnum<["provider_reported", "oxy_measured", "estimated"]>;
1260
- resolvedModelReference: z.ZodString;
1261
- servingProvider: z.ZodString;
1262
- deploymentId: z.ZodString;
1263
- routeSwitches: z.ZodNumber;
1264
- fundingTier: z.ZodOptional<z.ZodEnum<["free", "credit", "paid"]>>;
1265
- startedAt: z.ZodString;
1266
- completedAt: z.ZodString;
1267
- timeToFirstTokenMs: z.ZodOptional<z.ZodNumber>;
1268
- }, "strip", z.ZodTypeAny, {
1269
- schemaVersion: 2;
1270
- requestId: string;
1271
- outcome: "failed" | "completed" | "cancelled" | "partial";
1272
- resolvedModelReference: string;
1273
- servingProvider: string;
1274
- attribution: {
1275
- requestId: string;
1276
- principal: {
1277
- environment: "development" | "staging" | "production";
1278
- applicationId: string;
1279
- credentialId: string;
1280
- billing: {
1281
- accountId: string & z.BRAND<"OxyAccountId">;
1282
- };
1283
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1284
- };
1285
- userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
1286
- generationId?: string | undefined;
1287
- };
1288
- deploymentId: string;
1289
- completedAt: string;
1290
- units: {
1291
- 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" | "input_transcription_milliseconds";
1292
- quantity: number;
1293
- }[];
1294
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
1295
- routeSwitches: number;
1296
- startedAt: string;
1297
- generationId?: string | undefined;
1298
- fundingTier?: "free" | "credit" | "paid" | undefined;
1299
- timeToFirstTokenMs?: number | undefined;
1300
- }, {
1301
- schemaVersion: 2;
1302
- requestId: string;
1303
- outcome: "failed" | "completed" | "cancelled" | "partial";
1304
- resolvedModelReference: string;
1305
- servingProvider: string;
1306
- attribution: {
1307
- requestId: string;
1308
- principal: {
1309
- environment: "development" | "staging" | "production";
1310
- applicationId: string;
1311
- credentialId: string;
1312
- billing: {
1313
- accountId: string;
1314
- };
1315
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1316
- };
1317
- userId?: string | undefined;
1318
- generationId?: string | undefined;
1319
- };
1320
- deploymentId: string;
1321
- completedAt: string;
1322
- units: {
1323
- 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" | "input_transcription_milliseconds";
1324
- quantity: number;
1325
- }[];
1326
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
1327
- routeSwitches: number;
1328
- startedAt: string;
1329
- generationId?: string | undefined;
1330
- fundingTier?: "free" | "credit" | "paid" | undefined;
1331
- timeToFirstTokenMs?: number | undefined;
1332
- }>, {
1333
- schemaVersion: 2;
1334
- requestId: string;
1335
- outcome: "failed" | "completed" | "cancelled" | "partial";
1336
- resolvedModelReference: string;
1337
- servingProvider: string;
1338
- attribution: {
1339
- requestId: string;
1340
- principal: {
1341
- environment: "development" | "staging" | "production";
1342
- applicationId: string;
1343
- credentialId: string;
1344
- billing: {
1345
- accountId: string & z.BRAND<"OxyAccountId">;
1346
- };
1347
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1348
- };
1349
- userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
1350
- generationId?: string | undefined;
1351
- };
1352
- deploymentId: string;
1353
- completedAt: string;
1354
- units: {
1355
- 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" | "input_transcription_milliseconds";
1356
- quantity: number;
1357
- }[];
1358
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
1359
- routeSwitches: number;
1360
- startedAt: string;
1361
- generationId?: string | undefined;
1362
- fundingTier?: "free" | "credit" | "paid" | undefined;
1363
- timeToFirstTokenMs?: number | undefined;
1364
- }, {
1365
- schemaVersion: 2;
1366
- requestId: string;
1367
- outcome: "failed" | "completed" | "cancelled" | "partial";
1368
- resolvedModelReference: string;
1369
- servingProvider: string;
1370
- attribution: {
1371
- requestId: string;
1372
- principal: {
1373
- environment: "development" | "staging" | "production";
1374
- applicationId: string;
1375
- credentialId: string;
1376
- billing: {
1377
- accountId: string;
1378
- };
1379
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1380
- };
1381
- userId?: string | undefined;
1382
- generationId?: string | undefined;
1383
- };
1384
- deploymentId: string;
1385
- completedAt: string;
1386
- units: {
1387
- 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" | "input_transcription_milliseconds";
1388
- quantity: number;
1389
- }[];
1390
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
1391
- routeSwitches: number;
1392
- startedAt: string;
1393
- generationId?: string | undefined;
1394
- fundingTier?: "free" | "credit" | "paid" | undefined;
1395
- timeToFirstTokenMs?: number | undefined;
1396
- }>>;
1397
- }, "strict", z.ZodTypeAny, {
1398
- error: {
1399
- code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
1400
- message: string;
1401
- schemaVersion: 1;
1402
- requestId: string;
1403
- retryable: boolean;
1404
- retryAfterMs?: number | undefined;
1405
- param?: string | undefined;
1406
- upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
1407
- providerError?: {
1408
- provider: string;
1409
- code?: string | undefined;
1410
- message?: string | undefined;
1411
- status?: number | undefined;
1412
- } | undefined;
1413
- };
1414
- schemaVersion: 1;
1415
- requestId: string;
1416
- usage?: {
1417
- schemaVersion: 2;
1418
- requestId: string;
1419
- outcome: "failed" | "completed" | "cancelled" | "partial";
1420
- resolvedModelReference: string;
1421
- servingProvider: string;
1422
- attribution: {
1423
- requestId: string;
1424
- principal: {
1425
- environment: "development" | "staging" | "production";
1426
- applicationId: string;
1427
- credentialId: string;
1428
- billing: {
1429
- accountId: string & z.BRAND<"OxyAccountId">;
1430
- };
1431
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1432
- };
1433
- userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
1434
- generationId?: string | undefined;
1435
- };
1436
- deploymentId: string;
1437
- completedAt: string;
1438
- units: {
1439
- 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" | "input_transcription_milliseconds";
1440
- quantity: number;
1441
- }[];
1442
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
1443
- routeSwitches: number;
1444
- startedAt: string;
1445
- generationId?: string | undefined;
1446
- fundingTier?: "free" | "credit" | "paid" | undefined;
1447
- timeToFirstTokenMs?: number | undefined;
1448
- } | undefined;
1449
- }, {
1450
- error: {
1451
- code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
1452
- message: string;
1453
- schemaVersion: 1;
1454
- requestId: string;
1455
- retryable: boolean;
1456
- retryAfterMs?: number | undefined;
1457
- param?: string | undefined;
1458
- upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
1459
- providerError?: {
1460
- provider: string;
1461
- code?: string | undefined;
1462
- message?: string | undefined;
1463
- status?: number | undefined;
1464
- } | undefined;
1465
- };
1466
- schemaVersion: 1;
1467
- requestId: string;
1468
- usage?: {
1469
- schemaVersion: 2;
1470
- requestId: string;
1471
- outcome: "failed" | "completed" | "cancelled" | "partial";
1472
- resolvedModelReference: string;
1473
- servingProvider: string;
1474
- attribution: {
1475
- requestId: string;
1476
- principal: {
1477
- environment: "development" | "staging" | "production";
1478
- applicationId: string;
1479
- credentialId: string;
1480
- billing: {
1481
- accountId: string;
1482
- };
1483
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1484
- };
1485
- userId?: string | undefined;
1486
- generationId?: string | undefined;
1487
- };
1488
- deploymentId: string;
1489
- completedAt: string;
1490
- units: {
1491
- 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" | "input_transcription_milliseconds";
1492
- quantity: number;
1493
- }[];
1494
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
1495
- routeSwitches: number;
1496
- startedAt: string;
1497
- generationId?: string | undefined;
1498
- fundingTier?: "free" | "credit" | "paid" | undefined;
1499
- timeToFirstTokenMs?: number | undefined;
1500
- } | undefined;
1501
- }>, {
1502
- error: {
1503
- code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
1504
- message: string;
1505
- schemaVersion: 1;
1506
- requestId: string;
1507
- retryable: boolean;
1508
- retryAfterMs?: number | undefined;
1509
- param?: string | undefined;
1510
- upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
1511
- providerError?: {
1512
- provider: string;
1513
- code?: string | undefined;
1514
- message?: string | undefined;
1515
- status?: number | undefined;
1516
- } | undefined;
1517
- };
1518
- schemaVersion: 1;
1519
- requestId: string;
1520
- usage?: {
1521
- schemaVersion: 2;
1522
- requestId: string;
1523
- outcome: "failed" | "completed" | "cancelled" | "partial";
1524
- resolvedModelReference: string;
1525
- servingProvider: string;
1526
- attribution: {
1527
- requestId: string;
1528
- principal: {
1529
- environment: "development" | "staging" | "production";
1530
- applicationId: string;
1531
- credentialId: string;
1532
- billing: {
1533
- accountId: string & z.BRAND<"OxyAccountId">;
1534
- };
1535
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1536
- };
1537
- userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
1538
- generationId?: string | undefined;
1539
- };
1540
- deploymentId: string;
1541
- completedAt: string;
1542
- units: {
1543
- 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" | "input_transcription_milliseconds";
1544
- quantity: number;
1545
- }[];
1546
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
1547
- routeSwitches: number;
1548
- startedAt: string;
1549
- generationId?: string | undefined;
1550
- fundingTier?: "free" | "credit" | "paid" | undefined;
1551
- timeToFirstTokenMs?: number | undefined;
1552
- } | undefined;
1553
- }, {
1554
- error: {
1555
- code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
1556
- message: string;
1557
- schemaVersion: 1;
1558
- requestId: string;
1559
- retryable: boolean;
1560
- retryAfterMs?: number | undefined;
1561
- param?: string | undefined;
1562
- upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
1563
- providerError?: {
1564
- provider: string;
1565
- code?: string | undefined;
1566
- message?: string | undefined;
1567
- status?: number | undefined;
1568
- } | undefined;
1569
- };
1570
- schemaVersion: 1;
1571
- requestId: string;
1572
- usage?: {
1573
- schemaVersion: 2;
1574
- requestId: string;
1575
- outcome: "failed" | "completed" | "cancelled" | "partial";
1576
- resolvedModelReference: string;
1577
- servingProvider: string;
1578
- attribution: {
1579
- requestId: string;
1580
- principal: {
1581
- environment: "development" | "staging" | "production";
1582
- applicationId: string;
1583
- credentialId: string;
1584
- billing: {
1585
- accountId: string;
1586
- };
1587
- inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1588
- };
1589
- userId?: string | undefined;
1590
- generationId?: string | undefined;
1591
- };
1592
- deploymentId: string;
1593
- completedAt: string;
1594
- units: {
1595
- 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" | "input_transcription_milliseconds";
1596
- quantity: number;
1597
- }[];
1598
- usageSource: "provider_reported" | "oxy_measured" | "estimated";
1599
- routeSwitches: number;
1600
- startedAt: string;
1601
- generationId?: string | undefined;
1602
- fundingTier?: "free" | "credit" | "paid" | undefined;
1603
- timeToFirstTokenMs?: number | undefined;
1604
- } | undefined;
1605
- }>;
1606
- export declare const decisionSuccessSchema: z.ZodEffects<z.ZodObject<{
1607
- usage: z.ZodArray<z.ZodObject<{
1608
- 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", "input_transcription_milliseconds"]>;
1609
- quantity: z.ZodNumber;
1610
- }, "strict", z.ZodTypeAny, {
1611
- 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" | "input_transcription_milliseconds";
1612
- quantity: number;
1613
- }, {
1614
- 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" | "input_transcription_milliseconds";
1615
- quantity: number;
1616
- }>, "many">;
1617
- routingPolicy: z.ZodObject<{
1618
- routingPolicyId: z.ZodString;
1619
- policyVersion: z.ZodNumber;
1620
- }, "strict", z.ZodTypeAny, {
1621
- routingPolicyId: string;
1622
- policyVersion: number;
1623
- }, {
1624
- routingPolicyId: string;
1625
- policyVersion: number;
1626
- }>;
1627
- schemaVersion: z.ZodLiteral<1>;
1628
- requestId: z.ZodString;
1629
- model: z.ZodEffects<z.ZodString, string, string>;
1630
- data: z.ZodArray<z.ZodEffects<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1631
- id: z.ZodString;
1632
- kind: z.ZodLiteral<"choice">;
1633
- /** Actual provider-selected option. Never reconstructed from probabilities. */
1634
- reply: z.ZodString;
1635
- /** Provider-returned confidence, not a correctness probability. */
1636
- confidence: z.ZodNumber;
1637
- probabilities: z.ZodArray<z.ZodNumber, "many">;
1638
- }, "strict", z.ZodTypeAny, {
1639
- kind: "choice";
1640
- id: string;
1641
- reply: string;
1642
- confidence: number;
1643
- probabilities: number[];
1644
- }, {
1645
- kind: "choice";
1646
- id: string;
1647
- reply: string;
1648
- confidence: number;
1649
- probabilities: number[];
1650
- }>, z.ZodObject<{
1651
- id: z.ZodString;
1652
- kind: z.ZodLiteral<"score">;
1653
- /** Actual provider score. Kept separate from the validated expected index. */
1654
- reply: z.ZodNumber;
1655
- confidence: z.ZodNumber;
1656
- mean: z.ZodNumber;
1657
- distribution: z.ZodArray<z.ZodNumber, "many">;
1658
- }, "strict", z.ZodTypeAny, {
1659
- kind: "score";
1660
- id: string;
1661
- reply: number;
1662
- confidence: number;
1663
- mean: number;
1664
- distribution: number[];
1665
- }, {
1666
- kind: "score";
1667
- id: string;
1668
- reply: number;
1669
- confidence: number;
1670
- mean: number;
1671
- distribution: number[];
1672
- }>, z.ZodObject<{
1673
- id: z.ZodString;
1674
- kind: z.ZodLiteral<"noul">;
1675
- probability: z.ZodNumber;
1676
- }, "strict", z.ZodTypeAny, {
1677
- kind: "noul";
1678
- id: string;
1679
- probability: number;
1680
- }, {
1681
- kind: "noul";
1682
- id: string;
1683
- probability: number;
1684
- }>]>, {
1685
- kind: "choice";
1686
- id: string;
1687
- reply: string;
1688
- confidence: number;
1689
- probabilities: number[];
1690
- } | {
1691
- kind: "score";
1692
- id: string;
1693
- reply: number;
1694
- confidence: number;
1695
- mean: number;
1696
- distribution: number[];
1697
- } | {
1698
- kind: "noul";
1699
- id: string;
1700
- probability: number;
1701
- }, {
1702
- kind: "choice";
1703
- id: string;
1704
- reply: string;
1705
- confidence: number;
1706
- probabilities: number[];
1707
- } | {
1708
- kind: "score";
1709
- id: string;
1710
- reply: number;
1711
- confidence: number;
1712
- mean: number;
1713
- distribution: number[];
1714
- } | {
1715
- kind: "noul";
1716
- id: string;
1717
- probability: number;
1718
- }>, "many">;
1719
- }, "strict", z.ZodTypeAny, {
1720
- schemaVersion: 1;
1721
- data: ({
1722
- kind: "choice";
1723
- id: string;
1724
- reply: string;
1725
- confidence: number;
1726
- probabilities: number[];
1727
- } | {
1728
- kind: "score";
1729
- id: string;
1730
- reply: number;
1731
- confidence: number;
1732
- mean: number;
1733
- distribution: number[];
1734
- } | {
1735
- kind: "noul";
1736
- id: string;
1737
- probability: number;
1738
- })[];
1739
- requestId: string;
1740
- model: string;
1741
- usage: {
1742
- 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" | "input_transcription_milliseconds";
1743
- quantity: number;
1744
- }[];
1745
- routingPolicy: {
1746
- routingPolicyId: string;
1747
- policyVersion: number;
1748
- };
1749
- }, {
1750
- schemaVersion: 1;
1751
- data: ({
1752
- kind: "choice";
1753
- id: string;
1754
- reply: string;
1755
- confidence: number;
1756
- probabilities: number[];
1757
- } | {
1758
- kind: "score";
1759
- id: string;
1760
- reply: number;
1761
- confidence: number;
1762
- mean: number;
1763
- distribution: number[];
1764
- } | {
1765
- kind: "noul";
1766
- id: string;
1767
- probability: number;
1768
- })[];
1769
- requestId: string;
1770
- model: string;
1771
- usage: {
1772
- 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" | "input_transcription_milliseconds";
1773
- quantity: number;
1774
- }[];
1775
- routingPolicy: {
1776
- routingPolicyId: string;
1777
- policyVersion: number;
1778
- };
1779
- }>, {
1780
- schemaVersion: 1;
1781
- data: ({
1782
- kind: "choice";
1783
- id: string;
1784
- reply: string;
1785
- confidence: number;
1786
- probabilities: number[];
1787
- } | {
1788
- kind: "score";
1789
- id: string;
1790
- reply: number;
1791
- confidence: number;
1792
- mean: number;
1793
- distribution: number[];
1794
- } | {
1795
- kind: "noul";
1796
- id: string;
1797
- probability: number;
1798
- })[];
1799
- requestId: string;
1800
- model: string;
1801
- usage: {
1802
- 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" | "input_transcription_milliseconds";
1803
- quantity: number;
1804
- }[];
1805
- routingPolicy: {
1806
- routingPolicyId: string;
1807
- policyVersion: number;
1808
- };
1809
- }, {
1810
- schemaVersion: 1;
1811
- data: ({
1812
- kind: "choice";
1813
- id: string;
1814
- reply: string;
1815
- confidence: number;
1816
- probabilities: number[];
1817
- } | {
1818
- kind: "score";
1819
- id: string;
1820
- reply: number;
1821
- confidence: number;
1822
- mean: number;
1823
- distribution: number[];
1824
- } | {
1825
- kind: "noul";
1826
- id: string;
1827
- probability: number;
1828
- })[];
1829
- requestId: string;
1830
- model: string;
1831
- usage: {
1832
- 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" | "input_transcription_milliseconds";
1833
- quantity: number;
1834
- }[];
1835
- routingPolicy: {
1836
- routingPolicyId: string;
1837
- policyVersion: number;
1838
- };
1839
- }>;
1840
- /** Bind output to the exact request. Provider order is not semantic. */
1841
- export declare function decisionAnswersMatch(input: DecisionInput, answers: readonly DecisionAnswer[]): boolean;
1842
- export type DecisionQuestion = z.infer<typeof decisionQuestionSchema>;
1843
- export type DecisionInput = {
1844
- state: string;
1845
- instructions?: string;
1846
- questions: DecisionQuestion[];
1847
- effort?: z.infer<typeof decisionEffortSchema>;
1848
- };
1849
- export type DecisionRequest = z.infer<typeof decisionRequestSchema>;
1850
- export type DecisionAnswer = z.infer<typeof decisionAnswerSchema>;
1851
- export type DecisionResult = z.infer<typeof decisionResultSchema>;
1852
- export type DecisionSuccess = z.infer<typeof decisionSuccessSchema>;
1853
- export type DecisionFailure = z.infer<typeof decisionFailureSchema>;