@oxyhq/contracts 0.26.0 → 0.28.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.
Files changed (52) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/accountGraph.js +4 -3
  3. package/dist/cjs/index.js +186 -1
  4. package/dist/cjs/inference/accountBilling.js +334 -0
  5. package/dist/cjs/inference/attribution.js +106 -0
  6. package/dist/cjs/inference/catalogue.js +482 -0
  7. package/dist/cjs/inference/entitlement.js +217 -0
  8. package/dist/cjs/inference/errors.js +210 -0
  9. package/dist/cjs/inference/identifiers.js +197 -0
  10. package/dist/cjs/inference/money.js +188 -0
  11. package/dist/cjs/inference/priceVersion.js +110 -0
  12. package/dist/cjs/inference/providerConnection.js +142 -0
  13. package/dist/cjs/inference/request.js +288 -0
  14. package/dist/cjs/inference/routingPolicy.js +213 -0
  15. package/dist/cjs/inference/streamEvents.js +219 -0
  16. package/dist/cjs/inference/usage.js +297 -0
  17. package/dist/cjs/inference/version.js +85 -0
  18. package/dist/esm/.tsbuildinfo +1 -1
  19. package/dist/esm/accountGraph.js +4 -3
  20. package/dist/esm/index.js +54 -0
  21. package/dist/esm/inference/accountBilling.js +331 -0
  22. package/dist/esm/inference/attribution.js +103 -0
  23. package/dist/esm/inference/catalogue.js +479 -0
  24. package/dist/esm/inference/entitlement.js +214 -0
  25. package/dist/esm/inference/errors.js +207 -0
  26. package/dist/esm/inference/identifiers.js +194 -0
  27. package/dist/esm/inference/money.js +185 -0
  28. package/dist/esm/inference/priceVersion.js +107 -0
  29. package/dist/esm/inference/providerConnection.js +139 -0
  30. package/dist/esm/inference/request.js +285 -0
  31. package/dist/esm/inference/routingPolicy.js +210 -0
  32. package/dist/esm/inference/streamEvents.js +216 -0
  33. package/dist/esm/inference/usage.js +294 -0
  34. package/dist/esm/inference/version.js +82 -0
  35. package/dist/types/.tsbuildinfo +1 -1
  36. package/dist/types/accountGraph.d.ts +6 -5
  37. package/dist/types/index.d.ts +27 -0
  38. package/dist/types/inference/accountBilling.d.ts +738 -0
  39. package/dist/types/inference/attribution.d.ts +176 -0
  40. package/dist/types/inference/catalogue.d.ts +1612 -0
  41. package/dist/types/inference/entitlement.d.ts +519 -0
  42. package/dist/types/inference/errors.d.ts +206 -0
  43. package/dist/types/inference/identifiers.d.ts +157 -0
  44. package/dist/types/inference/money.d.ts +185 -0
  45. package/dist/types/inference/priceVersion.d.ts +182 -0
  46. package/dist/types/inference/providerConnection.d.ts +297 -0
  47. package/dist/types/inference/request.d.ts +2364 -0
  48. package/dist/types/inference/routingPolicy.d.ts +426 -0
  49. package/dist/types/inference/streamEvents.d.ts +906 -0
  50. package/dist/types/inference/usage.d.ts +1139 -0
  51. package/dist/types/inference/version.d.ts +82 -0
  52. package/package.json +1 -1
@@ -0,0 +1,2364 @@
1
+ /**
2
+ * The normalized inference request — the canonical internal envelope Oxy's
3
+ * public edge forwards to the data plane.
4
+ *
5
+ * The public surface speaks several dialects (`/v1/responses`,
6
+ * `/v1/chat/completions`, embeddings, images, audio). Exactly one of them is
7
+ * normalized here, at the edge, so that routing, metering, policy enforcement
8
+ * and settlement are written once against one shape instead of once per dialect.
9
+ * `client.apiFormat` records which dialect the customer used, because the
10
+ * response has to be rendered back in it.
11
+ *
12
+ * What the envelope carries that a provider request does not: the resolved
13
+ * attribution block (who pays, which application, which credential, which
14
+ * delegated user), the exact routing policy reference and the customer's
15
+ * idempotency key. Those are the fields that make a request billable and
16
+ * explainable, and they are resolved BEFORE the request enters the data plane.
17
+ *
18
+ * Decided in: docs/adr/0010-public-api-compatibility.md.
19
+ */
20
+ import { z } from 'zod';
21
+ /**
22
+ * Where binary or remote content comes from.
23
+ *
24
+ * `url` is fetched by the data plane; `inline` carries base64 the customer sent
25
+ * with the request. Both are transient: neither is persisted by default, and
26
+ * neither appears in a receipt, a log line or a telemetry event.
27
+ */
28
+ export declare const inferenceContentSourceSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
29
+ kind: z.ZodLiteral<"url">;
30
+ url: z.ZodString;
31
+ }, "strict", z.ZodTypeAny, {
32
+ kind: "url";
33
+ url: string;
34
+ }, {
35
+ kind: "url";
36
+ url: string;
37
+ }>, z.ZodObject<{
38
+ kind: z.ZodLiteral<"inline">;
39
+ mediaType: z.ZodString;
40
+ data: z.ZodString;
41
+ }, "strict", z.ZodTypeAny, {
42
+ kind: "inline";
43
+ data: string;
44
+ mediaType: string;
45
+ }, {
46
+ kind: "inline";
47
+ data: string;
48
+ mediaType: string;
49
+ }>]>;
50
+ /** One part of a message's content. A message is always a list of parts. */
51
+ export declare const inferenceContentPartSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
52
+ type: z.ZodLiteral<"text">;
53
+ text: z.ZodString;
54
+ }, "strict", z.ZodTypeAny, {
55
+ type: "text";
56
+ text: string;
57
+ }, {
58
+ type: "text";
59
+ text: string;
60
+ }>, z.ZodObject<{
61
+ type: z.ZodLiteral<"image">;
62
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
63
+ kind: z.ZodLiteral<"url">;
64
+ url: z.ZodString;
65
+ }, "strict", z.ZodTypeAny, {
66
+ kind: "url";
67
+ url: string;
68
+ }, {
69
+ kind: "url";
70
+ url: string;
71
+ }>, z.ZodObject<{
72
+ kind: z.ZodLiteral<"inline">;
73
+ mediaType: z.ZodString;
74
+ data: z.ZodString;
75
+ }, "strict", z.ZodTypeAny, {
76
+ kind: "inline";
77
+ data: string;
78
+ mediaType: string;
79
+ }, {
80
+ kind: "inline";
81
+ data: string;
82
+ mediaType: string;
83
+ }>]>;
84
+ /** Provider-independent hint; providers that ignore it are unaffected. */
85
+ detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
86
+ }, "strict", z.ZodTypeAny, {
87
+ type: "image";
88
+ source: {
89
+ kind: "url";
90
+ url: string;
91
+ } | {
92
+ kind: "inline";
93
+ data: string;
94
+ mediaType: string;
95
+ };
96
+ detail?: "low" | "high" | "auto" | undefined;
97
+ }, {
98
+ type: "image";
99
+ source: {
100
+ kind: "url";
101
+ url: string;
102
+ } | {
103
+ kind: "inline";
104
+ data: string;
105
+ mediaType: string;
106
+ };
107
+ detail?: "low" | "high" | "auto" | undefined;
108
+ }>, z.ZodObject<{
109
+ type: z.ZodLiteral<"audio">;
110
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
111
+ kind: z.ZodLiteral<"url">;
112
+ url: z.ZodString;
113
+ }, "strict", z.ZodTypeAny, {
114
+ kind: "url";
115
+ url: string;
116
+ }, {
117
+ kind: "url";
118
+ url: string;
119
+ }>, z.ZodObject<{
120
+ kind: z.ZodLiteral<"inline">;
121
+ mediaType: z.ZodString;
122
+ data: z.ZodString;
123
+ }, "strict", z.ZodTypeAny, {
124
+ kind: "inline";
125
+ data: string;
126
+ mediaType: string;
127
+ }, {
128
+ kind: "inline";
129
+ data: string;
130
+ mediaType: string;
131
+ }>]>;
132
+ }, "strict", z.ZodTypeAny, {
133
+ type: "audio";
134
+ source: {
135
+ kind: "url";
136
+ url: string;
137
+ } | {
138
+ kind: "inline";
139
+ data: string;
140
+ mediaType: string;
141
+ };
142
+ }, {
143
+ type: "audio";
144
+ source: {
145
+ kind: "url";
146
+ url: string;
147
+ } | {
148
+ kind: "inline";
149
+ data: string;
150
+ mediaType: string;
151
+ };
152
+ }>, z.ZodObject<{
153
+ type: z.ZodLiteral<"file">;
154
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
155
+ kind: z.ZodLiteral<"url">;
156
+ url: z.ZodString;
157
+ }, "strict", z.ZodTypeAny, {
158
+ kind: "url";
159
+ url: string;
160
+ }, {
161
+ kind: "url";
162
+ url: string;
163
+ }>, z.ZodObject<{
164
+ kind: z.ZodLiteral<"inline">;
165
+ mediaType: z.ZodString;
166
+ data: z.ZodString;
167
+ }, "strict", z.ZodTypeAny, {
168
+ kind: "inline";
169
+ data: string;
170
+ mediaType: string;
171
+ }, {
172
+ kind: "inline";
173
+ data: string;
174
+ mediaType: string;
175
+ }>]>;
176
+ filename: z.ZodOptional<z.ZodString>;
177
+ }, "strict", z.ZodTypeAny, {
178
+ type: "file";
179
+ source: {
180
+ kind: "url";
181
+ url: string;
182
+ } | {
183
+ kind: "inline";
184
+ data: string;
185
+ mediaType: string;
186
+ };
187
+ filename?: string | undefined;
188
+ }, {
189
+ type: "file";
190
+ source: {
191
+ kind: "url";
192
+ url: string;
193
+ } | {
194
+ kind: "inline";
195
+ data: string;
196
+ mediaType: string;
197
+ };
198
+ filename?: string | undefined;
199
+ }>]>;
200
+ /**
201
+ * A tool call an assistant made, in the normalized form.
202
+ *
203
+ * `arguments` is the JSON TEXT the model emitted, not a parsed object: models
204
+ * emit invalid JSON often enough that parsing it here would turn a recoverable
205
+ * model mistake into a rejected message.
206
+ */
207
+ export declare const inferenceToolCallSchema: z.ZodObject<{
208
+ id: z.ZodString;
209
+ name: z.ZodString;
210
+ arguments: z.ZodString;
211
+ }, "strict", z.ZodTypeAny, {
212
+ name: string;
213
+ id: string;
214
+ arguments: string;
215
+ }, {
216
+ name: string;
217
+ id: string;
218
+ arguments: string;
219
+ }>;
220
+ export declare const inferenceMessageRoleSchema: z.ZodEnum<["system", "developer", "user", "assistant", "tool"]>;
221
+ /**
222
+ * One normalized message.
223
+ *
224
+ * The role-specific fields are refined rather than modelled as a discriminated
225
+ * union so the shape stays the one a caller recognises from the OpenAI-style
226
+ * dialects; the refinement is what stops `toolCallId` from riding on a user
227
+ * message, where every provider would silently ignore it.
228
+ */
229
+ export declare const inferenceMessageSchema: z.ZodEffects<z.ZodObject<{
230
+ role: z.ZodEnum<["system", "developer", "user", "assistant", "tool"]>;
231
+ content: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
232
+ type: z.ZodLiteral<"text">;
233
+ text: z.ZodString;
234
+ }, "strict", z.ZodTypeAny, {
235
+ type: "text";
236
+ text: string;
237
+ }, {
238
+ type: "text";
239
+ text: string;
240
+ }>, z.ZodObject<{
241
+ type: z.ZodLiteral<"image">;
242
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
243
+ kind: z.ZodLiteral<"url">;
244
+ url: z.ZodString;
245
+ }, "strict", z.ZodTypeAny, {
246
+ kind: "url";
247
+ url: string;
248
+ }, {
249
+ kind: "url";
250
+ url: string;
251
+ }>, z.ZodObject<{
252
+ kind: z.ZodLiteral<"inline">;
253
+ mediaType: z.ZodString;
254
+ data: z.ZodString;
255
+ }, "strict", z.ZodTypeAny, {
256
+ kind: "inline";
257
+ data: string;
258
+ mediaType: string;
259
+ }, {
260
+ kind: "inline";
261
+ data: string;
262
+ mediaType: string;
263
+ }>]>;
264
+ /** Provider-independent hint; providers that ignore it are unaffected. */
265
+ detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
266
+ }, "strict", z.ZodTypeAny, {
267
+ type: "image";
268
+ source: {
269
+ kind: "url";
270
+ url: string;
271
+ } | {
272
+ kind: "inline";
273
+ data: string;
274
+ mediaType: string;
275
+ };
276
+ detail?: "low" | "high" | "auto" | undefined;
277
+ }, {
278
+ type: "image";
279
+ source: {
280
+ kind: "url";
281
+ url: string;
282
+ } | {
283
+ kind: "inline";
284
+ data: string;
285
+ mediaType: string;
286
+ };
287
+ detail?: "low" | "high" | "auto" | undefined;
288
+ }>, z.ZodObject<{
289
+ type: z.ZodLiteral<"audio">;
290
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
291
+ kind: z.ZodLiteral<"url">;
292
+ url: z.ZodString;
293
+ }, "strict", z.ZodTypeAny, {
294
+ kind: "url";
295
+ url: string;
296
+ }, {
297
+ kind: "url";
298
+ url: string;
299
+ }>, z.ZodObject<{
300
+ kind: z.ZodLiteral<"inline">;
301
+ mediaType: z.ZodString;
302
+ data: z.ZodString;
303
+ }, "strict", z.ZodTypeAny, {
304
+ kind: "inline";
305
+ data: string;
306
+ mediaType: string;
307
+ }, {
308
+ kind: "inline";
309
+ data: string;
310
+ mediaType: string;
311
+ }>]>;
312
+ }, "strict", z.ZodTypeAny, {
313
+ type: "audio";
314
+ source: {
315
+ kind: "url";
316
+ url: string;
317
+ } | {
318
+ kind: "inline";
319
+ data: string;
320
+ mediaType: string;
321
+ };
322
+ }, {
323
+ type: "audio";
324
+ source: {
325
+ kind: "url";
326
+ url: string;
327
+ } | {
328
+ kind: "inline";
329
+ data: string;
330
+ mediaType: string;
331
+ };
332
+ }>, z.ZodObject<{
333
+ type: z.ZodLiteral<"file">;
334
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
335
+ kind: z.ZodLiteral<"url">;
336
+ url: z.ZodString;
337
+ }, "strict", z.ZodTypeAny, {
338
+ kind: "url";
339
+ url: string;
340
+ }, {
341
+ kind: "url";
342
+ url: string;
343
+ }>, z.ZodObject<{
344
+ kind: z.ZodLiteral<"inline">;
345
+ mediaType: z.ZodString;
346
+ data: z.ZodString;
347
+ }, "strict", z.ZodTypeAny, {
348
+ kind: "inline";
349
+ data: string;
350
+ mediaType: string;
351
+ }, {
352
+ kind: "inline";
353
+ data: string;
354
+ mediaType: string;
355
+ }>]>;
356
+ filename: z.ZodOptional<z.ZodString>;
357
+ }, "strict", z.ZodTypeAny, {
358
+ type: "file";
359
+ source: {
360
+ kind: "url";
361
+ url: string;
362
+ } | {
363
+ kind: "inline";
364
+ data: string;
365
+ mediaType: string;
366
+ };
367
+ filename?: string | undefined;
368
+ }, {
369
+ type: "file";
370
+ source: {
371
+ kind: "url";
372
+ url: string;
373
+ } | {
374
+ kind: "inline";
375
+ data: string;
376
+ mediaType: string;
377
+ };
378
+ filename?: string | undefined;
379
+ }>]>, "many">;
380
+ /** Participant name, where the dialect supports naming participants. */
381
+ name: z.ZodOptional<z.ZodString>;
382
+ /** The tool call this message answers. Required on, and only on, `tool`. */
383
+ toolCallId: z.ZodOptional<z.ZodString>;
384
+ /** Tool calls the assistant made. Only on `assistant`. */
385
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
386
+ id: z.ZodString;
387
+ name: z.ZodString;
388
+ arguments: z.ZodString;
389
+ }, "strict", z.ZodTypeAny, {
390
+ name: string;
391
+ id: string;
392
+ arguments: string;
393
+ }, {
394
+ name: string;
395
+ id: string;
396
+ arguments: string;
397
+ }>, "many">>;
398
+ }, "strict", z.ZodTypeAny, {
399
+ content: ({
400
+ type: "text";
401
+ text: string;
402
+ } | {
403
+ type: "image";
404
+ source: {
405
+ kind: "url";
406
+ url: string;
407
+ } | {
408
+ kind: "inline";
409
+ data: string;
410
+ mediaType: string;
411
+ };
412
+ detail?: "low" | "high" | "auto" | undefined;
413
+ } | {
414
+ type: "audio";
415
+ source: {
416
+ kind: "url";
417
+ url: string;
418
+ } | {
419
+ kind: "inline";
420
+ data: string;
421
+ mediaType: string;
422
+ };
423
+ } | {
424
+ type: "file";
425
+ source: {
426
+ kind: "url";
427
+ url: string;
428
+ } | {
429
+ kind: "inline";
430
+ data: string;
431
+ mediaType: string;
432
+ };
433
+ filename?: string | undefined;
434
+ })[];
435
+ role: "system" | "user" | "developer" | "assistant" | "tool";
436
+ name?: string | undefined;
437
+ toolCallId?: string | undefined;
438
+ toolCalls?: {
439
+ name: string;
440
+ id: string;
441
+ arguments: string;
442
+ }[] | undefined;
443
+ }, {
444
+ content: ({
445
+ type: "text";
446
+ text: string;
447
+ } | {
448
+ type: "image";
449
+ source: {
450
+ kind: "url";
451
+ url: string;
452
+ } | {
453
+ kind: "inline";
454
+ data: string;
455
+ mediaType: string;
456
+ };
457
+ detail?: "low" | "high" | "auto" | undefined;
458
+ } | {
459
+ type: "audio";
460
+ source: {
461
+ kind: "url";
462
+ url: string;
463
+ } | {
464
+ kind: "inline";
465
+ data: string;
466
+ mediaType: string;
467
+ };
468
+ } | {
469
+ type: "file";
470
+ source: {
471
+ kind: "url";
472
+ url: string;
473
+ } | {
474
+ kind: "inline";
475
+ data: string;
476
+ mediaType: string;
477
+ };
478
+ filename?: string | undefined;
479
+ })[];
480
+ role: "system" | "user" | "developer" | "assistant" | "tool";
481
+ name?: string | undefined;
482
+ toolCallId?: string | undefined;
483
+ toolCalls?: {
484
+ name: string;
485
+ id: string;
486
+ arguments: string;
487
+ }[] | undefined;
488
+ }>, {
489
+ content: ({
490
+ type: "text";
491
+ text: string;
492
+ } | {
493
+ type: "image";
494
+ source: {
495
+ kind: "url";
496
+ url: string;
497
+ } | {
498
+ kind: "inline";
499
+ data: string;
500
+ mediaType: string;
501
+ };
502
+ detail?: "low" | "high" | "auto" | undefined;
503
+ } | {
504
+ type: "audio";
505
+ source: {
506
+ kind: "url";
507
+ url: string;
508
+ } | {
509
+ kind: "inline";
510
+ data: string;
511
+ mediaType: string;
512
+ };
513
+ } | {
514
+ type: "file";
515
+ source: {
516
+ kind: "url";
517
+ url: string;
518
+ } | {
519
+ kind: "inline";
520
+ data: string;
521
+ mediaType: string;
522
+ };
523
+ filename?: string | undefined;
524
+ })[];
525
+ role: "system" | "user" | "developer" | "assistant" | "tool";
526
+ name?: string | undefined;
527
+ toolCallId?: string | undefined;
528
+ toolCalls?: {
529
+ name: string;
530
+ id: string;
531
+ arguments: string;
532
+ }[] | undefined;
533
+ }, {
534
+ content: ({
535
+ type: "text";
536
+ text: string;
537
+ } | {
538
+ type: "image";
539
+ source: {
540
+ kind: "url";
541
+ url: string;
542
+ } | {
543
+ kind: "inline";
544
+ data: string;
545
+ mediaType: string;
546
+ };
547
+ detail?: "low" | "high" | "auto" | undefined;
548
+ } | {
549
+ type: "audio";
550
+ source: {
551
+ kind: "url";
552
+ url: string;
553
+ } | {
554
+ kind: "inline";
555
+ data: string;
556
+ mediaType: string;
557
+ };
558
+ } | {
559
+ type: "file";
560
+ source: {
561
+ kind: "url";
562
+ url: string;
563
+ } | {
564
+ kind: "inline";
565
+ data: string;
566
+ mediaType: string;
567
+ };
568
+ filename?: string | undefined;
569
+ })[];
570
+ role: "system" | "user" | "developer" | "assistant" | "tool";
571
+ name?: string | undefined;
572
+ toolCallId?: string | undefined;
573
+ toolCalls?: {
574
+ name: string;
575
+ id: string;
576
+ arguments: string;
577
+ }[] | undefined;
578
+ }>;
579
+ /**
580
+ * The request's input.
581
+ *
582
+ * Three formats, because the modalities genuinely differ: a chat request is a
583
+ * conversation, an embedding request is a string or a batch of strings, and
584
+ * pretending the latter is a one-message conversation loses the batch boundary
585
+ * that both metering and provider translation depend on.
586
+ */
587
+ export declare const inferenceInputSchema: z.ZodDiscriminatedUnion<"format", [z.ZodObject<{
588
+ format: z.ZodLiteral<"messages">;
589
+ messages: z.ZodArray<z.ZodEffects<z.ZodObject<{
590
+ role: z.ZodEnum<["system", "developer", "user", "assistant", "tool"]>;
591
+ content: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
592
+ type: z.ZodLiteral<"text">;
593
+ text: z.ZodString;
594
+ }, "strict", z.ZodTypeAny, {
595
+ type: "text";
596
+ text: string;
597
+ }, {
598
+ type: "text";
599
+ text: string;
600
+ }>, z.ZodObject<{
601
+ type: z.ZodLiteral<"image">;
602
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
603
+ kind: z.ZodLiteral<"url">;
604
+ url: z.ZodString;
605
+ }, "strict", z.ZodTypeAny, {
606
+ kind: "url";
607
+ url: string;
608
+ }, {
609
+ kind: "url";
610
+ url: string;
611
+ }>, z.ZodObject<{
612
+ kind: z.ZodLiteral<"inline">;
613
+ mediaType: z.ZodString;
614
+ data: z.ZodString;
615
+ }, "strict", z.ZodTypeAny, {
616
+ kind: "inline";
617
+ data: string;
618
+ mediaType: string;
619
+ }, {
620
+ kind: "inline";
621
+ data: string;
622
+ mediaType: string;
623
+ }>]>;
624
+ /** Provider-independent hint; providers that ignore it are unaffected. */
625
+ detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
626
+ }, "strict", z.ZodTypeAny, {
627
+ type: "image";
628
+ source: {
629
+ kind: "url";
630
+ url: string;
631
+ } | {
632
+ kind: "inline";
633
+ data: string;
634
+ mediaType: string;
635
+ };
636
+ detail?: "low" | "high" | "auto" | undefined;
637
+ }, {
638
+ type: "image";
639
+ source: {
640
+ kind: "url";
641
+ url: string;
642
+ } | {
643
+ kind: "inline";
644
+ data: string;
645
+ mediaType: string;
646
+ };
647
+ detail?: "low" | "high" | "auto" | undefined;
648
+ }>, z.ZodObject<{
649
+ type: z.ZodLiteral<"audio">;
650
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
651
+ kind: z.ZodLiteral<"url">;
652
+ url: z.ZodString;
653
+ }, "strict", z.ZodTypeAny, {
654
+ kind: "url";
655
+ url: string;
656
+ }, {
657
+ kind: "url";
658
+ url: string;
659
+ }>, z.ZodObject<{
660
+ kind: z.ZodLiteral<"inline">;
661
+ mediaType: z.ZodString;
662
+ data: z.ZodString;
663
+ }, "strict", z.ZodTypeAny, {
664
+ kind: "inline";
665
+ data: string;
666
+ mediaType: string;
667
+ }, {
668
+ kind: "inline";
669
+ data: string;
670
+ mediaType: string;
671
+ }>]>;
672
+ }, "strict", z.ZodTypeAny, {
673
+ type: "audio";
674
+ source: {
675
+ kind: "url";
676
+ url: string;
677
+ } | {
678
+ kind: "inline";
679
+ data: string;
680
+ mediaType: string;
681
+ };
682
+ }, {
683
+ type: "audio";
684
+ source: {
685
+ kind: "url";
686
+ url: string;
687
+ } | {
688
+ kind: "inline";
689
+ data: string;
690
+ mediaType: string;
691
+ };
692
+ }>, z.ZodObject<{
693
+ type: z.ZodLiteral<"file">;
694
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
695
+ kind: z.ZodLiteral<"url">;
696
+ url: z.ZodString;
697
+ }, "strict", z.ZodTypeAny, {
698
+ kind: "url";
699
+ url: string;
700
+ }, {
701
+ kind: "url";
702
+ url: string;
703
+ }>, z.ZodObject<{
704
+ kind: z.ZodLiteral<"inline">;
705
+ mediaType: z.ZodString;
706
+ data: z.ZodString;
707
+ }, "strict", z.ZodTypeAny, {
708
+ kind: "inline";
709
+ data: string;
710
+ mediaType: string;
711
+ }, {
712
+ kind: "inline";
713
+ data: string;
714
+ mediaType: string;
715
+ }>]>;
716
+ filename: z.ZodOptional<z.ZodString>;
717
+ }, "strict", z.ZodTypeAny, {
718
+ type: "file";
719
+ source: {
720
+ kind: "url";
721
+ url: string;
722
+ } | {
723
+ kind: "inline";
724
+ data: string;
725
+ mediaType: string;
726
+ };
727
+ filename?: string | undefined;
728
+ }, {
729
+ type: "file";
730
+ source: {
731
+ kind: "url";
732
+ url: string;
733
+ } | {
734
+ kind: "inline";
735
+ data: string;
736
+ mediaType: string;
737
+ };
738
+ filename?: string | undefined;
739
+ }>]>, "many">;
740
+ /** Participant name, where the dialect supports naming participants. */
741
+ name: z.ZodOptional<z.ZodString>;
742
+ /** The tool call this message answers. Required on, and only on, `tool`. */
743
+ toolCallId: z.ZodOptional<z.ZodString>;
744
+ /** Tool calls the assistant made. Only on `assistant`. */
745
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
746
+ id: z.ZodString;
747
+ name: z.ZodString;
748
+ arguments: z.ZodString;
749
+ }, "strict", z.ZodTypeAny, {
750
+ name: string;
751
+ id: string;
752
+ arguments: string;
753
+ }, {
754
+ name: string;
755
+ id: string;
756
+ arguments: string;
757
+ }>, "many">>;
758
+ }, "strict", z.ZodTypeAny, {
759
+ content: ({
760
+ type: "text";
761
+ text: string;
762
+ } | {
763
+ type: "image";
764
+ source: {
765
+ kind: "url";
766
+ url: string;
767
+ } | {
768
+ kind: "inline";
769
+ data: string;
770
+ mediaType: string;
771
+ };
772
+ detail?: "low" | "high" | "auto" | undefined;
773
+ } | {
774
+ type: "audio";
775
+ source: {
776
+ kind: "url";
777
+ url: string;
778
+ } | {
779
+ kind: "inline";
780
+ data: string;
781
+ mediaType: string;
782
+ };
783
+ } | {
784
+ type: "file";
785
+ source: {
786
+ kind: "url";
787
+ url: string;
788
+ } | {
789
+ kind: "inline";
790
+ data: string;
791
+ mediaType: string;
792
+ };
793
+ filename?: string | undefined;
794
+ })[];
795
+ role: "system" | "user" | "developer" | "assistant" | "tool";
796
+ name?: string | undefined;
797
+ toolCallId?: string | undefined;
798
+ toolCalls?: {
799
+ name: string;
800
+ id: string;
801
+ arguments: string;
802
+ }[] | undefined;
803
+ }, {
804
+ content: ({
805
+ type: "text";
806
+ text: string;
807
+ } | {
808
+ type: "image";
809
+ source: {
810
+ kind: "url";
811
+ url: string;
812
+ } | {
813
+ kind: "inline";
814
+ data: string;
815
+ mediaType: string;
816
+ };
817
+ detail?: "low" | "high" | "auto" | undefined;
818
+ } | {
819
+ type: "audio";
820
+ source: {
821
+ kind: "url";
822
+ url: string;
823
+ } | {
824
+ kind: "inline";
825
+ data: string;
826
+ mediaType: string;
827
+ };
828
+ } | {
829
+ type: "file";
830
+ source: {
831
+ kind: "url";
832
+ url: string;
833
+ } | {
834
+ kind: "inline";
835
+ data: string;
836
+ mediaType: string;
837
+ };
838
+ filename?: string | undefined;
839
+ })[];
840
+ role: "system" | "user" | "developer" | "assistant" | "tool";
841
+ name?: string | undefined;
842
+ toolCallId?: string | undefined;
843
+ toolCalls?: {
844
+ name: string;
845
+ id: string;
846
+ arguments: string;
847
+ }[] | undefined;
848
+ }>, {
849
+ content: ({
850
+ type: "text";
851
+ text: string;
852
+ } | {
853
+ type: "image";
854
+ source: {
855
+ kind: "url";
856
+ url: string;
857
+ } | {
858
+ kind: "inline";
859
+ data: string;
860
+ mediaType: string;
861
+ };
862
+ detail?: "low" | "high" | "auto" | undefined;
863
+ } | {
864
+ type: "audio";
865
+ source: {
866
+ kind: "url";
867
+ url: string;
868
+ } | {
869
+ kind: "inline";
870
+ data: string;
871
+ mediaType: string;
872
+ };
873
+ } | {
874
+ type: "file";
875
+ source: {
876
+ kind: "url";
877
+ url: string;
878
+ } | {
879
+ kind: "inline";
880
+ data: string;
881
+ mediaType: string;
882
+ };
883
+ filename?: string | undefined;
884
+ })[];
885
+ role: "system" | "user" | "developer" | "assistant" | "tool";
886
+ name?: string | undefined;
887
+ toolCallId?: string | undefined;
888
+ toolCalls?: {
889
+ name: string;
890
+ id: string;
891
+ arguments: string;
892
+ }[] | undefined;
893
+ }, {
894
+ content: ({
895
+ type: "text";
896
+ text: string;
897
+ } | {
898
+ type: "image";
899
+ source: {
900
+ kind: "url";
901
+ url: string;
902
+ } | {
903
+ kind: "inline";
904
+ data: string;
905
+ mediaType: string;
906
+ };
907
+ detail?: "low" | "high" | "auto" | undefined;
908
+ } | {
909
+ type: "audio";
910
+ source: {
911
+ kind: "url";
912
+ url: string;
913
+ } | {
914
+ kind: "inline";
915
+ data: string;
916
+ mediaType: string;
917
+ };
918
+ } | {
919
+ type: "file";
920
+ source: {
921
+ kind: "url";
922
+ url: string;
923
+ } | {
924
+ kind: "inline";
925
+ data: string;
926
+ mediaType: string;
927
+ };
928
+ filename?: string | undefined;
929
+ })[];
930
+ role: "system" | "user" | "developer" | "assistant" | "tool";
931
+ name?: string | undefined;
932
+ toolCallId?: string | undefined;
933
+ toolCalls?: {
934
+ name: string;
935
+ id: string;
936
+ arguments: string;
937
+ }[] | undefined;
938
+ }>, "many">;
939
+ }, "strict", z.ZodTypeAny, {
940
+ format: "messages";
941
+ messages: {
942
+ content: ({
943
+ type: "text";
944
+ text: string;
945
+ } | {
946
+ type: "image";
947
+ source: {
948
+ kind: "url";
949
+ url: string;
950
+ } | {
951
+ kind: "inline";
952
+ data: string;
953
+ mediaType: string;
954
+ };
955
+ detail?: "low" | "high" | "auto" | undefined;
956
+ } | {
957
+ type: "audio";
958
+ source: {
959
+ kind: "url";
960
+ url: string;
961
+ } | {
962
+ kind: "inline";
963
+ data: string;
964
+ mediaType: string;
965
+ };
966
+ } | {
967
+ type: "file";
968
+ source: {
969
+ kind: "url";
970
+ url: string;
971
+ } | {
972
+ kind: "inline";
973
+ data: string;
974
+ mediaType: string;
975
+ };
976
+ filename?: string | undefined;
977
+ })[];
978
+ role: "system" | "user" | "developer" | "assistant" | "tool";
979
+ name?: string | undefined;
980
+ toolCallId?: string | undefined;
981
+ toolCalls?: {
982
+ name: string;
983
+ id: string;
984
+ arguments: string;
985
+ }[] | undefined;
986
+ }[];
987
+ }, {
988
+ format: "messages";
989
+ messages: {
990
+ content: ({
991
+ type: "text";
992
+ text: string;
993
+ } | {
994
+ type: "image";
995
+ source: {
996
+ kind: "url";
997
+ url: string;
998
+ } | {
999
+ kind: "inline";
1000
+ data: string;
1001
+ mediaType: string;
1002
+ };
1003
+ detail?: "low" | "high" | "auto" | undefined;
1004
+ } | {
1005
+ type: "audio";
1006
+ source: {
1007
+ kind: "url";
1008
+ url: string;
1009
+ } | {
1010
+ kind: "inline";
1011
+ data: string;
1012
+ mediaType: string;
1013
+ };
1014
+ } | {
1015
+ type: "file";
1016
+ source: {
1017
+ kind: "url";
1018
+ url: string;
1019
+ } | {
1020
+ kind: "inline";
1021
+ data: string;
1022
+ mediaType: string;
1023
+ };
1024
+ filename?: string | undefined;
1025
+ })[];
1026
+ role: "system" | "user" | "developer" | "assistant" | "tool";
1027
+ name?: string | undefined;
1028
+ toolCallId?: string | undefined;
1029
+ toolCalls?: {
1030
+ name: string;
1031
+ id: string;
1032
+ arguments: string;
1033
+ }[] | undefined;
1034
+ }[];
1035
+ }>, z.ZodObject<{
1036
+ format: z.ZodLiteral<"text">;
1037
+ text: z.ZodString;
1038
+ }, "strict", z.ZodTypeAny, {
1039
+ text: string;
1040
+ format: "text";
1041
+ }, {
1042
+ text: string;
1043
+ format: "text";
1044
+ }>, z.ZodObject<{
1045
+ format: z.ZodLiteral<"text_batch">;
1046
+ texts: z.ZodArray<z.ZodString, "many">;
1047
+ }, "strict", z.ZodTypeAny, {
1048
+ format: "text_batch";
1049
+ texts: string[];
1050
+ }, {
1051
+ format: "text_batch";
1052
+ texts: string[];
1053
+ }>]>;
1054
+ /** Sampling parameters, all optional: absent means the route's own default. */
1055
+ export declare const samplingParametersSchema: z.ZodObject<{
1056
+ temperature: z.ZodOptional<z.ZodNumber>;
1057
+ topP: z.ZodOptional<z.ZodNumber>;
1058
+ topK: z.ZodOptional<z.ZodNumber>;
1059
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
1060
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
1061
+ /** A seed makes a request reproducible on providers that honour one. */
1062
+ seed: z.ZodOptional<z.ZodNumber>;
1063
+ stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1064
+ }, "strict", z.ZodTypeAny, {
1065
+ seed?: number | undefined;
1066
+ temperature?: number | undefined;
1067
+ topP?: number | undefined;
1068
+ topK?: number | undefined;
1069
+ frequencyPenalty?: number | undefined;
1070
+ presencePenalty?: number | undefined;
1071
+ stopSequences?: string[] | undefined;
1072
+ }, {
1073
+ seed?: number | undefined;
1074
+ temperature?: number | undefined;
1075
+ topP?: number | undefined;
1076
+ topK?: number | undefined;
1077
+ frequencyPenalty?: number | undefined;
1078
+ presencePenalty?: number | undefined;
1079
+ stopSequences?: string[] | undefined;
1080
+ }>;
1081
+ /**
1082
+ * A tool the model may call. `parameters` is a JSON Schema document, carried
1083
+ * as an opaque object: validating the customer's JSON Schema against a meta
1084
+ * schema here would reject documents providers accept.
1085
+ */
1086
+ export declare const toolDefinitionSchema: z.ZodObject<{
1087
+ type: z.ZodLiteral<"function">;
1088
+ name: z.ZodString;
1089
+ description: z.ZodOptional<z.ZodString>;
1090
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1091
+ /** Ask the provider to enforce the schema, where it supports enforcement. */
1092
+ strict: z.ZodOptional<z.ZodBoolean>;
1093
+ }, "strict", z.ZodTypeAny, {
1094
+ type: "function";
1095
+ name: string;
1096
+ parameters: Record<string, unknown>;
1097
+ description?: string | undefined;
1098
+ strict?: boolean | undefined;
1099
+ }, {
1100
+ type: "function";
1101
+ name: string;
1102
+ parameters: Record<string, unknown>;
1103
+ description?: string | undefined;
1104
+ strict?: boolean | undefined;
1105
+ }>;
1106
+ /** Whether, and which, tool the model must call. */
1107
+ export declare const toolChoiceSchema: z.ZodUnion<[z.ZodEnum<["auto", "none", "required"]>, z.ZodObject<{
1108
+ type: z.ZodLiteral<"function">;
1109
+ name: z.ZodString;
1110
+ }, "strict", z.ZodTypeAny, {
1111
+ type: "function";
1112
+ name: string;
1113
+ }, {
1114
+ type: "function";
1115
+ name: string;
1116
+ }>]>;
1117
+ /** Structured-output request: free text, any JSON object, or a named schema. */
1118
+ export declare const responseFormatSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1119
+ type: z.ZodLiteral<"text">;
1120
+ }, "strict", z.ZodTypeAny, {
1121
+ type: "text";
1122
+ }, {
1123
+ type: "text";
1124
+ }>, z.ZodObject<{
1125
+ type: z.ZodLiteral<"json_object">;
1126
+ }, "strict", z.ZodTypeAny, {
1127
+ type: "json_object";
1128
+ }, {
1129
+ type: "json_object";
1130
+ }>, z.ZodObject<{
1131
+ type: z.ZodLiteral<"json_schema">;
1132
+ name: z.ZodString;
1133
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1134
+ strict: z.ZodBoolean;
1135
+ }, "strict", z.ZodTypeAny, {
1136
+ type: "json_schema";
1137
+ name: string;
1138
+ strict: boolean;
1139
+ schema: Record<string, unknown>;
1140
+ }, {
1141
+ type: "json_schema";
1142
+ name: string;
1143
+ strict: boolean;
1144
+ schema: Record<string, unknown>;
1145
+ }>]>;
1146
+ /**
1147
+ * What the edge records about the CALL, as opposed to its content.
1148
+ *
1149
+ * `.strict()` is a privacy control, not tidiness. Oxy never persists a user IP
1150
+ * — raw, hashed or geo-derived — and this object is the natural place somebody
1151
+ * would add one "for security". Strict means a producer that attaches `ip`,
1152
+ * `country`, `userAgent` or `forwardedFor` fails the parse instead of quietly
1153
+ * shipping it into the data plane and the telemetry stream behind it.
1154
+ *
1155
+ * `labels` is customer-supplied cost-attribution metadata (a team name, a
1156
+ * feature flag). It is echoed on the receipt, so it must never be used for
1157
+ * anything the customer would not want to read back to themselves.
1158
+ */
1159
+ export declare const clientRequestMetadataSchema: z.ZodObject<{
1160
+ /** The public dialect the customer called. The response is rendered in it. */
1161
+ apiFormat: z.ZodEnum<["responses", "chat_completions", "embeddings", "images_generations", "audio_transcriptions", "audio_speech", "rerank", "batches"]>;
1162
+ /** The public path, e.g. `/v1/responses`. */
1163
+ endpoint: z.ZodString;
1164
+ /** The customer's own correlation id, when they sent one. */
1165
+ clientRequestId: z.ZodOptional<z.ZodString>;
1166
+ receivedAt: z.ZodString;
1167
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1168
+ }, "strict", z.ZodTypeAny, {
1169
+ apiFormat: "embeddings" | "responses" | "chat_completions" | "images_generations" | "audio_transcriptions" | "audio_speech" | "rerank" | "batches";
1170
+ endpoint: string;
1171
+ receivedAt: string;
1172
+ clientRequestId?: string | undefined;
1173
+ labels?: Record<string, string> | undefined;
1174
+ }, {
1175
+ apiFormat: "embeddings" | "responses" | "chat_completions" | "images_generations" | "audio_transcriptions" | "audio_speech" | "rerank" | "batches";
1176
+ endpoint: string;
1177
+ receivedAt: string;
1178
+ clientRequestId?: string | undefined;
1179
+ labels?: Record<string, string> | undefined;
1180
+ }>;
1181
+ /**
1182
+ * The canonical internal request Oxy forwards to the data plane.
1183
+ *
1184
+ * `target` distinguishes the two questions a caller can ask — "serve THIS
1185
+ * model" versus "choose one for me" — structurally. Everything downstream that
1186
+ * must not silently substitute a model reads that discriminant rather than
1187
+ * inferring intent from a string.
1188
+ */
1189
+ export declare const inferenceRequestSchema: z.ZodEffects<z.ZodObject<{
1190
+ /** See `version.ts`: this is the Oxy→data-plane request envelope. */
1191
+ schemaVersion: z.ZodLiteral<1>;
1192
+ attribution: z.ZodObject<{
1193
+ principal: z.ZodObject<{
1194
+ billing: z.ZodObject<{
1195
+ accountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
1196
+ }, "strict", z.ZodTypeAny, {
1197
+ accountId: string & z.BRAND<"OxyAccountId">;
1198
+ }, {
1199
+ accountId: string;
1200
+ }>;
1201
+ applicationId: z.ZodString;
1202
+ credentialId: z.ZodString;
1203
+ environment: z.ZodEnum<["development", "staging", "production"]>;
1204
+ 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">;
1205
+ }, "strip", z.ZodTypeAny, {
1206
+ environment: "development" | "staging" | "production";
1207
+ credentialId: string;
1208
+ applicationId: string;
1209
+ billing: {
1210
+ accountId: string & z.BRAND<"OxyAccountId">;
1211
+ };
1212
+ inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1213
+ }, {
1214
+ environment: "development" | "staging" | "production";
1215
+ credentialId: string;
1216
+ applicationId: string;
1217
+ billing: {
1218
+ accountId: string;
1219
+ };
1220
+ inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1221
+ }>;
1222
+ userId: z.ZodOptional<z.ZodBranded<z.ZodString, "DelegatedUserId">>;
1223
+ requestId: z.ZodString;
1224
+ generationId: z.ZodOptional<z.ZodString>;
1225
+ }, "strip", z.ZodTypeAny, {
1226
+ requestId: string;
1227
+ principal: {
1228
+ environment: "development" | "staging" | "production";
1229
+ credentialId: string;
1230
+ applicationId: string;
1231
+ billing: {
1232
+ accountId: string & z.BRAND<"OxyAccountId">;
1233
+ };
1234
+ inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1235
+ };
1236
+ userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
1237
+ generationId?: string | undefined;
1238
+ }, {
1239
+ requestId: string;
1240
+ principal: {
1241
+ environment: "development" | "staging" | "production";
1242
+ credentialId: string;
1243
+ applicationId: string;
1244
+ billing: {
1245
+ accountId: string;
1246
+ };
1247
+ inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1248
+ };
1249
+ userId?: string | undefined;
1250
+ generationId?: string | undefined;
1251
+ }>;
1252
+ target: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1253
+ kind: z.ZodLiteral<"model">;
1254
+ modelReference: z.ZodString;
1255
+ }, "strict", z.ZodTypeAny, {
1256
+ kind: "model";
1257
+ modelReference: string;
1258
+ }, {
1259
+ kind: "model";
1260
+ modelReference: string;
1261
+ }>, z.ZodObject<{
1262
+ kind: z.ZodLiteral<"routing_profile">;
1263
+ routingProfile: z.ZodString;
1264
+ }, "strict", z.ZodTypeAny, {
1265
+ kind: "routing_profile";
1266
+ routingProfile: string;
1267
+ }, {
1268
+ kind: "routing_profile";
1269
+ routingProfile: string;
1270
+ }>]>;
1271
+ modality: z.ZodEnum<["text", "image", "audio", "video", "embedding"]>;
1272
+ input: z.ZodDiscriminatedUnion<"format", [z.ZodObject<{
1273
+ format: z.ZodLiteral<"messages">;
1274
+ messages: z.ZodArray<z.ZodEffects<z.ZodObject<{
1275
+ role: z.ZodEnum<["system", "developer", "user", "assistant", "tool"]>;
1276
+ content: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1277
+ type: z.ZodLiteral<"text">;
1278
+ text: z.ZodString;
1279
+ }, "strict", z.ZodTypeAny, {
1280
+ type: "text";
1281
+ text: string;
1282
+ }, {
1283
+ type: "text";
1284
+ text: string;
1285
+ }>, z.ZodObject<{
1286
+ type: z.ZodLiteral<"image">;
1287
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1288
+ kind: z.ZodLiteral<"url">;
1289
+ url: z.ZodString;
1290
+ }, "strict", z.ZodTypeAny, {
1291
+ kind: "url";
1292
+ url: string;
1293
+ }, {
1294
+ kind: "url";
1295
+ url: string;
1296
+ }>, z.ZodObject<{
1297
+ kind: z.ZodLiteral<"inline">;
1298
+ mediaType: z.ZodString;
1299
+ data: z.ZodString;
1300
+ }, "strict", z.ZodTypeAny, {
1301
+ kind: "inline";
1302
+ data: string;
1303
+ mediaType: string;
1304
+ }, {
1305
+ kind: "inline";
1306
+ data: string;
1307
+ mediaType: string;
1308
+ }>]>;
1309
+ /** Provider-independent hint; providers that ignore it are unaffected. */
1310
+ detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
1311
+ }, "strict", z.ZodTypeAny, {
1312
+ type: "image";
1313
+ source: {
1314
+ kind: "url";
1315
+ url: string;
1316
+ } | {
1317
+ kind: "inline";
1318
+ data: string;
1319
+ mediaType: string;
1320
+ };
1321
+ detail?: "low" | "high" | "auto" | undefined;
1322
+ }, {
1323
+ type: "image";
1324
+ source: {
1325
+ kind: "url";
1326
+ url: string;
1327
+ } | {
1328
+ kind: "inline";
1329
+ data: string;
1330
+ mediaType: string;
1331
+ };
1332
+ detail?: "low" | "high" | "auto" | undefined;
1333
+ }>, z.ZodObject<{
1334
+ type: z.ZodLiteral<"audio">;
1335
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1336
+ kind: z.ZodLiteral<"url">;
1337
+ url: z.ZodString;
1338
+ }, "strict", z.ZodTypeAny, {
1339
+ kind: "url";
1340
+ url: string;
1341
+ }, {
1342
+ kind: "url";
1343
+ url: string;
1344
+ }>, z.ZodObject<{
1345
+ kind: z.ZodLiteral<"inline">;
1346
+ mediaType: z.ZodString;
1347
+ data: z.ZodString;
1348
+ }, "strict", z.ZodTypeAny, {
1349
+ kind: "inline";
1350
+ data: string;
1351
+ mediaType: string;
1352
+ }, {
1353
+ kind: "inline";
1354
+ data: string;
1355
+ mediaType: string;
1356
+ }>]>;
1357
+ }, "strict", z.ZodTypeAny, {
1358
+ type: "audio";
1359
+ source: {
1360
+ kind: "url";
1361
+ url: string;
1362
+ } | {
1363
+ kind: "inline";
1364
+ data: string;
1365
+ mediaType: string;
1366
+ };
1367
+ }, {
1368
+ type: "audio";
1369
+ source: {
1370
+ kind: "url";
1371
+ url: string;
1372
+ } | {
1373
+ kind: "inline";
1374
+ data: string;
1375
+ mediaType: string;
1376
+ };
1377
+ }>, z.ZodObject<{
1378
+ type: z.ZodLiteral<"file">;
1379
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1380
+ kind: z.ZodLiteral<"url">;
1381
+ url: z.ZodString;
1382
+ }, "strict", z.ZodTypeAny, {
1383
+ kind: "url";
1384
+ url: string;
1385
+ }, {
1386
+ kind: "url";
1387
+ url: string;
1388
+ }>, z.ZodObject<{
1389
+ kind: z.ZodLiteral<"inline">;
1390
+ mediaType: z.ZodString;
1391
+ data: z.ZodString;
1392
+ }, "strict", z.ZodTypeAny, {
1393
+ kind: "inline";
1394
+ data: string;
1395
+ mediaType: string;
1396
+ }, {
1397
+ kind: "inline";
1398
+ data: string;
1399
+ mediaType: string;
1400
+ }>]>;
1401
+ filename: z.ZodOptional<z.ZodString>;
1402
+ }, "strict", z.ZodTypeAny, {
1403
+ type: "file";
1404
+ source: {
1405
+ kind: "url";
1406
+ url: string;
1407
+ } | {
1408
+ kind: "inline";
1409
+ data: string;
1410
+ mediaType: string;
1411
+ };
1412
+ filename?: string | undefined;
1413
+ }, {
1414
+ type: "file";
1415
+ source: {
1416
+ kind: "url";
1417
+ url: string;
1418
+ } | {
1419
+ kind: "inline";
1420
+ data: string;
1421
+ mediaType: string;
1422
+ };
1423
+ filename?: string | undefined;
1424
+ }>]>, "many">;
1425
+ /** Participant name, where the dialect supports naming participants. */
1426
+ name: z.ZodOptional<z.ZodString>;
1427
+ /** The tool call this message answers. Required on, and only on, `tool`. */
1428
+ toolCallId: z.ZodOptional<z.ZodString>;
1429
+ /** Tool calls the assistant made. Only on `assistant`. */
1430
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1431
+ id: z.ZodString;
1432
+ name: z.ZodString;
1433
+ arguments: z.ZodString;
1434
+ }, "strict", z.ZodTypeAny, {
1435
+ name: string;
1436
+ id: string;
1437
+ arguments: string;
1438
+ }, {
1439
+ name: string;
1440
+ id: string;
1441
+ arguments: string;
1442
+ }>, "many">>;
1443
+ }, "strict", z.ZodTypeAny, {
1444
+ content: ({
1445
+ type: "text";
1446
+ text: string;
1447
+ } | {
1448
+ type: "image";
1449
+ source: {
1450
+ kind: "url";
1451
+ url: string;
1452
+ } | {
1453
+ kind: "inline";
1454
+ data: string;
1455
+ mediaType: string;
1456
+ };
1457
+ detail?: "low" | "high" | "auto" | undefined;
1458
+ } | {
1459
+ type: "audio";
1460
+ source: {
1461
+ kind: "url";
1462
+ url: string;
1463
+ } | {
1464
+ kind: "inline";
1465
+ data: string;
1466
+ mediaType: string;
1467
+ };
1468
+ } | {
1469
+ type: "file";
1470
+ source: {
1471
+ kind: "url";
1472
+ url: string;
1473
+ } | {
1474
+ kind: "inline";
1475
+ data: string;
1476
+ mediaType: string;
1477
+ };
1478
+ filename?: string | undefined;
1479
+ })[];
1480
+ role: "system" | "user" | "developer" | "assistant" | "tool";
1481
+ name?: string | undefined;
1482
+ toolCallId?: string | undefined;
1483
+ toolCalls?: {
1484
+ name: string;
1485
+ id: string;
1486
+ arguments: string;
1487
+ }[] | undefined;
1488
+ }, {
1489
+ content: ({
1490
+ type: "text";
1491
+ text: string;
1492
+ } | {
1493
+ type: "image";
1494
+ source: {
1495
+ kind: "url";
1496
+ url: string;
1497
+ } | {
1498
+ kind: "inline";
1499
+ data: string;
1500
+ mediaType: string;
1501
+ };
1502
+ detail?: "low" | "high" | "auto" | undefined;
1503
+ } | {
1504
+ type: "audio";
1505
+ source: {
1506
+ kind: "url";
1507
+ url: string;
1508
+ } | {
1509
+ kind: "inline";
1510
+ data: string;
1511
+ mediaType: string;
1512
+ };
1513
+ } | {
1514
+ type: "file";
1515
+ source: {
1516
+ kind: "url";
1517
+ url: string;
1518
+ } | {
1519
+ kind: "inline";
1520
+ data: string;
1521
+ mediaType: string;
1522
+ };
1523
+ filename?: string | undefined;
1524
+ })[];
1525
+ role: "system" | "user" | "developer" | "assistant" | "tool";
1526
+ name?: string | undefined;
1527
+ toolCallId?: string | undefined;
1528
+ toolCalls?: {
1529
+ name: string;
1530
+ id: string;
1531
+ arguments: string;
1532
+ }[] | undefined;
1533
+ }>, {
1534
+ content: ({
1535
+ type: "text";
1536
+ text: string;
1537
+ } | {
1538
+ type: "image";
1539
+ source: {
1540
+ kind: "url";
1541
+ url: string;
1542
+ } | {
1543
+ kind: "inline";
1544
+ data: string;
1545
+ mediaType: string;
1546
+ };
1547
+ detail?: "low" | "high" | "auto" | undefined;
1548
+ } | {
1549
+ type: "audio";
1550
+ source: {
1551
+ kind: "url";
1552
+ url: string;
1553
+ } | {
1554
+ kind: "inline";
1555
+ data: string;
1556
+ mediaType: string;
1557
+ };
1558
+ } | {
1559
+ type: "file";
1560
+ source: {
1561
+ kind: "url";
1562
+ url: string;
1563
+ } | {
1564
+ kind: "inline";
1565
+ data: string;
1566
+ mediaType: string;
1567
+ };
1568
+ filename?: string | undefined;
1569
+ })[];
1570
+ role: "system" | "user" | "developer" | "assistant" | "tool";
1571
+ name?: string | undefined;
1572
+ toolCallId?: string | undefined;
1573
+ toolCalls?: {
1574
+ name: string;
1575
+ id: string;
1576
+ arguments: string;
1577
+ }[] | undefined;
1578
+ }, {
1579
+ content: ({
1580
+ type: "text";
1581
+ text: string;
1582
+ } | {
1583
+ type: "image";
1584
+ source: {
1585
+ kind: "url";
1586
+ url: string;
1587
+ } | {
1588
+ kind: "inline";
1589
+ data: string;
1590
+ mediaType: string;
1591
+ };
1592
+ detail?: "low" | "high" | "auto" | undefined;
1593
+ } | {
1594
+ type: "audio";
1595
+ source: {
1596
+ kind: "url";
1597
+ url: string;
1598
+ } | {
1599
+ kind: "inline";
1600
+ data: string;
1601
+ mediaType: string;
1602
+ };
1603
+ } | {
1604
+ type: "file";
1605
+ source: {
1606
+ kind: "url";
1607
+ url: string;
1608
+ } | {
1609
+ kind: "inline";
1610
+ data: string;
1611
+ mediaType: string;
1612
+ };
1613
+ filename?: string | undefined;
1614
+ })[];
1615
+ role: "system" | "user" | "developer" | "assistant" | "tool";
1616
+ name?: string | undefined;
1617
+ toolCallId?: string | undefined;
1618
+ toolCalls?: {
1619
+ name: string;
1620
+ id: string;
1621
+ arguments: string;
1622
+ }[] | undefined;
1623
+ }>, "many">;
1624
+ }, "strict", z.ZodTypeAny, {
1625
+ format: "messages";
1626
+ messages: {
1627
+ content: ({
1628
+ type: "text";
1629
+ text: string;
1630
+ } | {
1631
+ type: "image";
1632
+ source: {
1633
+ kind: "url";
1634
+ url: string;
1635
+ } | {
1636
+ kind: "inline";
1637
+ data: string;
1638
+ mediaType: string;
1639
+ };
1640
+ detail?: "low" | "high" | "auto" | undefined;
1641
+ } | {
1642
+ type: "audio";
1643
+ source: {
1644
+ kind: "url";
1645
+ url: string;
1646
+ } | {
1647
+ kind: "inline";
1648
+ data: string;
1649
+ mediaType: string;
1650
+ };
1651
+ } | {
1652
+ type: "file";
1653
+ source: {
1654
+ kind: "url";
1655
+ url: string;
1656
+ } | {
1657
+ kind: "inline";
1658
+ data: string;
1659
+ mediaType: string;
1660
+ };
1661
+ filename?: string | undefined;
1662
+ })[];
1663
+ role: "system" | "user" | "developer" | "assistant" | "tool";
1664
+ name?: string | undefined;
1665
+ toolCallId?: string | undefined;
1666
+ toolCalls?: {
1667
+ name: string;
1668
+ id: string;
1669
+ arguments: string;
1670
+ }[] | undefined;
1671
+ }[];
1672
+ }, {
1673
+ format: "messages";
1674
+ messages: {
1675
+ content: ({
1676
+ type: "text";
1677
+ text: string;
1678
+ } | {
1679
+ type: "image";
1680
+ source: {
1681
+ kind: "url";
1682
+ url: string;
1683
+ } | {
1684
+ kind: "inline";
1685
+ data: string;
1686
+ mediaType: string;
1687
+ };
1688
+ detail?: "low" | "high" | "auto" | undefined;
1689
+ } | {
1690
+ type: "audio";
1691
+ source: {
1692
+ kind: "url";
1693
+ url: string;
1694
+ } | {
1695
+ kind: "inline";
1696
+ data: string;
1697
+ mediaType: string;
1698
+ };
1699
+ } | {
1700
+ type: "file";
1701
+ source: {
1702
+ kind: "url";
1703
+ url: string;
1704
+ } | {
1705
+ kind: "inline";
1706
+ data: string;
1707
+ mediaType: string;
1708
+ };
1709
+ filename?: string | undefined;
1710
+ })[];
1711
+ role: "system" | "user" | "developer" | "assistant" | "tool";
1712
+ name?: string | undefined;
1713
+ toolCallId?: string | undefined;
1714
+ toolCalls?: {
1715
+ name: string;
1716
+ id: string;
1717
+ arguments: string;
1718
+ }[] | undefined;
1719
+ }[];
1720
+ }>, z.ZodObject<{
1721
+ format: z.ZodLiteral<"text">;
1722
+ text: z.ZodString;
1723
+ }, "strict", z.ZodTypeAny, {
1724
+ text: string;
1725
+ format: "text";
1726
+ }, {
1727
+ text: string;
1728
+ format: "text";
1729
+ }>, z.ZodObject<{
1730
+ format: z.ZodLiteral<"text_batch">;
1731
+ texts: z.ZodArray<z.ZodString, "many">;
1732
+ }, "strict", z.ZodTypeAny, {
1733
+ format: "text_batch";
1734
+ texts: string[];
1735
+ }, {
1736
+ format: "text_batch";
1737
+ texts: string[];
1738
+ }>]>;
1739
+ stream: z.ZodBoolean;
1740
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
1741
+ sampling: z.ZodObject<{
1742
+ temperature: z.ZodOptional<z.ZodNumber>;
1743
+ topP: z.ZodOptional<z.ZodNumber>;
1744
+ topK: z.ZodOptional<z.ZodNumber>;
1745
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
1746
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
1747
+ /** A seed makes a request reproducible on providers that honour one. */
1748
+ seed: z.ZodOptional<z.ZodNumber>;
1749
+ stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1750
+ }, "strict", z.ZodTypeAny, {
1751
+ seed?: number | undefined;
1752
+ temperature?: number | undefined;
1753
+ topP?: number | undefined;
1754
+ topK?: number | undefined;
1755
+ frequencyPenalty?: number | undefined;
1756
+ presencePenalty?: number | undefined;
1757
+ stopSequences?: string[] | undefined;
1758
+ }, {
1759
+ seed?: number | undefined;
1760
+ temperature?: number | undefined;
1761
+ topP?: number | undefined;
1762
+ topK?: number | undefined;
1763
+ frequencyPenalty?: number | undefined;
1764
+ presencePenalty?: number | undefined;
1765
+ stopSequences?: string[] | undefined;
1766
+ }>;
1767
+ tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
1768
+ type: z.ZodLiteral<"function">;
1769
+ name: z.ZodString;
1770
+ description: z.ZodOptional<z.ZodString>;
1771
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1772
+ /** Ask the provider to enforce the schema, where it supports enforcement. */
1773
+ strict: z.ZodOptional<z.ZodBoolean>;
1774
+ }, "strict", z.ZodTypeAny, {
1775
+ type: "function";
1776
+ name: string;
1777
+ parameters: Record<string, unknown>;
1778
+ description?: string | undefined;
1779
+ strict?: boolean | undefined;
1780
+ }, {
1781
+ type: "function";
1782
+ name: string;
1783
+ parameters: Record<string, unknown>;
1784
+ description?: string | undefined;
1785
+ strict?: boolean | undefined;
1786
+ }>, "many">>;
1787
+ toolChoice: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["auto", "none", "required"]>, z.ZodObject<{
1788
+ type: z.ZodLiteral<"function">;
1789
+ name: z.ZodString;
1790
+ }, "strict", z.ZodTypeAny, {
1791
+ type: "function";
1792
+ name: string;
1793
+ }, {
1794
+ type: "function";
1795
+ name: string;
1796
+ }>]>>;
1797
+ responseFormat: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1798
+ type: z.ZodLiteral<"text">;
1799
+ }, "strict", z.ZodTypeAny, {
1800
+ type: "text";
1801
+ }, {
1802
+ type: "text";
1803
+ }>, z.ZodObject<{
1804
+ type: z.ZodLiteral<"json_object">;
1805
+ }, "strict", z.ZodTypeAny, {
1806
+ type: "json_object";
1807
+ }, {
1808
+ type: "json_object";
1809
+ }>, z.ZodObject<{
1810
+ type: z.ZodLiteral<"json_schema">;
1811
+ name: z.ZodString;
1812
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1813
+ strict: z.ZodBoolean;
1814
+ }, "strict", z.ZodTypeAny, {
1815
+ type: "json_schema";
1816
+ name: string;
1817
+ strict: boolean;
1818
+ schema: Record<string, unknown>;
1819
+ }, {
1820
+ type: "json_schema";
1821
+ name: string;
1822
+ strict: boolean;
1823
+ schema: Record<string, unknown>;
1824
+ }>]>>;
1825
+ client: z.ZodObject<{
1826
+ /** The public dialect the customer called. The response is rendered in it. */
1827
+ apiFormat: z.ZodEnum<["responses", "chat_completions", "embeddings", "images_generations", "audio_transcriptions", "audio_speech", "rerank", "batches"]>;
1828
+ /** The public path, e.g. `/v1/responses`. */
1829
+ endpoint: z.ZodString;
1830
+ /** The customer's own correlation id, when they sent one. */
1831
+ clientRequestId: z.ZodOptional<z.ZodString>;
1832
+ receivedAt: z.ZodString;
1833
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1834
+ }, "strict", z.ZodTypeAny, {
1835
+ apiFormat: "embeddings" | "responses" | "chat_completions" | "images_generations" | "audio_transcriptions" | "audio_speech" | "rerank" | "batches";
1836
+ endpoint: string;
1837
+ receivedAt: string;
1838
+ clientRequestId?: string | undefined;
1839
+ labels?: Record<string, string> | undefined;
1840
+ }, {
1841
+ apiFormat: "embeddings" | "responses" | "chat_completions" | "images_generations" | "audio_transcriptions" | "audio_speech" | "rerank" | "batches";
1842
+ endpoint: string;
1843
+ receivedAt: string;
1844
+ clientRequestId?: string | undefined;
1845
+ labels?: Record<string, string> | undefined;
1846
+ }>;
1847
+ /** Present when the operation is safe to deduplicate on retry. */
1848
+ idempotencyKey: z.ZodOptional<z.ZodString>;
1849
+ /** The exact policy revision this request is served under. */
1850
+ routingPolicy: z.ZodObject<{
1851
+ routingPolicyId: z.ZodString;
1852
+ policyVersion: z.ZodNumber;
1853
+ }, "strict", z.ZodTypeAny, {
1854
+ routingPolicyId: string;
1855
+ policyVersion: number;
1856
+ }, {
1857
+ routingPolicyId: string;
1858
+ policyVersion: number;
1859
+ }>;
1860
+ }, "strip", z.ZodTypeAny, {
1861
+ attribution: {
1862
+ requestId: string;
1863
+ principal: {
1864
+ environment: "development" | "staging" | "production";
1865
+ credentialId: string;
1866
+ applicationId: string;
1867
+ billing: {
1868
+ accountId: string & z.BRAND<"OxyAccountId">;
1869
+ };
1870
+ inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1871
+ };
1872
+ userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
1873
+ generationId?: string | undefined;
1874
+ };
1875
+ schemaVersion: 1;
1876
+ tools: {
1877
+ type: "function";
1878
+ name: string;
1879
+ parameters: Record<string, unknown>;
1880
+ description?: string | undefined;
1881
+ strict?: boolean | undefined;
1882
+ }[];
1883
+ target: {
1884
+ kind: "model";
1885
+ modelReference: string;
1886
+ } | {
1887
+ kind: "routing_profile";
1888
+ routingProfile: string;
1889
+ };
1890
+ modality: "image" | "text" | "audio" | "video" | "embedding";
1891
+ input: {
1892
+ format: "messages";
1893
+ messages: {
1894
+ content: ({
1895
+ type: "text";
1896
+ text: string;
1897
+ } | {
1898
+ type: "image";
1899
+ source: {
1900
+ kind: "url";
1901
+ url: string;
1902
+ } | {
1903
+ kind: "inline";
1904
+ data: string;
1905
+ mediaType: string;
1906
+ };
1907
+ detail?: "low" | "high" | "auto" | undefined;
1908
+ } | {
1909
+ type: "audio";
1910
+ source: {
1911
+ kind: "url";
1912
+ url: string;
1913
+ } | {
1914
+ kind: "inline";
1915
+ data: string;
1916
+ mediaType: string;
1917
+ };
1918
+ } | {
1919
+ type: "file";
1920
+ source: {
1921
+ kind: "url";
1922
+ url: string;
1923
+ } | {
1924
+ kind: "inline";
1925
+ data: string;
1926
+ mediaType: string;
1927
+ };
1928
+ filename?: string | undefined;
1929
+ })[];
1930
+ role: "system" | "user" | "developer" | "assistant" | "tool";
1931
+ name?: string | undefined;
1932
+ toolCallId?: string | undefined;
1933
+ toolCalls?: {
1934
+ name: string;
1935
+ id: string;
1936
+ arguments: string;
1937
+ }[] | undefined;
1938
+ }[];
1939
+ } | {
1940
+ text: string;
1941
+ format: "text";
1942
+ } | {
1943
+ format: "text_batch";
1944
+ texts: string[];
1945
+ };
1946
+ stream: boolean;
1947
+ sampling: {
1948
+ seed?: number | undefined;
1949
+ temperature?: number | undefined;
1950
+ topP?: number | undefined;
1951
+ topK?: number | undefined;
1952
+ frequencyPenalty?: number | undefined;
1953
+ presencePenalty?: number | undefined;
1954
+ stopSequences?: string[] | undefined;
1955
+ };
1956
+ client: {
1957
+ apiFormat: "embeddings" | "responses" | "chat_completions" | "images_generations" | "audio_transcriptions" | "audio_speech" | "rerank" | "batches";
1958
+ endpoint: string;
1959
+ receivedAt: string;
1960
+ clientRequestId?: string | undefined;
1961
+ labels?: Record<string, string> | undefined;
1962
+ };
1963
+ routingPolicy: {
1964
+ routingPolicyId: string;
1965
+ policyVersion: number;
1966
+ };
1967
+ idempotencyKey?: string | undefined;
1968
+ maxOutputTokens?: number | undefined;
1969
+ toolChoice?: "none" | "auto" | "required" | {
1970
+ type: "function";
1971
+ name: string;
1972
+ } | undefined;
1973
+ responseFormat?: {
1974
+ type: "text";
1975
+ } | {
1976
+ type: "json_object";
1977
+ } | {
1978
+ type: "json_schema";
1979
+ name: string;
1980
+ strict: boolean;
1981
+ schema: Record<string, unknown>;
1982
+ } | undefined;
1983
+ }, {
1984
+ attribution: {
1985
+ requestId: string;
1986
+ principal: {
1987
+ environment: "development" | "staging" | "production";
1988
+ credentialId: string;
1989
+ applicationId: string;
1990
+ billing: {
1991
+ accountId: string;
1992
+ };
1993
+ inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
1994
+ };
1995
+ userId?: string | undefined;
1996
+ generationId?: string | undefined;
1997
+ };
1998
+ schemaVersion: 1;
1999
+ target: {
2000
+ kind: "model";
2001
+ modelReference: string;
2002
+ } | {
2003
+ kind: "routing_profile";
2004
+ routingProfile: string;
2005
+ };
2006
+ modality: "image" | "text" | "audio" | "video" | "embedding";
2007
+ input: {
2008
+ format: "messages";
2009
+ messages: {
2010
+ content: ({
2011
+ type: "text";
2012
+ text: string;
2013
+ } | {
2014
+ type: "image";
2015
+ source: {
2016
+ kind: "url";
2017
+ url: string;
2018
+ } | {
2019
+ kind: "inline";
2020
+ data: string;
2021
+ mediaType: string;
2022
+ };
2023
+ detail?: "low" | "high" | "auto" | undefined;
2024
+ } | {
2025
+ type: "audio";
2026
+ source: {
2027
+ kind: "url";
2028
+ url: string;
2029
+ } | {
2030
+ kind: "inline";
2031
+ data: string;
2032
+ mediaType: string;
2033
+ };
2034
+ } | {
2035
+ type: "file";
2036
+ source: {
2037
+ kind: "url";
2038
+ url: string;
2039
+ } | {
2040
+ kind: "inline";
2041
+ data: string;
2042
+ mediaType: string;
2043
+ };
2044
+ filename?: string | undefined;
2045
+ })[];
2046
+ role: "system" | "user" | "developer" | "assistant" | "tool";
2047
+ name?: string | undefined;
2048
+ toolCallId?: string | undefined;
2049
+ toolCalls?: {
2050
+ name: string;
2051
+ id: string;
2052
+ arguments: string;
2053
+ }[] | undefined;
2054
+ }[];
2055
+ } | {
2056
+ text: string;
2057
+ format: "text";
2058
+ } | {
2059
+ format: "text_batch";
2060
+ texts: string[];
2061
+ };
2062
+ stream: boolean;
2063
+ sampling: {
2064
+ seed?: number | undefined;
2065
+ temperature?: number | undefined;
2066
+ topP?: number | undefined;
2067
+ topK?: number | undefined;
2068
+ frequencyPenalty?: number | undefined;
2069
+ presencePenalty?: number | undefined;
2070
+ stopSequences?: string[] | undefined;
2071
+ };
2072
+ client: {
2073
+ apiFormat: "embeddings" | "responses" | "chat_completions" | "images_generations" | "audio_transcriptions" | "audio_speech" | "rerank" | "batches";
2074
+ endpoint: string;
2075
+ receivedAt: string;
2076
+ clientRequestId?: string | undefined;
2077
+ labels?: Record<string, string> | undefined;
2078
+ };
2079
+ routingPolicy: {
2080
+ routingPolicyId: string;
2081
+ policyVersion: number;
2082
+ };
2083
+ idempotencyKey?: string | undefined;
2084
+ tools?: {
2085
+ type: "function";
2086
+ name: string;
2087
+ parameters: Record<string, unknown>;
2088
+ description?: string | undefined;
2089
+ strict?: boolean | undefined;
2090
+ }[] | undefined;
2091
+ maxOutputTokens?: number | undefined;
2092
+ toolChoice?: "none" | "auto" | "required" | {
2093
+ type: "function";
2094
+ name: string;
2095
+ } | undefined;
2096
+ responseFormat?: {
2097
+ type: "text";
2098
+ } | {
2099
+ type: "json_object";
2100
+ } | {
2101
+ type: "json_schema";
2102
+ name: string;
2103
+ strict: boolean;
2104
+ schema: Record<string, unknown>;
2105
+ } | undefined;
2106
+ }>, {
2107
+ attribution: {
2108
+ requestId: string;
2109
+ principal: {
2110
+ environment: "development" | "staging" | "production";
2111
+ credentialId: string;
2112
+ applicationId: string;
2113
+ billing: {
2114
+ accountId: string & z.BRAND<"OxyAccountId">;
2115
+ };
2116
+ inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
2117
+ };
2118
+ userId?: (string & z.BRAND<"DelegatedUserId">) | undefined;
2119
+ generationId?: string | undefined;
2120
+ };
2121
+ schemaVersion: 1;
2122
+ tools: {
2123
+ type: "function";
2124
+ name: string;
2125
+ parameters: Record<string, unknown>;
2126
+ description?: string | undefined;
2127
+ strict?: boolean | undefined;
2128
+ }[];
2129
+ target: {
2130
+ kind: "model";
2131
+ modelReference: string;
2132
+ } | {
2133
+ kind: "routing_profile";
2134
+ routingProfile: string;
2135
+ };
2136
+ modality: "image" | "text" | "audio" | "video" | "embedding";
2137
+ input: {
2138
+ format: "messages";
2139
+ messages: {
2140
+ content: ({
2141
+ type: "text";
2142
+ text: string;
2143
+ } | {
2144
+ type: "image";
2145
+ source: {
2146
+ kind: "url";
2147
+ url: string;
2148
+ } | {
2149
+ kind: "inline";
2150
+ data: string;
2151
+ mediaType: string;
2152
+ };
2153
+ detail?: "low" | "high" | "auto" | undefined;
2154
+ } | {
2155
+ type: "audio";
2156
+ source: {
2157
+ kind: "url";
2158
+ url: string;
2159
+ } | {
2160
+ kind: "inline";
2161
+ data: string;
2162
+ mediaType: string;
2163
+ };
2164
+ } | {
2165
+ type: "file";
2166
+ source: {
2167
+ kind: "url";
2168
+ url: string;
2169
+ } | {
2170
+ kind: "inline";
2171
+ data: string;
2172
+ mediaType: string;
2173
+ };
2174
+ filename?: string | undefined;
2175
+ })[];
2176
+ role: "system" | "user" | "developer" | "assistant" | "tool";
2177
+ name?: string | undefined;
2178
+ toolCallId?: string | undefined;
2179
+ toolCalls?: {
2180
+ name: string;
2181
+ id: string;
2182
+ arguments: string;
2183
+ }[] | undefined;
2184
+ }[];
2185
+ } | {
2186
+ text: string;
2187
+ format: "text";
2188
+ } | {
2189
+ format: "text_batch";
2190
+ texts: string[];
2191
+ };
2192
+ stream: boolean;
2193
+ sampling: {
2194
+ seed?: number | undefined;
2195
+ temperature?: number | undefined;
2196
+ topP?: number | undefined;
2197
+ topK?: number | undefined;
2198
+ frequencyPenalty?: number | undefined;
2199
+ presencePenalty?: number | undefined;
2200
+ stopSequences?: string[] | undefined;
2201
+ };
2202
+ client: {
2203
+ apiFormat: "embeddings" | "responses" | "chat_completions" | "images_generations" | "audio_transcriptions" | "audio_speech" | "rerank" | "batches";
2204
+ endpoint: string;
2205
+ receivedAt: string;
2206
+ clientRequestId?: string | undefined;
2207
+ labels?: Record<string, string> | undefined;
2208
+ };
2209
+ routingPolicy: {
2210
+ routingPolicyId: string;
2211
+ policyVersion: number;
2212
+ };
2213
+ idempotencyKey?: string | undefined;
2214
+ maxOutputTokens?: number | undefined;
2215
+ toolChoice?: "none" | "auto" | "required" | {
2216
+ type: "function";
2217
+ name: string;
2218
+ } | undefined;
2219
+ responseFormat?: {
2220
+ type: "text";
2221
+ } | {
2222
+ type: "json_object";
2223
+ } | {
2224
+ type: "json_schema";
2225
+ name: string;
2226
+ strict: boolean;
2227
+ schema: Record<string, unknown>;
2228
+ } | undefined;
2229
+ }, {
2230
+ attribution: {
2231
+ requestId: string;
2232
+ principal: {
2233
+ environment: "development" | "staging" | "production";
2234
+ credentialId: string;
2235
+ applicationId: string;
2236
+ billing: {
2237
+ accountId: string;
2238
+ };
2239
+ inferenceScopes: ("inference:invoke" | "inference:models:read" | "inference:usage:read" | "inference:routing:read" | "inference:routing:write" | "inference:providers:read" | "inference:providers:write")[];
2240
+ };
2241
+ userId?: string | undefined;
2242
+ generationId?: string | undefined;
2243
+ };
2244
+ schemaVersion: 1;
2245
+ target: {
2246
+ kind: "model";
2247
+ modelReference: string;
2248
+ } | {
2249
+ kind: "routing_profile";
2250
+ routingProfile: string;
2251
+ };
2252
+ modality: "image" | "text" | "audio" | "video" | "embedding";
2253
+ input: {
2254
+ format: "messages";
2255
+ messages: {
2256
+ content: ({
2257
+ type: "text";
2258
+ text: string;
2259
+ } | {
2260
+ type: "image";
2261
+ source: {
2262
+ kind: "url";
2263
+ url: string;
2264
+ } | {
2265
+ kind: "inline";
2266
+ data: string;
2267
+ mediaType: string;
2268
+ };
2269
+ detail?: "low" | "high" | "auto" | undefined;
2270
+ } | {
2271
+ type: "audio";
2272
+ source: {
2273
+ kind: "url";
2274
+ url: string;
2275
+ } | {
2276
+ kind: "inline";
2277
+ data: string;
2278
+ mediaType: string;
2279
+ };
2280
+ } | {
2281
+ type: "file";
2282
+ source: {
2283
+ kind: "url";
2284
+ url: string;
2285
+ } | {
2286
+ kind: "inline";
2287
+ data: string;
2288
+ mediaType: string;
2289
+ };
2290
+ filename?: string | undefined;
2291
+ })[];
2292
+ role: "system" | "user" | "developer" | "assistant" | "tool";
2293
+ name?: string | undefined;
2294
+ toolCallId?: string | undefined;
2295
+ toolCalls?: {
2296
+ name: string;
2297
+ id: string;
2298
+ arguments: string;
2299
+ }[] | undefined;
2300
+ }[];
2301
+ } | {
2302
+ text: string;
2303
+ format: "text";
2304
+ } | {
2305
+ format: "text_batch";
2306
+ texts: string[];
2307
+ };
2308
+ stream: boolean;
2309
+ sampling: {
2310
+ seed?: number | undefined;
2311
+ temperature?: number | undefined;
2312
+ topP?: number | undefined;
2313
+ topK?: number | undefined;
2314
+ frequencyPenalty?: number | undefined;
2315
+ presencePenalty?: number | undefined;
2316
+ stopSequences?: string[] | undefined;
2317
+ };
2318
+ client: {
2319
+ apiFormat: "embeddings" | "responses" | "chat_completions" | "images_generations" | "audio_transcriptions" | "audio_speech" | "rerank" | "batches";
2320
+ endpoint: string;
2321
+ receivedAt: string;
2322
+ clientRequestId?: string | undefined;
2323
+ labels?: Record<string, string> | undefined;
2324
+ };
2325
+ routingPolicy: {
2326
+ routingPolicyId: string;
2327
+ policyVersion: number;
2328
+ };
2329
+ idempotencyKey?: string | undefined;
2330
+ tools?: {
2331
+ type: "function";
2332
+ name: string;
2333
+ parameters: Record<string, unknown>;
2334
+ description?: string | undefined;
2335
+ strict?: boolean | undefined;
2336
+ }[] | undefined;
2337
+ maxOutputTokens?: number | undefined;
2338
+ toolChoice?: "none" | "auto" | "required" | {
2339
+ type: "function";
2340
+ name: string;
2341
+ } | undefined;
2342
+ responseFormat?: {
2343
+ type: "text";
2344
+ } | {
2345
+ type: "json_object";
2346
+ } | {
2347
+ type: "json_schema";
2348
+ name: string;
2349
+ strict: boolean;
2350
+ schema: Record<string, unknown>;
2351
+ } | undefined;
2352
+ }>;
2353
+ export type InferenceContentSource = z.infer<typeof inferenceContentSourceSchema>;
2354
+ export type InferenceContentPart = z.infer<typeof inferenceContentPartSchema>;
2355
+ export type InferenceToolCall = z.infer<typeof inferenceToolCallSchema>;
2356
+ export type InferenceMessageRole = z.infer<typeof inferenceMessageRoleSchema>;
2357
+ export type InferenceMessage = z.infer<typeof inferenceMessageSchema>;
2358
+ export type InferenceInput = z.infer<typeof inferenceInputSchema>;
2359
+ export type SamplingParameters = z.infer<typeof samplingParametersSchema>;
2360
+ export type ToolDefinition = z.infer<typeof toolDefinitionSchema>;
2361
+ export type ToolChoice = z.infer<typeof toolChoiceSchema>;
2362
+ export type ResponseFormat = z.infer<typeof responseFormatSchema>;
2363
+ export type ClientRequestMetadata = z.infer<typeof clientRequestMetadataSchema>;
2364
+ export type InferenceRequest = z.infer<typeof inferenceRequestSchema>;