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