@kaana.ai/contracts 0.0.0-stage → 4.4.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 (79) hide show
  1. package/LICENSE +673 -0
  2. package/NOTICE +21 -0
  3. package/dist/index.d.ts +29 -0
  4. package/dist/index.js +29 -0
  5. package/dist/internal/attribution.d.ts +116 -0
  6. package/dist/internal/attribution.js +82 -0
  7. package/dist/internal/canonical.d.ts +31 -0
  8. package/dist/internal/canonical.js +57 -0
  9. package/dist/internal/catalogue.d.ts +1059 -0
  10. package/dist/internal/catalogue.js +389 -0
  11. package/dist/internal/credentialControl.d.ts +329 -0
  12. package/dist/internal/credentialControl.js +256 -0
  13. package/dist/internal/decisions.d.ts +245 -0
  14. package/dist/internal/decisions.js +69 -0
  15. package/dist/internal/economics.d.ts +27 -0
  16. package/dist/internal/economics.js +26 -0
  17. package/dist/internal/embeddings.d.ts +164 -0
  18. package/dist/internal/embeddings.js +59 -0
  19. package/dist/internal/errors.d.ts +185 -0
  20. package/dist/internal/errors.js +211 -0
  21. package/dist/internal/grant.d.ts +699 -0
  22. package/dist/internal/grant.js +445 -0
  23. package/dist/internal/identifiers.d.ts +63 -0
  24. package/dist/internal/identifiers.js +65 -0
  25. package/dist/internal/privateAutoExecution.d.ts +158 -0
  26. package/dist/internal/privateAutoExecution.js +188 -0
  27. package/dist/internal/realtime.d.ts +1005 -0
  28. package/dist/internal/realtime.js +187 -0
  29. package/dist/internal/request.d.ts +1079 -0
  30. package/dist/internal/request.js +404 -0
  31. package/dist/internal/routing.d.ts +90 -0
  32. package/dist/internal/routing.js +139 -0
  33. package/dist/internal/scopedExecution.d.ts +74 -0
  34. package/dist/internal/scopedExecution.js +61 -0
  35. package/dist/internal/settlement.d.ts +205 -0
  36. package/dist/internal/settlement.js +71 -0
  37. package/dist/internal/streamEvents.d.ts +422 -0
  38. package/dist/internal/streamEvents.js +171 -0
  39. package/dist/internal/usage.d.ts +127 -0
  40. package/dist/internal/usage.js +109 -0
  41. package/dist/internal.d.ts +30 -0
  42. package/dist/internal.js +30 -0
  43. package/dist/public/audio.d.ts +347 -0
  44. package/dist/public/audio.js +236 -0
  45. package/dist/public/audioFormats.d.ts +64 -0
  46. package/dist/public/audioFormats.js +60 -0
  47. package/dist/public/catalogue.d.ts +914 -0
  48. package/dist/public/catalogue.js +516 -0
  49. package/dist/public/chatCompletions.d.ts +381 -0
  50. package/dist/public/chatCompletions.js +321 -0
  51. package/dist/public/decisions.d.ts +182 -0
  52. package/dist/public/decisions.js +257 -0
  53. package/dist/public/embeddings.d.ts +34 -0
  54. package/dist/public/embeddings.js +66 -0
  55. package/dist/public/errors.d.ts +195 -0
  56. package/dist/public/errors.js +274 -0
  57. package/dist/public/generations.d.ts +330 -0
  58. package/dist/public/generations.js +121 -0
  59. package/dist/public/identifiers.d.ts +139 -0
  60. package/dist/public/identifiers.js +160 -0
  61. package/dist/public/images.d.ts +36 -0
  62. package/dist/public/images.js +36 -0
  63. package/dist/public/messages.d.ts +297 -0
  64. package/dist/public/messages.js +251 -0
  65. package/dist/public/money.d.ts +308 -0
  66. package/dist/public/money.js +237 -0
  67. package/dist/public/policy.d.ts +19 -0
  68. package/dist/public/policy.js +20 -0
  69. package/dist/public/realtime.d.ts +2006 -0
  70. package/dist/public/realtime.js +797 -0
  71. package/dist/public/responses.d.ts +253 -0
  72. package/dist/public/responses.js +95 -0
  73. package/dist/public/streamEvents.d.ts +372 -0
  74. package/dist/public/streamEvents.js +157 -0
  75. package/dist/public/version.d.ts +184 -0
  76. package/dist/public/version.js +184 -0
  77. package/openapi.json +6967 -0
  78. package/package.json +44 -4
  79. package/README.md +0 -3
@@ -0,0 +1,2006 @@
1
+ /**
2
+ * Realtime sessions as a public client speaks them (`GET /v1/realtime`).
3
+ *
4
+ * Moved from `@oxy.so/contracts` 4.12.0 (`src/inference/realtime.ts`) by Kaana ADR 0002.
5
+ */
6
+ import { z } from 'zod';
7
+ import { type ModelAudioCapabilities, type ModelCapabilities, realtimeSessionKindSchema } from './catalogue.js';
8
+ /**
9
+ * The most base64 characters one audio frame may carry: 49 152 bytes of audio,
10
+ * about one second of 24 kHz mono PCM16. Bounded so no frame is large enough to
11
+ * stall a connection, and so a byte cap can be enforced as audio arrives rather
12
+ * than after it has been buffered.
13
+ */
14
+ export declare const MAX_REALTIME_AUDIO_FRAME_BASE64_LENGTH = 65536;
15
+ /** The longest a session may be signed for: one hour. */
16
+ export declare const MAX_REALTIME_SESSION_DURATION_MS = 3600000;
17
+ /**
18
+ * The most audio a session may be signed for in EACH direction: one hour of
19
+ * 24 kHz mono PCM16 (48 000 bytes per second), the densest format a session
20
+ * carries.
21
+ */
22
+ export declare const MAX_REALTIME_SESSION_AUDIO_BYTES = 172800000;
23
+ /** The longest a dropped connection may be resumed after: one minute. */
24
+ export declare const MAX_REALTIME_RESUME_WINDOW_MS = 60000;
25
+ /** A client-chosen command identity, unique within one session. */
26
+ export declare const realtimeCommandIdSchema: z.ZodString;
27
+ /** A conversation item's identity within one session. */
28
+ export declare const realtimeItemIdSchema: z.ZodString;
29
+ /** A response's identity within one session. */
30
+ export declare const realtimeResponseIdSchema: z.ZodString;
31
+ /** What a session's responses produce. */
32
+ export declare const realtimeOutputModalitySchema: z.ZodEnum<{
33
+ text: "text";
34
+ audio: "audio";
35
+ }>;
36
+ /**
37
+ * How the end of a user's turn is detected.
38
+ *
39
+ * `none` means the client commits input audio itself. The two VAD forms name
40
+ * `createResponse` and `interruptResponse` explicitly rather than defaulting
41
+ * them: whether the model answers on its own, and whether new speech cuts it
42
+ * off, are the two behaviours a caller most needs to have chosen, and a default
43
+ * would choose them silently — and differently per provider.
44
+ */
45
+ export declare const realtimeTurnDetectionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
46
+ type: z.ZodLiteral<"none">;
47
+ }, z.core.$strict>, z.ZodObject<{
48
+ type: z.ZodLiteral<"server_vad">;
49
+ threshold: z.ZodOptional<z.ZodNumber>;
50
+ prefixPaddingMs: z.ZodOptional<z.ZodNumber>;
51
+ silenceDurationMs: z.ZodOptional<z.ZodNumber>;
52
+ createResponse: z.ZodBoolean;
53
+ interruptResponse: z.ZodBoolean;
54
+ }, z.core.$strict>, z.ZodObject<{
55
+ type: z.ZodLiteral<"semantic_vad">;
56
+ eagerness: z.ZodEnum<{
57
+ low: "low";
58
+ medium: "medium";
59
+ high: "high";
60
+ auto: "auto";
61
+ }>;
62
+ createResponse: z.ZodBoolean;
63
+ interruptResponse: z.ZodBoolean;
64
+ }, z.core.$strict>], "type">;
65
+ /**
66
+ * Transcription of the caller's input audio. Presence enables it; the
67
+ * transcription model is the deployment's own, declared where the deployment
68
+ * is, never chosen by a string here.
69
+ *
70
+ * In a `conversation` it is served only by a model whose catalogue entry says
71
+ * so (`capabilities.realtime.inputAudioTranscription`, contract set 4.1.0),
72
+ * and each transcribed turn arrives as `transcript.delta` / `transcript.done`
73
+ * with `source: 'input_audio'`. What it costs is settled with the session:
74
+ * where the provider bills the transcription apart from the session model, as
75
+ * `input_transcription_milliseconds` (see `USAGE_UNITS`); where the session's
76
+ * own price includes it, as nothing more.
77
+ *
78
+ * `language`, when given, is one of the model's published `audio.languages`.
79
+ */
80
+ export declare const realtimeInputTranscriptionSchema: z.ZodObject<{
81
+ language: z.ZodOptional<z.ZodString>;
82
+ prompt: z.ZodOptional<z.ZodString>;
83
+ }, z.core.$strict>;
84
+ /** The target of a `translation` session. */
85
+ export declare const realtimeTranslationSchema: z.ZodObject<{
86
+ targetLanguage: z.ZodString;
87
+ }, z.core.$strict>;
88
+ /**
89
+ * A session's full configuration, as signed at open and as echoed back by
90
+ * `session.created` and `session.updated`.
91
+ *
92
+ * `inputAudioFormat` and `turnDetection` are required because every session
93
+ * kind consumes audio and has to know when a turn ends; nothing else is,
94
+ * because each kind needs a different subset — see the refinement on
95
+ * {@link realtimeSessionRequestSchema}.
96
+ */
97
+ export declare const realtimeSessionConfigSchema: z.ZodObject<{
98
+ instructions: z.ZodOptional<z.ZodString>;
99
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
100
+ text: "text";
101
+ audio: "audio";
102
+ }>>>;
103
+ voice: z.ZodOptional<z.ZodString>;
104
+ inputAudioFormat: z.ZodEnum<{
105
+ pcm16_24khz: "pcm16_24khz";
106
+ g711_ulaw: "g711_ulaw";
107
+ g711_alaw: "g711_alaw";
108
+ }>;
109
+ outputAudioFormat: z.ZodOptional<z.ZodEnum<{
110
+ pcm16_24khz: "pcm16_24khz";
111
+ g711_ulaw: "g711_ulaw";
112
+ g711_alaw: "g711_alaw";
113
+ }>>;
114
+ turnDetection: z.ZodDiscriminatedUnion<[z.ZodObject<{
115
+ type: z.ZodLiteral<"none">;
116
+ }, z.core.$strict>, z.ZodObject<{
117
+ type: z.ZodLiteral<"server_vad">;
118
+ threshold: z.ZodOptional<z.ZodNumber>;
119
+ prefixPaddingMs: z.ZodOptional<z.ZodNumber>;
120
+ silenceDurationMs: z.ZodOptional<z.ZodNumber>;
121
+ createResponse: z.ZodBoolean;
122
+ interruptResponse: z.ZodBoolean;
123
+ }, z.core.$strict>, z.ZodObject<{
124
+ type: z.ZodLiteral<"semantic_vad">;
125
+ eagerness: z.ZodEnum<{
126
+ low: "low";
127
+ medium: "medium";
128
+ high: "high";
129
+ auto: "auto";
130
+ }>;
131
+ createResponse: z.ZodBoolean;
132
+ interruptResponse: z.ZodBoolean;
133
+ }, z.core.$strict>], "type">;
134
+ inputAudioTranscription: z.ZodOptional<z.ZodObject<{
135
+ language: z.ZodOptional<z.ZodString>;
136
+ prompt: z.ZodOptional<z.ZodString>;
137
+ }, z.core.$strict>>;
138
+ translation: z.ZodOptional<z.ZodObject<{
139
+ targetLanguage: z.ZodString;
140
+ }, z.core.$strict>>;
141
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
142
+ type: z.ZodLiteral<"function">;
143
+ name: z.ZodString;
144
+ description: z.ZodOptional<z.ZodString>;
145
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
146
+ strict: z.ZodOptional<z.ZodBoolean>;
147
+ }, z.core.$strict>>>;
148
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
149
+ auto: "auto";
150
+ none: "none";
151
+ required: "required";
152
+ }>, z.ZodObject<{
153
+ type: z.ZodLiteral<"function">;
154
+ name: z.ZodString;
155
+ }, z.core.$strict>]>>;
156
+ temperature: z.ZodOptional<z.ZodNumber>;
157
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
158
+ }, z.core.$strict>;
159
+ /**
160
+ * What `session.update` may change mid-session.
161
+ *
162
+ * The session's kind, its audio formats and its voice are fixed at open —
163
+ * providers refuse to change a voice once it has spoken, and a format change
164
+ * mid-stream would make every buffered frame ambiguous — so they are not fields
165
+ * here, and the strict parse refuses them rather than ignoring them.
166
+ */
167
+ export declare const realtimeSessionConfigUpdateSchema: z.ZodObject<{
168
+ instructions: z.ZodOptional<z.ZodString>;
169
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
170
+ text: "text";
171
+ audio: "audio";
172
+ }>>>;
173
+ turnDetection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
174
+ type: z.ZodLiteral<"none">;
175
+ }, z.core.$strict>, z.ZodObject<{
176
+ type: z.ZodLiteral<"server_vad">;
177
+ threshold: z.ZodOptional<z.ZodNumber>;
178
+ prefixPaddingMs: z.ZodOptional<z.ZodNumber>;
179
+ silenceDurationMs: z.ZodOptional<z.ZodNumber>;
180
+ createResponse: z.ZodBoolean;
181
+ interruptResponse: z.ZodBoolean;
182
+ }, z.core.$strict>, z.ZodObject<{
183
+ type: z.ZodLiteral<"semantic_vad">;
184
+ eagerness: z.ZodEnum<{
185
+ low: "low";
186
+ medium: "medium";
187
+ high: "high";
188
+ auto: "auto";
189
+ }>;
190
+ createResponse: z.ZodBoolean;
191
+ interruptResponse: z.ZodBoolean;
192
+ }, z.core.$strict>], "type">>;
193
+ inputAudioTranscription: z.ZodOptional<z.ZodObject<{
194
+ language: z.ZodOptional<z.ZodString>;
195
+ prompt: z.ZodOptional<z.ZodString>;
196
+ }, z.core.$strict>>;
197
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
198
+ type: z.ZodLiteral<"function">;
199
+ name: z.ZodString;
200
+ description: z.ZodOptional<z.ZodString>;
201
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
202
+ strict: z.ZodOptional<z.ZodBoolean>;
203
+ }, z.core.$strict>>>;
204
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
205
+ auto: "auto";
206
+ none: "none";
207
+ required: "required";
208
+ }>, z.ZodObject<{
209
+ type: z.ZodLiteral<"function">;
210
+ name: z.ZodString;
211
+ }, z.core.$strict>]>>;
212
+ temperature: z.ZodOptional<z.ZodNumber>;
213
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
214
+ }, z.core.$strict>;
215
+ /**
216
+ * The ceilings Oxy signed the session for. The data plane enforces each one and
217
+ * closes the session (`limit_exceeded`, `max_duration`, `idle_timeout`) rather
218
+ * than exceeding it: these bound what the session can cost, which is what Oxy's
219
+ * spend reservation was sized against.
220
+ */
221
+ export declare const realtimeSessionLimitsSchema: z.ZodObject<{
222
+ maxDurationMs: z.ZodNumber;
223
+ idleTimeoutMs: z.ZodNumber;
224
+ maxInputAudioBytes: z.ZodNumber;
225
+ maxOutputAudioBytes: z.ZodNumber;
226
+ maxResponses: z.ZodNumber;
227
+ }, z.core.$strict>;
228
+ /**
229
+ * One part of a conversation message.
230
+ *
231
+ * `input_audio` carries its audio inline (one bounded frame); `output_audio`
232
+ * never does — spoken output arrives as `output_audio.delta` events, and an
233
+ * item echoing it carries only the format and, once known, the transcript.
234
+ */
235
+ export declare const realtimeContentPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
236
+ type: z.ZodLiteral<"input_text">;
237
+ text: z.ZodString;
238
+ }, z.core.$strict>, z.ZodObject<{
239
+ type: z.ZodLiteral<"input_audio">;
240
+ format: z.ZodEnum<{
241
+ pcm16_24khz: "pcm16_24khz";
242
+ g711_ulaw: "g711_ulaw";
243
+ g711_alaw: "g711_alaw";
244
+ }>;
245
+ data: z.ZodOptional<z.ZodString>;
246
+ transcript: z.ZodOptional<z.ZodString>;
247
+ }, z.core.$strict>, z.ZodObject<{
248
+ type: z.ZodLiteral<"output_text">;
249
+ text: z.ZodString;
250
+ }, z.core.$strict>, z.ZodObject<{
251
+ type: z.ZodLiteral<"output_audio">;
252
+ format: z.ZodEnum<{
253
+ pcm16_24khz: "pcm16_24khz";
254
+ g711_ulaw: "g711_ulaw";
255
+ g711_alaw: "g711_alaw";
256
+ }>;
257
+ transcript: z.ZodOptional<z.ZodString>;
258
+ }, z.core.$strict>], "type">;
259
+ /**
260
+ * One item of the conversation a session holds.
261
+ *
262
+ * `itemId` is optional on an item a client CREATES (the server assigns one) and
263
+ * is always stated by the server on the events that carry an item.
264
+ */
265
+ export declare const realtimeConversationItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
266
+ type: z.ZodLiteral<"message">;
267
+ itemId: z.ZodOptional<z.ZodString>;
268
+ role: z.ZodEnum<{
269
+ user: "user";
270
+ system: "system";
271
+ assistant: "assistant";
272
+ }>;
273
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
274
+ type: z.ZodLiteral<"input_text">;
275
+ text: z.ZodString;
276
+ }, z.core.$strict>, z.ZodObject<{
277
+ type: z.ZodLiteral<"input_audio">;
278
+ format: z.ZodEnum<{
279
+ pcm16_24khz: "pcm16_24khz";
280
+ g711_ulaw: "g711_ulaw";
281
+ g711_alaw: "g711_alaw";
282
+ }>;
283
+ data: z.ZodOptional<z.ZodString>;
284
+ transcript: z.ZodOptional<z.ZodString>;
285
+ }, z.core.$strict>, z.ZodObject<{
286
+ type: z.ZodLiteral<"output_text">;
287
+ text: z.ZodString;
288
+ }, z.core.$strict>, z.ZodObject<{
289
+ type: z.ZodLiteral<"output_audio">;
290
+ format: z.ZodEnum<{
291
+ pcm16_24khz: "pcm16_24khz";
292
+ g711_ulaw: "g711_ulaw";
293
+ g711_alaw: "g711_alaw";
294
+ }>;
295
+ transcript: z.ZodOptional<z.ZodString>;
296
+ }, z.core.$strict>], "type">>;
297
+ }, z.core.$strict>, z.ZodObject<{
298
+ type: z.ZodLiteral<"function_call">;
299
+ itemId: z.ZodOptional<z.ZodString>;
300
+ callId: z.ZodString;
301
+ name: z.ZodString;
302
+ arguments: z.ZodString;
303
+ }, z.core.$strict>, z.ZodObject<{
304
+ type: z.ZodLiteral<"function_call_output">;
305
+ itemId: z.ZodOptional<z.ZodString>;
306
+ callId: z.ZodString;
307
+ output: z.ZodString;
308
+ }, z.core.$strict>], "type">;
309
+ /** Per-response overrides for `response.create`. Absent fields keep the session's. */
310
+ export declare const realtimeResponseParametersSchema: z.ZodObject<{
311
+ instructions: z.ZodOptional<z.ZodString>;
312
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
313
+ text: "text";
314
+ audio: "audio";
315
+ }>>>;
316
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
317
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
318
+ auto: "auto";
319
+ none: "none";
320
+ required: "required";
321
+ }>, z.ZodObject<{
322
+ type: z.ZodLiteral<"function">;
323
+ name: z.ZodString;
324
+ }, z.core.$strict>]>>;
325
+ }, z.core.$strict>;
326
+ export declare const realtimeSessionUpdateCommandSchema: z.ZodObject<{
327
+ type: z.ZodLiteral<"session.update">;
328
+ config: z.ZodObject<{
329
+ instructions: z.ZodOptional<z.ZodString>;
330
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
331
+ text: "text";
332
+ audio: "audio";
333
+ }>>>;
334
+ turnDetection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
335
+ type: z.ZodLiteral<"none">;
336
+ }, z.core.$strict>, z.ZodObject<{
337
+ type: z.ZodLiteral<"server_vad">;
338
+ threshold: z.ZodOptional<z.ZodNumber>;
339
+ prefixPaddingMs: z.ZodOptional<z.ZodNumber>;
340
+ silenceDurationMs: z.ZodOptional<z.ZodNumber>;
341
+ createResponse: z.ZodBoolean;
342
+ interruptResponse: z.ZodBoolean;
343
+ }, z.core.$strict>, z.ZodObject<{
344
+ type: z.ZodLiteral<"semantic_vad">;
345
+ eagerness: z.ZodEnum<{
346
+ low: "low";
347
+ medium: "medium";
348
+ high: "high";
349
+ auto: "auto";
350
+ }>;
351
+ createResponse: z.ZodBoolean;
352
+ interruptResponse: z.ZodBoolean;
353
+ }, z.core.$strict>], "type">>;
354
+ inputAudioTranscription: z.ZodOptional<z.ZodObject<{
355
+ language: z.ZodOptional<z.ZodString>;
356
+ prompt: z.ZodOptional<z.ZodString>;
357
+ }, z.core.$strict>>;
358
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
359
+ type: z.ZodLiteral<"function">;
360
+ name: z.ZodString;
361
+ description: z.ZodOptional<z.ZodString>;
362
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
363
+ strict: z.ZodOptional<z.ZodBoolean>;
364
+ }, z.core.$strict>>>;
365
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
366
+ auto: "auto";
367
+ none: "none";
368
+ required: "required";
369
+ }>, z.ZodObject<{
370
+ type: z.ZodLiteral<"function">;
371
+ name: z.ZodString;
372
+ }, z.core.$strict>]>>;
373
+ temperature: z.ZodOptional<z.ZodNumber>;
374
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
375
+ }, z.core.$strict>;
376
+ schemaVersion: z.ZodLiteral<1>;
377
+ requestId: z.ZodString;
378
+ commandId: z.ZodString;
379
+ }, z.core.$strip>;
380
+ export declare const realtimeItemCreateCommandSchema: z.ZodObject<{
381
+ type: z.ZodLiteral<"conversation.item.create">;
382
+ previousItemId: z.ZodOptional<z.ZodString>;
383
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
384
+ type: z.ZodLiteral<"message">;
385
+ itemId: z.ZodOptional<z.ZodString>;
386
+ role: z.ZodEnum<{
387
+ user: "user";
388
+ system: "system";
389
+ assistant: "assistant";
390
+ }>;
391
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
392
+ type: z.ZodLiteral<"input_text">;
393
+ text: z.ZodString;
394
+ }, z.core.$strict>, z.ZodObject<{
395
+ type: z.ZodLiteral<"input_audio">;
396
+ format: z.ZodEnum<{
397
+ pcm16_24khz: "pcm16_24khz";
398
+ g711_ulaw: "g711_ulaw";
399
+ g711_alaw: "g711_alaw";
400
+ }>;
401
+ data: z.ZodOptional<z.ZodString>;
402
+ transcript: z.ZodOptional<z.ZodString>;
403
+ }, z.core.$strict>, z.ZodObject<{
404
+ type: z.ZodLiteral<"output_text">;
405
+ text: z.ZodString;
406
+ }, z.core.$strict>, z.ZodObject<{
407
+ type: z.ZodLiteral<"output_audio">;
408
+ format: z.ZodEnum<{
409
+ pcm16_24khz: "pcm16_24khz";
410
+ g711_ulaw: "g711_ulaw";
411
+ g711_alaw: "g711_alaw";
412
+ }>;
413
+ transcript: z.ZodOptional<z.ZodString>;
414
+ }, z.core.$strict>], "type">>;
415
+ }, z.core.$strict>, z.ZodObject<{
416
+ type: z.ZodLiteral<"function_call">;
417
+ itemId: z.ZodOptional<z.ZodString>;
418
+ callId: z.ZodString;
419
+ name: z.ZodString;
420
+ arguments: z.ZodString;
421
+ }, z.core.$strict>, z.ZodObject<{
422
+ type: z.ZodLiteral<"function_call_output">;
423
+ itemId: z.ZodOptional<z.ZodString>;
424
+ callId: z.ZodString;
425
+ output: z.ZodString;
426
+ }, z.core.$strict>], "type">;
427
+ schemaVersion: z.ZodLiteral<1>;
428
+ requestId: z.ZodString;
429
+ commandId: z.ZodString;
430
+ }, z.core.$strip>;
431
+ export declare const realtimeItemDeleteCommandSchema: z.ZodObject<{
432
+ type: z.ZodLiteral<"conversation.item.delete">;
433
+ itemId: z.ZodString;
434
+ schemaVersion: z.ZodLiteral<1>;
435
+ requestId: z.ZodString;
436
+ commandId: z.ZodString;
437
+ }, z.core.$strip>;
438
+ /**
439
+ * Cut an assistant's audio item at the point the listener actually heard, after
440
+ * an interruption, so the conversation the model remembers is the one that was
441
+ * spoken rather than the one that was generated.
442
+ */
443
+ export declare const realtimeItemTruncateCommandSchema: z.ZodObject<{
444
+ type: z.ZodLiteral<"conversation.item.truncate">;
445
+ itemId: z.ZodString;
446
+ contentIndex: z.ZodNumber;
447
+ audioEndMs: z.ZodNumber;
448
+ schemaVersion: z.ZodLiteral<1>;
449
+ requestId: z.ZodString;
450
+ commandId: z.ZodString;
451
+ }, z.core.$strip>;
452
+ export declare const realtimeInputAudioAppendCommandSchema: z.ZodObject<{
453
+ type: z.ZodLiteral<"input_audio.append">;
454
+ data: z.ZodString;
455
+ schemaVersion: z.ZodLiteral<1>;
456
+ requestId: z.ZodString;
457
+ commandId: z.ZodString;
458
+ }, z.core.$strip>;
459
+ export declare const realtimeInputAudioCommitCommandSchema: z.ZodObject<{
460
+ type: z.ZodLiteral<"input_audio.commit">;
461
+ schemaVersion: z.ZodLiteral<1>;
462
+ requestId: z.ZodString;
463
+ commandId: z.ZodString;
464
+ }, z.core.$strip>;
465
+ export declare const realtimeInputAudioClearCommandSchema: z.ZodObject<{
466
+ type: z.ZodLiteral<"input_audio.clear">;
467
+ schemaVersion: z.ZodLiteral<1>;
468
+ requestId: z.ZodString;
469
+ commandId: z.ZodString;
470
+ }, z.core.$strip>;
471
+ export declare const realtimeResponseCreateCommandSchema: z.ZodObject<{
472
+ type: z.ZodLiteral<"response.create">;
473
+ response: z.ZodOptional<z.ZodObject<{
474
+ instructions: z.ZodOptional<z.ZodString>;
475
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
476
+ text: "text";
477
+ audio: "audio";
478
+ }>>>;
479
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
480
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
481
+ auto: "auto";
482
+ none: "none";
483
+ required: "required";
484
+ }>, z.ZodObject<{
485
+ type: z.ZodLiteral<"function">;
486
+ name: z.ZodString;
487
+ }, z.core.$strict>]>>;
488
+ }, z.core.$strict>>;
489
+ schemaVersion: z.ZodLiteral<1>;
490
+ requestId: z.ZodString;
491
+ commandId: z.ZodString;
492
+ }, z.core.$strip>;
493
+ export declare const realtimeResponseCancelCommandSchema: z.ZodObject<{
494
+ type: z.ZodLiteral<"response.cancel">;
495
+ responseId: z.ZodOptional<z.ZodString>;
496
+ schemaVersion: z.ZodLiteral<1>;
497
+ requestId: z.ZodString;
498
+ commandId: z.ZodString;
499
+ }, z.core.$strip>;
500
+ /**
501
+ * The first frame of a reconnection: replay every event after `afterSequence`.
502
+ * `-1` asks for every buffered event from the start.
503
+ */
504
+ export declare const realtimeSessionResumeCommandSchema: z.ZodObject<{
505
+ type: z.ZodLiteral<"session.resume">;
506
+ afterSequence: z.ZodNumber;
507
+ schemaVersion: z.ZodLiteral<1>;
508
+ requestId: z.ZodString;
509
+ commandId: z.ZodString;
510
+ }, z.core.$strip>;
511
+ export declare const realtimeSessionCloseCommandSchema: z.ZodObject<{
512
+ type: z.ZodLiteral<"session.close">;
513
+ schemaVersion: z.ZodLiteral<1>;
514
+ requestId: z.ZodString;
515
+ commandId: z.ZodString;
516
+ }, z.core.$strip>;
517
+ /** Every command a client can send. */
518
+ export declare const realtimeClientCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
519
+ type: z.ZodLiteral<"session.update">;
520
+ config: z.ZodObject<{
521
+ instructions: z.ZodOptional<z.ZodString>;
522
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
523
+ text: "text";
524
+ audio: "audio";
525
+ }>>>;
526
+ turnDetection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
527
+ type: z.ZodLiteral<"none">;
528
+ }, z.core.$strict>, z.ZodObject<{
529
+ type: z.ZodLiteral<"server_vad">;
530
+ threshold: z.ZodOptional<z.ZodNumber>;
531
+ prefixPaddingMs: z.ZodOptional<z.ZodNumber>;
532
+ silenceDurationMs: z.ZodOptional<z.ZodNumber>;
533
+ createResponse: z.ZodBoolean;
534
+ interruptResponse: z.ZodBoolean;
535
+ }, z.core.$strict>, z.ZodObject<{
536
+ type: z.ZodLiteral<"semantic_vad">;
537
+ eagerness: z.ZodEnum<{
538
+ low: "low";
539
+ medium: "medium";
540
+ high: "high";
541
+ auto: "auto";
542
+ }>;
543
+ createResponse: z.ZodBoolean;
544
+ interruptResponse: z.ZodBoolean;
545
+ }, z.core.$strict>], "type">>;
546
+ inputAudioTranscription: z.ZodOptional<z.ZodObject<{
547
+ language: z.ZodOptional<z.ZodString>;
548
+ prompt: z.ZodOptional<z.ZodString>;
549
+ }, z.core.$strict>>;
550
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
551
+ type: z.ZodLiteral<"function">;
552
+ name: z.ZodString;
553
+ description: z.ZodOptional<z.ZodString>;
554
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
555
+ strict: z.ZodOptional<z.ZodBoolean>;
556
+ }, z.core.$strict>>>;
557
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
558
+ auto: "auto";
559
+ none: "none";
560
+ required: "required";
561
+ }>, z.ZodObject<{
562
+ type: z.ZodLiteral<"function">;
563
+ name: z.ZodString;
564
+ }, z.core.$strict>]>>;
565
+ temperature: z.ZodOptional<z.ZodNumber>;
566
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
567
+ }, z.core.$strict>;
568
+ schemaVersion: z.ZodLiteral<1>;
569
+ requestId: z.ZodString;
570
+ commandId: z.ZodString;
571
+ }, z.core.$strip>, z.ZodObject<{
572
+ type: z.ZodLiteral<"conversation.item.create">;
573
+ previousItemId: z.ZodOptional<z.ZodString>;
574
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
575
+ type: z.ZodLiteral<"message">;
576
+ itemId: z.ZodOptional<z.ZodString>;
577
+ role: z.ZodEnum<{
578
+ user: "user";
579
+ system: "system";
580
+ assistant: "assistant";
581
+ }>;
582
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
583
+ type: z.ZodLiteral<"input_text">;
584
+ text: z.ZodString;
585
+ }, z.core.$strict>, z.ZodObject<{
586
+ type: z.ZodLiteral<"input_audio">;
587
+ format: z.ZodEnum<{
588
+ pcm16_24khz: "pcm16_24khz";
589
+ g711_ulaw: "g711_ulaw";
590
+ g711_alaw: "g711_alaw";
591
+ }>;
592
+ data: z.ZodOptional<z.ZodString>;
593
+ transcript: z.ZodOptional<z.ZodString>;
594
+ }, z.core.$strict>, z.ZodObject<{
595
+ type: z.ZodLiteral<"output_text">;
596
+ text: z.ZodString;
597
+ }, z.core.$strict>, z.ZodObject<{
598
+ type: z.ZodLiteral<"output_audio">;
599
+ format: z.ZodEnum<{
600
+ pcm16_24khz: "pcm16_24khz";
601
+ g711_ulaw: "g711_ulaw";
602
+ g711_alaw: "g711_alaw";
603
+ }>;
604
+ transcript: z.ZodOptional<z.ZodString>;
605
+ }, z.core.$strict>], "type">>;
606
+ }, z.core.$strict>, z.ZodObject<{
607
+ type: z.ZodLiteral<"function_call">;
608
+ itemId: z.ZodOptional<z.ZodString>;
609
+ callId: z.ZodString;
610
+ name: z.ZodString;
611
+ arguments: z.ZodString;
612
+ }, z.core.$strict>, z.ZodObject<{
613
+ type: z.ZodLiteral<"function_call_output">;
614
+ itemId: z.ZodOptional<z.ZodString>;
615
+ callId: z.ZodString;
616
+ output: z.ZodString;
617
+ }, z.core.$strict>], "type">;
618
+ schemaVersion: z.ZodLiteral<1>;
619
+ requestId: z.ZodString;
620
+ commandId: z.ZodString;
621
+ }, z.core.$strip>, z.ZodObject<{
622
+ type: z.ZodLiteral<"conversation.item.delete">;
623
+ itemId: z.ZodString;
624
+ schemaVersion: z.ZodLiteral<1>;
625
+ requestId: z.ZodString;
626
+ commandId: z.ZodString;
627
+ }, z.core.$strip>, z.ZodObject<{
628
+ type: z.ZodLiteral<"conversation.item.truncate">;
629
+ itemId: z.ZodString;
630
+ contentIndex: z.ZodNumber;
631
+ audioEndMs: z.ZodNumber;
632
+ schemaVersion: z.ZodLiteral<1>;
633
+ requestId: z.ZodString;
634
+ commandId: z.ZodString;
635
+ }, z.core.$strip>, z.ZodObject<{
636
+ type: z.ZodLiteral<"input_audio.append">;
637
+ data: z.ZodString;
638
+ schemaVersion: z.ZodLiteral<1>;
639
+ requestId: z.ZodString;
640
+ commandId: z.ZodString;
641
+ }, z.core.$strip>, z.ZodObject<{
642
+ type: z.ZodLiteral<"input_audio.commit">;
643
+ schemaVersion: z.ZodLiteral<1>;
644
+ requestId: z.ZodString;
645
+ commandId: z.ZodString;
646
+ }, z.core.$strip>, z.ZodObject<{
647
+ type: z.ZodLiteral<"input_audio.clear">;
648
+ schemaVersion: z.ZodLiteral<1>;
649
+ requestId: z.ZodString;
650
+ commandId: z.ZodString;
651
+ }, z.core.$strip>, z.ZodObject<{
652
+ type: z.ZodLiteral<"response.create">;
653
+ response: z.ZodOptional<z.ZodObject<{
654
+ instructions: z.ZodOptional<z.ZodString>;
655
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
656
+ text: "text";
657
+ audio: "audio";
658
+ }>>>;
659
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
660
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
661
+ auto: "auto";
662
+ none: "none";
663
+ required: "required";
664
+ }>, z.ZodObject<{
665
+ type: z.ZodLiteral<"function">;
666
+ name: z.ZodString;
667
+ }, z.core.$strict>]>>;
668
+ }, z.core.$strict>>;
669
+ schemaVersion: z.ZodLiteral<1>;
670
+ requestId: z.ZodString;
671
+ commandId: z.ZodString;
672
+ }, z.core.$strip>, z.ZodObject<{
673
+ type: z.ZodLiteral<"response.cancel">;
674
+ responseId: z.ZodOptional<z.ZodString>;
675
+ schemaVersion: z.ZodLiteral<1>;
676
+ requestId: z.ZodString;
677
+ commandId: z.ZodString;
678
+ }, z.core.$strip>, z.ZodObject<{
679
+ type: z.ZodLiteral<"session.resume">;
680
+ afterSequence: z.ZodNumber;
681
+ schemaVersion: z.ZodLiteral<1>;
682
+ requestId: z.ZodString;
683
+ commandId: z.ZodString;
684
+ }, z.core.$strip>, z.ZodObject<{
685
+ type: z.ZodLiteral<"session.close">;
686
+ schemaVersion: z.ZodLiteral<1>;
687
+ requestId: z.ZodString;
688
+ commandId: z.ZodString;
689
+ }, z.core.$strip>], "type">;
690
+ export declare const realtimeSessionUpdatedEventSchema: z.ZodObject<{
691
+ type: z.ZodLiteral<"session.updated">;
692
+ config: z.ZodObject<{
693
+ instructions: z.ZodOptional<z.ZodString>;
694
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
695
+ text: "text";
696
+ audio: "audio";
697
+ }>>>;
698
+ voice: z.ZodOptional<z.ZodString>;
699
+ inputAudioFormat: z.ZodEnum<{
700
+ pcm16_24khz: "pcm16_24khz";
701
+ g711_ulaw: "g711_ulaw";
702
+ g711_alaw: "g711_alaw";
703
+ }>;
704
+ outputAudioFormat: z.ZodOptional<z.ZodEnum<{
705
+ pcm16_24khz: "pcm16_24khz";
706
+ g711_ulaw: "g711_ulaw";
707
+ g711_alaw: "g711_alaw";
708
+ }>>;
709
+ turnDetection: z.ZodDiscriminatedUnion<[z.ZodObject<{
710
+ type: z.ZodLiteral<"none">;
711
+ }, z.core.$strict>, z.ZodObject<{
712
+ type: z.ZodLiteral<"server_vad">;
713
+ threshold: z.ZodOptional<z.ZodNumber>;
714
+ prefixPaddingMs: z.ZodOptional<z.ZodNumber>;
715
+ silenceDurationMs: z.ZodOptional<z.ZodNumber>;
716
+ createResponse: z.ZodBoolean;
717
+ interruptResponse: z.ZodBoolean;
718
+ }, z.core.$strict>, z.ZodObject<{
719
+ type: z.ZodLiteral<"semantic_vad">;
720
+ eagerness: z.ZodEnum<{
721
+ low: "low";
722
+ medium: "medium";
723
+ high: "high";
724
+ auto: "auto";
725
+ }>;
726
+ createResponse: z.ZodBoolean;
727
+ interruptResponse: z.ZodBoolean;
728
+ }, z.core.$strict>], "type">;
729
+ inputAudioTranscription: z.ZodOptional<z.ZodObject<{
730
+ language: z.ZodOptional<z.ZodString>;
731
+ prompt: z.ZodOptional<z.ZodString>;
732
+ }, z.core.$strict>>;
733
+ translation: z.ZodOptional<z.ZodObject<{
734
+ targetLanguage: z.ZodString;
735
+ }, z.core.$strict>>;
736
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
737
+ type: z.ZodLiteral<"function">;
738
+ name: z.ZodString;
739
+ description: z.ZodOptional<z.ZodString>;
740
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
741
+ strict: z.ZodOptional<z.ZodBoolean>;
742
+ }, z.core.$strict>>>;
743
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
744
+ auto: "auto";
745
+ none: "none";
746
+ required: "required";
747
+ }>, z.ZodObject<{
748
+ type: z.ZodLiteral<"function">;
749
+ name: z.ZodString;
750
+ }, z.core.$strict>]>>;
751
+ temperature: z.ZodOptional<z.ZodNumber>;
752
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
753
+ }, z.core.$strict>;
754
+ schemaVersion: z.ZodLiteral<1>;
755
+ requestId: z.ZodString;
756
+ sequence: z.ZodNumber;
757
+ commandId: z.ZodOptional<z.ZodString>;
758
+ }, z.core.$strip>;
759
+ export declare const realtimeSessionResumedEventSchema: z.ZodObject<{
760
+ type: z.ZodLiteral<"session.resumed">;
761
+ afterSequence: z.ZodNumber;
762
+ schemaVersion: z.ZodLiteral<1>;
763
+ requestId: z.ZodString;
764
+ sequence: z.ZodNumber;
765
+ commandId: z.ZodOptional<z.ZodString>;
766
+ }, z.core.$strip>;
767
+ /** Sent before a command is applied. `duplicate` means it was not applied again. */
768
+ export declare const realtimeCommandAcceptedEventSchema: z.ZodObject<{
769
+ type: z.ZodLiteral<"command.accepted">;
770
+ commandId: z.ZodString;
771
+ duplicate: z.ZodBoolean;
772
+ schemaVersion: z.ZodLiteral<1>;
773
+ requestId: z.ZodString;
774
+ sequence: z.ZodNumber;
775
+ }, z.core.$strip>;
776
+ export declare const realtimeItemAddedEventSchema: z.ZodObject<{
777
+ type: z.ZodLiteral<"conversation.item.added">;
778
+ itemId: z.ZodString;
779
+ previousItemId: z.ZodOptional<z.ZodString>;
780
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
781
+ type: z.ZodLiteral<"message">;
782
+ itemId: z.ZodOptional<z.ZodString>;
783
+ role: z.ZodEnum<{
784
+ user: "user";
785
+ system: "system";
786
+ assistant: "assistant";
787
+ }>;
788
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
789
+ type: z.ZodLiteral<"input_text">;
790
+ text: z.ZodString;
791
+ }, z.core.$strict>, z.ZodObject<{
792
+ type: z.ZodLiteral<"input_audio">;
793
+ format: z.ZodEnum<{
794
+ pcm16_24khz: "pcm16_24khz";
795
+ g711_ulaw: "g711_ulaw";
796
+ g711_alaw: "g711_alaw";
797
+ }>;
798
+ data: z.ZodOptional<z.ZodString>;
799
+ transcript: z.ZodOptional<z.ZodString>;
800
+ }, z.core.$strict>, z.ZodObject<{
801
+ type: z.ZodLiteral<"output_text">;
802
+ text: z.ZodString;
803
+ }, z.core.$strict>, z.ZodObject<{
804
+ type: z.ZodLiteral<"output_audio">;
805
+ format: z.ZodEnum<{
806
+ pcm16_24khz: "pcm16_24khz";
807
+ g711_ulaw: "g711_ulaw";
808
+ g711_alaw: "g711_alaw";
809
+ }>;
810
+ transcript: z.ZodOptional<z.ZodString>;
811
+ }, z.core.$strict>], "type">>;
812
+ }, z.core.$strict>, z.ZodObject<{
813
+ type: z.ZodLiteral<"function_call">;
814
+ itemId: z.ZodOptional<z.ZodString>;
815
+ callId: z.ZodString;
816
+ name: z.ZodString;
817
+ arguments: z.ZodString;
818
+ }, z.core.$strict>, z.ZodObject<{
819
+ type: z.ZodLiteral<"function_call_output">;
820
+ itemId: z.ZodOptional<z.ZodString>;
821
+ callId: z.ZodString;
822
+ output: z.ZodString;
823
+ }, z.core.$strict>], "type">;
824
+ schemaVersion: z.ZodLiteral<1>;
825
+ requestId: z.ZodString;
826
+ sequence: z.ZodNumber;
827
+ commandId: z.ZodOptional<z.ZodString>;
828
+ }, z.core.$strip>;
829
+ export declare const realtimeItemDoneEventSchema: z.ZodObject<{
830
+ type: z.ZodLiteral<"conversation.item.done">;
831
+ itemId: z.ZodString;
832
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
833
+ type: z.ZodLiteral<"message">;
834
+ itemId: z.ZodOptional<z.ZodString>;
835
+ role: z.ZodEnum<{
836
+ user: "user";
837
+ system: "system";
838
+ assistant: "assistant";
839
+ }>;
840
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
841
+ type: z.ZodLiteral<"input_text">;
842
+ text: z.ZodString;
843
+ }, z.core.$strict>, z.ZodObject<{
844
+ type: z.ZodLiteral<"input_audio">;
845
+ format: z.ZodEnum<{
846
+ pcm16_24khz: "pcm16_24khz";
847
+ g711_ulaw: "g711_ulaw";
848
+ g711_alaw: "g711_alaw";
849
+ }>;
850
+ data: z.ZodOptional<z.ZodString>;
851
+ transcript: z.ZodOptional<z.ZodString>;
852
+ }, z.core.$strict>, z.ZodObject<{
853
+ type: z.ZodLiteral<"output_text">;
854
+ text: z.ZodString;
855
+ }, z.core.$strict>, z.ZodObject<{
856
+ type: z.ZodLiteral<"output_audio">;
857
+ format: z.ZodEnum<{
858
+ pcm16_24khz: "pcm16_24khz";
859
+ g711_ulaw: "g711_ulaw";
860
+ g711_alaw: "g711_alaw";
861
+ }>;
862
+ transcript: z.ZodOptional<z.ZodString>;
863
+ }, z.core.$strict>], "type">>;
864
+ }, z.core.$strict>, z.ZodObject<{
865
+ type: z.ZodLiteral<"function_call">;
866
+ itemId: z.ZodOptional<z.ZodString>;
867
+ callId: z.ZodString;
868
+ name: z.ZodString;
869
+ arguments: z.ZodString;
870
+ }, z.core.$strict>, z.ZodObject<{
871
+ type: z.ZodLiteral<"function_call_output">;
872
+ itemId: z.ZodOptional<z.ZodString>;
873
+ callId: z.ZodString;
874
+ output: z.ZodString;
875
+ }, z.core.$strict>], "type">;
876
+ schemaVersion: z.ZodLiteral<1>;
877
+ requestId: z.ZodString;
878
+ sequence: z.ZodNumber;
879
+ commandId: z.ZodOptional<z.ZodString>;
880
+ }, z.core.$strip>;
881
+ export declare const realtimeItemDeletedEventSchema: z.ZodObject<{
882
+ type: z.ZodLiteral<"conversation.item.deleted">;
883
+ itemId: z.ZodString;
884
+ schemaVersion: z.ZodLiteral<1>;
885
+ requestId: z.ZodString;
886
+ sequence: z.ZodNumber;
887
+ commandId: z.ZodOptional<z.ZodString>;
888
+ }, z.core.$strip>;
889
+ export declare const realtimeItemTruncatedEventSchema: z.ZodObject<{
890
+ type: z.ZodLiteral<"conversation.item.truncated">;
891
+ itemId: z.ZodString;
892
+ contentIndex: z.ZodNumber;
893
+ audioEndMs: z.ZodNumber;
894
+ schemaVersion: z.ZodLiteral<1>;
895
+ requestId: z.ZodString;
896
+ sequence: z.ZodNumber;
897
+ commandId: z.ZodOptional<z.ZodString>;
898
+ }, z.core.$strip>;
899
+ /**
900
+ * Voice activity began. With `interruptResponse`, a response in progress is
901
+ * cancelled by it: this event is the interruption, and the client should stop
902
+ * playback and truncate what was not heard.
903
+ */
904
+ export declare const realtimeSpeechStartedEventSchema: z.ZodObject<{
905
+ type: z.ZodLiteral<"input_audio.speech_started">;
906
+ itemId: z.ZodString;
907
+ audioStartMs: z.ZodNumber;
908
+ schemaVersion: z.ZodLiteral<1>;
909
+ requestId: z.ZodString;
910
+ sequence: z.ZodNumber;
911
+ commandId: z.ZodOptional<z.ZodString>;
912
+ }, z.core.$strip>;
913
+ export declare const realtimeSpeechStoppedEventSchema: z.ZodObject<{
914
+ type: z.ZodLiteral<"input_audio.speech_stopped">;
915
+ itemId: z.ZodString;
916
+ audioEndMs: z.ZodNumber;
917
+ schemaVersion: z.ZodLiteral<1>;
918
+ requestId: z.ZodString;
919
+ sequence: z.ZodNumber;
920
+ commandId: z.ZodOptional<z.ZodString>;
921
+ }, z.core.$strip>;
922
+ export declare const realtimeInputAudioCommittedEventSchema: z.ZodObject<{
923
+ type: z.ZodLiteral<"input_audio.committed">;
924
+ itemId: z.ZodString;
925
+ previousItemId: z.ZodOptional<z.ZodString>;
926
+ schemaVersion: z.ZodLiteral<1>;
927
+ requestId: z.ZodString;
928
+ sequence: z.ZodNumber;
929
+ commandId: z.ZodOptional<z.ZodString>;
930
+ }, z.core.$strip>;
931
+ export declare const realtimeInputAudioClearedEventSchema: z.ZodObject<{
932
+ type: z.ZodLiteral<"input_audio.cleared">;
933
+ schemaVersion: z.ZodLiteral<1>;
934
+ requestId: z.ZodString;
935
+ sequence: z.ZodNumber;
936
+ commandId: z.ZodOptional<z.ZodString>;
937
+ }, z.core.$strip>;
938
+ export declare const realtimeResponseCreatedEventSchema: z.ZodObject<{
939
+ type: z.ZodLiteral<"response.created">;
940
+ responseId: z.ZodString;
941
+ schemaVersion: z.ZodLiteral<1>;
942
+ requestId: z.ZodString;
943
+ sequence: z.ZodNumber;
944
+ commandId: z.ZodOptional<z.ZodString>;
945
+ }, z.core.$strip>;
946
+ /** One bounded frame of spoken output, in the session's `outputAudioFormat`. */
947
+ export declare const realtimeOutputAudioDeltaEventSchema: z.ZodObject<{
948
+ type: z.ZodLiteral<"output_audio.delta">;
949
+ responseId: z.ZodString;
950
+ itemId: z.ZodString;
951
+ contentIndex: z.ZodNumber;
952
+ format: z.ZodEnum<{
953
+ pcm16_24khz: "pcm16_24khz";
954
+ g711_ulaw: "g711_ulaw";
955
+ g711_alaw: "g711_alaw";
956
+ }>;
957
+ data: z.ZodString;
958
+ schemaVersion: z.ZodLiteral<1>;
959
+ requestId: z.ZodString;
960
+ sequence: z.ZodNumber;
961
+ commandId: z.ZodOptional<z.ZodString>;
962
+ }, z.core.$strip>;
963
+ export declare const realtimeOutputAudioDoneEventSchema: z.ZodObject<{
964
+ type: z.ZodLiteral<"output_audio.done">;
965
+ responseId: z.ZodString;
966
+ itemId: z.ZodString;
967
+ contentIndex: z.ZodNumber;
968
+ schemaVersion: z.ZodLiteral<1>;
969
+ requestId: z.ZodString;
970
+ sequence: z.ZodNumber;
971
+ commandId: z.ZodOptional<z.ZodString>;
972
+ }, z.core.$strip>;
973
+ /**
974
+ * Which audio a transcript describes: the caller's (`input_audio`) or the
975
+ * model's own speech (`output_audio`). Neither is answer text.
976
+ */
977
+ export declare const realtimeTranscriptSourceSchema: z.ZodEnum<{
978
+ input_audio: "input_audio";
979
+ output_audio: "output_audio";
980
+ }>;
981
+ export declare const realtimeTranscriptDeltaEventSchema: z.ZodObject<{
982
+ type: z.ZodLiteral<"transcript.delta">;
983
+ source: z.ZodEnum<{
984
+ input_audio: "input_audio";
985
+ output_audio: "output_audio";
986
+ }>;
987
+ itemId: z.ZodString;
988
+ contentIndex: z.ZodNumber;
989
+ responseId: z.ZodOptional<z.ZodString>;
990
+ text: z.ZodString;
991
+ schemaVersion: z.ZodLiteral<1>;
992
+ requestId: z.ZodString;
993
+ sequence: z.ZodNumber;
994
+ commandId: z.ZodOptional<z.ZodString>;
995
+ }, z.core.$strip>;
996
+ export declare const realtimeTranscriptDoneEventSchema: z.ZodObject<{
997
+ type: z.ZodLiteral<"transcript.done">;
998
+ source: z.ZodEnum<{
999
+ input_audio: "input_audio";
1000
+ output_audio: "output_audio";
1001
+ }>;
1002
+ itemId: z.ZodString;
1003
+ contentIndex: z.ZodNumber;
1004
+ responseId: z.ZodOptional<z.ZodString>;
1005
+ transcript: z.ZodString;
1006
+ schemaVersion: z.ZodLiteral<1>;
1007
+ requestId: z.ZodString;
1008
+ sequence: z.ZodNumber;
1009
+ commandId: z.ZodOptional<z.ZodString>;
1010
+ }, z.core.$strip>;
1011
+ /** Written output of a response (`outputModalities` including `text`). */
1012
+ export declare const realtimeTextDeltaEventSchema: z.ZodObject<{
1013
+ type: z.ZodLiteral<"text.delta">;
1014
+ responseId: z.ZodString;
1015
+ itemId: z.ZodString;
1016
+ contentIndex: z.ZodNumber;
1017
+ text: z.ZodString;
1018
+ schemaVersion: z.ZodLiteral<1>;
1019
+ requestId: z.ZodString;
1020
+ sequence: z.ZodNumber;
1021
+ commandId: z.ZodOptional<z.ZodString>;
1022
+ }, z.core.$strip>;
1023
+ /** A tool call being streamed; same accumulation rules as the one-shot event. */
1024
+ export declare const realtimeToolCallEventSchema: z.ZodObject<{
1025
+ type: z.ZodLiteral<"tool_call">;
1026
+ responseId: z.ZodString;
1027
+ itemId: z.ZodString;
1028
+ toolCallId: z.ZodString;
1029
+ name: z.ZodOptional<z.ZodString>;
1030
+ argumentsDelta: z.ZodOptional<z.ZodString>;
1031
+ complete: z.ZodBoolean;
1032
+ schemaVersion: z.ZodLiteral<1>;
1033
+ requestId: z.ZodString;
1034
+ sequence: z.ZodNumber;
1035
+ commandId: z.ZodOptional<z.ZodString>;
1036
+ }, z.core.$strip>;
1037
+ /** How a response ended. */
1038
+ export declare const realtimeResponseStatusSchema: z.ZodEnum<{
1039
+ cancelled: "cancelled";
1040
+ completed: "completed";
1041
+ failed: "failed";
1042
+ incomplete: "incomplete";
1043
+ }>;
1044
+ /** Why a session ended. */
1045
+ export declare const realtimeSessionCloseReasonSchema: z.ZodEnum<{
1046
+ no_route_available: "no_route_available";
1047
+ client_closed: "client_closed";
1048
+ max_duration: "max_duration";
1049
+ idle_timeout: "idle_timeout";
1050
+ limit_exceeded: "limit_exceeded";
1051
+ resume_expired: "resume_expired";
1052
+ upstream_closed: "upstream_closed";
1053
+ upstream_error: "upstream_error";
1054
+ server_shutdown: "server_shutdown";
1055
+ }>;
1056
+ /** One configuration a session kind cannot honour, with its path inside `config`. */
1057
+ export interface RealtimeConfigIssue {
1058
+ readonly path: (string | number)[];
1059
+ readonly message: string;
1060
+ }
1061
+ /**
1062
+ * What a session kind requires of its configuration. Each kind needs a
1063
+ * different subset of the config, so these rules are cross-field and live
1064
+ * here once: the public `session.open` frame and the signed session request
1065
+ * apply the same ones, and a session a client may open is one Kaana may run.
1066
+ */
1067
+ export declare function realtimeConfigIssues(kind: z.infer<typeof realtimeSessionKindSchema>, config: z.infer<typeof realtimeSessionConfigSchema>): RealtimeConfigIssue[];
1068
+ /**
1069
+ * The most text `conversation.item.create` commands a session may be opened
1070
+ * for: the bound a duration-priced route's hold is sized from.
1071
+ */
1072
+ export declare const MAX_REALTIME_TEXT_ITEMS = 10000;
1073
+ /**
1074
+ * The customer's partial limits request: every signed limit, each filled from
1075
+ * Kaana's defaults when omitted, plus `maxTextItems`, the most billable text
1076
+ * items the session may send (absent, it defaults to `maxResponses`).
1077
+ */
1078
+ export declare const realtimeOpenLimitsSchema: z.ZodObject<{
1079
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
1080
+ idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
1081
+ maxInputAudioBytes: z.ZodOptional<z.ZodNumber>;
1082
+ maxOutputAudioBytes: z.ZodOptional<z.ZodNumber>;
1083
+ maxResponses: z.ZodOptional<z.ZodNumber>;
1084
+ maxTextItems: z.ZodOptional<z.ZodNumber>;
1085
+ }, z.core.$strict>;
1086
+ /**
1087
+ * The first frame a client sends on `GET /v1/realtime?model=…` to OPEN a
1088
+ * session (a reconnection instead sends `session.resume`). One grant covers the
1089
+ * whole session and it is settled exactly once, when the session closes.
1090
+ *
1091
+ * Moved from the Oxy edge (`realtimeOpenFrameSchema`) by Kaana ADR 0002.
1092
+ */
1093
+ export declare const realtimeSessionOpenSchema: z.ZodObject<{
1094
+ type: z.ZodLiteral<"session.open">;
1095
+ kind: z.ZodEnum<{
1096
+ conversation: "conversation";
1097
+ transcription: "transcription";
1098
+ translation: "translation";
1099
+ }>;
1100
+ transport: z.ZodOptional<z.ZodEnum<{
1101
+ websocket: "websocket";
1102
+ }>>;
1103
+ config: z.ZodObject<{
1104
+ instructions: z.ZodOptional<z.ZodString>;
1105
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1106
+ text: "text";
1107
+ audio: "audio";
1108
+ }>>>;
1109
+ voice: z.ZodOptional<z.ZodString>;
1110
+ inputAudioFormat: z.ZodEnum<{
1111
+ pcm16_24khz: "pcm16_24khz";
1112
+ g711_ulaw: "g711_ulaw";
1113
+ g711_alaw: "g711_alaw";
1114
+ }>;
1115
+ outputAudioFormat: z.ZodOptional<z.ZodEnum<{
1116
+ pcm16_24khz: "pcm16_24khz";
1117
+ g711_ulaw: "g711_ulaw";
1118
+ g711_alaw: "g711_alaw";
1119
+ }>>;
1120
+ turnDetection: z.ZodDiscriminatedUnion<[z.ZodObject<{
1121
+ type: z.ZodLiteral<"none">;
1122
+ }, z.core.$strict>, z.ZodObject<{
1123
+ type: z.ZodLiteral<"server_vad">;
1124
+ threshold: z.ZodOptional<z.ZodNumber>;
1125
+ prefixPaddingMs: z.ZodOptional<z.ZodNumber>;
1126
+ silenceDurationMs: z.ZodOptional<z.ZodNumber>;
1127
+ createResponse: z.ZodBoolean;
1128
+ interruptResponse: z.ZodBoolean;
1129
+ }, z.core.$strict>, z.ZodObject<{
1130
+ type: z.ZodLiteral<"semantic_vad">;
1131
+ eagerness: z.ZodEnum<{
1132
+ low: "low";
1133
+ medium: "medium";
1134
+ high: "high";
1135
+ auto: "auto";
1136
+ }>;
1137
+ createResponse: z.ZodBoolean;
1138
+ interruptResponse: z.ZodBoolean;
1139
+ }, z.core.$strict>], "type">;
1140
+ inputAudioTranscription: z.ZodOptional<z.ZodObject<{
1141
+ language: z.ZodOptional<z.ZodString>;
1142
+ prompt: z.ZodOptional<z.ZodString>;
1143
+ }, z.core.$strict>>;
1144
+ translation: z.ZodOptional<z.ZodObject<{
1145
+ targetLanguage: z.ZodString;
1146
+ }, z.core.$strict>>;
1147
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1148
+ type: z.ZodLiteral<"function">;
1149
+ name: z.ZodString;
1150
+ description: z.ZodOptional<z.ZodString>;
1151
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1152
+ strict: z.ZodOptional<z.ZodBoolean>;
1153
+ }, z.core.$strict>>>;
1154
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
1155
+ auto: "auto";
1156
+ none: "none";
1157
+ required: "required";
1158
+ }>, z.ZodObject<{
1159
+ type: z.ZodLiteral<"function">;
1160
+ name: z.ZodString;
1161
+ }, z.core.$strict>]>>;
1162
+ temperature: z.ZodOptional<z.ZodNumber>;
1163
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
1164
+ }, z.core.$strict>;
1165
+ limits: z.ZodOptional<z.ZodObject<{
1166
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
1167
+ idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
1168
+ maxInputAudioBytes: z.ZodOptional<z.ZodNumber>;
1169
+ maxOutputAudioBytes: z.ZodOptional<z.ZodNumber>;
1170
+ maxResponses: z.ZodOptional<z.ZodNumber>;
1171
+ maxTextItems: z.ZodOptional<z.ZodNumber>;
1172
+ }, z.core.$strict>>;
1173
+ clientSessionId: z.ZodOptional<z.ZodString>;
1174
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1175
+ }, z.core.$strict>;
1176
+ /** Why a session open cannot be served by a model, before anything is held. */
1177
+ export interface RealtimeOpenIssue {
1178
+ /** The open frame's field at fault, as `invalid_request.param` names it. */
1179
+ readonly param: string;
1180
+ readonly message: string;
1181
+ }
1182
+ /**
1183
+ * Check a `session.open` against the model's published catalogue entry — its
1184
+ * `capabilities.realtime` and its `audio` — the realtime counterpart of
1185
+ * {@link checkSpeechRequest} (Kaana ADR 0002 decision 9; Alia ADR 0017 §5).
1186
+ * Kaana refuses an open with `invalid_request` and the first issue's `param`
1187
+ * BEFORE asking Oxy for a grant; a client may run the same check to choose a
1188
+ * model.
1189
+ *
1190
+ * A field the catalogue leaves undeclared (an older producer) is not checked:
1191
+ * absent is unknown, never "everything" and never "nothing". The one
1192
+ * exception is input transcription in a conversation, which a model must
1193
+ * declare to be asked for, because asking for it starts a charge.
1194
+ *
1195
+ * Returns every issue, in field order; an empty list means the model accepts
1196
+ * the open.
1197
+ */
1198
+ export declare function checkRealtimeSessionOpen(open: z.infer<typeof realtimeSessionOpenSchema>, model: {
1199
+ readonly capabilities: ModelCapabilities;
1200
+ readonly audio?: ModelAudioCapabilities;
1201
+ }): RealtimeOpenIssue[];
1202
+ /**
1203
+ * The session opened: the revision-pinned model, fixed for the rest of the
1204
+ * session, and the effective configuration and limits. The signed lane's
1205
+ * `realtimeSessionCreatedEventSchema` also names the provider and deployment;
1206
+ * a public client is never told either.
1207
+ */
1208
+ export declare const realtimePublicSessionCreatedEventSchema: z.ZodObject<{
1209
+ type: z.ZodLiteral<"session.created">;
1210
+ model: z.ZodString;
1211
+ kind: z.ZodEnum<{
1212
+ conversation: "conversation";
1213
+ transcription: "transcription";
1214
+ translation: "translation";
1215
+ }>;
1216
+ config: z.ZodObject<{
1217
+ instructions: z.ZodOptional<z.ZodString>;
1218
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1219
+ text: "text";
1220
+ audio: "audio";
1221
+ }>>>;
1222
+ voice: z.ZodOptional<z.ZodString>;
1223
+ inputAudioFormat: z.ZodEnum<{
1224
+ pcm16_24khz: "pcm16_24khz";
1225
+ g711_ulaw: "g711_ulaw";
1226
+ g711_alaw: "g711_alaw";
1227
+ }>;
1228
+ outputAudioFormat: z.ZodOptional<z.ZodEnum<{
1229
+ pcm16_24khz: "pcm16_24khz";
1230
+ g711_ulaw: "g711_ulaw";
1231
+ g711_alaw: "g711_alaw";
1232
+ }>>;
1233
+ turnDetection: z.ZodDiscriminatedUnion<[z.ZodObject<{
1234
+ type: z.ZodLiteral<"none">;
1235
+ }, z.core.$strict>, z.ZodObject<{
1236
+ type: z.ZodLiteral<"server_vad">;
1237
+ threshold: z.ZodOptional<z.ZodNumber>;
1238
+ prefixPaddingMs: z.ZodOptional<z.ZodNumber>;
1239
+ silenceDurationMs: z.ZodOptional<z.ZodNumber>;
1240
+ createResponse: z.ZodBoolean;
1241
+ interruptResponse: z.ZodBoolean;
1242
+ }, z.core.$strict>, z.ZodObject<{
1243
+ type: z.ZodLiteral<"semantic_vad">;
1244
+ eagerness: z.ZodEnum<{
1245
+ low: "low";
1246
+ medium: "medium";
1247
+ high: "high";
1248
+ auto: "auto";
1249
+ }>;
1250
+ createResponse: z.ZodBoolean;
1251
+ interruptResponse: z.ZodBoolean;
1252
+ }, z.core.$strict>], "type">;
1253
+ inputAudioTranscription: z.ZodOptional<z.ZodObject<{
1254
+ language: z.ZodOptional<z.ZodString>;
1255
+ prompt: z.ZodOptional<z.ZodString>;
1256
+ }, z.core.$strict>>;
1257
+ translation: z.ZodOptional<z.ZodObject<{
1258
+ targetLanguage: z.ZodString;
1259
+ }, z.core.$strict>>;
1260
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1261
+ type: z.ZodLiteral<"function">;
1262
+ name: z.ZodString;
1263
+ description: z.ZodOptional<z.ZodString>;
1264
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1265
+ strict: z.ZodOptional<z.ZodBoolean>;
1266
+ }, z.core.$strict>>>;
1267
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
1268
+ auto: "auto";
1269
+ none: "none";
1270
+ required: "required";
1271
+ }>, z.ZodObject<{
1272
+ type: z.ZodLiteral<"function">;
1273
+ name: z.ZodString;
1274
+ }, z.core.$strict>]>>;
1275
+ temperature: z.ZodOptional<z.ZodNumber>;
1276
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
1277
+ }, z.core.$strict>;
1278
+ limits: z.ZodObject<{
1279
+ maxDurationMs: z.ZodNumber;
1280
+ idleTimeoutMs: z.ZodNumber;
1281
+ maxInputAudioBytes: z.ZodNumber;
1282
+ maxOutputAudioBytes: z.ZodNumber;
1283
+ maxResponses: z.ZodNumber;
1284
+ }, z.core.$strict>;
1285
+ resumeWindowMs: z.ZodNumber;
1286
+ startedAt: z.ZodString;
1287
+ expiresAt: z.ZodString;
1288
+ schemaVersion: z.ZodLiteral<1>;
1289
+ requestId: z.ZodString;
1290
+ sequence: z.ZodNumber;
1291
+ commandId: z.ZodOptional<z.ZodString>;
1292
+ }, z.core.$strip>;
1293
+ /** A response ended, with the units it consumed. */
1294
+ export declare const realtimePublicResponseDoneEventSchema: z.ZodObject<{
1295
+ type: z.ZodLiteral<"response.done">;
1296
+ responseId: z.ZodString;
1297
+ status: z.ZodEnum<{
1298
+ cancelled: "cancelled";
1299
+ completed: "completed";
1300
+ failed: "failed";
1301
+ incomplete: "incomplete";
1302
+ }>;
1303
+ finishReason: z.ZodOptional<z.ZodEnum<{
1304
+ content_filter: "content_filter";
1305
+ cancelled: "cancelled";
1306
+ refusal: "refusal";
1307
+ stop: "stop";
1308
+ length: "length";
1309
+ tool_calls: "tool_calls";
1310
+ }>>;
1311
+ units: z.ZodArray<z.ZodObject<{
1312
+ unit: z.ZodEnum<{
1313
+ input_tokens: "input_tokens";
1314
+ cached_input_tokens: "cached_input_tokens";
1315
+ output_tokens: "output_tokens";
1316
+ reasoning_tokens: "reasoning_tokens";
1317
+ requests: "requests";
1318
+ images: "images";
1319
+ audio_input_milliseconds: "audio_input_milliseconds";
1320
+ audio_output_milliseconds: "audio_output_milliseconds";
1321
+ video_milliseconds: "video_milliseconds";
1322
+ characters: "characters";
1323
+ embeddings: "embeddings";
1324
+ audio_input_tokens: "audio_input_tokens";
1325
+ cached_audio_input_tokens: "cached_audio_input_tokens";
1326
+ audio_output_tokens: "audio_output_tokens";
1327
+ session_milliseconds: "session_milliseconds";
1328
+ input_transcription_milliseconds: "input_transcription_milliseconds";
1329
+ }>;
1330
+ quantity: z.ZodNumber;
1331
+ }, z.core.$strict>>;
1332
+ usageSource: z.ZodEnum<{
1333
+ provider_reported: "provider_reported";
1334
+ oxy_measured: "oxy_measured";
1335
+ estimated: "estimated";
1336
+ }>;
1337
+ schemaVersion: z.ZodLiteral<1>;
1338
+ requestId: z.ZodString;
1339
+ sequence: z.ZodNumber;
1340
+ commandId: z.ZodOptional<z.ZodString>;
1341
+ }, z.core.$strip>;
1342
+ /**
1343
+ * An error in the public vocabulary. `fatal: false` refuses one command and
1344
+ * the session continues; `fatal: true` is followed by `session.closed`.
1345
+ */
1346
+ export declare const realtimePublicErrorEventSchema: z.ZodObject<{
1347
+ type: z.ZodLiteral<"error">;
1348
+ fatal: z.ZodBoolean;
1349
+ error: z.ZodObject<{
1350
+ schemaVersion: z.ZodLiteral<1>;
1351
+ code: z.ZodEnum<{
1352
+ invalid_request: "invalid_request";
1353
+ authentication_failed: "authentication_failed";
1354
+ permission_denied: "permission_denied";
1355
+ insufficient_scope: "insufficient_scope";
1356
+ model_not_found: "model_not_found";
1357
+ unsupported_modality: "unsupported_modality";
1358
+ context_length_exceeded: "context_length_exceeded";
1359
+ request_too_large: "request_too_large";
1360
+ output_limit_exceeded: "output_limit_exceeded";
1361
+ idempotency_conflict: "idempotency_conflict";
1362
+ insufficient_balance: "insufficient_balance";
1363
+ spending_limit_exceeded: "spending_limit_exceeded";
1364
+ quota_exceeded: "quota_exceeded";
1365
+ byok_credential_invalid: "byok_credential_invalid";
1366
+ policy_violation: "policy_violation";
1367
+ commercial_permission_denied: "commercial_permission_denied";
1368
+ no_route_available: "no_route_available";
1369
+ upstream_content_filtered: "upstream_content_filtered";
1370
+ cancelled: "cancelled";
1371
+ rate_limited: "rate_limited";
1372
+ provider_error: "provider_error";
1373
+ provider_timeout: "provider_timeout";
1374
+ provider_overloaded: "provider_overloaded";
1375
+ service_unavailable: "service_unavailable";
1376
+ internal_error: "internal_error";
1377
+ }>;
1378
+ message: z.ZodString;
1379
+ retryable: z.ZodBoolean;
1380
+ requestId: z.ZodString;
1381
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
1382
+ param: z.ZodOptional<z.ZodString>;
1383
+ upstreamCategory: z.ZodOptional<z.ZodEnum<{
1384
+ rate_limit: "rate_limit";
1385
+ quota: "quota";
1386
+ timeout: "timeout";
1387
+ overloaded: "overloaded";
1388
+ server_error: "server_error";
1389
+ content_filter: "content_filter";
1390
+ invalid_request: "invalid_request";
1391
+ authentication: "authentication";
1392
+ unknown: "unknown";
1393
+ }>>;
1394
+ }, z.core.$strict>;
1395
+ schemaVersion: z.ZodLiteral<1>;
1396
+ requestId: z.ZodString;
1397
+ sequence: z.ZodNumber;
1398
+ commandId: z.ZodOptional<z.ZodString>;
1399
+ }, z.core.$strip>;
1400
+ /** The terminal event, with the session's total units. */
1401
+ export declare const realtimePublicSessionClosedEventSchema: z.ZodObject<{
1402
+ type: z.ZodLiteral<"session.closed">;
1403
+ reason: z.ZodEnum<{
1404
+ no_route_available: "no_route_available";
1405
+ client_closed: "client_closed";
1406
+ max_duration: "max_duration";
1407
+ idle_timeout: "idle_timeout";
1408
+ limit_exceeded: "limit_exceeded";
1409
+ resume_expired: "resume_expired";
1410
+ upstream_closed: "upstream_closed";
1411
+ upstream_error: "upstream_error";
1412
+ server_shutdown: "server_shutdown";
1413
+ }>;
1414
+ units: z.ZodArray<z.ZodObject<{
1415
+ unit: z.ZodEnum<{
1416
+ input_tokens: "input_tokens";
1417
+ cached_input_tokens: "cached_input_tokens";
1418
+ output_tokens: "output_tokens";
1419
+ reasoning_tokens: "reasoning_tokens";
1420
+ requests: "requests";
1421
+ images: "images";
1422
+ audio_input_milliseconds: "audio_input_milliseconds";
1423
+ audio_output_milliseconds: "audio_output_milliseconds";
1424
+ video_milliseconds: "video_milliseconds";
1425
+ characters: "characters";
1426
+ embeddings: "embeddings";
1427
+ audio_input_tokens: "audio_input_tokens";
1428
+ cached_audio_input_tokens: "cached_audio_input_tokens";
1429
+ audio_output_tokens: "audio_output_tokens";
1430
+ session_milliseconds: "session_milliseconds";
1431
+ input_transcription_milliseconds: "input_transcription_milliseconds";
1432
+ }>;
1433
+ quantity: z.ZodNumber;
1434
+ }, z.core.$strict>>;
1435
+ usageSource: z.ZodEnum<{
1436
+ provider_reported: "provider_reported";
1437
+ oxy_measured: "oxy_measured";
1438
+ estimated: "estimated";
1439
+ }>;
1440
+ closedAt: z.ZodString;
1441
+ schemaVersion: z.ZodLiteral<1>;
1442
+ requestId: z.ZodString;
1443
+ sequence: z.ZodNumber;
1444
+ commandId: z.ZodOptional<z.ZodString>;
1445
+ }, z.core.$strip>;
1446
+ /** Every event a public session can emit. */
1447
+ export declare const realtimePublicServerEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1448
+ type: z.ZodLiteral<"session.created">;
1449
+ model: z.ZodString;
1450
+ kind: z.ZodEnum<{
1451
+ conversation: "conversation";
1452
+ transcription: "transcription";
1453
+ translation: "translation";
1454
+ }>;
1455
+ config: z.ZodObject<{
1456
+ instructions: z.ZodOptional<z.ZodString>;
1457
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1458
+ text: "text";
1459
+ audio: "audio";
1460
+ }>>>;
1461
+ voice: z.ZodOptional<z.ZodString>;
1462
+ inputAudioFormat: z.ZodEnum<{
1463
+ pcm16_24khz: "pcm16_24khz";
1464
+ g711_ulaw: "g711_ulaw";
1465
+ g711_alaw: "g711_alaw";
1466
+ }>;
1467
+ outputAudioFormat: z.ZodOptional<z.ZodEnum<{
1468
+ pcm16_24khz: "pcm16_24khz";
1469
+ g711_ulaw: "g711_ulaw";
1470
+ g711_alaw: "g711_alaw";
1471
+ }>>;
1472
+ turnDetection: z.ZodDiscriminatedUnion<[z.ZodObject<{
1473
+ type: z.ZodLiteral<"none">;
1474
+ }, z.core.$strict>, z.ZodObject<{
1475
+ type: z.ZodLiteral<"server_vad">;
1476
+ threshold: z.ZodOptional<z.ZodNumber>;
1477
+ prefixPaddingMs: z.ZodOptional<z.ZodNumber>;
1478
+ silenceDurationMs: z.ZodOptional<z.ZodNumber>;
1479
+ createResponse: z.ZodBoolean;
1480
+ interruptResponse: z.ZodBoolean;
1481
+ }, z.core.$strict>, z.ZodObject<{
1482
+ type: z.ZodLiteral<"semantic_vad">;
1483
+ eagerness: z.ZodEnum<{
1484
+ low: "low";
1485
+ medium: "medium";
1486
+ high: "high";
1487
+ auto: "auto";
1488
+ }>;
1489
+ createResponse: z.ZodBoolean;
1490
+ interruptResponse: z.ZodBoolean;
1491
+ }, z.core.$strict>], "type">;
1492
+ inputAudioTranscription: z.ZodOptional<z.ZodObject<{
1493
+ language: z.ZodOptional<z.ZodString>;
1494
+ prompt: z.ZodOptional<z.ZodString>;
1495
+ }, z.core.$strict>>;
1496
+ translation: z.ZodOptional<z.ZodObject<{
1497
+ targetLanguage: z.ZodString;
1498
+ }, z.core.$strict>>;
1499
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1500
+ type: z.ZodLiteral<"function">;
1501
+ name: z.ZodString;
1502
+ description: z.ZodOptional<z.ZodString>;
1503
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1504
+ strict: z.ZodOptional<z.ZodBoolean>;
1505
+ }, z.core.$strict>>>;
1506
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
1507
+ auto: "auto";
1508
+ none: "none";
1509
+ required: "required";
1510
+ }>, z.ZodObject<{
1511
+ type: z.ZodLiteral<"function">;
1512
+ name: z.ZodString;
1513
+ }, z.core.$strict>]>>;
1514
+ temperature: z.ZodOptional<z.ZodNumber>;
1515
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
1516
+ }, z.core.$strict>;
1517
+ limits: z.ZodObject<{
1518
+ maxDurationMs: z.ZodNumber;
1519
+ idleTimeoutMs: z.ZodNumber;
1520
+ maxInputAudioBytes: z.ZodNumber;
1521
+ maxOutputAudioBytes: z.ZodNumber;
1522
+ maxResponses: z.ZodNumber;
1523
+ }, z.core.$strict>;
1524
+ resumeWindowMs: z.ZodNumber;
1525
+ startedAt: z.ZodString;
1526
+ expiresAt: z.ZodString;
1527
+ schemaVersion: z.ZodLiteral<1>;
1528
+ requestId: z.ZodString;
1529
+ sequence: z.ZodNumber;
1530
+ commandId: z.ZodOptional<z.ZodString>;
1531
+ }, z.core.$strip>, z.ZodObject<{
1532
+ type: z.ZodLiteral<"session.updated">;
1533
+ config: z.ZodObject<{
1534
+ instructions: z.ZodOptional<z.ZodString>;
1535
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1536
+ text: "text";
1537
+ audio: "audio";
1538
+ }>>>;
1539
+ voice: z.ZodOptional<z.ZodString>;
1540
+ inputAudioFormat: z.ZodEnum<{
1541
+ pcm16_24khz: "pcm16_24khz";
1542
+ g711_ulaw: "g711_ulaw";
1543
+ g711_alaw: "g711_alaw";
1544
+ }>;
1545
+ outputAudioFormat: z.ZodOptional<z.ZodEnum<{
1546
+ pcm16_24khz: "pcm16_24khz";
1547
+ g711_ulaw: "g711_ulaw";
1548
+ g711_alaw: "g711_alaw";
1549
+ }>>;
1550
+ turnDetection: z.ZodDiscriminatedUnion<[z.ZodObject<{
1551
+ type: z.ZodLiteral<"none">;
1552
+ }, z.core.$strict>, z.ZodObject<{
1553
+ type: z.ZodLiteral<"server_vad">;
1554
+ threshold: z.ZodOptional<z.ZodNumber>;
1555
+ prefixPaddingMs: z.ZodOptional<z.ZodNumber>;
1556
+ silenceDurationMs: z.ZodOptional<z.ZodNumber>;
1557
+ createResponse: z.ZodBoolean;
1558
+ interruptResponse: z.ZodBoolean;
1559
+ }, z.core.$strict>, z.ZodObject<{
1560
+ type: z.ZodLiteral<"semantic_vad">;
1561
+ eagerness: z.ZodEnum<{
1562
+ low: "low";
1563
+ medium: "medium";
1564
+ high: "high";
1565
+ auto: "auto";
1566
+ }>;
1567
+ createResponse: z.ZodBoolean;
1568
+ interruptResponse: z.ZodBoolean;
1569
+ }, z.core.$strict>], "type">;
1570
+ inputAudioTranscription: z.ZodOptional<z.ZodObject<{
1571
+ language: z.ZodOptional<z.ZodString>;
1572
+ prompt: z.ZodOptional<z.ZodString>;
1573
+ }, z.core.$strict>>;
1574
+ translation: z.ZodOptional<z.ZodObject<{
1575
+ targetLanguage: z.ZodString;
1576
+ }, z.core.$strict>>;
1577
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1578
+ type: z.ZodLiteral<"function">;
1579
+ name: z.ZodString;
1580
+ description: z.ZodOptional<z.ZodString>;
1581
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1582
+ strict: z.ZodOptional<z.ZodBoolean>;
1583
+ }, z.core.$strict>>>;
1584
+ toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
1585
+ auto: "auto";
1586
+ none: "none";
1587
+ required: "required";
1588
+ }>, z.ZodObject<{
1589
+ type: z.ZodLiteral<"function">;
1590
+ name: z.ZodString;
1591
+ }, z.core.$strict>]>>;
1592
+ temperature: z.ZodOptional<z.ZodNumber>;
1593
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
1594
+ }, z.core.$strict>;
1595
+ schemaVersion: z.ZodLiteral<1>;
1596
+ requestId: z.ZodString;
1597
+ sequence: z.ZodNumber;
1598
+ commandId: z.ZodOptional<z.ZodString>;
1599
+ }, z.core.$strip>, z.ZodObject<{
1600
+ type: z.ZodLiteral<"session.resumed">;
1601
+ afterSequence: z.ZodNumber;
1602
+ schemaVersion: z.ZodLiteral<1>;
1603
+ requestId: z.ZodString;
1604
+ sequence: z.ZodNumber;
1605
+ commandId: z.ZodOptional<z.ZodString>;
1606
+ }, z.core.$strip>, z.ZodObject<{
1607
+ type: z.ZodLiteral<"command.accepted">;
1608
+ commandId: z.ZodString;
1609
+ duplicate: z.ZodBoolean;
1610
+ schemaVersion: z.ZodLiteral<1>;
1611
+ requestId: z.ZodString;
1612
+ sequence: z.ZodNumber;
1613
+ }, z.core.$strip>, z.ZodObject<{
1614
+ type: z.ZodLiteral<"conversation.item.added">;
1615
+ itemId: z.ZodString;
1616
+ previousItemId: z.ZodOptional<z.ZodString>;
1617
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
1618
+ type: z.ZodLiteral<"message">;
1619
+ itemId: z.ZodOptional<z.ZodString>;
1620
+ role: z.ZodEnum<{
1621
+ user: "user";
1622
+ system: "system";
1623
+ assistant: "assistant";
1624
+ }>;
1625
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1626
+ type: z.ZodLiteral<"input_text">;
1627
+ text: z.ZodString;
1628
+ }, z.core.$strict>, z.ZodObject<{
1629
+ type: z.ZodLiteral<"input_audio">;
1630
+ format: z.ZodEnum<{
1631
+ pcm16_24khz: "pcm16_24khz";
1632
+ g711_ulaw: "g711_ulaw";
1633
+ g711_alaw: "g711_alaw";
1634
+ }>;
1635
+ data: z.ZodOptional<z.ZodString>;
1636
+ transcript: z.ZodOptional<z.ZodString>;
1637
+ }, z.core.$strict>, z.ZodObject<{
1638
+ type: z.ZodLiteral<"output_text">;
1639
+ text: z.ZodString;
1640
+ }, z.core.$strict>, z.ZodObject<{
1641
+ type: z.ZodLiteral<"output_audio">;
1642
+ format: z.ZodEnum<{
1643
+ pcm16_24khz: "pcm16_24khz";
1644
+ g711_ulaw: "g711_ulaw";
1645
+ g711_alaw: "g711_alaw";
1646
+ }>;
1647
+ transcript: z.ZodOptional<z.ZodString>;
1648
+ }, z.core.$strict>], "type">>;
1649
+ }, z.core.$strict>, z.ZodObject<{
1650
+ type: z.ZodLiteral<"function_call">;
1651
+ itemId: z.ZodOptional<z.ZodString>;
1652
+ callId: z.ZodString;
1653
+ name: z.ZodString;
1654
+ arguments: z.ZodString;
1655
+ }, z.core.$strict>, z.ZodObject<{
1656
+ type: z.ZodLiteral<"function_call_output">;
1657
+ itemId: z.ZodOptional<z.ZodString>;
1658
+ callId: z.ZodString;
1659
+ output: z.ZodString;
1660
+ }, z.core.$strict>], "type">;
1661
+ schemaVersion: z.ZodLiteral<1>;
1662
+ requestId: z.ZodString;
1663
+ sequence: z.ZodNumber;
1664
+ commandId: z.ZodOptional<z.ZodString>;
1665
+ }, z.core.$strip>, z.ZodObject<{
1666
+ type: z.ZodLiteral<"conversation.item.done">;
1667
+ itemId: z.ZodString;
1668
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
1669
+ type: z.ZodLiteral<"message">;
1670
+ itemId: z.ZodOptional<z.ZodString>;
1671
+ role: z.ZodEnum<{
1672
+ user: "user";
1673
+ system: "system";
1674
+ assistant: "assistant";
1675
+ }>;
1676
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1677
+ type: z.ZodLiteral<"input_text">;
1678
+ text: z.ZodString;
1679
+ }, z.core.$strict>, z.ZodObject<{
1680
+ type: z.ZodLiteral<"input_audio">;
1681
+ format: z.ZodEnum<{
1682
+ pcm16_24khz: "pcm16_24khz";
1683
+ g711_ulaw: "g711_ulaw";
1684
+ g711_alaw: "g711_alaw";
1685
+ }>;
1686
+ data: z.ZodOptional<z.ZodString>;
1687
+ transcript: z.ZodOptional<z.ZodString>;
1688
+ }, z.core.$strict>, z.ZodObject<{
1689
+ type: z.ZodLiteral<"output_text">;
1690
+ text: z.ZodString;
1691
+ }, z.core.$strict>, z.ZodObject<{
1692
+ type: z.ZodLiteral<"output_audio">;
1693
+ format: z.ZodEnum<{
1694
+ pcm16_24khz: "pcm16_24khz";
1695
+ g711_ulaw: "g711_ulaw";
1696
+ g711_alaw: "g711_alaw";
1697
+ }>;
1698
+ transcript: z.ZodOptional<z.ZodString>;
1699
+ }, z.core.$strict>], "type">>;
1700
+ }, z.core.$strict>, z.ZodObject<{
1701
+ type: z.ZodLiteral<"function_call">;
1702
+ itemId: z.ZodOptional<z.ZodString>;
1703
+ callId: z.ZodString;
1704
+ name: z.ZodString;
1705
+ arguments: z.ZodString;
1706
+ }, z.core.$strict>, z.ZodObject<{
1707
+ type: z.ZodLiteral<"function_call_output">;
1708
+ itemId: z.ZodOptional<z.ZodString>;
1709
+ callId: z.ZodString;
1710
+ output: z.ZodString;
1711
+ }, z.core.$strict>], "type">;
1712
+ schemaVersion: z.ZodLiteral<1>;
1713
+ requestId: z.ZodString;
1714
+ sequence: z.ZodNumber;
1715
+ commandId: z.ZodOptional<z.ZodString>;
1716
+ }, z.core.$strip>, z.ZodObject<{
1717
+ type: z.ZodLiteral<"conversation.item.deleted">;
1718
+ itemId: z.ZodString;
1719
+ schemaVersion: z.ZodLiteral<1>;
1720
+ requestId: z.ZodString;
1721
+ sequence: z.ZodNumber;
1722
+ commandId: z.ZodOptional<z.ZodString>;
1723
+ }, z.core.$strip>, z.ZodObject<{
1724
+ type: z.ZodLiteral<"conversation.item.truncated">;
1725
+ itemId: z.ZodString;
1726
+ contentIndex: z.ZodNumber;
1727
+ audioEndMs: z.ZodNumber;
1728
+ schemaVersion: z.ZodLiteral<1>;
1729
+ requestId: z.ZodString;
1730
+ sequence: z.ZodNumber;
1731
+ commandId: z.ZodOptional<z.ZodString>;
1732
+ }, z.core.$strip>, z.ZodObject<{
1733
+ type: z.ZodLiteral<"input_audio.speech_started">;
1734
+ itemId: z.ZodString;
1735
+ audioStartMs: z.ZodNumber;
1736
+ schemaVersion: z.ZodLiteral<1>;
1737
+ requestId: z.ZodString;
1738
+ sequence: z.ZodNumber;
1739
+ commandId: z.ZodOptional<z.ZodString>;
1740
+ }, z.core.$strip>, z.ZodObject<{
1741
+ type: z.ZodLiteral<"input_audio.speech_stopped">;
1742
+ itemId: z.ZodString;
1743
+ audioEndMs: z.ZodNumber;
1744
+ schemaVersion: z.ZodLiteral<1>;
1745
+ requestId: z.ZodString;
1746
+ sequence: z.ZodNumber;
1747
+ commandId: z.ZodOptional<z.ZodString>;
1748
+ }, z.core.$strip>, z.ZodObject<{
1749
+ type: z.ZodLiteral<"input_audio.committed">;
1750
+ itemId: z.ZodString;
1751
+ previousItemId: z.ZodOptional<z.ZodString>;
1752
+ schemaVersion: z.ZodLiteral<1>;
1753
+ requestId: z.ZodString;
1754
+ sequence: z.ZodNumber;
1755
+ commandId: z.ZodOptional<z.ZodString>;
1756
+ }, z.core.$strip>, z.ZodObject<{
1757
+ type: z.ZodLiteral<"input_audio.cleared">;
1758
+ schemaVersion: z.ZodLiteral<1>;
1759
+ requestId: z.ZodString;
1760
+ sequence: z.ZodNumber;
1761
+ commandId: z.ZodOptional<z.ZodString>;
1762
+ }, z.core.$strip>, z.ZodObject<{
1763
+ type: z.ZodLiteral<"response.created">;
1764
+ responseId: z.ZodString;
1765
+ schemaVersion: z.ZodLiteral<1>;
1766
+ requestId: z.ZodString;
1767
+ sequence: z.ZodNumber;
1768
+ commandId: z.ZodOptional<z.ZodString>;
1769
+ }, z.core.$strip>, z.ZodObject<{
1770
+ type: z.ZodLiteral<"output_audio.delta">;
1771
+ responseId: z.ZodString;
1772
+ itemId: z.ZodString;
1773
+ contentIndex: z.ZodNumber;
1774
+ format: z.ZodEnum<{
1775
+ pcm16_24khz: "pcm16_24khz";
1776
+ g711_ulaw: "g711_ulaw";
1777
+ g711_alaw: "g711_alaw";
1778
+ }>;
1779
+ data: z.ZodString;
1780
+ schemaVersion: z.ZodLiteral<1>;
1781
+ requestId: z.ZodString;
1782
+ sequence: z.ZodNumber;
1783
+ commandId: z.ZodOptional<z.ZodString>;
1784
+ }, z.core.$strip>, z.ZodObject<{
1785
+ type: z.ZodLiteral<"output_audio.done">;
1786
+ responseId: z.ZodString;
1787
+ itemId: z.ZodString;
1788
+ contentIndex: z.ZodNumber;
1789
+ schemaVersion: z.ZodLiteral<1>;
1790
+ requestId: z.ZodString;
1791
+ sequence: z.ZodNumber;
1792
+ commandId: z.ZodOptional<z.ZodString>;
1793
+ }, z.core.$strip>, z.ZodObject<{
1794
+ type: z.ZodLiteral<"transcript.delta">;
1795
+ source: z.ZodEnum<{
1796
+ input_audio: "input_audio";
1797
+ output_audio: "output_audio";
1798
+ }>;
1799
+ itemId: z.ZodString;
1800
+ contentIndex: z.ZodNumber;
1801
+ responseId: z.ZodOptional<z.ZodString>;
1802
+ text: z.ZodString;
1803
+ schemaVersion: z.ZodLiteral<1>;
1804
+ requestId: z.ZodString;
1805
+ sequence: z.ZodNumber;
1806
+ commandId: z.ZodOptional<z.ZodString>;
1807
+ }, z.core.$strip>, z.ZodObject<{
1808
+ type: z.ZodLiteral<"transcript.done">;
1809
+ source: z.ZodEnum<{
1810
+ input_audio: "input_audio";
1811
+ output_audio: "output_audio";
1812
+ }>;
1813
+ itemId: z.ZodString;
1814
+ contentIndex: z.ZodNumber;
1815
+ responseId: z.ZodOptional<z.ZodString>;
1816
+ transcript: z.ZodString;
1817
+ schemaVersion: z.ZodLiteral<1>;
1818
+ requestId: z.ZodString;
1819
+ sequence: z.ZodNumber;
1820
+ commandId: z.ZodOptional<z.ZodString>;
1821
+ }, z.core.$strip>, z.ZodObject<{
1822
+ type: z.ZodLiteral<"text.delta">;
1823
+ responseId: z.ZodString;
1824
+ itemId: z.ZodString;
1825
+ contentIndex: z.ZodNumber;
1826
+ text: z.ZodString;
1827
+ schemaVersion: z.ZodLiteral<1>;
1828
+ requestId: z.ZodString;
1829
+ sequence: z.ZodNumber;
1830
+ commandId: z.ZodOptional<z.ZodString>;
1831
+ }, z.core.$strip>, z.ZodObject<{
1832
+ type: z.ZodLiteral<"tool_call">;
1833
+ responseId: z.ZodString;
1834
+ itemId: z.ZodString;
1835
+ toolCallId: z.ZodString;
1836
+ name: z.ZodOptional<z.ZodString>;
1837
+ argumentsDelta: z.ZodOptional<z.ZodString>;
1838
+ complete: z.ZodBoolean;
1839
+ schemaVersion: z.ZodLiteral<1>;
1840
+ requestId: z.ZodString;
1841
+ sequence: z.ZodNumber;
1842
+ commandId: z.ZodOptional<z.ZodString>;
1843
+ }, z.core.$strip>, z.ZodObject<{
1844
+ type: z.ZodLiteral<"response.done">;
1845
+ responseId: z.ZodString;
1846
+ status: z.ZodEnum<{
1847
+ cancelled: "cancelled";
1848
+ completed: "completed";
1849
+ failed: "failed";
1850
+ incomplete: "incomplete";
1851
+ }>;
1852
+ finishReason: z.ZodOptional<z.ZodEnum<{
1853
+ content_filter: "content_filter";
1854
+ cancelled: "cancelled";
1855
+ refusal: "refusal";
1856
+ stop: "stop";
1857
+ length: "length";
1858
+ tool_calls: "tool_calls";
1859
+ }>>;
1860
+ units: z.ZodArray<z.ZodObject<{
1861
+ unit: z.ZodEnum<{
1862
+ input_tokens: "input_tokens";
1863
+ cached_input_tokens: "cached_input_tokens";
1864
+ output_tokens: "output_tokens";
1865
+ reasoning_tokens: "reasoning_tokens";
1866
+ requests: "requests";
1867
+ images: "images";
1868
+ audio_input_milliseconds: "audio_input_milliseconds";
1869
+ audio_output_milliseconds: "audio_output_milliseconds";
1870
+ video_milliseconds: "video_milliseconds";
1871
+ characters: "characters";
1872
+ embeddings: "embeddings";
1873
+ audio_input_tokens: "audio_input_tokens";
1874
+ cached_audio_input_tokens: "cached_audio_input_tokens";
1875
+ audio_output_tokens: "audio_output_tokens";
1876
+ session_milliseconds: "session_milliseconds";
1877
+ input_transcription_milliseconds: "input_transcription_milliseconds";
1878
+ }>;
1879
+ quantity: z.ZodNumber;
1880
+ }, z.core.$strict>>;
1881
+ usageSource: z.ZodEnum<{
1882
+ provider_reported: "provider_reported";
1883
+ oxy_measured: "oxy_measured";
1884
+ estimated: "estimated";
1885
+ }>;
1886
+ schemaVersion: z.ZodLiteral<1>;
1887
+ requestId: z.ZodString;
1888
+ sequence: z.ZodNumber;
1889
+ commandId: z.ZodOptional<z.ZodString>;
1890
+ }, z.core.$strip>, z.ZodObject<{
1891
+ type: z.ZodLiteral<"error">;
1892
+ fatal: z.ZodBoolean;
1893
+ error: z.ZodObject<{
1894
+ schemaVersion: z.ZodLiteral<1>;
1895
+ code: z.ZodEnum<{
1896
+ invalid_request: "invalid_request";
1897
+ authentication_failed: "authentication_failed";
1898
+ permission_denied: "permission_denied";
1899
+ insufficient_scope: "insufficient_scope";
1900
+ model_not_found: "model_not_found";
1901
+ unsupported_modality: "unsupported_modality";
1902
+ context_length_exceeded: "context_length_exceeded";
1903
+ request_too_large: "request_too_large";
1904
+ output_limit_exceeded: "output_limit_exceeded";
1905
+ idempotency_conflict: "idempotency_conflict";
1906
+ insufficient_balance: "insufficient_balance";
1907
+ spending_limit_exceeded: "spending_limit_exceeded";
1908
+ quota_exceeded: "quota_exceeded";
1909
+ byok_credential_invalid: "byok_credential_invalid";
1910
+ policy_violation: "policy_violation";
1911
+ commercial_permission_denied: "commercial_permission_denied";
1912
+ no_route_available: "no_route_available";
1913
+ upstream_content_filtered: "upstream_content_filtered";
1914
+ cancelled: "cancelled";
1915
+ rate_limited: "rate_limited";
1916
+ provider_error: "provider_error";
1917
+ provider_timeout: "provider_timeout";
1918
+ provider_overloaded: "provider_overloaded";
1919
+ service_unavailable: "service_unavailable";
1920
+ internal_error: "internal_error";
1921
+ }>;
1922
+ message: z.ZodString;
1923
+ retryable: z.ZodBoolean;
1924
+ requestId: z.ZodString;
1925
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
1926
+ param: z.ZodOptional<z.ZodString>;
1927
+ upstreamCategory: z.ZodOptional<z.ZodEnum<{
1928
+ rate_limit: "rate_limit";
1929
+ quota: "quota";
1930
+ timeout: "timeout";
1931
+ overloaded: "overloaded";
1932
+ server_error: "server_error";
1933
+ content_filter: "content_filter";
1934
+ invalid_request: "invalid_request";
1935
+ authentication: "authentication";
1936
+ unknown: "unknown";
1937
+ }>>;
1938
+ }, z.core.$strict>;
1939
+ schemaVersion: z.ZodLiteral<1>;
1940
+ requestId: z.ZodString;
1941
+ sequence: z.ZodNumber;
1942
+ commandId: z.ZodOptional<z.ZodString>;
1943
+ }, z.core.$strip>, z.ZodObject<{
1944
+ type: z.ZodLiteral<"session.closed">;
1945
+ reason: z.ZodEnum<{
1946
+ no_route_available: "no_route_available";
1947
+ client_closed: "client_closed";
1948
+ max_duration: "max_duration";
1949
+ idle_timeout: "idle_timeout";
1950
+ limit_exceeded: "limit_exceeded";
1951
+ resume_expired: "resume_expired";
1952
+ upstream_closed: "upstream_closed";
1953
+ upstream_error: "upstream_error";
1954
+ server_shutdown: "server_shutdown";
1955
+ }>;
1956
+ units: z.ZodArray<z.ZodObject<{
1957
+ unit: z.ZodEnum<{
1958
+ input_tokens: "input_tokens";
1959
+ cached_input_tokens: "cached_input_tokens";
1960
+ output_tokens: "output_tokens";
1961
+ reasoning_tokens: "reasoning_tokens";
1962
+ requests: "requests";
1963
+ images: "images";
1964
+ audio_input_milliseconds: "audio_input_milliseconds";
1965
+ audio_output_milliseconds: "audio_output_milliseconds";
1966
+ video_milliseconds: "video_milliseconds";
1967
+ characters: "characters";
1968
+ embeddings: "embeddings";
1969
+ audio_input_tokens: "audio_input_tokens";
1970
+ cached_audio_input_tokens: "cached_audio_input_tokens";
1971
+ audio_output_tokens: "audio_output_tokens";
1972
+ session_milliseconds: "session_milliseconds";
1973
+ input_transcription_milliseconds: "input_transcription_milliseconds";
1974
+ }>;
1975
+ quantity: z.ZodNumber;
1976
+ }, z.core.$strict>>;
1977
+ usageSource: z.ZodEnum<{
1978
+ provider_reported: "provider_reported";
1979
+ oxy_measured: "oxy_measured";
1980
+ estimated: "estimated";
1981
+ }>;
1982
+ closedAt: z.ZodString;
1983
+ schemaVersion: z.ZodLiteral<1>;
1984
+ requestId: z.ZodString;
1985
+ sequence: z.ZodNumber;
1986
+ commandId: z.ZodOptional<z.ZodString>;
1987
+ }, z.core.$strip>], "type">;
1988
+ export type RealtimeOutputModality = z.infer<typeof realtimeOutputModalitySchema>;
1989
+ export type RealtimeTurnDetection = z.infer<typeof realtimeTurnDetectionSchema>;
1990
+ export type RealtimeInputTranscription = z.infer<typeof realtimeInputTranscriptionSchema>;
1991
+ export type RealtimeTranslation = z.infer<typeof realtimeTranslationSchema>;
1992
+ export type RealtimeSessionConfig = z.infer<typeof realtimeSessionConfigSchema>;
1993
+ export type RealtimeSessionConfigUpdate = z.infer<typeof realtimeSessionConfigUpdateSchema>;
1994
+ export type RealtimeSessionLimits = z.infer<typeof realtimeSessionLimitsSchema>;
1995
+ export type RealtimeContentPart = z.infer<typeof realtimeContentPartSchema>;
1996
+ export type RealtimeConversationItem = z.infer<typeof realtimeConversationItemSchema>;
1997
+ export type RealtimeResponseParameters = z.infer<typeof realtimeResponseParametersSchema>;
1998
+ export type RealtimeClientCommand = z.infer<typeof realtimeClientCommandSchema>;
1999
+ export type RealtimeTranscriptSource = z.infer<typeof realtimeTranscriptSourceSchema>;
2000
+ export type RealtimeResponseStatus = z.infer<typeof realtimeResponseStatusSchema>;
2001
+ export type RealtimeSessionCloseReason = z.infer<typeof realtimeSessionCloseReasonSchema>;
2002
+ export type RealtimeOpenLimits = z.infer<typeof realtimeOpenLimitsSchema>;
2003
+ export type RealtimeSessionOpen = z.infer<typeof realtimeSessionOpenSchema>;
2004
+ /** What a public client sends after `session.open`: the commands. */
2005
+ export type RealtimeClientEvent = RealtimeClientCommand;
2006
+ export type RealtimeServerEvent = z.infer<typeof realtimePublicServerEventSchema>;