1/**
2 * @stability unstable
3 * @since 1.0.0
4 */
5
6import * as Data from "effect/Data"
7import * as Effect from "effect/Effect"
8import * as Sse from "effect/encoding/Sse"
9import * as HttpClient from "effect/http/HttpClient"
10import * as HttpClientError from "effect/http/HttpClientError"
11import * as HttpClientRequest from "effect/http/HttpClientRequest"
12import * as HttpClientResponse from "effect/http/HttpClientResponse"
13import type { SchemaError } from "effect/Schema"
14import * as Schema from "effect/Schema"
15import * as Stream from "effect/Stream"
16// non-recursive definitions
17export type AABenchmarkEntry = {
18 readonly "agentic_index": number | null
19 readonly "coding_index": number | null
20 readonly "intelligence_index": number | null
21}
22export const AABenchmarkEntry = Schema.Struct({
23 "agentic_index": Schema.Union([
24 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
25 Schema.Null
26 ]).annotate({ "description": "Artificial Analysis Agentic Index score", "format": "double" }),
27 "coding_index": Schema.Union([
28 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29 Schema.Null
30 ]).annotate({ "description": "Artificial Analysis Coding Index score", "format": "double" }),
31 "intelligence_index": Schema.Union([
32 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
33 Schema.Null
34 ]).annotate({ "description": "Artificial Analysis Intelligence Index score", "format": "double" })
35}).annotate({ "description": "Artificial Analysis benchmark index scores.", "identifier": "AABenchmarkEntry" })
36export type ActivityItem = {
37 readonly "byok_usage_inference": number
38 readonly "completion_tokens": number
39 readonly "date": string
40 readonly "endpoint_id": string
41 readonly "model": string
42 readonly "model_permaslug": string
43 readonly "prompt_tokens": number
44 readonly "provider_name": string
45 readonly "reasoning_tokens": number
46 readonly "requests": number
47 readonly "usage": number
48}
49export const ActivityItem = Schema.Struct({
50 "byok_usage_inference": Schema.Number.annotate({
51 "description": "BYOK inference cost in USD (external credits spent)",
52 "format": "double"
53 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
54 "completion_tokens": Schema.Number.annotate({ "description": "Total completion tokens generated" }).check(
55 Schema.isInt().annotate({ "expected": "an integer" })
56 ),
57 "date": Schema.String.annotate({ "description": "Date of the activity (YYYY-MM-DD format)" }),
58 "endpoint_id": Schema.String.annotate({ "description": "Unique identifier for the endpoint" }),
59 "model": Schema.String.annotate({ "description": "Model slug (e.g., \"openai/gpt-4.1\")" }),
60 "model_permaslug": Schema.String.annotate({ "description": "Model permaslug (e.g., \"openai/gpt-4.1-2025-04-14\")" }),
61 "prompt_tokens": Schema.Number.annotate({ "description": "Total prompt tokens used" }).check(
62 Schema.isInt().annotate({ "expected": "an integer" })
63 ),
64 "provider_name": Schema.String.annotate({ "description": "Name of the provider serving this endpoint" }),
65 "reasoning_tokens": Schema.Number.annotate({ "description": "Total reasoning tokens used" }).check(
66 Schema.isInt().annotate({ "expected": "an integer" })
67 ),
68 "requests": Schema.Number.annotate({ "description": "Number of requests made" }).check(
69 Schema.isInt().annotate({ "expected": "an integer" })
70 ),
71 "usage": Schema.Number.annotate({ "description": "Total cost in USD (OpenRouter credits spent)", "format": "double" })
72 .check(Schema.isFinite().annotate({ "expected": "a finite number" }))
73}).annotate({ "identifier": "ActivityItem" })
74export type AdvisorNestedTool = { readonly "parameters"?: {}; readonly "type": string }
75export const AdvisorNestedTool = Schema.Struct({
76 "parameters": Schema.optionalKey(Schema.Struct({})),
77 "type": Schema.String
78}).annotate({
79 "description":
80 "A tool made available to the advisor sub-agent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the advisor has no way to execute them. The advisor tool may not list itself.",
81 "identifier": "AdvisorNestedTool"
82})
83export type AdvisorReasoning = {
84 readonly "effort"?: "max" | "xhigh" | "high" | "medium" | "low" | "minimal" | "none"
85 readonly "max_tokens"?: number
86}
87export const AdvisorReasoning = Schema.Struct({
88 "effort": Schema.optionalKey(
89 Schema.Literals(["max", "xhigh", "high", "medium", "low", "minimal", "none"]).annotate({
90 "description": "Reasoning effort level for the advisor call."
91 })
92 ),
93 "max_tokens": Schema.optionalKey(
94 Schema.Number.annotate({ "description": "Maximum number of reasoning tokens the advisor may use." }).check(
95 Schema.isInt().annotate({ "expected": "an integer" })
96 )
97 )
98}).annotate({
99 "description":
100 "Reasoning configuration forwarded to the advisor call. Use this to control reasoning effort and token budget for models that support extended thinking.",
101 "identifier": "AdvisorReasoning"
102})
103export type AnthropicAdvisorToolResult = {
104 readonly "content": {}
105 readonly "tool_use_id": string
106 readonly "type": "advisor_tool_result"
107}
108export const AnthropicAdvisorToolResult = Schema.Struct({
109 "content": Schema.Struct({}),
110 "tool_use_id": Schema.String,
111 "type": Schema.Literal("advisor_tool_result")
112}).annotate({ "identifier": "AnthropicAdvisorToolResult" })
113export type AnthropicAllowedCallers = ReadonlyArray<"direct" | "code_execution_20250825" | "code_execution_20260120">
114export const AnthropicAllowedCallers = Schema.Array(
115 Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"])
116).annotate({ "identifier": "AnthropicAllowedCallers" })
117export type AnthropicBase64PdfSource = {
118 readonly "data": string
119 readonly "media_type": "application/pdf"
120 readonly "type": "base64"
121}
122export const AnthropicBase64PdfSource = Schema.Struct({
123 "data": Schema.String,
124 "media_type": Schema.Literal("application/pdf"),
125 "type": Schema.Literal("base64")
126}).annotate({ "identifier": "AnthropicBase64PdfSource" })
127export type AnthropicBashCodeExecutionOutput = {
128 readonly "file_id": string
129 readonly "type": "bash_code_execution_output"
130}
131export const AnthropicBashCodeExecutionOutput = Schema.Struct({
132 "file_id": Schema.String,
133 "type": Schema.Literal("bash_code_execution_output")
134}).annotate({ "identifier": "AnthropicBashCodeExecutionOutput" })
135export type AnthropicBashCodeExecutionToolResultError = {
136 readonly "error_code":
137 | "invalid_tool_input"
138 | "unavailable"
139 | "too_many_requests"
140 | "execution_time_exceeded"
141 | "output_file_too_large"
142 readonly "type": "bash_code_execution_tool_result_error"
143}
144export const AnthropicBashCodeExecutionToolResultError = Schema.Struct({
145 "error_code": Schema.Literals([
146 "invalid_tool_input",
147 "unavailable",
148 "too_many_requests",
149 "execution_time_exceeded",
150 "output_file_too_large"
151 ]),
152 "type": Schema.Literal("bash_code_execution_tool_result_error")
153}).annotate({ "identifier": "AnthropicBashCodeExecutionToolResultError" })
154export type AnthropicCacheControlTtl = "5m" | "1h"
155export const AnthropicCacheControlTtl = Schema.Literals(["5m", "1h"]).annotate({
156 "identifier": "AnthropicCacheControlTtl"
157})
158export type Objects_ = {
159 readonly "ephemeral_1h_input_tokens": number
160 readonly "ephemeral_5m_input_tokens": number
161 readonly [x: string]: Schema.Json
162}
163export const Objects_ = Schema.StructWithRest(
164 Schema.Struct({
165 "ephemeral_1h_input_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
166 "ephemeral_5m_input_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
167 }),
168 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
169)
170export type AnthropicCitationCharLocation = {
171 readonly "cited_text": string
172 readonly "document_index": number
173 readonly "document_title": string | null
174 readonly "end_char_index": number
175 readonly "file_id": string | null
176 readonly "start_char_index": number
177 readonly "type": "char_location"
178}
179export const AnthropicCitationCharLocation = Schema.Struct({
180 "cited_text": Schema.String,
181 "document_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
182 "document_title": Schema.Union([Schema.String, Schema.Null]),
183 "end_char_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
184 "file_id": Schema.Union([Schema.String, Schema.Null]),
185 "start_char_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
186 "type": Schema.Literal("char_location")
187}).annotate({ "identifier": "AnthropicCitationCharLocation" })
188export type AnthropicCitationCharLocationParam = {
189 readonly "cited_text": string
190 readonly "document_index": number
191 readonly "document_title": string | null
192 readonly "end_char_index": number
193 readonly "start_char_index": number
194 readonly "type": "char_location"
195}
196export const AnthropicCitationCharLocationParam = Schema.Struct({
197 "cited_text": Schema.String,
198 "document_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
199 "document_title": Schema.Union([Schema.String, Schema.Null]),
200 "end_char_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
201 "start_char_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
202 "type": Schema.Literal("char_location")
203}).annotate({ "identifier": "AnthropicCitationCharLocationParam" })
204export type AnthropicCitationContentBlockLocation = {
205 readonly "cited_text": string
206 readonly "document_index": number
207 readonly "document_title": string | null
208 readonly "end_block_index": number
209 readonly "file_id": string | null
210 readonly "start_block_index": number
211 readonly "type": "content_block_location"
212}
213export const AnthropicCitationContentBlockLocation = Schema.Struct({
214 "cited_text": Schema.String,
215 "document_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
216 "document_title": Schema.Union([Schema.String, Schema.Null]),
217 "end_block_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
218 "file_id": Schema.Union([Schema.String, Schema.Null]),
219 "start_block_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
220 "type": Schema.Literal("content_block_location")
221}).annotate({ "identifier": "AnthropicCitationContentBlockLocation" })
222export type AnthropicCitationContentBlockLocationParam = {
223 readonly "cited_text": string
224 readonly "document_index": number
225 readonly "document_title": string | null
226 readonly "end_block_index": number
227 readonly "start_block_index": number
228 readonly "type": "content_block_location"
229}
230export const AnthropicCitationContentBlockLocationParam = Schema.Struct({
231 "cited_text": Schema.String,
232 "document_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
233 "document_title": Schema.Union([Schema.String, Schema.Null]),
234 "end_block_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
235 "start_block_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
236 "type": Schema.Literal("content_block_location")
237}).annotate({ "identifier": "AnthropicCitationContentBlockLocationParam" })
238export type AnthropicCitationPageLocation = {
239 readonly "cited_text": string
240 readonly "document_index": number
241 readonly "document_title": string | null
242 readonly "end_page_number": number
243 readonly "file_id": string | null
244 readonly "start_page_number": number
245 readonly "type": "page_location"
246}
247export const AnthropicCitationPageLocation = Schema.Struct({
248 "cited_text": Schema.String,
249 "document_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
250 "document_title": Schema.Union([Schema.String, Schema.Null]),
251 "end_page_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
252 "file_id": Schema.Union([Schema.String, Schema.Null]),
253 "start_page_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
254 "type": Schema.Literal("page_location")
255}).annotate({ "identifier": "AnthropicCitationPageLocation" })
256export type AnthropicCitationPageLocationParam = {
257 readonly "cited_text": string
258 readonly "document_index": number
259 readonly "document_title": string | null
260 readonly "end_page_number": number
261 readonly "start_page_number": number
262 readonly "type": "page_location"
263}
264export const AnthropicCitationPageLocationParam = Schema.Struct({
265 "cited_text": Schema.String,
266 "document_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
267 "document_title": Schema.Union([Schema.String, Schema.Null]),
268 "end_page_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
269 "start_page_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
270 "type": Schema.Literal("page_location")
271}).annotate({ "identifier": "AnthropicCitationPageLocationParam" })
272export type Objects_1 = { readonly "enabled": boolean; readonly [x: string]: Schema.Json }
273export const Objects_1 = Schema.StructWithRest(Schema.Struct({ "enabled": Schema.Boolean }), [
274 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))
275])
276export type AnthropicCitationSearchResultLocation = {
277 readonly "cited_text": string
278 readonly "end_block_index": number
279 readonly "search_result_index": number
280 readonly "source": string
281 readonly "start_block_index": number
282 readonly "title": string | null
283 readonly "type": "search_result_location"
284}
285export const AnthropicCitationSearchResultLocation = Schema.Struct({
286 "cited_text": Schema.String,
287 "end_block_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
288 "search_result_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
289 "source": Schema.String,
290 "start_block_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
291 "title": Schema.Union([Schema.String, Schema.Null]),
292 "type": Schema.Literal("search_result_location")
293}).annotate({ "identifier": "AnthropicCitationSearchResultLocation" })
294export type AnthropicCitationSearchResultLocationParam = {
295 readonly "cited_text": string
296 readonly "end_block_index": number
297 readonly "search_result_index": number
298 readonly "source": string
299 readonly "start_block_index": number
300 readonly "title": string | null
301 readonly "type": "search_result_location"
302}
303export const AnthropicCitationSearchResultLocationParam = Schema.Struct({
304 "cited_text": Schema.String,
305 "end_block_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
306 "search_result_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
307 "source": Schema.String,
308 "start_block_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
309 "title": Schema.Union([Schema.String, Schema.Null]),
310 "type": Schema.Literal("search_result_location")
311}).annotate({ "identifier": "AnthropicCitationSearchResultLocationParam" })
312export type AnthropicCitationWebSearchResultLocation = {
313 readonly "cited_text": string
314 readonly "encrypted_index": string
315 readonly "title": string | null
316 readonly "type": "web_search_result_location"
317 readonly "url": string
318}
319export const AnthropicCitationWebSearchResultLocation = Schema.Struct({
320 "cited_text": Schema.String,
321 "encrypted_index": Schema.String,
322 "title": Schema.Union([Schema.String, Schema.Null]),
323 "type": Schema.Literal("web_search_result_location"),
324 "url": Schema.String
325}).annotate({ "identifier": "AnthropicCitationWebSearchResultLocation" })
326export type AnthropicCitationWebSearchResultLocationParam = {
327 readonly "cited_text": string
328 readonly "encrypted_index": string
329 readonly "title": string | null
330 readonly "type": "web_search_result_location"
331 readonly "url": string
332}
333export const AnthropicCitationWebSearchResultLocationParam = Schema.Struct({
334 "cited_text": Schema.String,
335 "encrypted_index": Schema.String,
336 "title": Schema.Union([Schema.String, Schema.Null]),
337 "type": Schema.Literal("web_search_result_location"),
338 "url": Schema.String
339}).annotate({ "identifier": "AnthropicCitationWebSearchResultLocationParam" })
340export type AnthropicCodeExecution20250825Caller = {
341 readonly "tool_id": string
342 readonly "type": "code_execution_20250825"
343}
344export const AnthropicCodeExecution20250825Caller = Schema.Struct({
345 "tool_id": Schema.String,
346 "type": Schema.Literal("code_execution_20250825")
347}).annotate({ "identifier": "AnthropicCodeExecution20250825Caller" })
348export type AnthropicCodeExecution20260120Caller = {
349 readonly "tool_id": string
350 readonly "type": "code_execution_20260120"
351}
352export const AnthropicCodeExecution20260120Caller = Schema.Struct({
353 "tool_id": Schema.String,
354 "type": Schema.Literal("code_execution_20260120")
355}).annotate({ "identifier": "AnthropicCodeExecution20260120Caller" })
356export type AnthropicCodeExecutionOutput = { readonly "file_id": string; readonly "type": "code_execution_output" }
357export const AnthropicCodeExecutionOutput = Schema.Struct({
358 "file_id": Schema.String,
359 "type": Schema.Literal("code_execution_output")
360}).annotate({ "identifier": "AnthropicCodeExecutionOutput" })
361export type AnthropicCompactionBlock = { readonly "content": string | null; readonly "type": "compaction" }
362export const AnthropicCompactionBlock = Schema.Struct({
363 "content": Schema.Union([Schema.String, Schema.Null]),
364 "type": Schema.Literal("compaction")
365}).annotate({ "identifier": "AnthropicCompactionBlock" })
366export type AnthropicContainer = {
367 readonly "expires_at": string
368 readonly "id": string
369 readonly [x: string]: Schema.Json
370} | null
371export const AnthropicContainer = Schema.Union([
372 Schema.StructWithRest(Schema.Struct({ "expires_at": Schema.String, "id": Schema.String }), [
373 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))
374 ]),
375 Schema.Null
376]).annotate({ "identifier": "AnthropicContainer" })
377export type AnthropicContainerUpload = { readonly "file_id": string; readonly "type": "container_upload" }
378export const AnthropicContainerUpload = Schema.Struct({
379 "file_id": Schema.String,
380 "type": Schema.Literal("container_upload")
381}).annotate({ "identifier": "AnthropicContainerUpload" })
382export type AnthropicDirectCaller = { readonly "type": "direct" }
383export const AnthropicDirectCaller = Schema.Struct({ "type": Schema.Literal("direct") }).annotate({
384 "identifier": "AnthropicDirectCaller"
385})
386export type AnthropicFileDocumentSource = { readonly "file_id": string; readonly "type": "file" }
387export const AnthropicFileDocumentSource = Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("file") })
388 .annotate({ "identifier": "AnthropicFileDocumentSource" })
389export type AnthropicImageMimeType = "image/jpeg" | "image/png" | "image/gif" | "image/webp"
390export const AnthropicImageMimeType = Schema.Literals(["image/jpeg", "image/png", "image/gif", "image/webp"]).annotate({
391 "identifier": "AnthropicImageMimeType"
392})
393export type Objects_2 = { readonly "type": "input_tokens"; readonly "value": number; readonly [x: string]: Schema.Json }
394export const Objects_2 = Schema.StructWithRest(
395 Schema.Struct({
396 "type": Schema.Literal("input_tokens"),
397 "value": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
398 }),
399 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
400)
401export type AnthropicInputTokensTrigger = { readonly "type": "input_tokens"; readonly "value": number }
402export const AnthropicInputTokensTrigger = Schema.Struct({
403 "type": Schema.Literal("input_tokens"),
404 "value": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
405}).annotate({ "identifier": "AnthropicInputTokensTrigger" })
406export type Objects_3 = {
407 readonly "ephemeral_1h_input_tokens"?: number
408 readonly "ephemeral_5m_input_tokens"?: number
409 readonly [x: string]: Schema.Json
410}
411export const Objects_3 = Schema.StructWithRest(
412 Schema.Struct({
413 "ephemeral_1h_input_tokens": Schema.optionalKey(
414 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
415 ),
416 "ephemeral_5m_input_tokens": Schema.optionalKey(
417 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
418 )
419 }),
420 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
421)
422export type AnthropicOutputTokensDetails =
423 | { readonly "thinking_tokens": number; readonly [x: string]: Schema.Json }
424 | null
425export const AnthropicOutputTokensDetails = Schema.Union([
426 Schema.StructWithRest(
427 Schema.Struct({ "thinking_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })) }),
428 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
429 ),
430 Schema.Null
431]).annotate({ "identifier": "AnthropicOutputTokensDetails" })
432export type AnthropicPlainTextSource = {
433 readonly "data": string
434 readonly "media_type": "text/plain"
435 readonly "type": "text"
436}
437export const AnthropicPlainTextSource = Schema.Struct({
438 "data": Schema.String,
439 "media_type": Schema.Literal("text/plain"),
440 "type": Schema.Literal("text")
441}).annotate({ "identifier": "AnthropicPlainTextSource" })
442export type AnthropicRedactedThinkingBlock = { readonly "data": string; readonly "type": "redacted_thinking" }
443export const AnthropicRedactedThinkingBlock = Schema.Struct({
444 "data": Schema.String,
445 "type": Schema.Literal("redacted_thinking")
446}).annotate({ "identifier": "AnthropicRedactedThinkingBlock" })
447export type AnthropicRefusalStopDetails = {
448 readonly "category": "cyber" | "bio" | null
449 readonly "explanation": string | null
450 readonly "type": "refusal"
451 readonly [x: string]: Schema.Json
452} | null
453export const AnthropicRefusalStopDetails = Schema.Union([
454 Schema.StructWithRest(
455 Schema.Struct({
456 "category": Schema.Union([Schema.Literal("cyber"), Schema.Literal("bio"), Schema.Null]),
457 "explanation": Schema.Union([Schema.String, Schema.Null]),
458 "type": Schema.Literal("refusal")
459 }),
460 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
461 ),
462 Schema.Null
463]).annotate({ "description": "Structured information about a refusal", "identifier": "AnthropicRefusalStopDetails" })
464export type AnthropicServerToolErrorCode =
465 | "invalid_tool_input"
466 | "unavailable"
467 | "too_many_requests"
468 | "execution_time_exceeded"
469export const AnthropicServerToolErrorCode = Schema.Literals([
470 "invalid_tool_input",
471 "unavailable",
472 "too_many_requests",
473 "execution_time_exceeded"
474]).annotate({ "identifier": "AnthropicServerToolErrorCode" })
475export type AnthropicServerToolUsage = {
476 readonly "web_fetch_requests": number
477 readonly "web_search_requests": number
478 readonly [x: string]: Schema.Json
479} | null
480export const AnthropicServerToolUsage = Schema.Union([
481 Schema.StructWithRest(
482 Schema.Struct({
483 "web_fetch_requests": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
484 "web_search_requests": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
485 }),
486 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
487 ),
488 Schema.Null
489]).annotate({ "identifier": "AnthropicServerToolUsage" })
490export type AnthropicServiceTier = "standard" | "priority" | "batch" | null
491export const AnthropicServiceTier = Schema.Union([
492 Schema.Literal("standard"),
493 Schema.Literal("priority"),
494 Schema.Literal("batch"),
495 Schema.Null
496]).annotate({ "identifier": "AnthropicServiceTier" })
497export type AnthropicSpeed = "fast" | "standard" | null
498export const AnthropicSpeed = Schema.Union([Schema.Literal("fast"), Schema.Literal("standard"), Schema.Null]).annotate({
499 "identifier": "AnthropicSpeed"
500})
501export type AnthropicTextEditorCodeExecutionCreateResult = {
502 readonly "is_file_update": boolean
503 readonly "type": "text_editor_code_execution_create_result"
504}
505export const AnthropicTextEditorCodeExecutionCreateResult = Schema.Struct({
506 "is_file_update": Schema.Boolean,
507 "type": Schema.Literal("text_editor_code_execution_create_result")
508}).annotate({ "identifier": "AnthropicTextEditorCodeExecutionCreateResult" })
509export type AnthropicTextEditorCodeExecutionStrReplaceResult = {
510 readonly "lines": ReadonlyArray<string> | null
511 readonly "new_lines": number | null
512 readonly "new_start": number | null
513 readonly "old_lines": number | null
514 readonly "old_start": number | null
515 readonly "type": "text_editor_code_execution_str_replace_result"
516}
517export const AnthropicTextEditorCodeExecutionStrReplaceResult = Schema.Struct({
518 "lines": Schema.Union([Schema.Array(Schema.String), Schema.Null]),
519 "new_lines": Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]),
520 "new_start": Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]),
521 "old_lines": Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]),
522 "old_start": Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]),
523 "type": Schema.Literal("text_editor_code_execution_str_replace_result")
524}).annotate({ "identifier": "AnthropicTextEditorCodeExecutionStrReplaceResult" })
525export type AnthropicTextEditorCodeExecutionToolResultError = {
526 readonly "error_code":
527 | "invalid_tool_input"
528 | "unavailable"
529 | "too_many_requests"
530 | "execution_time_exceeded"
531 | "file_not_found"
532 readonly "error_message": string | null
533 readonly "type": "text_editor_code_execution_tool_result_error"
534}
535export const AnthropicTextEditorCodeExecutionToolResultError = Schema.Struct({
536 "error_code": Schema.Literals([
537 "invalid_tool_input",
538 "unavailable",
539 "too_many_requests",
540 "execution_time_exceeded",
541 "file_not_found"
542 ]),
543 "error_message": Schema.Union([Schema.String, Schema.Null]),
544 "type": Schema.Literal("text_editor_code_execution_tool_result_error")
545}).annotate({ "identifier": "AnthropicTextEditorCodeExecutionToolResultError" })
546export type AnthropicTextEditorCodeExecutionViewResult = {
547 readonly "content": string
548 readonly "file_type": "text" | "image" | "pdf"
549 readonly "num_lines": number | null
550 readonly "start_line": number | null
551 readonly "total_lines": number | null
552 readonly "type": "text_editor_code_execution_view_result"
553}
554export const AnthropicTextEditorCodeExecutionViewResult = Schema.Struct({
555 "content": Schema.String,
556 "file_type": Schema.Literals(["text", "image", "pdf"]),
557 "num_lines": Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]),
558 "start_line": Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]),
559 "total_lines": Schema.Union([
560 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
561 Schema.Null
562 ]),
563 "type": Schema.Literal("text_editor_code_execution_view_result")
564}).annotate({ "identifier": "AnthropicTextEditorCodeExecutionViewResult" })
565export type AnthropicThinkingBlock = {
566 readonly "signature": string
567 readonly "thinking": string
568 readonly "type": "thinking"
569}
570export const AnthropicThinkingBlock = Schema.Struct({
571 "signature": Schema.String,
572 "thinking": Schema.String,
573 "type": Schema.Literal("thinking")
574}).annotate({ "identifier": "AnthropicThinkingBlock" })
575export type AnthropicThinkingDisplay = "summarized" | "omitted" | null
576export const AnthropicThinkingDisplay = Schema.Union([
577 Schema.Literal("summarized"),
578 Schema.Literal("omitted"),
579 Schema.Null
580]).annotate({ "identifier": "AnthropicThinkingDisplay" })
581export type AnthropicThinkingTurns = { readonly "type": "thinking_turns"; readonly "value": number }
582export const AnthropicThinkingTurns = Schema.Struct({
583 "type": Schema.Literal("thinking_turns"),
584 "value": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
585}).annotate({ "identifier": "AnthropicThinkingTurns" })
586export type AnthropicToolReference = { readonly "tool_name": string; readonly "type": "tool_reference" }
587export const AnthropicToolReference = Schema.Struct({
588 "tool_name": Schema.String,
589 "type": Schema.Literal("tool_reference")
590}).annotate({ "identifier": "AnthropicToolReference" })
591export type AnthropicToolUsesKeep = { readonly "type": "tool_uses"; readonly "value": number }
592export const AnthropicToolUsesKeep = Schema.Struct({
593 "type": Schema.Literal("tool_uses"),
594 "value": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
595}).annotate({ "identifier": "AnthropicToolUsesKeep" })
596export type AnthropicToolUsesTrigger = { readonly "type": "tool_uses"; readonly "value": number }
597export const AnthropicToolUsesTrigger = Schema.Struct({
598 "type": Schema.Literal("tool_uses"),
599 "value": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
600}).annotate({ "identifier": "AnthropicToolUsesTrigger" })
601export type AnthropicUrlImageSource = { readonly "type": "url"; readonly "url": string }
602export const AnthropicUrlImageSource = Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }).annotate({
603 "identifier": "AnthropicUrlImageSource"
604})
605export type AnthropicUrlPdfSource = { readonly "type": "url"; readonly "url": string }
606export const AnthropicUrlPdfSource = Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }).annotate({
607 "identifier": "AnthropicUrlPdfSource"
608})
609export type AnthropicWebFetchToolResultError = {
610 readonly "error_code":
611 | "invalid_tool_input"
612 | "url_too_long"
613 | "url_not_allowed"
614 | "url_not_accessible"
615 | "unsupported_content_type"
616 | "too_many_requests"
617 | "max_uses_exceeded"
618 | "unavailable"
619 readonly "type": "web_fetch_tool_result_error"
620}
621export const AnthropicWebFetchToolResultError = Schema.Struct({
622 "error_code": Schema.Literals([
623 "invalid_tool_input",
624 "url_too_long",
625 "url_not_allowed",
626 "url_not_accessible",
627 "unsupported_content_type",
628 "too_many_requests",
629 "max_uses_exceeded",
630 "unavailable"
631 ]),
632 "type": Schema.Literal("web_fetch_tool_result_error")
633}).annotate({ "identifier": "AnthropicWebFetchToolResultError" })
634export type AnthropicWebSearchResult = {
635 readonly "encrypted_content": string
636 readonly "page_age": string | null
637 readonly "title": string
638 readonly "type": "web_search_result"
639 readonly "url": string
640}
641export const AnthropicWebSearchResult = Schema.Struct({
642 "encrypted_content": Schema.String,
643 "page_age": Schema.Union([Schema.String, Schema.Null]),
644 "title": Schema.String,
645 "type": Schema.Literal("web_search_result"),
646 "url": Schema.String
647}).annotate({ "identifier": "AnthropicWebSearchResult" })
648export type AnthropicWebSearchResultBlockParam = {
649 readonly "encrypted_content": string
650 readonly "page_age"?: string | null
651 readonly "title": string
652 readonly "type": "web_search_result"
653 readonly "url": string
654}
655export const AnthropicWebSearchResultBlockParam = Schema.Struct({
656 "encrypted_content": Schema.String,
657 "page_age": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
658 "title": Schema.String,
659 "type": Schema.Literal("web_search_result"),
660 "url": Schema.String
661}).annotate({ "identifier": "AnthropicWebSearchResultBlockParam" })
662export type AnthropicWebSearchToolResultError = {
663 readonly "error_code":
664 | "invalid_tool_input"
665 | "unavailable"
666 | "max_uses_exceeded"
667 | "too_many_requests"
668 | "query_too_long"
669 | "request_too_large"
670 readonly "type": "web_search_tool_result_error"
671}
672export const AnthropicWebSearchToolResultError = Schema.Struct({
673 "error_code": Schema.Literals([
674 "invalid_tool_input",
675 "unavailable",
676 "max_uses_exceeded",
677 "too_many_requests",
678 "query_too_long",
679 "request_too_large"
680 ]),
681 "type": Schema.Literal("web_search_tool_result_error")
682}).annotate({ "identifier": "AnthropicWebSearchToolResultError" })
683export type Objects_4 = {
684 readonly "city"?: string | null
685 readonly "country"?: string | null
686 readonly "region"?: string | null
687 readonly "timezone"?: string | null
688 readonly "type": "approximate"
689 readonly [x: string]: Schema.Json
690}
691export const Objects_4 = Schema.StructWithRest(
692 Schema.Struct({
693 "city": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
694 "country": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
695 "region": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
696 "timezone": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
697 "type": Schema.Literal("approximate")
698 }),
699 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
700)
701export type ApiErrorType =
702 | "context_length_exceeded"
703 | "max_tokens_exceeded"
704 | "token_limit_exceeded"
705 | "string_too_long"
706 | "authentication"
707 | "permission_denied"
708 | "payment_required"
709 | "rate_limit_exceeded"
710 | "provider_overloaded"
711 | "provider_unavailable"
712 | "invalid_request"
713 | "invalid_prompt"
714 | "not_found"
715 | "precondition_failed"
716 | "payload_too_large"
717 | "unprocessable"
718 | "content_policy_violation"
719 | "refusal"
720 | "invalid_image"
721 | "image_too_large"
722 | "image_too_small"
723 | "unsupported_image_format"
724 | "image_not_found"
725 | "image_download_failed"
726 | "server"
727 | "timeout"
728 | "unmapped"
729export const ApiErrorType = Schema.Literals([
730 "context_length_exceeded",
731 "max_tokens_exceeded",
732 "token_limit_exceeded",
733 "string_too_long",
734 "authentication",
735 "permission_denied",
736 "payment_required",
737 "rate_limit_exceeded",
738 "provider_overloaded",
739 "provider_unavailable",
740 "invalid_request",
741 "invalid_prompt",
742 "not_found",
743 "precondition_failed",
744 "payload_too_large",
745 "unprocessable",
746 "content_policy_violation",
747 "refusal",
748 "invalid_image",
749 "image_too_large",
750 "image_too_small",
751 "unsupported_image_format",
752 "image_not_found",
753 "image_download_failed",
754 "server",
755 "timeout",
756 "unmapped"
757]).annotate({
758 "description": "Canonical OpenRouter error type, stable across all API formats",
759 "identifier": "ApiErrorType"
760})
761export type ApplyPatchCallOperationDiffDeltaEvent = {
762 readonly "delta": string
763 readonly "item_id": string
764 readonly "output_index": number
765 readonly "sequence_number": number
766 readonly "type": "response.apply_patch_call_operation_diff.delta"
767}
768export const ApplyPatchCallOperationDiffDeltaEvent = Schema.Struct({
769 "delta": Schema.String,
770 "item_id": Schema.String,
771 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
772 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
773 "type": Schema.Literal("response.apply_patch_call_operation_diff.delta")
774}).annotate({
775 "description": "Incremental chunk of `operation.diff` for an `apply_patch_call`. Matches OpenAI's streaming shape.",
776 "identifier": "ApplyPatchCallOperationDiffDeltaEvent"
777})
778export type ApplyPatchCallOperationDiffDoneEvent = {
779 readonly "diff": string
780 readonly "item_id": string
781 readonly "output_index": number
782 readonly "sequence_number": number
783 readonly "type": "response.apply_patch_call_operation_diff.done"
784}
785export const ApplyPatchCallOperationDiffDoneEvent = Schema.Struct({
786 "diff": Schema.String,
787 "item_id": Schema.String,
788 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
789 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
790 "type": Schema.Literal("response.apply_patch_call_operation_diff.done")
791}).annotate({
792 "description": "Emitted when `operation.diff` streaming completes for an `apply_patch_call`.",
793 "identifier": "ApplyPatchCallOperationDiffDoneEvent"
794})
795export type ApplyPatchCallOutputItem = {
796 readonly "call_id": string
797 readonly "id"?: string | null
798 readonly "output"?: string | null
799 readonly "status": "completed" | "failed"
800 readonly "type": "apply_patch_call_output"
801}
802export const ApplyPatchCallOutputItem = Schema.Struct({
803 "call_id": Schema.String,
804 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
805 "output": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
806 "status": Schema.Literals(["completed", "failed"]),
807 "type": Schema.Literal("apply_patch_call_output")
808}).annotate({
809 "description":
810 "The client's echo of an `apply_patch_call` after applying the patch. `output` is an optional human-readable log; `status` is `completed` when the patch was applied successfully, `failed` otherwise.",
811 "identifier": "ApplyPatchCallOutputItem"
812})
813export type ApplyPatchCallStatus = "in_progress" | "completed"
814export const ApplyPatchCallStatus = Schema.Literals(["in_progress", "completed"]).annotate({
815 "description": "Lifecycle state of an `apply_patch_call` output item.",
816 "identifier": "ApplyPatchCallStatus"
817})
818export type ApplyPatchCreateFileOperation = {
819 readonly "diff": string
820 readonly "path": string
821 readonly "type": "create_file"
822}
823export const ApplyPatchCreateFileOperation = Schema.Struct({
824 "diff": Schema.String,
825 "path": Schema.String,
826 "type": Schema.Literal("create_file")
827}).annotate({
828 "description":
829 "The `create_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing the new file contents.",
830 "identifier": "ApplyPatchCreateFileOperation"
831})
832export type ApplyPatchDeleteFileOperation = { readonly "path": string; readonly "type": "delete_file" }
833export const ApplyPatchDeleteFileOperation = Schema.Struct({
834 "path": Schema.String,
835 "type": Schema.Literal("delete_file")
836}).annotate({
837 "description":
838 "The `delete_file` variant of an `apply_patch_call.operation`. Identifies the file to remove; no diff is required.",
839 "identifier": "ApplyPatchDeleteFileOperation"
840})
841export type ApplyPatchEngineEnum = "auto" | "native" | "openrouter"
842export const ApplyPatchEngineEnum = Schema.Literals(["auto", "native", "openrouter"]).annotate({
843 "description":
844 "Which apply_patch engine to use. \"auto\" (default) uses native passthrough when the endpoint advertises native apply_patch support, otherwise falls back to OpenRouter's HITL validator. \"native\" forces native passthrough — when the endpoint does not support native, the request falls back to HITL. \"openrouter\" always runs the HITL validator. Native passthrough streams the diff incrementally via `apply_patch_call_operation_diff.delta` events; HITL buffers the diff for atomic delivery as a single delta.",
845 "identifier": "ApplyPatchEngineEnum"
846})
847export type ApplyPatchServerTool = { readonly "type": "apply_patch" }
848export const ApplyPatchServerTool = Schema.Struct({ "type": Schema.Literal("apply_patch") }).annotate({
849 "description": "Apply patch tool configuration",
850 "identifier": "ApplyPatchServerTool"
851})
852export type ApplyPatchUpdateFileOperation = {
853 readonly "diff": string
854 readonly "path": string
855 readonly "type": "update_file"
856}
857export const ApplyPatchUpdateFileOperation = Schema.Struct({
858 "diff": Schema.String,
859 "path": Schema.String,
860 "type": Schema.Literal("update_file")
861}).annotate({
862 "description":
863 "The `update_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing edits to an existing file.",
864 "identifier": "ApplyPatchUpdateFileOperation"
865})
866export type AppRankingsItem = {
867 readonly "app_id": number
868 readonly "app_name": string
869 readonly "rank": number
870 readonly "total_requests": number
871 readonly "total_tokens": string
872}
873export const AppRankingsItem = Schema.Struct({
874 "app_id": Schema.Number.annotate({ "description": "Stable numeric identifier of the app on OpenRouter." }).check(
875 Schema.isInt().annotate({ "expected": "an integer" })
876 ),
877 "app_name": Schema.String.annotate({ "description": "Public display name of the app." }),
878 "rank": Schema.Number.annotate({
879 "description": "1-based position of the app within this response, per the requested `sort`."
880 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
881 "total_requests": Schema.Number.annotate({
882 "description": "Number of requests attributed to the app inside the date window."
883 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
884 "total_tokens": Schema.String.annotate({
885 "description":
886 "Sum of `prompt_tokens + completion_tokens` attributed to the app inside the date window, returned as a decimal string so 64-bit values are not truncated."
887 })
888}).annotate({ "identifier": "AppRankingsItem" })
889export type AutoBetaRouterPlugin = {
890 readonly "allowed_models"?: ReadonlyArray<string>
891 readonly "cost_quality_tradeoff"?: number
892 readonly "enabled"?: boolean
893 readonly "id": "auto-beta-router"
894}
895export const AutoBetaRouterPlugin = Schema.Struct({
896 "allowed_models": Schema.optionalKey(
897 Schema.Array(Schema.String).annotate({
898 "description":
899 "List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list."
900 })
901 ),
902 "cost_quality_tradeoff": Schema.optionalKey(
903 Schema.Number.annotate({
904 "description":
905 "Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9."
906 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
907 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
908 ).check(Schema.isLessThanOrEqualTo(10).annotate({ "expected": "a value less than or equal to 10" }))
909 ),
910 "enabled": Schema.optionalKey(
911 Schema.Boolean.annotate({
912 "description": "Set to false to disable the auto-beta-router plugin for this request. Defaults to true."
913 })
914 ),
915 "id": Schema.Literal("auto-beta-router")
916}).annotate({ "identifier": "AutoBetaRouterPlugin" })
917export type AutoRouterPlugin = {
918 readonly "allowed_models"?: ReadonlyArray<string>
919 readonly "cost_quality_tradeoff"?: number
920 readonly "enabled"?: boolean
921 readonly "id": "auto-router"
922 readonly "pin_model"?: boolean
923}
924export const AutoRouterPlugin = Schema.Struct({
925 "allowed_models": Schema.optionalKey(
926 Schema.Array(Schema.String).annotate({
927 "description":
928 "List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list."
929 })
930 ),
931 "cost_quality_tradeoff": Schema.optionalKey(
932 Schema.Number.annotate({
933 "description":
934 "Controls cost vs. quality routing tradeoff (0–10). 0 = pure quality (best model regardless of cost), 10 = maximize for cost (cheapest model wins). Intermediate values blend quality and cost signals continuously. Defaults to 7."
935 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
936 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
937 ).check(Schema.isLessThanOrEqualTo(10).annotate({ "expected": "a value less than or equal to 10" }))
938 ),
939 "enabled": Schema.optionalKey(
940 Schema.Boolean.annotate({
941 "description": "Set to false to disable the auto-router plugin for this request. Defaults to true."
942 })
943 ),
944 "id": Schema.Literal("auto-router"),
945 "pin_model": Schema.optionalKey(
946 Schema.Boolean.annotate({
947 "description":
948 "When true, reuses the model from the most recent assistant message's `model` attribute for subsequent turns. Defaults to false."
949 })
950 )
951}).annotate({ "identifier": "AutoRouterPlugin" })
952export type BadGatewayResponseErrorData = {
953 readonly "code": number
954 readonly "message": string
955 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
956}
957export const BadGatewayResponseErrorData = Schema.Struct({
958 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
959 "message": Schema.String,
960 "metadata": Schema.optionalKey(
961 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
962 )
963}).annotate({ "description": "Error data for BadGatewayResponse", "identifier": "BadGatewayResponseErrorData" })
964export type BadRequestResponseErrorData = {
965 readonly "code": number
966 readonly "message": string
967 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
968}
969export const BadRequestResponseErrorData = Schema.Struct({
970 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
971 "message": Schema.String,
972 "metadata": Schema.optionalKey(
973 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
974 )
975}).annotate({ "description": "Error data for BadRequestResponse", "identifier": "BadRequestResponseErrorData" })
976export type BaseCustomToolCallInputDeltaEvent = {
977 readonly "delta": string
978 readonly "item_id": string
979 readonly "output_index": number
980 readonly "sequence_number": number
981 readonly "type": "response.custom_tool_call_input.delta"
982}
983export const BaseCustomToolCallInputDeltaEvent = Schema.Struct({
984 "delta": Schema.String,
985 "item_id": Schema.String,
986 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
987 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
988 "type": Schema.Literal("response.custom_tool_call_input.delta")
989}).annotate({
990 "description":
991 "Event emitted when a custom tool call's freeform input is being streamed. Mirrors `response.function_call_arguments.delta` but for `custom` tools whose input is opaque text rather than JSON arguments.",
992 "identifier": "BaseCustomToolCallInputDeltaEvent"
993})
994export type BaseCustomToolCallInputDoneEvent = {
995 readonly "input": string
996 readonly "item_id": string
997 readonly "output_index": number
998 readonly "sequence_number": number
999 readonly "type": "response.custom_tool_call_input.done"
1000}
1001export const BaseCustomToolCallInputDoneEvent = Schema.Struct({
1002 "input": Schema.String,
1003 "item_id": Schema.String,
1004 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1005 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1006 "type": Schema.Literal("response.custom_tool_call_input.done")
1007}).annotate({
1008 "description":
1009 "Event emitted when a custom tool call's freeform input streaming is complete. Mirrors `response.function_call_arguments.done` but for `custom` tools.",
1010 "identifier": "BaseCustomToolCallInputDoneEvent"
1011})
1012export type BaseErrorEvent = {
1013 readonly "code": string | null
1014 readonly "message": string
1015 readonly "param": string | null
1016 readonly "sequence_number": number
1017 readonly "type": "error"
1018}
1019export const BaseErrorEvent = Schema.Struct({
1020 "code": Schema.Union([Schema.String, Schema.Null]),
1021 "message": Schema.String,
1022 "param": Schema.Union([Schema.String, Schema.Null]),
1023 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1024 "type": Schema.Literal("error")
1025}).annotate({ "description": "Event emitted when an error occurs during streaming", "identifier": "BaseErrorEvent" })
1026export type BaseFunctionCallArgsDeltaEvent = {
1027 readonly "delta": string
1028 readonly "item_id": string
1029 readonly "output_index": number
1030 readonly "sequence_number": number
1031 readonly "type": "response.function_call_arguments.delta"
1032}
1033export const BaseFunctionCallArgsDeltaEvent = Schema.Struct({
1034 "delta": Schema.String,
1035 "item_id": Schema.String,
1036 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1037 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1038 "type": Schema.Literal("response.function_call_arguments.delta")
1039}).annotate({
1040 "description": "Event emitted when function call arguments are being streamed",
1041 "identifier": "BaseFunctionCallArgsDeltaEvent"
1042})
1043export type BaseFunctionCallArgsDoneEvent = {
1044 readonly "arguments": string
1045 readonly "item_id": string
1046 readonly "name": string
1047 readonly "output_index": number
1048 readonly "sequence_number": number
1049 readonly "type": "response.function_call_arguments.done"
1050}
1051export const BaseFunctionCallArgsDoneEvent = Schema.Struct({
1052 "arguments": Schema.String,
1053 "item_id": Schema.String,
1054 "name": Schema.String,
1055 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1056 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1057 "type": Schema.Literal("response.function_call_arguments.done")
1058}).annotate({
1059 "description": "Event emitted when function call arguments streaming is complete",
1060 "identifier": "BaseFunctionCallArgsDoneEvent"
1061})
1062export type BaseReasoningDeltaEvent = {
1063 readonly "content_index": number
1064 readonly "delta": string
1065 readonly "item_id": string
1066 readonly "output_index": number
1067 readonly "sequence_number": number
1068 readonly "type": "response.reasoning_text.delta"
1069}
1070export const BaseReasoningDeltaEvent = Schema.Struct({
1071 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1072 "delta": Schema.String,
1073 "item_id": Schema.String,
1074 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1075 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1076 "type": Schema.Literal("response.reasoning_text.delta")
1077}).annotate({
1078 "description": "Event emitted when reasoning text delta is streamed",
1079 "identifier": "BaseReasoningDeltaEvent"
1080})
1081export type BaseReasoningDoneEvent = {
1082 readonly "content_index": number
1083 readonly "item_id": string
1084 readonly "output_index": number
1085 readonly "sequence_number": number
1086 readonly "text": string
1087 readonly "type": "response.reasoning_text.done"
1088}
1089export const BaseReasoningDoneEvent = Schema.Struct({
1090 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1091 "item_id": Schema.String,
1092 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1093 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1094 "text": Schema.String,
1095 "type": Schema.Literal("response.reasoning_text.done")
1096}).annotate({
1097 "description": "Event emitted when reasoning text streaming is complete",
1098 "identifier": "BaseReasoningDoneEvent"
1099})
1100export type BaseReasoningSummaryTextDeltaEvent = {
1101 readonly "delta": string
1102 readonly "item_id": string
1103 readonly "output_index": number
1104 readonly "sequence_number": number
1105 readonly "summary_index": number
1106 readonly "type": "response.reasoning_summary_text.delta"
1107}
1108export const BaseReasoningSummaryTextDeltaEvent = Schema.Struct({
1109 "delta": Schema.String,
1110 "item_id": Schema.String,
1111 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1112 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1113 "summary_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1114 "type": Schema.Literal("response.reasoning_summary_text.delta")
1115}).annotate({
1116 "description": "Event emitted when reasoning summary text delta is streamed",
1117 "identifier": "BaseReasoningSummaryTextDeltaEvent"
1118})
1119export type BaseReasoningSummaryTextDoneEvent = {
1120 readonly "item_id": string
1121 readonly "output_index": number
1122 readonly "sequence_number": number
1123 readonly "summary_index": number
1124 readonly "text": string
1125 readonly "type": "response.reasoning_summary_text.done"
1126}
1127export const BaseReasoningSummaryTextDoneEvent = Schema.Struct({
1128 "item_id": Schema.String,
1129 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1130 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1131 "summary_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1132 "text": Schema.String,
1133 "type": Schema.Literal("response.reasoning_summary_text.done")
1134}).annotate({
1135 "description": "Event emitted when reasoning summary text streaming is complete",
1136 "identifier": "BaseReasoningSummaryTextDoneEvent"
1137})
1138export type BaseRefusalDeltaEvent = {
1139 readonly "content_index": number
1140 readonly "delta": string
1141 readonly "item_id": string
1142 readonly "output_index": number
1143 readonly "sequence_number": number
1144 readonly "type": "response.refusal.delta"
1145}
1146export const BaseRefusalDeltaEvent = Schema.Struct({
1147 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1148 "delta": Schema.String,
1149 "item_id": Schema.String,
1150 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1151 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1152 "type": Schema.Literal("response.refusal.delta")
1153}).annotate({ "description": "Event emitted when a refusal delta is streamed", "identifier": "BaseRefusalDeltaEvent" })
1154export type BaseRefusalDoneEvent = {
1155 readonly "content_index": number
1156 readonly "item_id": string
1157 readonly "output_index": number
1158 readonly "refusal": string
1159 readonly "sequence_number": number
1160 readonly "type": "response.refusal.done"
1161}
1162export const BaseRefusalDoneEvent = Schema.Struct({
1163 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1164 "item_id": Schema.String,
1165 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1166 "refusal": Schema.String,
1167 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1168 "type": Schema.Literal("response.refusal.done")
1169}).annotate({ "description": "Event emitted when refusal streaming is complete", "identifier": "BaseRefusalDoneEvent" })
1170export type BashServerToolEngine = "auto" | "native" | "openrouter"
1171export const BashServerToolEngine = Schema.Literals(["auto", "native", "openrouter"]).annotate({
1172 "description":
1173 "Which bash engine to use. \"openrouter\" runs commands server-side in the OpenRouter sandbox. \"auto\" (default) and \"native\" use native passthrough, returning the tool call to your application to run client-side; OpenRouter does not execute the commands.",
1174 "identifier": "BashServerToolEngine"
1175})
1176export type BooleanCapability = { readonly "type": "boolean" }
1177export const BooleanCapability = Schema.Struct({ "type": Schema.Literal("boolean") }).annotate({
1178 "description": "A supported-or-not flag. Present means the parameter is accepted.",
1179 "identifier": "BooleanCapability"
1180})
1181export type BulkAddWorkspaceMembersRequest = { readonly "user_ids": ReadonlyArray<string> }
1182export const BulkAddWorkspaceMembersRequest = Schema.Struct({
1183 "user_ids": Schema.Array(Schema.String).annotate({
1184 "description":
1185 "List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization."
1186 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
1187 Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" })
1188 )
1189}).annotate({ "identifier": "BulkAddWorkspaceMembersRequest" })
1190export type BulkAssignKeysRequest = { readonly "key_hashes": ReadonlyArray<string> }
1191export const BulkAssignKeysRequest = Schema.Struct({
1192 "key_hashes": Schema.Array(
1193 Schema.String.check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
1194 ).annotate({ "description": "Array of API key hashes to assign to the guardrail" }).check(
1195 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
1196 )
1197}).annotate({ "identifier": "BulkAssignKeysRequest" })
1198export type BulkAssignKeysResponse = { readonly "assigned_count": number }
1199export const BulkAssignKeysResponse = Schema.Struct({
1200 "assigned_count": Schema.Number.annotate({ "description": "Number of keys successfully assigned" }).check(
1201 Schema.isInt().annotate({ "expected": "an integer" })
1202 )
1203}).annotate({ "identifier": "BulkAssignKeysResponse" })
1204export type BulkAssignMembersRequest = { readonly "member_user_ids": ReadonlyArray<string> }
1205export const BulkAssignMembersRequest = Schema.Struct({
1206 "member_user_ids": Schema.Array(
1207 Schema.String.check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
1208 ).annotate({ "description": "Array of member user IDs to assign to the guardrail" }).check(
1209 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
1210 )
1211}).annotate({ "identifier": "BulkAssignMembersRequest" })
1212export type BulkAssignMembersResponse = { readonly "assigned_count": number }
1213export const BulkAssignMembersResponse = Schema.Struct({
1214 "assigned_count": Schema.Number.annotate({ "description": "Number of members successfully assigned" }).check(
1215 Schema.isInt().annotate({ "expected": "an integer" })
1216 )
1217}).annotate({ "identifier": "BulkAssignMembersResponse" })
1218export type BulkRemoveWorkspaceMembersRequest = { readonly "user_ids": ReadonlyArray<string> }
1219export const BulkRemoveWorkspaceMembersRequest = Schema.Struct({
1220 "user_ids": Schema.Array(Schema.String).annotate({ "description": "List of user IDs to remove from the workspace" })
1221 .check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
1222 Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" })
1223 )
1224}).annotate({ "identifier": "BulkRemoveWorkspaceMembersRequest" })
1225export type BulkRemoveWorkspaceMembersResponse = { readonly "removed_count": number }
1226export const BulkRemoveWorkspaceMembersResponse = Schema.Struct({
1227 "removed_count": Schema.Number.annotate({ "description": "Number of members removed" }).check(
1228 Schema.isInt().annotate({ "expected": "an integer" })
1229 )
1230}).annotate({ "identifier": "BulkRemoveWorkspaceMembersResponse" })
1231export type BulkUnassignKeysRequest = { readonly "key_hashes": ReadonlyArray<string> }
1232export const BulkUnassignKeysRequest = Schema.Struct({
1233 "key_hashes": Schema.Array(
1234 Schema.String.check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
1235 ).annotate({ "description": "Array of API key hashes to unassign from the guardrail" }).check(
1236 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
1237 )
1238}).annotate({ "identifier": "BulkUnassignKeysRequest" })
1239export type BulkUnassignKeysResponse = { readonly "unassigned_count": number }
1240export const BulkUnassignKeysResponse = Schema.Struct({
1241 "unassigned_count": Schema.Number.annotate({ "description": "Number of keys successfully unassigned" }).check(
1242 Schema.isInt().annotate({ "expected": "an integer" })
1243 )
1244}).annotate({ "identifier": "BulkUnassignKeysResponse" })
1245export type BulkUnassignMembersRequest = { readonly "member_user_ids": ReadonlyArray<string> }
1246export const BulkUnassignMembersRequest = Schema.Struct({
1247 "member_user_ids": Schema.Array(
1248 Schema.String.check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
1249 ).annotate({ "description": "Array of member user IDs to unassign from the guardrail" }).check(
1250 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
1251 )
1252}).annotate({ "identifier": "BulkUnassignMembersRequest" })
1253export type BulkUnassignMembersResponse = { readonly "unassigned_count": number }
1254export const BulkUnassignMembersResponse = Schema.Struct({
1255 "unassigned_count": Schema.Number.annotate({ "description": "Number of members successfully unassigned" }).check(
1256 Schema.isInt().annotate({ "expected": "an integer" })
1257 )
1258}).annotate({ "identifier": "BulkUnassignMembersResponse" })
1259export type BYOKProviderSlug =
1260 | "ai21"
1261 | "aion-labs"
1262 | "akashml"
1263 | "alibaba"
1264 | "amazon-bedrock"
1265 | "amazon-nova"
1266 | "ambient"
1267 | "anthropic"
1268 | "arcee-ai"
1269 | "atlas-cloud"
1270 | "avian"
1271 | "azure"
1272 | "baidu"
1273 | "baseten"
1274 | "black-forest-labs"
1275 | "byteplus"
1276 | "cerebras"
1277 | "chutes"
1278 | "cirrascale"
1279 | "clarifai"
1280 | "cloudflare"
1281 | "cohere"
1282 | "coreweave"
1283 | "crusoe"
1284 | "darkbloom"
1285 | "decart"
1286 | "deepgram"
1287 | "deepinfra"
1288 | "deepseek"
1289 | "dekallm"
1290 | "digitalocean"
1291 | "featherless"
1292 | "fireworks"
1293 | "fish-audio"
1294 | "friendli"
1295 | "gmicloud"
1296 | "google-ai-studio"
1297 | "google-vertex"
1298 | "groq"
1299 | "heygen"
1300 | "inception"
1301 | "inceptron"
1302 | "inferact-vllm"
1303 | "inference-net"
1304 | "infermatic"
1305 | "inflection"
1306 | "io-net"
1307 | "ionstream"
1308 | "krea"
1309 | "liquid"
1310 | "mancer"
1311 | "mara"
1312 | "meta"
1313 | "minimax"
1314 | "mistral"
1315 | "modelrun"
1316 | "modular"
1317 | "moonshotai"
1318 | "morph"
1319 | "ncompass"
1320 | "nebius"
1321 | "nex-agi"
1322 | "nextbit"
1323 | "novita"
1324 | "nvidia"
1325 | "open-inference"
1326 | "openai"
1327 | "parasail"
1328 | "perceptron"
1329 | "perplexity"
1330 | "phala"
1331 | "poolside"
1332 | "quiver"
1333 | "recraft"
1334 | "reka"
1335 | "relace"
1336 | "runway"
1337 | "sail-research"
1338 | "sakana"
1339 | "sambanova"
1340 | "seed"
1341 | "siliconflow"
1342 | "sourceful"
1343 | "stepfun"
1344 | "streamlake"
1345 | "switchpoint"
1346 | "tencent"
1347 | "tenstorrent"
1348 | "together"
1349 | "upstage"
1350 | "venice"
1351 | "wafer"
1352 | "wandb"
1353 | "xai"
1354 | "xiaomi"
1355 | "z-ai"
1356export const BYOKProviderSlug = Schema.Literals([
1357 "ai21",
1358 "aion-labs",
1359 "akashml",
1360 "alibaba",
1361 "amazon-bedrock",
1362 "amazon-nova",
1363 "ambient",
1364 "anthropic",
1365 "arcee-ai",
1366 "atlas-cloud",
1367 "avian",
1368 "azure",
1369 "baidu",
1370 "baseten",
1371 "black-forest-labs",
1372 "byteplus",
1373 "cerebras",
1374 "chutes",
1375 "cirrascale",
1376 "clarifai",
1377 "cloudflare",
1378 "cohere",
1379 "coreweave",
1380 "crusoe",
1381 "darkbloom",
1382 "decart",
1383 "deepgram",
1384 "deepinfra",
1385 "deepseek",
1386 "dekallm",
1387 "digitalocean",
1388 "featherless",
1389 "fireworks",
1390 "fish-audio",
1391 "friendli",
1392 "gmicloud",
1393 "google-ai-studio",
1394 "google-vertex",
1395 "groq",
1396 "heygen",
1397 "inception",
1398 "inceptron",
1399 "inferact-vllm",
1400 "inference-net",
1401 "infermatic",
1402 "inflection",
1403 "io-net",
1404 "ionstream",
1405 "krea",
1406 "liquid",
1407 "mancer",
1408 "mara",
1409 "meta",
1410 "minimax",
1411 "mistral",
1412 "modelrun",
1413 "modular",
1414 "moonshotai",
1415 "morph",
1416 "ncompass",
1417 "nebius",
1418 "nex-agi",
1419 "nextbit",
1420 "novita",
1421 "nvidia",
1422 "open-inference",
1423 "openai",
1424 "parasail",
1425 "perceptron",
1426 "perplexity",
1427 "phala",
1428 "poolside",
1429 "quiver",
1430 "recraft",
1431 "reka",
1432 "relace",
1433 "runway",
1434 "sail-research",
1435 "sakana",
1436 "sambanova",
1437 "seed",
1438 "siliconflow",
1439 "sourceful",
1440 "stepfun",
1441 "streamlake",
1442 "switchpoint",
1443 "tencent",
1444 "tenstorrent",
1445 "together",
1446 "upstage",
1447 "venice",
1448 "wafer",
1449 "wandb",
1450 "xai",
1451 "xiaomi",
1452 "z-ai"
1453]).annotate({
1454 "description":
1455 "The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`).",
1456 "identifier": "BYOKProviderSlug"
1457})
1458export type ChatAssistantImages = ReadonlyArray<{ readonly "image_url": { readonly "url": string } }>
1459export const ChatAssistantImages = Schema.Array(
1460 Schema.Struct({
1461 "image_url": Schema.Struct({
1462 "url": Schema.String.annotate({ "description": "URL or base64-encoded data of the generated image" })
1463 })
1464 })
1465).annotate({ "description": "Generated images from image generation models", "identifier": "ChatAssistantImages" })
1466export type ChatAudioOutput = {
1467 readonly "data"?: string
1468 readonly "expires_at"?: number
1469 readonly "id"?: string
1470 readonly "transcript"?: string
1471}
1472export const ChatAudioOutput = Schema.Struct({
1473 "data": Schema.optionalKey(Schema.String.annotate({ "description": "Base64 encoded audio data" })),
1474 "expires_at": Schema.optionalKey(
1475 Schema.Number.annotate({ "description": "Audio expiration timestamp" }).check(
1476 Schema.isInt().annotate({ "expected": "an integer" })
1477 )
1478 ),
1479 "id": Schema.optionalKey(Schema.String.annotate({ "description": "Audio output identifier" })),
1480 "transcript": Schema.optionalKey(Schema.String.annotate({ "description": "Audio transcript" }))
1481}).annotate({ "description": "Audio output data or reference", "identifier": "ChatAudioOutput" })
1482export type ChatContentAudio = {
1483 readonly "input_audio": { readonly "data": string; readonly "format": string }
1484 readonly "type": "input_audio"
1485}
1486export const ChatContentAudio = Schema.Struct({
1487 "input_audio": Schema.Struct({
1488 "data": Schema.String.annotate({ "description": "Base64 encoded audio data" }),
1489 "format": Schema.String.annotate({
1490 "description":
1491 "Audio format (e.g., wav, mp3, flac, m4a, ogg, aiff, aac, pcm16, pcm24). Supported formats vary by provider."
1492 })
1493 }),
1494 "type": Schema.Literal("input_audio")
1495}).annotate({
1496 "description": "Audio input content part. Supported audio formats vary by provider.",
1497 "identifier": "ChatContentAudio"
1498})
1499export type ChatContentFile = {
1500 readonly "file": { readonly "file_data"?: string; readonly "file_id"?: string; readonly "filename"?: string }
1501 readonly "type": "file"
1502}
1503export const ChatContentFile = Schema.Struct({
1504 "file": Schema.Struct({
1505 "file_data": Schema.optionalKey(
1506 Schema.String.annotate({ "description": "File content as base64 data URL or URL" })
1507 ),
1508 "file_id": Schema.optionalKey(Schema.String.annotate({ "description": "File ID for previously uploaded files" })),
1509 "filename": Schema.optionalKey(Schema.String.annotate({ "description": "Original filename" }))
1510 }),
1511 "type": Schema.Literal("file")
1512}).annotate({ "description": "File content part for document processing", "identifier": "ChatContentFile" })
1513export type ChatContentImage = {
1514 readonly "image_url": { readonly "detail"?: "auto" | "low" | "high" | "original"; readonly "url": string }
1515 readonly "type": "image_url"
1516}
1517export const ChatContentImage = Schema.Struct({
1518 "image_url": Schema.Struct({
1519 "detail": Schema.optionalKey(
1520 Schema.Literals(["auto", "low", "high", "original"]).annotate({
1521 "description":
1522 "Image detail level for vision models. `original` is an OpenRouter extension (not in the OpenAI Chat Completions spec) requesting true original-resolution media; it is downgraded to `high` for providers that lack an original-resolution tier."
1523 })
1524 ),
1525 "url": Schema.String.annotate({ "description": "URL of the image (data: URLs supported)" })
1526 }),
1527 "type": Schema.Literal("image_url")
1528}).annotate({ "description": "Image content part for vision models", "identifier": "ChatContentImage" })
1529export type ChatContentVideoInput = { readonly "url": string }
1530export const ChatContentVideoInput = Schema.Struct({
1531 "url": Schema.String.annotate({ "description": "URL of the video (data: URLs supported)" })
1532}).annotate({ "description": "Video input object", "identifier": "ChatContentVideoInput" })
1533export type ChatDebugOptions = { readonly "echo_upstream_body"?: boolean }
1534export const ChatDebugOptions = Schema.Struct({
1535 "echo_upstream_body": Schema.optionalKey(
1536 Schema.Boolean.annotate({
1537 "description":
1538 "If true, includes the transformed upstream request body in a debug chunk at the start of the stream. Only works with streaming mode."
1539 })
1540 )
1541}).annotate({
1542 "description": "Debug options for inspecting request transformations (streaming only)",
1543 "identifier": "ChatDebugOptions"
1544})
1545export type ChatFinishReasonEnum = "tool_calls" | "stop" | "length" | "content_filter" | "error" | null
1546export const ChatFinishReasonEnum = Schema.Union([
1547 Schema.Literal("tool_calls"),
1548 Schema.Literal("stop"),
1549 Schema.Literal("length"),
1550 Schema.Literal("content_filter"),
1551 Schema.Literal("error"),
1552 Schema.Null
1553]).annotate({ "identifier": "ChatFinishReasonEnum" })
1554export type ChatFormatGrammarConfig = { readonly "grammar": string; readonly "type": "grammar" }
1555export const ChatFormatGrammarConfig = Schema.Struct({
1556 "grammar": Schema.String.annotate({ "description": "Custom grammar for text generation" }),
1557 "type": Schema.Literal("grammar")
1558}).annotate({ "description": "Custom grammar response format", "identifier": "ChatFormatGrammarConfig" })
1559export type ChatFormatJsonObjectConfig = { readonly "type": "json_object" }
1560export const ChatFormatJsonObjectConfig = Schema.Struct({ "type": Schema.Literal("json_object") }).annotate({
1561 "description": "JSON object response format",
1562 "identifier": "ChatFormatJsonObjectConfig"
1563})
1564export type ChatFormatPythonConfig = { readonly "type": "python" }
1565export const ChatFormatPythonConfig = Schema.Struct({ "type": Schema.Literal("python") }).annotate({
1566 "description": "Python code response format",
1567 "identifier": "ChatFormatPythonConfig"
1568})
1569export type ChatFormatTextConfig = { readonly "type": "text" }
1570export const ChatFormatTextConfig = Schema.Struct({ "type": Schema.Literal("text") }).annotate({
1571 "description": "Default text response format",
1572 "identifier": "ChatFormatTextConfig"
1573})
1574export type ChatJsonSchemaConfig = {
1575 readonly "description"?: string
1576 readonly "name": string
1577 readonly "schema"?: {}
1578 readonly "strict"?: boolean | null
1579}
1580export const ChatJsonSchemaConfig = Schema.Struct({
1581 "description": Schema.optionalKey(Schema.String.annotate({ "description": "Schema description for the model" })),
1582 "name": Schema.String.annotate({ "description": "Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)" })
1583 .check(Schema.isMaxLength(64).annotate({ "expected": "a value with a length of at most 64" })),
1584 "schema": Schema.optionalKey(Schema.Struct({}).annotate({ "description": "JSON Schema object" })),
1585 "strict": Schema.optionalKey(
1586 Schema.Union([Schema.Boolean, Schema.Null]).annotate({ "description": "Enable strict schema adherence" })
1587 )
1588}).annotate({ "description": "JSON Schema configuration object", "identifier": "ChatJsonSchemaConfig" })
1589export type ChatNamedToolChoice = { readonly "function": { readonly "name": string }; readonly "type": "function" }
1590export const ChatNamedToolChoice = Schema.Struct({
1591 "function": Schema.Struct({ "name": Schema.String.annotate({ "description": "Function name to call" }) }),
1592 "type": Schema.Literal("function")
1593}).annotate({ "description": "Named tool choice for specific function", "identifier": "ChatNamedToolChoice" })
1594export type ChatReasoningSummaryVerbosityEnum = "auto" | "concise" | "detailed" | null
1595export const ChatReasoningSummaryVerbosityEnum = Schema.Union([
1596 Schema.Literal("auto"),
1597 Schema.Literal("concise"),
1598 Schema.Literal("detailed"),
1599 Schema.Null
1600]).annotate({ "identifier": "ChatReasoningSummaryVerbosityEnum" })
1601export type ChatServerToolChoice = { readonly "type": string }
1602export const ChatServerToolChoice = Schema.Struct({
1603 "type": Schema.String.annotate({
1604 "description":
1605 "OpenRouter server-tool type to force (e.g. `openrouter:web_search`, `web_search`, `web_search_preview`)."
1606 })
1607}).annotate({
1608 "description":
1609 "OpenRouter extension: force a specific server tool by naming it directly in `tool_choice.type` instead of wrapping it in `{ type: \"function\", function: { name } }`.",
1610 "identifier": "ChatServerToolChoice"
1611})
1612export type Objects_6 = { readonly "include_usage"?: boolean; readonly [x: string]: Schema.Json }
1613export const Objects_6 = Schema.StructWithRest(
1614 Schema.Struct({
1615 "include_usage": Schema.optionalKey(
1616 Schema.Boolean.annotate({
1617 "description": "Deprecated: This field has no effect. Full usage details are always included."
1618 })
1619 )
1620 }),
1621 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
1622)
1623export type ChatStreamToolCall = {
1624 readonly "function"?: { readonly "arguments"?: string; readonly "name"?: string | null }
1625 readonly "id"?: string | null
1626 readonly "index": number
1627 readonly "type"?: "function" | null
1628}
1629export const ChatStreamToolCall = Schema.Struct({
1630 "function": Schema.optionalKey(
1631 Schema.Struct({
1632 "arguments": Schema.optionalKey(Schema.String.annotate({ "description": "Function arguments as JSON string" })),
1633 "name": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
1634 }).annotate({ "description": "Function call details" })
1635 ),
1636 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1637 "index": Schema.Number.annotate({ "description": "Tool call index in the array" }).check(
1638 Schema.isInt().annotate({ "expected": "an integer" })
1639 ),
1640 "type": Schema.optionalKey(Schema.Union([Schema.Literal("function"), Schema.Null]))
1641}).annotate({ "description": "Tool call delta for streaming responses", "identifier": "ChatStreamToolCall" })
1642export type ChatTokenLogprob = {
1643 readonly "bytes": ReadonlyArray<number> | null
1644 readonly "logprob": number
1645 readonly "token": string
1646 readonly "top_logprobs": ReadonlyArray<
1647 { readonly "bytes": ReadonlyArray<number> | null; readonly "logprob": number; readonly "token": string }
1648 >
1649}
1650export const ChatTokenLogprob = Schema.Struct({
1651 "bytes": Schema.Union([
1652 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
1653 Schema.Null
1654 ]).annotate({ "description": "UTF-8 bytes of the token" }),
1655 "logprob": Schema.Number.annotate({ "description": "Log probability of the token", "format": "double" }).check(
1656 Schema.isFinite().annotate({ "expected": "a finite number" })
1657 ),
1658 "token": Schema.String.annotate({ "description": "The token" }),
1659 "top_logprobs": Schema.Array(Schema.Struct({
1660 "bytes": Schema.Union([
1661 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
1662 Schema.Null
1663 ]),
1664 "logprob": Schema.Number.annotate({ "format": "double" }).check(
1665 Schema.isFinite().annotate({ "expected": "a finite number" })
1666 ),
1667 "token": Schema.String
1668 })).annotate({ "description": "Top alternative tokens with probabilities" })
1669}).annotate({ "description": "Token log probability information", "identifier": "ChatTokenLogprob" })
1670export type ChatToolCall = {
1671 readonly "function": { readonly "arguments": string; readonly "name": string }
1672 readonly "id": string
1673 readonly "type": "function"
1674}
1675export const ChatToolCall = Schema.Struct({
1676 "function": Schema.Struct({
1677 "arguments": Schema.String.annotate({ "description": "Function arguments as JSON string" }),
1678 "name": Schema.String.annotate({ "description": "Function name to call" })
1679 }),
1680 "id": Schema.String.annotate({ "description": "Tool call identifier" }),
1681 "type": Schema.Literal("function")
1682}).annotate({ "description": "Tool call made by the assistant", "identifier": "ChatToolCall" })
1683export type Union_ = {
1684 readonly "accepted_prediction_tokens"?: number | null
1685 readonly "audio_tokens"?: number | null
1686 readonly "reasoning_tokens"?: number | null
1687 readonly "rejected_prediction_tokens"?: number | null
1688 readonly [x: string]: Schema.Json
1689} | null
1690export const Union_ = Schema.Union([
1691 Schema.StructWithRest(
1692 Schema.Struct({
1693 "accepted_prediction_tokens": Schema.optionalKey(
1694 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
1695 .annotate({ "description": "Accepted prediction tokens" })
1696 ),
1697 "audio_tokens": Schema.optionalKey(
1698 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
1699 .annotate({ "description": "Tokens used for audio output" })
1700 ),
1701 "reasoning_tokens": Schema.optionalKey(
1702 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
1703 .annotate({ "description": "Tokens used for reasoning" })
1704 ),
1705 "rejected_prediction_tokens": Schema.optionalKey(
1706 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
1707 .annotate({ "description": "Rejected prediction tokens" })
1708 )
1709 }),
1710 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
1711 ),
1712 Schema.Null
1713]).annotate({ "description": "Detailed completion token usage" })
1714export type Union_1 = {
1715 readonly "audio_tokens"?: number
1716 readonly "cache_write_tokens"?: number
1717 readonly "cached_tokens"?: number
1718 readonly "video_tokens"?: number
1719 readonly [x: string]: Schema.Json
1720} | null
1721export const Union_1 = Schema.Union([
1722 Schema.StructWithRest(
1723 Schema.Struct({
1724 "audio_tokens": Schema.optionalKey(
1725 Schema.Number.annotate({ "description": "Audio input tokens" }).check(
1726 Schema.isInt().annotate({ "expected": "an integer" })
1727 )
1728 ),
1729 "cache_write_tokens": Schema.optionalKey(
1730 Schema.Number.annotate({
1731 "description":
1732 "Tokens written to cache. Only returned for models with explicit caching and cache write pricing."
1733 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
1734 ),
1735 "cached_tokens": Schema.optionalKey(
1736 Schema.Number.annotate({ "description": "Cached prompt tokens" }).check(
1737 Schema.isInt().annotate({ "expected": "an integer" })
1738 )
1739 ),
1740 "video_tokens": Schema.optionalKey(
1741 Schema.Number.annotate({ "description": "Video input tokens" }).check(
1742 Schema.isInt().annotate({ "expected": "an integer" })
1743 )
1744 )
1745 }),
1746 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
1747 ),
1748 Schema.Null
1749]).annotate({ "description": "Detailed prompt token usage" })
1750export type CodeInterpreterServerTool = {
1751 readonly "container": string | {
1752 readonly "file_ids"?: ReadonlyArray<string>
1753 readonly "memory_limit"?: "1g" | "4g" | "16g" | "64g" | null
1754 readonly "type": "auto"
1755 }
1756 readonly "type": "code_interpreter"
1757}
1758export const CodeInterpreterServerTool = Schema.Struct({
1759 "container": Schema.Union([
1760 Schema.String,
1761 Schema.Struct({
1762 "file_ids": Schema.optionalKey(Schema.Array(Schema.String)),
1763 "memory_limit": Schema.optionalKey(
1764 Schema.Union([
1765 Schema.Literal("1g"),
1766 Schema.Literal("4g"),
1767 Schema.Literal("16g"),
1768 Schema.Literal("64g"),
1769 Schema.Null
1770 ])
1771 ),
1772 "type": Schema.Literal("auto")
1773 })
1774 ]),
1775 "type": Schema.Literal("code_interpreter")
1776}).annotate({ "description": "Code interpreter tool configuration", "identifier": "CodeInterpreterServerTool" })
1777export type CodexLocalShellTool = { readonly "type": "local_shell" }
1778export const CodexLocalShellTool = Schema.Struct({ "type": Schema.Literal("local_shell") }).annotate({
1779 "description": "Local shell tool configuration",
1780 "identifier": "CodexLocalShellTool"
1781})
1782export type CompactionItem = {
1783 readonly "encrypted_content": string
1784 readonly "id"?: string | null
1785 readonly "type": "compaction"
1786}
1787export const CompactionItem = Schema.Struct({
1788 "encrypted_content": Schema.String,
1789 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1790 "type": Schema.Literal("compaction")
1791}).annotate({ "description": "A context compaction marker with encrypted summary", "identifier": "CompactionItem" })
1792export type CompoundFilter = { readonly "filters": ReadonlyArray<{}>; readonly "type": "and" | "or" }
1793export const CompoundFilter = Schema.Struct({
1794 "filters": Schema.Array(Schema.Struct({})),
1795 "type": Schema.Literals(["and", "or"])
1796}).annotate({
1797 "description": "A compound filter that combines multiple comparison or compound filters",
1798 "identifier": "CompoundFilter"
1799})
1800export type ComputerUseServerTool = {
1801 readonly "display_height": number
1802 readonly "display_width": number
1803 readonly "environment": "windows" | "mac" | "linux" | "ubuntu" | "browser"
1804 readonly "type": "computer_use_preview"
1805}
1806export const ComputerUseServerTool = Schema.Struct({
1807 "display_height": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1808 "display_width": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1809 "environment": Schema.Literals(["windows", "mac", "linux", "ubuntu", "browser"]),
1810 "type": Schema.Literal("computer_use_preview")
1811}).annotate({ "description": "Computer use preview tool configuration", "identifier": "ComputerUseServerTool" })
1812export type ConflictResponseErrorData = {
1813 readonly "code": number
1814 readonly "message": string
1815 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
1816}
1817export const ConflictResponseErrorData = Schema.Struct({
1818 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1819 "message": Schema.String,
1820 "metadata": Schema.optionalKey(
1821 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
1822 )
1823}).annotate({ "description": "Error data for ConflictResponse", "identifier": "ConflictResponseErrorData" })
1824export type ContainerAutoEnvironment = { readonly "type": "container_auto" }
1825export const ContainerAutoEnvironment = Schema.Struct({ "type": Schema.Literal("container_auto") }).annotate({
1826 "description": "An OpenRouter-managed, auto-provisioned ephemeral container.",
1827 "identifier": "ContainerAutoEnvironment"
1828})
1829export type ContainerReferenceEnvironment = { readonly "container_id": string; readonly "type": "container_reference" }
1830export const ContainerReferenceEnvironment = Schema.Struct({
1831 "container_id": Schema.String.annotate({
1832 "description": "Identifier of an existing container to reuse (max 20 characters)."
1833 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
1834 Schema.isMaxLength(20).annotate({ "expected": "a value with a length of at most 20" })
1835 ).check(Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ "expected": "a string matching the RegExp ^[\\w-]+$" })),
1836 "type": Schema.Literal("container_reference")
1837}).annotate({
1838 "description": "Reference to a previously created container to reuse.",
1839 "identifier": "ContainerReferenceEnvironment"
1840})
1841export type ContentFilterAction = "redact" | "block" | "flag"
1842export const ContentFilterAction = Schema.Literals(["redact", "block", "flag"]).annotate({
1843 "description": "Action taken when the pattern matches",
1844 "identifier": "ContentFilterAction"
1845})
1846export type ContentFilterBuiltinAction = "redact" | "block" | "flag"
1847export const ContentFilterBuiltinAction = Schema.Literals(["redact", "block", "flag"]).annotate({
1848 "description": "Action taken when the builtin filter triggers",
1849 "identifier": "ContentFilterBuiltinAction"
1850})
1851export type ContentFilterBuiltinSlug =
1852 | "email"
1853 | "phone"
1854 | "ssn"
1855 | "credit-card"
1856 | "ip-address"
1857 | "person-name"
1858 | "address"
1859 | "regex-prompt-injection"
1860export const ContentFilterBuiltinSlug = Schema.Literals([
1861 "email",
1862 "phone",
1863 "ssn",
1864 "credit-card",
1865 "ip-address",
1866 "person-name",
1867 "address",
1868 "regex-prompt-injection"
1869]).annotate({ "description": "The builtin filter identifier", "identifier": "ContentFilterBuiltinSlug" })
1870export type ContentPartAudio = { readonly "audio_url": { readonly "url": string }; readonly "type": "audio_url" }
1871export const ContentPartAudio = Schema.Struct({
1872 "audio_url": Schema.Struct({ "url": Schema.String }),
1873 "type": Schema.Literal("audio_url")
1874}).annotate({ "identifier": "ContentPartAudio" })
1875export type ContentPartImage = { readonly "image_url": { readonly "url": string }; readonly "type": "image_url" }
1876export const ContentPartImage = Schema.Struct({
1877 "image_url": Schema.Struct({ "url": Schema.String }),
1878 "type": Schema.Literal("image_url")
1879}).annotate({ "identifier": "ContentPartImage" })
1880export type ContentPartVideo = { readonly "type": "video_url"; readonly "video_url": { readonly "url": string } }
1881export const ContentPartVideo = Schema.Struct({
1882 "type": Schema.Literal("video_url"),
1883 "video_url": Schema.Struct({ "url": Schema.String })
1884}).annotate({ "identifier": "ContentPartVideo" })
1885export type ContextCompactionItem = {
1886 readonly "encrypted_content"?: string | null
1887 readonly "id"?: string | null
1888 readonly "type": "context_compaction"
1889}
1890export const ContextCompactionItem = Schema.Struct({
1891 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1892 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1893 "type": Schema.Literal("context_compaction")
1894}).annotate({
1895 "description": "A context compaction marker with an optional encrypted summary",
1896 "identifier": "ContextCompactionItem"
1897})
1898export type ContextCompressionEngine = "middle-out"
1899export const ContextCompressionEngine = Schema.Literal("middle-out").annotate({
1900 "description": "The compression engine to use. Defaults to \"middle-out\".",
1901 "identifier": "ContextCompressionEngine"
1902})
1903export type Objects_8 = {
1904 readonly "upstream_inference_completions_cost": number
1905 readonly "upstream_inference_cost"?: number | null
1906 readonly "upstream_inference_prompt_cost": number
1907 readonly [x: string]: Schema.Json
1908}
1909export const Objects_8 = Schema.StructWithRest(
1910 Schema.Struct({
1911 "upstream_inference_completions_cost": Schema.Number.annotate({ "format": "double" }).check(
1912 Schema.isFinite().annotate({ "expected": "a finite number" })
1913 ),
1914 "upstream_inference_cost": Schema.optionalKey(
1915 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
1916 .annotate({ "format": "double" })
1917 ),
1918 "upstream_inference_prompt_cost": Schema.Number.annotate({ "format": "double" }).check(
1919 Schema.isFinite().annotate({ "expected": "a finite number" })
1920 )
1921 }),
1922 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
1923)
1924export type CreateWorkspaceRequest = {
1925 readonly "default_image_model"?: string | null
1926 readonly "default_provider_sort"?: string | null
1927 readonly "default_text_model"?: string | null
1928 readonly "description"?: string | null
1929 readonly "io_logging_api_key_ids"?: ReadonlyArray<number> | null
1930 readonly "io_logging_sampling_rate"?: number
1931 readonly "is_data_discount_logging_enabled"?: boolean
1932 readonly "is_observability_broadcast_enabled"?: boolean
1933 readonly "is_observability_io_logging_enabled"?: boolean
1934 readonly "name": string
1935 readonly "slug": string
1936}
1937export const CreateWorkspaceRequest = Schema.Struct({
1938 "default_image_model": Schema.optionalKey(
1939 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Default image model for this workspace" })
1940 ),
1941 "default_provider_sort": Schema.optionalKey(
1942 Schema.Union([Schema.String, Schema.Null]).annotate({
1943 "description": "Default provider sort preference (price, throughput, latency, exacto)"
1944 })
1945 ),
1946 "default_text_model": Schema.optionalKey(
1947 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Default text model for this workspace" })
1948 ),
1949 "description": Schema.optionalKey(
1950 Schema.Union([
1951 Schema.String.check(Schema.isMaxLength(500).annotate({ "expected": "a value with a length of at most 500" })),
1952 Schema.Null
1953 ]).annotate({ "description": "Description of the workspace" })
1954 ),
1955 "io_logging_api_key_ids": Schema.optionalKey(
1956 Schema.Union([
1957 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
1958 Schema.Null
1959 ]).annotate({ "description": "Optional array of API key IDs to filter I/O logging" })
1960 ),
1961 "io_logging_sampling_rate": Schema.optionalKey(
1962 Schema.Number.annotate({ "description": "Sampling rate for I/O logging (0.0001-1)", "format": "double" }).check(
1963 Schema.isFinite().annotate({ "expected": "a finite number" })
1964 )
1965 ),
1966 "is_data_discount_logging_enabled": Schema.optionalKey(
1967 Schema.Boolean.annotate({ "description": "Whether data discount logging is enabled" })
1968 ),
1969 "is_observability_broadcast_enabled": Schema.optionalKey(
1970 Schema.Boolean.annotate({ "description": "Whether broadcast is enabled" })
1971 ),
1972 "is_observability_io_logging_enabled": Schema.optionalKey(
1973 Schema.Boolean.annotate({ "description": "Whether private logging is enabled" })
1974 ),
1975 "name": Schema.String.annotate({ "description": "Name for the new workspace" }).check(
1976 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
1977 ).check(Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" })),
1978 "slug": Schema.String.annotate({
1979 "description":
1980 "URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens)"
1981 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
1982 Schema.isMaxLength(50).annotate({ "expected": "a value with a length of at most 50" })
1983 ).check(
1984 Schema.isPattern(new RegExp("^[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({
1985 "expected": "a string matching the RegExp ^[a-z0-9]+(?:-[a-z0-9]+)*$"
1986 })
1987 )
1988}).annotate({ "identifier": "CreateWorkspaceRequest" })
1989export type CustomTool = {
1990 readonly "description"?: string
1991 readonly "format"?: { readonly "type": "text" } | {
1992 readonly "definition": string
1993 readonly "syntax": "lark" | "regex"
1994 readonly "type": "grammar"
1995 }
1996 readonly "name": string
1997 readonly "type": "custom"
1998}
1999export const CustomTool = Schema.Struct({
2000 "description": Schema.optionalKey(Schema.String),
2001 "format": Schema.optionalKey(
2002 Schema.Union([
2003 Schema.Struct({ "type": Schema.Literal("text") }),
2004 Schema.Struct({
2005 "definition": Schema.String,
2006 "syntax": Schema.Literals(["lark", "regex"]),
2007 "type": Schema.Literal("grammar")
2008 })
2009 ])
2010 ),
2011 "name": Schema.String,
2012 "type": Schema.Literal("custom")
2013}).annotate({ "description": "Custom tool configuration", "identifier": "CustomTool" })
2014export type CustomToolCallInputDeltaEvent = {
2015 readonly "delta": string
2016 readonly "item_id": string
2017 readonly "output_index": number
2018 readonly "sequence_number": number
2019 readonly "type": "response.custom_tool_call_input.delta"
2020}
2021export const CustomToolCallInputDeltaEvent = Schema.Struct({
2022 "delta": Schema.String,
2023 "item_id": Schema.String,
2024 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2025 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2026 "type": Schema.Literal("response.custom_tool_call_input.delta")
2027}).annotate({
2028 "description":
2029 "Event emitted when a custom tool call's freeform input is being streamed. Mirrors `response.function_call_arguments.delta` but for `custom` tools whose input is opaque text rather than JSON arguments.",
2030 "identifier": "CustomToolCallInputDeltaEvent"
2031})
2032export type CustomToolCallInputDoneEvent = {
2033 readonly "input": string
2034 readonly "item_id": string
2035 readonly "output_index": number
2036 readonly "sequence_number": number
2037 readonly "type": "response.custom_tool_call_input.done"
2038}
2039export const CustomToolCallInputDoneEvent = Schema.Struct({
2040 "input": Schema.String,
2041 "item_id": Schema.String,
2042 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2043 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2044 "type": Schema.Literal("response.custom_tool_call_input.done")
2045}).annotate({
2046 "description":
2047 "Event emitted when a custom tool call's freeform input streaming is complete. Mirrors `response.function_call_arguments.done` but for `custom` tools.",
2048 "identifier": "CustomToolCallInputDoneEvent"
2049})
2050export type CustomToolCallItem = {
2051 readonly "call_id": string
2052 readonly "id"?: string
2053 readonly "input": string
2054 readonly "name": string
2055 readonly "namespace"?: string
2056 readonly "type": "custom_tool_call"
2057}
2058export const CustomToolCallItem = Schema.Struct({
2059 "call_id": Schema.String,
2060 "id": Schema.optionalKey(Schema.String),
2061 "input": Schema.String,
2062 "name": Schema.String,
2063 "namespace": Schema.optionalKey(
2064 Schema.String.annotate({
2065 "description": "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
2066 })
2067 ),
2068 "type": Schema.Literal("custom_tool_call")
2069}).annotate({
2070 "description":
2071 "A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments.",
2072 "identifier": "CustomToolCallItem"
2073})
2074export type DABenchmarkEntry = {
2075 readonly "arena": string
2076 readonly "category": string
2077 readonly "elo": number
2078 readonly "rank": number
2079 readonly "win_rate": number
2080}
2081export const DABenchmarkEntry = Schema.Struct({
2082 "arena": Schema.String.annotate({ "description": "Arena type (e.g. models, builders, agents)" }),
2083 "category": Schema.String.annotate({
2084 "description": "Category within the arena (e.g. website, gamedev, uicomponent)"
2085 }),
2086 "elo": Schema.Number.annotate({ "description": "ELO rating from head-to-head arena battles", "format": "double" })
2087 .check(Schema.isFinite().annotate({ "expected": "a finite number" })),
2088 "rank": Schema.Number.annotate({
2089 "description": "Rank position within this arena+category among models available on OpenRouter (1 = highest ELO)"
2090 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
2091 "win_rate": Schema.Number.annotate({ "description": "Win rate percentage in arena battles", "format": "double" })
2092 .check(Schema.isFinite().annotate({ "expected": "a finite number" }))
2093}).annotate({
2094 "description": "A single Design Arena benchmark entry for a specific arena+category",
2095 "identifier": "DABenchmarkEntry"
2096})
2097export type DatetimeServerToolConfig = { readonly "timezone"?: string }
2098export const DatetimeServerToolConfig = Schema.Struct({
2099 "timezone": Schema.optionalKey(
2100 Schema.String.annotate({ "description": "IANA timezone name (e.g. \"America/New_York\"). Defaults to UTC." })
2101 )
2102}).annotate({
2103 "description": "Configuration for the openrouter:datetime server tool",
2104 "identifier": "DatetimeServerToolConfig"
2105})
2106export type DebugEvent = {
2107 readonly "debug": {
2108 readonly "echo_upstream_body"?: {}
2109 readonly "timings"?: {
2110 readonly "epoch_ms": number
2111 readonly "event": "adapter_request" | "upstream_headers_received" | "first_token_received" | "upstream_body_ended"
2112 readonly "start_ms": number
2113 }
2114 }
2115 readonly "sequence_number": number
2116 readonly "type": "response.debug"
2117}
2118export const DebugEvent = Schema.Struct({
2119 "debug": Schema.Struct({
2120 "echo_upstream_body": Schema.optionalKey(Schema.Struct({})),
2121 "timings": Schema.optionalKey(Schema.Struct({
2122 "epoch_ms": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2123 "event": Schema.Literals([
2124 "adapter_request",
2125 "upstream_headers_received",
2126 "first_token_received",
2127 "upstream_body_ended"
2128 ]),
2129 "start_ms": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
2130 }))
2131 }),
2132 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2133 "type": Schema.Literal("response.debug")
2134}).annotate({
2135 "description":
2136 "Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones.",
2137 "identifier": "DebugEvent"
2138})
2139export type DefaultParameters = {
2140 readonly "frequency_penalty"?: number | null
2141 readonly "presence_penalty"?: number | null
2142 readonly "repetition_penalty"?: number | null
2143 readonly "temperature"?: number | null
2144 readonly "top_k"?: number | null
2145 readonly "top_p"?: number | null
2146} | null
2147export const DefaultParameters = Schema.Union([
2148 Schema.Struct({
2149 "frequency_penalty": Schema.optionalKey(
2150 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
2151 .annotate({ "format": "double" })
2152 ),
2153 "presence_penalty": Schema.optionalKey(
2154 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
2155 .annotate({ "format": "double" })
2156 ),
2157 "repetition_penalty": Schema.optionalKey(
2158 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
2159 .annotate({ "format": "double" })
2160 ),
2161 "temperature": Schema.optionalKey(
2162 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
2163 .annotate({ "format": "double" })
2164 ),
2165 "top_k": Schema.optionalKey(
2166 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2167 ),
2168 "top_p": Schema.optionalKey(
2169 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
2170 .annotate({ "format": "double" })
2171 )
2172 }),
2173 Schema.Null
2174]).annotate({ "description": "Default parameters for this model", "identifier": "DefaultParameters" })
2175export type DeleteBYOKKeyResponse = { readonly "deleted": true }
2176export const DeleteBYOKKeyResponse = Schema.Struct({
2177 "deleted": Schema.Literal(true).annotate({ "description": "Confirmation that the BYOK credential was deleted." })
2178}).annotate({ "identifier": "DeleteBYOKKeyResponse" })
2179export type DeleteGuardrailResponse = { readonly "deleted": true }
2180export const DeleteGuardrailResponse = Schema.Struct({
2181 "deleted": Schema.Literal(true).annotate({ "description": "Confirmation that the guardrail was deleted" })
2182}).annotate({ "identifier": "DeleteGuardrailResponse" })
2183export type DeleteObservabilityDestinationResponse = { readonly "deleted": true }
2184export const DeleteObservabilityDestinationResponse = Schema.Struct({
2185 "deleted": Schema.Literal(true).annotate({ "description": "Always `true` on success." })
2186}).annotate({ "identifier": "DeleteObservabilityDestinationResponse" })
2187export type DeleteWorkspaceBudgetResponse = { readonly "deleted": true }
2188export const DeleteWorkspaceBudgetResponse = Schema.Struct({
2189 "deleted": Schema.Literal(true).annotate({
2190 "description": "Confirmation that the budget was deleted (or did not exist)"
2191 })
2192}).annotate({ "identifier": "DeleteWorkspaceBudgetResponse" })
2193export type DeleteWorkspaceResponse = { readonly "deleted": true }
2194export const DeleteWorkspaceResponse = Schema.Struct({
2195 "deleted": Schema.Literal(true).annotate({ "description": "Confirmation that the workspace was deleted" })
2196}).annotate({ "identifier": "DeleteWorkspaceResponse" })
2197export type DeprecatedRoute = "fallback" | "sort" | null
2198export const DeprecatedRoute = Schema.Union([Schema.Literal("fallback"), Schema.Literal("sort"), Schema.Null]).annotate(
2199 {
2200 "description":
2201 "**DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: \"fallback\" (maps to \"model\"), \"sort\" (maps to \"none\").",
2202 "identifier": "DeprecatedRoute"
2203 }
2204)
2205export type EdgeNetworkTimeoutResponseErrorData = {
2206 readonly "code": number
2207 readonly "message": string
2208 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
2209}
2210export const EdgeNetworkTimeoutResponseErrorData = Schema.Struct({
2211 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2212 "message": Schema.String,
2213 "metadata": Schema.optionalKey(
2214 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
2215 )
2216}).annotate({
2217 "description": "Error data for EdgeNetworkTimeoutResponse",
2218 "identifier": "EdgeNetworkTimeoutResponseErrorData"
2219})
2220export type EndpointInfo = { readonly "model": string; readonly "provider": string; readonly "selected": boolean }
2221export const EndpointInfo = Schema.Struct({
2222 "model": Schema.String,
2223 "provider": Schema.String,
2224 "selected": Schema.Boolean
2225}).annotate({ "identifier": "EndpointInfo" })
2226export type EndpointStatus = 0 | -1 | -2 | -3 | -5 | -10
2227export const EndpointStatus = Schema.Literals([0, -1, -2, -3, -5, -10]).annotate({ "identifier": "EndpointStatus" })
2228export type EnumCapability = { readonly "type": "enum"; readonly "values": ReadonlyArray<string> }
2229export const EnumCapability = Schema.Struct({ "type": Schema.Literal("enum"), "values": Schema.Array(Schema.String) })
2230 .annotate({
2231 "description": "A parameter that accepts one of a discrete set of string values.",
2232 "identifier": "EnumCapability"
2233 })
2234export type ErrorEvent = {
2235 readonly "code": string | null
2236 readonly "message": string
2237 readonly "param": string | null
2238 readonly "sequence_number": number
2239 readonly "type": "error"
2240}
2241export const ErrorEvent = Schema.Struct({
2242 "code": Schema.Union([Schema.String, Schema.Null]),
2243 "message": Schema.String,
2244 "param": Schema.Union([Schema.String, Schema.Null]),
2245 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2246 "type": Schema.Literal("error")
2247}).annotate({ "description": "Event emitted when an error occurs during streaming", "identifier": "ErrorEvent" })
2248export type FileCitation = {
2249 readonly "file_id": string
2250 readonly "filename": string
2251 readonly "index": number
2252 readonly "type": "file_citation"
2253}
2254export const FileCitation = Schema.Struct({
2255 "file_id": Schema.String,
2256 "filename": Schema.String,
2257 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2258 "type": Schema.Literal("file_citation")
2259}).annotate({ "identifier": "FileCitation" })
2260export type FileDeleteResponse = { readonly "id": string; readonly "type": "file_deleted" }
2261export const FileDeleteResponse = Schema.Struct({ "id": Schema.String, "type": Schema.Literal("file_deleted") })
2262 .annotate({ "description": "Confirmation that a file was deleted.", "identifier": "FileDeleteResponse" })
2263export type FileMetadata = {
2264 readonly "created_at": string
2265 readonly "downloadable": boolean
2266 readonly "filename": string
2267 readonly "id": string
2268 readonly "mime_type": string
2269 readonly "size_bytes": number
2270 readonly "type": "file"
2271}
2272export const FileMetadata = Schema.Struct({
2273 "created_at": Schema.String,
2274 "downloadable": Schema.Boolean,
2275 "filename": Schema.String,
2276 "id": Schema.String,
2277 "mime_type": Schema.String,
2278 "size_bytes": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2279 "type": Schema.Literal("file")
2280}).annotate({ "description": "Metadata describing a stored file.", "identifier": "FileMetadata" })
2281export type FilePath = { readonly "file_id": string; readonly "index": number; readonly "type": "file_path" }
2282export const FilePath = Schema.Struct({
2283 "file_id": Schema.String,
2284 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2285 "type": Schema.Literal("file_path")
2286}).annotate({ "identifier": "FilePath" })
2287export type FilesServerToolConfig = {}
2288export const FilesServerToolConfig = Schema.Struct({}).annotate({
2289 "description": "Configuration for the openrouter:files server tool",
2290 "identifier": "FilesServerToolConfig"
2291})
2292export type ForbiddenResponseErrorData = {
2293 readonly "code": number
2294 readonly "message": string
2295 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
2296}
2297export const ForbiddenResponseErrorData = Schema.Struct({
2298 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2299 "message": Schema.String,
2300 "metadata": Schema.optionalKey(
2301 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
2302 )
2303}).annotate({ "description": "Error data for ForbiddenResponse", "identifier": "ForbiddenResponseErrorData" })
2304export type FormatJsonObjectConfig = { readonly "type": "json_object" }
2305export const FormatJsonObjectConfig = Schema.Struct({ "type": Schema.Literal("json_object") }).annotate({
2306 "description": "JSON object response format",
2307 "identifier": "FormatJsonObjectConfig"
2308})
2309export type FormatJsonSchemaConfig = {
2310 readonly "description"?: string
2311 readonly "name": string
2312 readonly "schema": {}
2313 readonly "strict"?: boolean | null
2314 readonly "type": "json_schema"
2315}
2316export const FormatJsonSchemaConfig = Schema.Struct({
2317 "description": Schema.optionalKey(Schema.String),
2318 "name": Schema.String,
2319 "schema": Schema.Struct({}),
2320 "strict": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
2321 "type": Schema.Literal("json_schema")
2322}).annotate({ "description": "JSON schema constrained response format", "identifier": "FormatJsonSchemaConfig" })
2323export type FormatTextConfig = { readonly "type": "text" }
2324export const FormatTextConfig = Schema.Struct({ "type": Schema.Literal("text") }).annotate({
2325 "description": "Plain text response format",
2326 "identifier": "FormatTextConfig"
2327})
2328export type FrameImage = {
2329 readonly "image_url": { readonly "url": string }
2330 readonly "type": "image_url"
2331 readonly "frame_type": "first_frame" | "last_frame"
2332}
2333export const FrameImage = Schema.Struct({
2334 "image_url": Schema.Struct({ "url": Schema.String }),
2335 "type": Schema.Literal("image_url"),
2336 "frame_type": Schema.Literals(["first_frame", "last_frame"]).annotate({
2337 "description": "Whether this image represents the first or last frame of the video"
2338 })
2339}).annotate({ "identifier": "FrameImage" })
2340export type FunctionCallArgsDeltaEvent = {
2341 readonly "delta": string
2342 readonly "item_id": string
2343 readonly "output_index": number
2344 readonly "sequence_number": number
2345 readonly "type": "response.function_call_arguments.delta"
2346}
2347export const FunctionCallArgsDeltaEvent = Schema.Struct({
2348 "delta": Schema.String,
2349 "item_id": Schema.String,
2350 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2351 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2352 "type": Schema.Literal("response.function_call_arguments.delta")
2353}).annotate({
2354 "description": "Event emitted when function call arguments are being streamed",
2355 "identifier": "FunctionCallArgsDeltaEvent"
2356})
2357export type FunctionCallArgsDoneEvent = {
2358 readonly "arguments": string
2359 readonly "item_id": string
2360 readonly "name": string
2361 readonly "output_index": number
2362 readonly "sequence_number": number
2363 readonly "type": "response.function_call_arguments.done"
2364}
2365export const FunctionCallArgsDoneEvent = Schema.Struct({
2366 "arguments": Schema.String,
2367 "item_id": Schema.String,
2368 "name": Schema.String,
2369 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2370 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2371 "type": Schema.Literal("response.function_call_arguments.done")
2372}).annotate({
2373 "description": "Event emitted when function call arguments streaming is complete",
2374 "identifier": "FunctionCallArgsDoneEvent"
2375})
2376export type FunctionTool = {
2377 readonly "description"?: string | null
2378 readonly "name": string
2379 readonly "parameters": { readonly [x: string]: Schema.Json } | null
2380 readonly "strict"?: boolean | null
2381 readonly "type": "function"
2382}
2383export const FunctionTool = Schema.Struct({
2384 "description": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
2385 "name": Schema.String,
2386 "parameters": Schema.Union([
2387 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })),
2388 Schema.Null
2389 ]),
2390 "strict": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
2391 "type": Schema.Literal("function")
2392}).annotate({ "description": "Function tool definition", "identifier": "FunctionTool" })
2393export type Arrays_1 = ReadonlyArray<string>
2394export const Arrays_1 = Schema.Array(Schema.String)
2395export type Arrays_2 = ReadonlyArray<string>
2396export const Arrays_2 = Schema.Array(Schema.String)
2397export type Arrays_3 = ReadonlyArray<
2398 {
2399 readonly "stances": ReadonlyArray<{ readonly "model": string; readonly "stance": string }>
2400 readonly "topic": string
2401 }
2402>
2403export const Arrays_3 = Schema.Array(
2404 Schema.Struct({
2405 "stances": Schema.Array(Schema.Struct({ "model": Schema.String, "stance": Schema.String })),
2406 "topic": Schema.String
2407 })
2408)
2409export type Arrays_4 = ReadonlyArray<{ readonly "models": ReadonlyArray<string>; readonly "point": string }>
2410export const Arrays_4 = Schema.Array(Schema.Struct({ "models": Schema.Array(Schema.String), "point": Schema.String }))
2411export type Arrays_5 = ReadonlyArray<{ readonly "insight": string; readonly "model": string }>
2412export const Arrays_5 = Schema.Array(Schema.Struct({ "insight": Schema.String, "model": Schema.String }))
2413export type FusionCallAnalysisInProgressEvent = {
2414 readonly "item_id": string
2415 readonly "judge_model": string
2416 readonly "output_index": number
2417 readonly "sequence_number": number
2418 readonly "type": "response.fusion_call.analysis.in_progress"
2419}
2420export const FusionCallAnalysisInProgressEvent = Schema.Struct({
2421 "item_id": Schema.String,
2422 "judge_model": Schema.String,
2423 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2424 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2425 "type": Schema.Literal("response.fusion_call.analysis.in_progress")
2426}).annotate({
2427 "description": "Emitted when the fusion judge starts producing the structured analysis.",
2428 "identifier": "FusionCallAnalysisInProgressEvent"
2429})
2430export type FusionCallCompletedEvent = {
2431 readonly "item_id": string
2432 readonly "output_index": number
2433 readonly "sequence_number": number
2434 readonly "type": "response.fusion_call.completed"
2435}
2436export const FusionCallCompletedEvent = Schema.Struct({
2437 "item_id": Schema.String,
2438 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2439 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2440 "type": Schema.Literal("response.fusion_call.completed")
2441}).annotate({
2442 "description": "Emitted when the openrouter:fusion tool call finishes.",
2443 "identifier": "FusionCallCompletedEvent"
2444})
2445export type FusionCallInProgressEvent = {
2446 readonly "item_id": string
2447 readonly "output_index": number
2448 readonly "sequence_number": number
2449 readonly "type": "response.fusion_call.in_progress"
2450}
2451export const FusionCallInProgressEvent = Schema.Struct({
2452 "item_id": Schema.String,
2453 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2454 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2455 "type": Schema.Literal("response.fusion_call.in_progress")
2456}).annotate({
2457 "description": "Emitted when an openrouter:fusion tool call begins executing.",
2458 "identifier": "FusionCallInProgressEvent"
2459})
2460export type FusionCallPanelAddedEvent = {
2461 readonly "item_id": string
2462 readonly "model": string
2463 readonly "output_index": number
2464 readonly "sequence_number": number
2465 readonly "type": "response.fusion_call.panel.added"
2466}
2467export const FusionCallPanelAddedEvent = Schema.Struct({
2468 "item_id": Schema.String,
2469 "model": Schema.String,
2470 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2471 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2472 "type": Schema.Literal("response.fusion_call.panel.added")
2473}).annotate({
2474 "description": "Emitted when a fusion analysis-panel model starts.",
2475 "identifier": "FusionCallPanelAddedEvent"
2476})
2477export type FusionCallPanelCompletedEvent = {
2478 readonly "content": string
2479 readonly "item_id": string
2480 readonly "model": string
2481 readonly "output_index": number
2482 readonly "sequence_number": number
2483 readonly "type": "response.fusion_call.panel.completed"
2484}
2485export const FusionCallPanelCompletedEvent = Schema.Struct({
2486 "content": Schema.String,
2487 "item_id": Schema.String,
2488 "model": Schema.String,
2489 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2490 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2491 "type": Schema.Literal("response.fusion_call.panel.completed")
2492}).annotate({
2493 "description": "Emitted when a fusion panel model finishes with its full content.",
2494 "identifier": "FusionCallPanelCompletedEvent"
2495})
2496export type FusionCallPanelDeltaEvent = {
2497 readonly "delta": string
2498 readonly "item_id": string
2499 readonly "model": string
2500 readonly "output_index": number
2501 readonly "sequence_number": number
2502 readonly "type": "response.fusion_call.panel.delta"
2503}
2504export const FusionCallPanelDeltaEvent = Schema.Struct({
2505 "delta": Schema.String,
2506 "item_id": Schema.String,
2507 "model": Schema.String,
2508 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2509 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2510 "type": Schema.Literal("response.fusion_call.panel.delta")
2511}).annotate({
2512 "description": "Incremental content token from a fusion panel model.",
2513 "identifier": "FusionCallPanelDeltaEvent"
2514})
2515export type FusionCallPanelFailedEvent = {
2516 readonly "error": string
2517 readonly "item_id": string
2518 readonly "model": string
2519 readonly "output_index": number
2520 readonly "sequence_number": number
2521 readonly "status_code"?: number
2522 readonly "type": "response.fusion_call.panel.failed"
2523}
2524export const FusionCallPanelFailedEvent = Schema.Struct({
2525 "error": Schema.String,
2526 "item_id": Schema.String,
2527 "model": Schema.String,
2528 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2529 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2530 "status_code": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
2531 "type": Schema.Literal("response.fusion_call.panel.failed")
2532}).annotate({ "description": "Emitted when a fusion panel model fails.", "identifier": "FusionCallPanelFailedEvent" })
2533export type FusionCallPanelReasoningDeltaEvent = {
2534 readonly "delta": string
2535 readonly "item_id": string
2536 readonly "model": string
2537 readonly "output_index": number
2538 readonly "sequence_number": number
2539 readonly "type": "response.fusion_call.panel.reasoning.delta"
2540}
2541export const FusionCallPanelReasoningDeltaEvent = Schema.Struct({
2542 "delta": Schema.String,
2543 "item_id": Schema.String,
2544 "model": Schema.String,
2545 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2546 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2547 "type": Schema.Literal("response.fusion_call.panel.reasoning.delta")
2548}).annotate({
2549 "description": "Incremental reasoning token from a fusion panel model.",
2550 "identifier": "FusionCallPanelReasoningDeltaEvent"
2551})
2552export type FusionPlugin = {
2553 readonly "analysis_models"?: ReadonlyArray<string>
2554 readonly "enabled"?: boolean
2555 readonly "id": "fusion"
2556 readonly "max_tool_calls"?: number
2557 readonly "model"?: string
2558 readonly "preset"?: "general-high" | "general-budget" | "general-fast"
2559 readonly "tools"?: ReadonlyArray<{ readonly "parameters"?: {}; readonly "type": string }>
2560}
2561export const FusionPlugin = Schema.Struct({
2562 "analysis_models": Schema.optionalKey(
2563 Schema.Array(Schema.String).annotate({
2564 "description":
2565 "Slugs of models to run in parallel as the \"expert panel\" the judge analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capped at 8 models to bound cost amplification. When omitted, defaults to the Quality preset from the /labs/fusion UI (~anthropic/claude-opus-latest, ~openai/gpt-latest, ~google/gemini-pro-latest)."
2566 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
2567 Schema.isMaxLength(8).annotate({ "expected": "a value with a length of at most 8" })
2568 )
2569 ),
2570 "enabled": Schema.optionalKey(
2571 Schema.Boolean.annotate({
2572 "description": "Set to false to disable the fusion plugin for this request. Defaults to true."
2573 })
2574 ),
2575 "id": Schema.Literal("fusion"),
2576 "max_tool_calls": Schema.optionalKey(
2577 Schema.Number.annotate({
2578 "description":
2579 "Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16."
2580 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
2581 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
2582 ).check(Schema.isLessThanOrEqualTo(16).annotate({ "expected": "a value less than or equal to 16" }))
2583 ),
2584 "model": Schema.optionalKey(
2585 Schema.String.annotate({
2586 "description":
2587 "Slug of the model that performs both the judge step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset."
2588 })
2589 ),
2590 "preset": Schema.optionalKey(
2591 Schema.Literals(["general-high", "general-budget", "general-fast"]).annotate({
2592 "description":
2593 "A curated OpenRouter fusion preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and judge model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence."
2594 })
2595 ),
2596 "tools": Schema.optionalKey(
2597 Schema.Array(Schema.Struct({
2598 "parameters": Schema.optionalKey(
2599 Schema.Struct({}).annotate({
2600 "description": "Optional configuration forwarded as the tool's `parameters` object."
2601 })
2602 ),
2603 "type": Schema.String.annotate({
2604 "description": "Server tool type identifier (e.g. \"openrouter:web_search\", \"openrouter:web_fetch\")."
2605 })
2606 })).annotate({
2607 "description":
2608 "Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: \"openrouter:web_search\" }, { type: \"openrouter:web_fetch\" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only)."
2609 }).check(Schema.isMaxLength(8).annotate({ "expected": "a value with a length of at most 8" }))
2610 )
2611}).annotate({ "identifier": "FusionPlugin" })
2612export type Arrays_6 = ReadonlyArray<string>
2613export const Arrays_6 = Schema.Array(Schema.String).annotate({
2614 "description":
2615 "Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion."
2616}).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
2617 Schema.isMaxLength(8).annotate({ "expected": "a value with a length of at most 8" })
2618)
2619export type Objects_9 = {
2620 readonly "effort"?: "max" | "xhigh" | "high" | "medium" | "low" | "minimal" | "none"
2621 readonly "max_tokens"?: number
2622}
2623export const Objects_9 = Schema.Struct({
2624 "effort": Schema.optionalKey(
2625 Schema.Literals(["max", "xhigh", "high", "medium", "low", "minimal", "none"]).annotate({
2626 "description": "Reasoning effort level for panelist and judge inner calls."
2627 })
2628 ),
2629 "max_tokens": Schema.optionalKey(
2630 Schema.Number.annotate({
2631 "description":
2632 "Maximum number of reasoning tokens each panelist and judge model may use. Helps bound cost when models allocate too much budget to chain-of-thought."
2633 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
2634 )
2635}).annotate({
2636 "description":
2637 "Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking."
2638})
2639export type Arrays_7 = ReadonlyArray<{ readonly "parameters"?: {}; readonly "type": string }>
2640export const Arrays_7 = Schema.Array(Schema.Struct({
2641 "parameters": Schema.optionalKey(
2642 Schema.Struct({}).annotate({ "description": "Optional configuration forwarded as the tool's `parameters` object." })
2643 ),
2644 "type": Schema.String.annotate({
2645 "description": "Server tool type identifier (e.g. \"openrouter:web_search\", \"openrouter:web_fetch\")."
2646 })
2647})).annotate({
2648 "description":
2649 "Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: \"openrouter:web_search\" }, { type: \"openrouter:web_fetch\" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only)."
2650}).check(Schema.isMaxLength(8).annotate({ "expected": "a value with a length of at most 8" }))
2651export type FusionSource = { readonly "title": string; readonly "url": string }
2652export const FusionSource = Schema.Struct({
2653 "title": Schema.String.annotate({ "description": "Title of the retrieved web page." }),
2654 "url": Schema.String.annotate({
2655 "description": "URL of the web page a panel or the judge retrieved during the run."
2656 })
2657}).annotate({ "description": "A web page retrieved via web search during a fusion run.", "identifier": "FusionSource" })
2658export type GenerationContentData = {
2659 readonly "input": { readonly "prompt": string } | { readonly "messages": ReadonlyArray<Schema.Json> }
2660 readonly "output": { readonly "completion": string | null; readonly "reasoning": string | null }
2661}
2662export const GenerationContentData = Schema.Struct({
2663 "input": Schema.Union([
2664 Schema.Struct({ "prompt": Schema.String }),
2665 Schema.Struct({ "messages": Schema.Array(Schema.Json.annotate({ "expected": "JSON value" })) })
2666 ]).annotate({ "description": "The input to the generation — either a prompt string or an array of messages" }),
2667 "output": Schema.Struct({
2668 "completion": Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "The completion output" }),
2669 "reasoning": Schema.Union([Schema.String, Schema.Null]).annotate({
2670 "description": "Reasoning/thinking output, if any"
2671 })
2672 }).annotate({ "description": "The output from the generation" })
2673}).annotate({ "description": "Stored prompt and completion content", "identifier": "GenerationContentData" })
2674export type GoneResponseErrorData = {
2675 readonly "code": number
2676 readonly "message": string
2677 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
2678}
2679export const GoneResponseErrorData = Schema.Struct({
2680 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2681 "message": Schema.String,
2682 "metadata": Schema.optionalKey(
2683 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
2684 )
2685}).annotate({ "description": "Error data for GoneResponse", "identifier": "GoneResponseErrorData" })
2686export type GuardrailInterval = "daily" | "weekly" | "monthly" | null
2687export const GuardrailInterval = Schema.Union([
2688 Schema.Literal("daily"),
2689 Schema.Literal("weekly"),
2690 Schema.Literal("monthly"),
2691 Schema.Null
2692]).annotate({
2693 "description": "Interval at which the limit resets (daily, weekly, monthly)",
2694 "identifier": "GuardrailInterval"
2695})
2696export type ImageConfig = {}
2697export const ImageConfig = Schema.Struct({}).annotate({
2698 "description":
2699 "Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details.",
2700 "identifier": "ImageConfig"
2701})
2702export type ImageGenCallCompletedEvent = {
2703 readonly "item_id": string
2704 readonly "output_index": number
2705 readonly "sequence_number": number
2706 readonly "type": "response.image_generation_call.completed"
2707}
2708export const ImageGenCallCompletedEvent = Schema.Struct({
2709 "item_id": Schema.String,
2710 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2711 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2712 "type": Schema.Literal("response.image_generation_call.completed")
2713}).annotate({ "description": "Image generation call completed", "identifier": "ImageGenCallCompletedEvent" })
2714export type ImageGenCallGeneratingEvent = {
2715 readonly "item_id": string
2716 readonly "output_index": number
2717 readonly "sequence_number": number
2718 readonly "type": "response.image_generation_call.generating"
2719}
2720export const ImageGenCallGeneratingEvent = Schema.Struct({
2721 "item_id": Schema.String,
2722 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2723 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2724 "type": Schema.Literal("response.image_generation_call.generating")
2725}).annotate({ "description": "Image generation call is generating", "identifier": "ImageGenCallGeneratingEvent" })
2726export type ImageGenCallInProgressEvent = {
2727 readonly "item_id": string
2728 readonly "output_index": number
2729 readonly "sequence_number": number
2730 readonly "type": "response.image_generation_call.in_progress"
2731}
2732export const ImageGenCallInProgressEvent = Schema.Struct({
2733 "item_id": Schema.String,
2734 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2735 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2736 "type": Schema.Literal("response.image_generation_call.in_progress")
2737}).annotate({ "description": "Image generation call in progress", "identifier": "ImageGenCallInProgressEvent" })
2738export type ImageGenCallPartialImageEvent = {
2739 readonly "item_id": string
2740 readonly "output_index": number
2741 readonly "partial_image_b64": string
2742 readonly "partial_image_index": number
2743 readonly "sequence_number": number
2744 readonly "type": "response.image_generation_call.partial_image"
2745}
2746export const ImageGenCallPartialImageEvent = Schema.Struct({
2747 "item_id": Schema.String,
2748 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2749 "partial_image_b64": Schema.String,
2750 "partial_image_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2751 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2752 "type": Schema.Literal("response.image_generation_call.partial_image")
2753}).annotate({
2754 "description": "Image generation call with partial image",
2755 "identifier": "ImageGenCallPartialImageEvent"
2756})
2757export type ImageGenerationServerTool = {
2758 readonly "background"?: "transparent" | "opaque" | "auto"
2759 readonly "input_fidelity"?: "high" | "low" | null
2760 readonly "input_image_mask"?: { readonly "file_id"?: string; readonly "image_url"?: string }
2761 readonly "model"?: string
2762 readonly "moderation"?: "auto" | "low"
2763 readonly "output_compression"?: number
2764 readonly "output_format"?: "png" | "webp" | "jpeg"
2765 readonly "partial_images"?: number
2766 readonly "quality"?: "low" | "medium" | "high" | "auto"
2767 readonly "size"?: string
2768 readonly "type": "image_generation"
2769}
2770export const ImageGenerationServerTool = Schema.Struct({
2771 "background": Schema.optionalKey(Schema.Literals(["transparent", "opaque", "auto"])),
2772 "input_fidelity": Schema.optionalKey(Schema.Union([Schema.Literal("high"), Schema.Literal("low"), Schema.Null])),
2773 "input_image_mask": Schema.optionalKey(
2774 Schema.Struct({ "file_id": Schema.optionalKey(Schema.String), "image_url": Schema.optionalKey(Schema.String) })
2775 ),
2776 "model": Schema.optionalKey(Schema.String),
2777 "moderation": Schema.optionalKey(Schema.Literals(["auto", "low"])),
2778 "output_compression": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
2779 "output_format": Schema.optionalKey(Schema.Literals(["png", "webp", "jpeg"])),
2780 "partial_images": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
2781 "quality": Schema.optionalKey(Schema.Literals(["low", "medium", "high", "auto"])),
2782 "size": Schema.optionalKey(Schema.String),
2783 "type": Schema.Literal("image_generation")
2784}).annotate({ "description": "Image generation tool configuration", "identifier": "ImageGenerationServerTool" })
2785export type ImageGenerationServerToolConfig = { readonly "model"?: string }
2786export const ImageGenerationServerToolConfig = Schema.Struct({
2787 "model": Schema.optionalKey(
2788 Schema.String.annotate({
2789 "description":
2790 "Which image generation model to use (e.g. \"openai/gpt-5-image\"). Defaults to \"openai/gpt-5-image\"."
2791 })
2792 )
2793}).annotate({
2794 "description":
2795 "Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field.",
2796 "identifier": "ImageGenerationServerToolConfig"
2797})
2798export type ImageGenerationStatus = "in_progress" | "completed" | "generating" | "failed"
2799export const ImageGenerationStatus = Schema.Literals(["in_progress", "completed", "generating", "failed"]).annotate({
2800 "identifier": "ImageGenerationStatus"
2801})
2802export type Union_6 = {
2803 readonly "audio_tokens"?: number | null
2804 readonly "image_tokens"?: number | null
2805 readonly "reasoning_tokens"?: number | null
2806 readonly [x: string]: Schema.Json
2807} | null
2808export const Union_6 = Schema.Union([
2809 Schema.StructWithRest(
2810 Schema.Struct({
2811 "audio_tokens": Schema.optionalKey(
2812 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2813 .annotate({ "description": "Tokens generated by the model for audio output." })
2814 ),
2815 "image_tokens": Schema.optionalKey(
2816 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2817 .annotate({ "description": "Tokens generated by the model for image output." })
2818 ),
2819 "reasoning_tokens": Schema.optionalKey(
2820 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2821 .annotate({ "description": "Tokens generated by the model for reasoning." })
2822 )
2823 }),
2824 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
2825 ),
2826 Schema.Null
2827])
2828export type Union_8 = {
2829 readonly "audio_tokens"?: number | null
2830 readonly "cache_write_tokens"?: number | null
2831 readonly "cached_tokens"?: number | null
2832 readonly "file_tokens"?: number | null
2833 readonly "video_tokens"?: number | null
2834 readonly [x: string]: Schema.Json
2835} | null
2836export const Union_8 = Schema.Union([
2837 Schema.StructWithRest(
2838 Schema.Struct({
2839 "audio_tokens": Schema.optionalKey(
2840 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2841 .annotate({ "description": "Tokens used for input audio." })
2842 ),
2843 "cache_write_tokens": Schema.optionalKey(
2844 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2845 .annotate({
2846 "description":
2847 "Tokens written to cache. Only returned for models with explicit caching and cache write pricing."
2848 })
2849 ),
2850 "cached_tokens": Schema.optionalKey(
2851 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2852 .annotate({ "description": "Tokens cached by the endpoint." })
2853 ),
2854 "file_tokens": Schema.optionalKey(
2855 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2856 .annotate({ "description": "Tokens used for input files/documents." })
2857 ),
2858 "video_tokens": Schema.optionalKey(
2859 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2860 .annotate({ "description": "Tokens used for input video." })
2861 )
2862 }),
2863 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
2864 ),
2865 Schema.Null
2866]).annotate({ "description": "Breakdown of tokens used in the prompt." })
2867export type Union_9 = {
2868 readonly "tool_calls_executed"?: number | null
2869 readonly "tool_calls_requested"?: number | null
2870 readonly "web_search_requests"?: number | null
2871 readonly [x: string]: Schema.Json
2872} | null
2873export const Union_9 = Schema.Union([
2874 Schema.StructWithRest(
2875 Schema.Struct({
2876 "tool_calls_executed": Schema.optionalKey(
2877 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2878 .annotate({ "description": "Number of OpenRouter server tool calls that executed and produced a result." })
2879 ),
2880 "tool_calls_requested": Schema.optionalKey(
2881 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2882 .annotate({
2883 "description":
2884 "Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here."
2885 })
2886 ),
2887 "web_search_requests": Schema.optionalKey(
2888 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
2889 .annotate({
2890 "description":
2891 "Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two."
2892 })
2893 )
2894 }),
2895 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
2896 ),
2897 Schema.Null
2898]).annotate({ "description": "Usage for server-side tool execution (e.g., web search)" })
2899export type ImageGenPartialImageEvent = {
2900 readonly "b64_json": string
2901 readonly "partial_image_index": number
2902 readonly "type": "image_generation.partial_image"
2903}
2904export const ImageGenPartialImageEvent = Schema.Struct({
2905 "b64_json": Schema.String.annotate({ "description": "Base64-encoded partial image data" }),
2906 "partial_image_index": Schema.Number.annotate({
2907 "description": "0-based index indicating which partial image this is in the sequence"
2908 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
2909 "type": Schema.Literal("image_generation.partial_image").annotate({ "description": "The event type" })
2910}).annotate({
2911 "description": "Emitted when a partial image becomes available during streaming generation",
2912 "identifier": "ImageGenPartialImageEvent"
2913})
2914export type ImageGenStreamErrorEvent = {
2915 readonly "error": {
2916 readonly "code"?: string | null
2917 readonly "message": string
2918 readonly "param"?: string | null
2919 readonly "type"?: string | null
2920 }
2921 readonly "type": "error"
2922}
2923export const ImageGenStreamErrorEvent = Schema.Struct({
2924 "error": Schema.Struct({
2925 "code": Schema.optionalKey(
2926 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Provider error code, when supplied" })
2927 ),
2928 "message": Schema.String.annotate({ "description": "Provider error message" }),
2929 "param": Schema.optionalKey(
2930 Schema.Union([Schema.String, Schema.Null]).annotate({
2931 "description": "Request parameter associated with the error, when supplied"
2932 })
2933 ),
2934 "type": Schema.optionalKey(
2935 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Provider error type, when supplied" })
2936 )
2937 }).annotate({ "description": "Provider error details" }),
2938 "type": Schema.Literal("error").annotate({ "description": "The event type" })
2939}).annotate({
2940 "description": "Emitted when streaming generation fails after the SSE response starts",
2941 "identifier": "ImageGenStreamErrorEvent"
2942})
2943export type ImageGenTextChunkEvent = {
2944 readonly "phase": "content" | "reasoning" | "draft"
2945 readonly "text": string
2946 readonly "type": "image_generation.text_chunk"
2947}
2948export const ImageGenTextChunkEvent = Schema.Struct({
2949 "phase": Schema.Literals(["content", "reasoning", "draft"]).annotate({
2950 "description":
2951 "The generation phase this chunk belongs to. `content` is the renderable output; `reasoning` and `draft` are intermediate provider phases."
2952 }),
2953 "text": Schema.String.annotate({
2954 "description": "A text fragment of the image being generated (e.g. partial SVG markup)"
2955 }),
2956 "type": Schema.Literal("image_generation.text_chunk").annotate({ "description": "The event type" })
2957}).annotate({
2958 "description":
2959 "Emitted when a text chunk becomes available during streaming generation of text-based formats (e.g. SVG)",
2960 "identifier": "ImageGenTextChunkEvent"
2961})
2962export type ImageInputModality = "text" | "image" | "file" | "audio" | "video"
2963export const ImageInputModality = Schema.Literals(["text", "image", "file", "audio", "video"]).annotate({
2964 "identifier": "ImageInputModality"
2965})
2966export type ImageOutputModality =
2967 | "text"
2968 | "image"
2969 | "embeddings"
2970 | "audio"
2971 | "video"
2972 | "rerank"
2973 | "speech"
2974 | "transcription"
2975export const ImageOutputModality = Schema.Literals([
2976 "text",
2977 "image",
2978 "embeddings",
2979 "audio",
2980 "video",
2981 "rerank",
2982 "speech",
2983 "transcription"
2984]).annotate({ "identifier": "ImageOutputModality" })
2985export type ImagePricingEntry = {
2986 readonly "billable": "output_image" | "input_image" | "input_font" | "input_reference" | "input_text"
2987 readonly "cost_usd": number
2988 readonly "unit": "image" | "megapixel" | "token"
2989 readonly "variant"?: string
2990}
2991export const ImagePricingEntry = Schema.Struct({
2992 "billable": Schema.Literals(["output_image", "input_image", "input_font", "input_reference", "input_text"]),
2993 "cost_usd": Schema.Number.annotate({ "format": "double" }).check(
2994 Schema.isFinite().annotate({ "expected": "a finite number" })
2995 ),
2996 "unit": Schema.Literals(["image", "megapixel", "token"]),
2997 "variant": Schema.optionalKey(Schema.String)
2998}).annotate({ "description": "One billable pricing line for an image provider.", "identifier": "ImagePricingEntry" })
2999export type IncompleteDetails = {
3000 readonly "reason"?: "max_output_tokens" | "content_filter"
3001 readonly [x: string]: Schema.Json
3002} | null
3003export const IncompleteDetails = Schema.Union([
3004 Schema.StructWithRest(
3005 Schema.Struct({ "reason": Schema.optionalKey(Schema.Literals(["max_output_tokens", "content_filter"])) }),
3006 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
3007 ),
3008 Schema.Null
3009]).annotate({ "identifier": "IncompleteDetails" })
3010export type InputAudio = {
3011 readonly "input_audio": { readonly "data": string; readonly "format": "mp3" | "wav" }
3012 readonly "type": "input_audio"
3013}
3014export const InputAudio = Schema.Struct({
3015 "input_audio": Schema.Struct({ "data": Schema.String, "format": Schema.Literals(["mp3", "wav"]) }),
3016 "type": Schema.Literal("input_audio")
3017}).annotate({ "description": "Audio input content item", "identifier": "InputAudio" })
3018export type InputFile = {
3019 readonly "file_data"?: string
3020 readonly "file_id"?: string | null
3021 readonly "file_url"?: string
3022 readonly "filename"?: string
3023 readonly "type": "input_file"
3024}
3025export const InputFile = Schema.Struct({
3026 "file_data": Schema.optionalKey(Schema.String),
3027 "file_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
3028 "file_url": Schema.optionalKey(Schema.String),
3029 "filename": Schema.optionalKey(Schema.String),
3030 "type": Schema.Literal("input_file")
3031}).annotate({ "description": "File input content item", "identifier": "InputFile" })
3032export type InputImage = {
3033 readonly "detail": "auto" | "high" | "low" | "original"
3034 readonly "image_url"?: string | null
3035 readonly "type": "input_image"
3036}
3037export const InputImage = Schema.Struct({
3038 "detail": Schema.Literals(["auto", "high", "low", "original"]),
3039 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
3040 "type": Schema.Literal("input_image")
3041}).annotate({ "description": "Image input content item", "identifier": "InputImage" })
3042export type InputModality = "text" | "image" | "file" | "audio" | "video"
3043export const InputModality = Schema.Literals(["text", "image", "file", "audio", "video"]).annotate({
3044 "identifier": "InputModality"
3045})
3046export type InputVideo = { readonly "type": "input_video"; readonly "video_url": string }
3047export const InputVideo = Schema.Struct({
3048 "type": Schema.Literal("input_video"),
3049 "video_url": Schema.String.annotate({
3050 "description": "A base64 data URL or remote URL that resolves to a video file"
3051 })
3052}).annotate({ "description": "Video input content item", "identifier": "InputVideo" })
3053export type InstructType =
3054 | "none"
3055 | "airoboros"
3056 | "alpaca"
3057 | "alpaca-modif"
3058 | "chatml"
3059 | "claude"
3060 | "code-llama"
3061 | "gemma"
3062 | "llama2"
3063 | "llama3"
3064 | "mistral"
3065 | "nemotron"
3066 | "neural"
3067 | "openchat"
3068 | "phi3"
3069 | "rwkv"
3070 | "vicuna"
3071 | "zephyr"
3072 | "deepseek-r1"
3073 | "deepseek-v3.1"
3074 | "qwq"
3075 | "qwen3"
3076 | null
3077export const InstructType = Schema.Union([
3078 Schema.Literal("none"),
3079 Schema.Literal("airoboros"),
3080 Schema.Literal("alpaca"),
3081 Schema.Literal("alpaca-modif"),
3082 Schema.Literal("chatml"),
3083 Schema.Literal("claude"),
3084 Schema.Literal("code-llama"),
3085 Schema.Literal("gemma"),
3086 Schema.Literal("llama2"),
3087 Schema.Literal("llama3"),
3088 Schema.Literal("mistral"),
3089 Schema.Literal("nemotron"),
3090 Schema.Literal("neural"),
3091 Schema.Literal("openchat"),
3092 Schema.Literal("phi3"),
3093 Schema.Literal("rwkv"),
3094 Schema.Literal("vicuna"),
3095 Schema.Literal("zephyr"),
3096 Schema.Literal("deepseek-r1"),
3097 Schema.Literal("deepseek-v3.1"),
3098 Schema.Literal("qwq"),
3099 Schema.Literal("qwen3"),
3100 Schema.Null
3101]).annotate({ "description": "Instruction format type", "identifier": "InstructType" })
3102export type InternalServerResponseErrorData = {
3103 readonly "code": number
3104 readonly "message": string
3105 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
3106}
3107export const InternalServerResponseErrorData = Schema.Struct({
3108 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3109 "message": Schema.String,
3110 "metadata": Schema.optionalKey(
3111 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
3112 )
3113}).annotate({ "description": "Error data for InternalServerResponse", "identifier": "InternalServerResponseErrorData" })
3114export type ItemReferenceItem = { readonly "id": string; readonly "type": "item_reference" }
3115export const ItemReferenceItem = Schema.Struct({ "id": Schema.String, "type": Schema.Literal("item_reference") })
3116 .annotate({ "description": "A reference to a previous response item by ID", "identifier": "ItemReferenceItem" })
3117export type KeyAssignment = {
3118 readonly "assigned_by": string | null
3119 readonly "created_at": string
3120 readonly "guardrail_id": string
3121 readonly "id": string
3122 readonly "key_hash": string
3123 readonly "key_label": string
3124 readonly "key_name": string
3125}
3126export const KeyAssignment = Schema.Struct({
3127 "assigned_by": Schema.Union([Schema.String, Schema.Null]).annotate({
3128 "description": "User ID of who made the assignment"
3129 }),
3130 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the assignment was created" }),
3131 "guardrail_id": Schema.String.annotate({ "description": "ID of the guardrail", "format": "uuid" }),
3132 "id": Schema.String.annotate({ "description": "Unique identifier for the assignment", "format": "uuid" }),
3133 "key_hash": Schema.String.annotate({ "description": "Hash of the assigned API key" }),
3134 "key_label": Schema.String.annotate({ "description": "Label of the API key" }),
3135 "key_name": Schema.String.annotate({ "description": "Name of the API key" })
3136}).annotate({ "identifier": "KeyAssignment" })
3137export type Legacy_ChatContentVideoInput = { readonly "url": string }
3138export const Legacy_ChatContentVideoInput = Schema.Struct({
3139 "url": Schema.String.annotate({ "description": "URL of the video (data: URLs supported)" })
3140}).annotate({ "description": "Video input object", "identifier": "Legacy_ChatContentVideoInput" })
3141export type McpApprovalRequestItem = {
3142 readonly "arguments": string
3143 readonly "id": string
3144 readonly "name": string
3145 readonly "server_label": string
3146 readonly "type": "mcp_approval_request"
3147}
3148export const McpApprovalRequestItem = Schema.Struct({
3149 "arguments": Schema.String,
3150 "id": Schema.String,
3151 "name": Schema.String,
3152 "server_label": Schema.String,
3153 "type": Schema.Literal("mcp_approval_request")
3154}).annotate({ "description": "Request for approval to execute an MCP tool", "identifier": "McpApprovalRequestItem" })
3155export type McpApprovalResponseItem = {
3156 readonly "approval_request_id": string
3157 readonly "approve": boolean
3158 readonly "id"?: string | null
3159 readonly "reason"?: string | null
3160 readonly "type": "mcp_approval_response"
3161}
3162export const McpApprovalResponseItem = Schema.Struct({
3163 "approval_request_id": Schema.String,
3164 "approve": Schema.Boolean,
3165 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
3166 "reason": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
3167 "type": Schema.Literal("mcp_approval_response")
3168}).annotate({ "description": "User response to an MCP tool approval request", "identifier": "McpApprovalResponseItem" })
3169export type McpCallItem = {
3170 readonly "arguments": string
3171 readonly "error"?: string | null
3172 readonly "id": string
3173 readonly "name": string
3174 readonly "output"?: string | null
3175 readonly "server_label": string
3176 readonly "type": "mcp_call"
3177}
3178export const McpCallItem = Schema.Struct({
3179 "arguments": Schema.String,
3180 "error": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
3181 "id": Schema.String,
3182 "name": Schema.String,
3183 "output": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
3184 "server_label": Schema.String,
3185 "type": Schema.Literal("mcp_call")
3186}).annotate({ "description": "An MCP tool call with its output or error", "identifier": "McpCallItem" })
3187export type McpListToolsItem = {
3188 readonly "error"?: string | null
3189 readonly "id": string
3190 readonly "server_label": string
3191 readonly "tools": ReadonlyArray<
3192 {
3193 readonly "annotations"?: Schema.Json
3194 readonly "description"?: string | null
3195 readonly "input_schema": {}
3196 readonly "name": string
3197 }
3198 >
3199 readonly "type": "mcp_list_tools"
3200}
3201export const McpListToolsItem = Schema.Struct({
3202 "error": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
3203 "id": Schema.String,
3204 "server_label": Schema.String,
3205 "tools": Schema.Array(
3206 Schema.Struct({
3207 "annotations": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
3208 "description": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
3209 "input_schema": Schema.Struct({}),
3210 "name": Schema.String
3211 })
3212 ),
3213 "type": Schema.Literal("mcp_list_tools")
3214}).annotate({ "description": "List of available MCP tools from a server", "identifier": "McpListToolsItem" })
3215export type McpServerTool = {
3216 readonly "allowed_tools"?: ReadonlyArray<string> | {
3217 readonly "read_only"?: boolean
3218 readonly "tool_names"?: ReadonlyArray<string>
3219 } | null
3220 readonly "authorization"?: string
3221 readonly "connector_id"?:
3222 | "connector_dropbox"
3223 | "connector_gmail"
3224 | "connector_googlecalendar"
3225 | "connector_googledrive"
3226 | "connector_microsoftteams"
3227 | "connector_outlookcalendar"
3228 | "connector_outlookemail"
3229 | "connector_sharepoint"
3230 readonly "headers"?: { readonly [x: string]: string } | null
3231 readonly "require_approval"?:
3232 | {
3233 readonly "always"?: { readonly "tool_names"?: ReadonlyArray<string> }
3234 readonly "never"?: { readonly "tool_names"?: ReadonlyArray<string> }
3235 }
3236 | "always"
3237 | "never"
3238 | null
3239 readonly "server_description"?: string
3240 readonly "server_label": string
3241 readonly "server_url"?: string
3242 readonly "type": "mcp"
3243}
3244export const McpServerTool = Schema.Struct({
3245 "allowed_tools": Schema.optionalKey(
3246 Schema.Union([
3247 Schema.Array(Schema.String),
3248 Schema.Struct({
3249 "read_only": Schema.optionalKey(Schema.Boolean),
3250 "tool_names": Schema.optionalKey(Schema.Array(Schema.String))
3251 }),
3252 Schema.Null
3253 ])
3254 ),
3255 "authorization": Schema.optionalKey(Schema.String),
3256 "connector_id": Schema.optionalKey(
3257 Schema.Literals([
3258 "connector_dropbox",
3259 "connector_gmail",
3260 "connector_googlecalendar",
3261 "connector_googledrive",
3262 "connector_microsoftteams",
3263 "connector_outlookcalendar",
3264 "connector_outlookemail",
3265 "connector_sharepoint"
3266 ])
3267 ),
3268 "headers": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null])),
3269 "require_approval": Schema.optionalKey(
3270 Schema.Union([
3271 Schema.Struct({
3272 "always": Schema.optionalKey(Schema.Struct({ "tool_names": Schema.optionalKey(Schema.Array(Schema.String)) })),
3273 "never": Schema.optionalKey(Schema.Struct({ "tool_names": Schema.optionalKey(Schema.Array(Schema.String)) }))
3274 }),
3275 Schema.Literal("always"),
3276 Schema.Literal("never"),
3277 Schema.Null
3278 ])
3279 ),
3280 "server_description": Schema.optionalKey(Schema.String),
3281 "server_label": Schema.String,
3282 "server_url": Schema.optionalKey(Schema.String),
3283 "type": Schema.Literal("mcp")
3284}).annotate({ "description": "MCP (Model Context Protocol) tool configuration", "identifier": "McpServerTool" })
3285export type MemberAssignment = {
3286 readonly "assigned_by": string | null
3287 readonly "created_at": string
3288 readonly "guardrail_id": string
3289 readonly "id": string
3290 readonly "organization_id": string
3291 readonly "user_id": string
3292}
3293export const MemberAssignment = Schema.Struct({
3294 "assigned_by": Schema.Union([Schema.String, Schema.Null]).annotate({
3295 "description": "User ID of who made the assignment"
3296 }),
3297 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the assignment was created" }),
3298 "guardrail_id": Schema.String.annotate({ "description": "ID of the guardrail", "format": "uuid" }),
3299 "id": Schema.String.annotate({ "description": "Unique identifier for the assignment", "format": "uuid" }),
3300 "organization_id": Schema.String.annotate({ "description": "Organization ID" }),
3301 "user_id": Schema.String.annotate({ "description": "Clerk user ID of the assigned member" })
3302}).annotate({ "identifier": "MemberAssignment" })
3303export type MessagesAdvisorToolResultBlock = {
3304 readonly "content": {}
3305 readonly "tool_use_id": string
3306 readonly "type": "advisor_tool_result"
3307}
3308export const MessagesAdvisorToolResultBlock = Schema.Struct({
3309 "content": Schema.Struct({}),
3310 "tool_use_id": Schema.String,
3311 "type": Schema.Literal("advisor_tool_result")
3312}).annotate({
3313 "description":
3314 "Advisor tool result from a prior assistant turn, replayed back to the model on the next turn. Mirrors the block Anthropic returns in assistant content when the `advisor_20260301` tool runs.",
3315 "identifier": "MessagesAdvisorToolResultBlock"
3316})
3317export type MessagesContentBlockStopEvent = { readonly "index": number; readonly "type": "content_block_stop" }
3318export const MessagesContentBlockStopEvent = Schema.Struct({
3319 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3320 "type": Schema.Literal("content_block_stop")
3321}).annotate({
3322 "description": "Event sent when a content block is complete",
3323 "identifier": "MessagesContentBlockStopEvent"
3324})
3325export type MessagesFallbackParam = { readonly "model": string }
3326export const MessagesFallbackParam = Schema.Struct({ "model": Schema.String }).annotate({
3327 "description":
3328 "Fallback model to try when the primary model fails or refuses. Only the `model` field is supported; per-attempt overrides are rejected.",
3329 "identifier": "MessagesFallbackParam"
3330})
3331export type Union_10 =
3332 | { readonly "schema": {}; readonly "type": "json_schema"; readonly [x: string]: Schema.Json }
3333 | null
3334export const Union_10 = Schema.Union([
3335 Schema.StructWithRest(Schema.Struct({ "schema": Schema.Struct({}), "type": Schema.Literal("json_schema") }), [
3336 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))
3337 ]),
3338 Schema.Null
3339]).annotate({
3340 "description":
3341 "A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)."
3342})
3343export type Union_11 = {
3344 readonly "remaining"?: number | null
3345 readonly "total": number
3346 readonly "type": "tokens"
3347 readonly [x: string]: Schema.Json
3348} | null
3349export const Union_11 = Schema.Union([
3350 Schema.StructWithRest(
3351 Schema.Struct({
3352 "remaining": Schema.optionalKey(
3353 Schema.Union([
3354 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3355 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
3356 ),
3357 Schema.Null
3358 ])
3359 ),
3360 "total": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3361 Schema.isGreaterThanOrEqualTo(20000).annotate({ "expected": "a value greater than or equal to 20000" })
3362 ),
3363 "type": Schema.Literal("tokens")
3364 }),
3365 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
3366 ),
3367 Schema.Null
3368]).annotate({
3369 "description":
3370 "Task budget for an agentic turn. The model sees a countdown of remaining tokens and uses it to prioritize work and wind down gracefully. Advisory — does not enforce a hard cap."
3371})
3372export type MessagesPingEvent = { readonly "type": "ping" }
3373export const MessagesPingEvent = Schema.Struct({ "type": Schema.Literal("ping") }).annotate({
3374 "description": "Keep-alive ping event",
3375 "identifier": "MessagesPingEvent"
3376})
3377export type MetadataLevel = "disabled" | "enabled"
3378export const MetadataLevel = Schema.Literals(["disabled", "enabled"]).annotate({
3379 "description": "Opt-in level for surfacing routing metadata on the response under `openrouter_metadata`.",
3380 "identifier": "MetadataLevel"
3381})
3382export type ModelGroup =
3383 | "Router"
3384 | "Media"
3385 | "Other"
3386 | "GPT"
3387 | "Claude"
3388 | "Gemini"
3389 | "Gemma"
3390 | "Grok"
3391 | "Cohere"
3392 | "Nova"
3393 | "Qwen"
3394 | "Yi"
3395 | "DeepSeek"
3396 | "Mistral"
3397 | "Llama2"
3398 | "Llama3"
3399 | "Llama4"
3400 | "PaLM"
3401 | "RWKV"
3402 | "Qwen3"
3403export const ModelGroup = Schema.Literals([
3404 "Router",
3405 "Media",
3406 "Other",
3407 "GPT",
3408 "Claude",
3409 "Gemini",
3410 "Gemma",
3411 "Grok",
3412 "Cohere",
3413 "Nova",
3414 "Qwen",
3415 "Yi",
3416 "DeepSeek",
3417 "Mistral",
3418 "Llama2",
3419 "Llama3",
3420 "Llama4",
3421 "PaLM",
3422 "RWKV",
3423 "Qwen3"
3424]).annotate({ "description": "Tokenizer type used by the model", "identifier": "ModelGroup" })
3425export type ModelLinks = { readonly "details": string }
3426export const ModelLinks = Schema.Struct({
3427 "details": Schema.String.annotate({ "description": "URL for the model details/endpoints API" })
3428}).annotate({ "description": "Related API endpoints and resources for this model.", "identifier": "ModelLinks" })
3429export type ModelName = string
3430export const ModelName = Schema.String.annotate({
3431 "description": "Model to use for completion",
3432 "identifier": "ModelName"
3433})
3434export type ModelsCountResponse = { readonly "data": { readonly "count": number } }
3435export const ModelsCountResponse = Schema.Struct({
3436 "data": Schema.Struct({
3437 "count": Schema.Number.annotate({ "description": "Total number of available models" }).check(
3438 Schema.isInt().annotate({ "expected": "an integer" })
3439 )
3440 }).annotate({ "description": "Model count data" })
3441}).annotate({ "description": "Model count data", "identifier": "ModelsCountResponse" })
3442export type ModerationPlugin = { readonly "id": "moderation" }
3443export const ModerationPlugin = Schema.Struct({ "id": Schema.Literal("moderation") }).annotate({
3444 "identifier": "ModerationPlugin"
3445})
3446export type MultimodalMedia = { readonly "data": string; readonly "format"?: string }
3447export const MultimodalMedia = Schema.Struct({ "data": Schema.String, "format": Schema.optionalKey(Schema.String) })
3448 .annotate({ "identifier": "MultimodalMedia" })
3449export type NamespaceFunctionTool = {
3450 readonly "allowed_callers"?: ReadonlyArray<"direct" | "programmatic"> | null
3451 readonly "defer_loading"?: boolean
3452 readonly "description"?: string | null
3453 readonly "name": string
3454 readonly "output_schema"?: { readonly [x: string]: Schema.Json } | null
3455 readonly "parameters"?: { readonly [x: string]: Schema.Json } | null
3456 readonly "strict"?: boolean | null
3457 readonly "type": "function"
3458}
3459export const NamespaceFunctionTool = Schema.Struct({
3460 "allowed_callers": Schema.optionalKey(
3461 Schema.Union([Schema.Array(Schema.Literals(["direct", "programmatic"])), Schema.Null])
3462 ),
3463 "defer_loading": Schema.optionalKey(Schema.Boolean),
3464 "description": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
3465 "name": Schema.String,
3466 "output_schema": Schema.optionalKey(
3467 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
3468 ),
3469 "parameters": Schema.optionalKey(
3470 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
3471 ),
3472 "strict": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
3473 "type": Schema.Literal("function")
3474}).annotate({ "description": "A function tool grouped inside a namespace tool", "identifier": "NamespaceFunctionTool" })
3475export type NotFoundResponseErrorData = {
3476 readonly "code": number
3477 readonly "message": string
3478 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
3479}
3480export const NotFoundResponseErrorData = Schema.Struct({
3481 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3482 "message": Schema.String,
3483 "metadata": Schema.optionalKey(
3484 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
3485 )
3486}).annotate({ "description": "Error data for NotFoundResponse", "identifier": "NotFoundResponseErrorData" })
3487export type ObservabilityFilterRuleGroup = {
3488 readonly "logic"?: "and" | "or"
3489 readonly "rules": ReadonlyArray<
3490 {
3491 readonly "field":
3492 | "model"
3493 | "provider"
3494 | "session_id"
3495 | "user_id"
3496 | "api_key_name"
3497 | "finish_reason"
3498 | "input"
3499 | "output"
3500 | "total_cost"
3501 | "total_tokens"
3502 | "prompt_tokens"
3503 | "completion_tokens"
3504 readonly "operator":
3505 | "equals"
3506 | "not_equals"
3507 | "contains"
3508 | "not_contains"
3509 | "regex"
3510 | "starts_with"
3511 | "ends_with"
3512 | "gt"
3513 | "lt"
3514 | "gte"
3515 | "lte"
3516 | "exists"
3517 | "not_exists"
3518 readonly "value"?: string | number
3519 }
3520 >
3521}
3522export const ObservabilityFilterRuleGroup = Schema.Struct({
3523 "logic": Schema.optionalKey(Schema.Literals(["and", "or"])),
3524 "rules": Schema.Array(Schema.Struct({
3525 "field": Schema.Literals([
3526 "model",
3527 "provider",
3528 "session_id",
3529 "user_id",
3530 "api_key_name",
3531 "finish_reason",
3532 "input",
3533 "output",
3534 "total_cost",
3535 "total_tokens",
3536 "prompt_tokens",
3537 "completion_tokens"
3538 ]),
3539 "operator": Schema.Literals([
3540 "equals",
3541 "not_equals",
3542 "contains",
3543 "not_contains",
3544 "regex",
3545 "starts_with",
3546 "ends_with",
3547 "gt",
3548 "lt",
3549 "gte",
3550 "lte",
3551 "exists",
3552 "not_exists"
3553 ]),
3554 "value": Schema.optionalKey(
3555 Schema.Union([Schema.String, Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" }))])
3556 )
3557 }))
3558}).annotate({ "identifier": "ObservabilityFilterRuleGroup" })
3559export type OpenAIResponseCustomToolCall = {
3560 readonly "call_id": string
3561 readonly "id"?: string
3562 readonly "input": string
3563 readonly "name": string
3564 readonly "namespace"?: string
3565 readonly "type": "custom_tool_call"
3566}
3567export const OpenAIResponseCustomToolCall = Schema.Struct({
3568 "call_id": Schema.String,
3569 "id": Schema.optionalKey(Schema.String),
3570 "input": Schema.String,
3571 "name": Schema.String,
3572 "namespace": Schema.optionalKey(
3573 Schema.String.annotate({
3574 "description": "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
3575 })
3576 ),
3577 "type": Schema.Literal("custom_tool_call")
3578}).annotate({ "identifier": "OpenAIResponseCustomToolCall" })
3579export type OpenAIResponsesImageGenCallCompleted = {
3580 readonly "item_id": string
3581 readonly "output_index": number
3582 readonly "sequence_number": number
3583 readonly "type": "response.image_generation_call.completed"
3584}
3585export const OpenAIResponsesImageGenCallCompleted = Schema.Struct({
3586 "item_id": Schema.String,
3587 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3588 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3589 "type": Schema.Literal("response.image_generation_call.completed")
3590}).annotate({ "identifier": "OpenAIResponsesImageGenCallCompleted" })
3591export type OpenAIResponsesImageGenCallGenerating = {
3592 readonly "item_id": string
3593 readonly "output_index": number
3594 readonly "sequence_number": number
3595 readonly "type": "response.image_generation_call.generating"
3596}
3597export const OpenAIResponsesImageGenCallGenerating = Schema.Struct({
3598 "item_id": Schema.String,
3599 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3600 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3601 "type": Schema.Literal("response.image_generation_call.generating")
3602}).annotate({ "identifier": "OpenAIResponsesImageGenCallGenerating" })
3603export type OpenAIResponsesImageGenCallInProgress = {
3604 readonly "item_id": string
3605 readonly "output_index": number
3606 readonly "sequence_number": number
3607 readonly "type": "response.image_generation_call.in_progress"
3608}
3609export const OpenAIResponsesImageGenCallInProgress = Schema.Struct({
3610 "item_id": Schema.String,
3611 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3612 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3613 "type": Schema.Literal("response.image_generation_call.in_progress")
3614}).annotate({ "identifier": "OpenAIResponsesImageGenCallInProgress" })
3615export type OpenAIResponsesImageGenCallPartialImage = {
3616 readonly "item_id": string
3617 readonly "output_index": number
3618 readonly "partial_image_b64": string
3619 readonly "partial_image_index": number
3620 readonly "sequence_number": number
3621 readonly "type": "response.image_generation_call.partial_image"
3622}
3623export const OpenAIResponsesImageGenCallPartialImage = Schema.Struct({
3624 "item_id": Schema.String,
3625 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3626 "partial_image_b64": Schema.String,
3627 "partial_image_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3628 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3629 "type": Schema.Literal("response.image_generation_call.partial_image")
3630}).annotate({ "identifier": "OpenAIResponsesImageGenCallPartialImage" })
3631export type OpenAIResponsesRefusalContent = { readonly "refusal": string; readonly "type": "refusal" }
3632export const OpenAIResponsesRefusalContent = Schema.Struct({
3633 "refusal": Schema.String,
3634 "type": Schema.Literal("refusal")
3635}).annotate({ "identifier": "OpenAIResponsesRefusalContent" })
3636export type OpenAIResponsesResponseStatus =
3637 | "completed"
3638 | "incomplete"
3639 | "in_progress"
3640 | "failed"
3641 | "cancelled"
3642 | "queued"
3643export const OpenAIResponsesResponseStatus = Schema.Literals([
3644 "completed",
3645 "incomplete",
3646 "in_progress",
3647 "failed",
3648 "cancelled",
3649 "queued"
3650]).annotate({ "identifier": "OpenAIResponsesResponseStatus" })
3651export type OpenAIResponsesSearchCompleted = {
3652 readonly "item_id": string
3653 readonly "output_index": number
3654 readonly "sequence_number": number
3655 readonly "type": "response.web_search_call.completed"
3656}
3657export const OpenAIResponsesSearchCompleted = Schema.Struct({
3658 "item_id": Schema.String,
3659 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3660 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3661 "type": Schema.Literal("response.web_search_call.completed")
3662}).annotate({ "identifier": "OpenAIResponsesSearchCompleted" })
3663export type Objects_11 = { readonly "name": string; readonly "type": "function" }
3664export const Objects_11 = Schema.Struct({ "name": Schema.String, "type": Schema.Literal("function") })
3665export type Objects_12 = { readonly "type": "web_search_preview_2025_03_11" | "web_search_preview" }
3666export const Objects_12 = Schema.Struct({
3667 "type": Schema.Literals(["web_search_preview_2025_03_11", "web_search_preview"])
3668})
3669export type Objects_13 = { readonly "type": "apply_patch" }
3670export const Objects_13 = Schema.Struct({ "type": Schema.Literal("apply_patch") })
3671export type Objects_14 = { readonly "type": "shell" }
3672export const Objects_14 = Schema.Struct({ "type": Schema.Literal("shell") })
3673export type OpenAIResponsesTruncation = "auto" | "disabled" | null
3674export const OpenAIResponsesTruncation = Schema.Union([Schema.Literal("auto"), Schema.Literal("disabled"), Schema.Null])
3675 .annotate({ "identifier": "OpenAIResponsesTruncation" })
3676export type Objects_15 = { readonly "cache_write_tokens"?: number | null; readonly "cached_tokens": number }
3677export const Objects_15 = Schema.Struct({
3678 "cache_write_tokens": Schema.optionalKey(
3679 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
3680 ),
3681 "cached_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
3682})
3683export type Objects_16 = { readonly "reasoning_tokens": number }
3684export const Objects_16 = Schema.Struct({
3685 "reasoning_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
3686})
3687export type OpenAIResponsesWebSearchCallInProgress = {
3688 readonly "item_id": string
3689 readonly "output_index": number
3690 readonly "sequence_number": number
3691 readonly "type": "response.web_search_call.in_progress"
3692}
3693export const OpenAIResponsesWebSearchCallInProgress = Schema.Struct({
3694 "item_id": Schema.String,
3695 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3696 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3697 "type": Schema.Literal("response.web_search_call.in_progress")
3698}).annotate({ "identifier": "OpenAIResponsesWebSearchCallInProgress" })
3699export type OpenAIResponsesWebSearchCallSearching = {
3700 readonly "item_id": string
3701 readonly "output_index": number
3702 readonly "sequence_number": number
3703 readonly "type": "response.web_search_call.searching"
3704}
3705export const OpenAIResponsesWebSearchCallSearching = Schema.Struct({
3706 "item_id": Schema.String,
3707 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3708 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3709 "type": Schema.Literal("response.web_search_call.searching")
3710}).annotate({ "identifier": "OpenAIResponsesWebSearchCallSearching" })
3711export type OpenResponsesTopLogprobs = {
3712 readonly "bytes"?: ReadonlyArray<number>
3713 readonly "logprob"?: number
3714 readonly "token"?: string
3715}
3716export const OpenResponsesTopLogprobs = Schema.Struct({
3717 "bytes": Schema.optionalKey(Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })))),
3718 "logprob": Schema.optionalKey(
3719 Schema.Number.annotate({ "format": "double" }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
3720 ),
3721 "token": Schema.optionalKey(Schema.String)
3722}).annotate({ "description": "Alternative token with its log probability", "identifier": "OpenResponsesTopLogprobs" })
3723export type ORAnthropicStopReason =
3724 | "end_turn"
3725 | "max_tokens"
3726 | "stop_sequence"
3727 | "tool_use"
3728 | "pause_turn"
3729 | "refusal"
3730 | "compaction"
3731 | null
3732export const ORAnthropicStopReason = Schema.Union([
3733 Schema.Literal("end_turn"),
3734 Schema.Literal("max_tokens"),
3735 Schema.Literal("stop_sequence"),
3736 Schema.Literal("tool_use"),
3737 Schema.Literal("pause_turn"),
3738 Schema.Literal("refusal"),
3739 Schema.Literal("compaction"),
3740 Schema.Null
3741]).annotate({ "identifier": "ORAnthropicStopReason" })
3742export type OutputComputerCallItem = {
3743 readonly "action"?: Schema.Json
3744 readonly "call_id": string
3745 readonly "id"?: string
3746 readonly "pending_safety_checks": ReadonlyArray<
3747 { readonly "code": string; readonly "id": string; readonly "message": string }
3748 >
3749 readonly "status": "completed" | "incomplete" | "in_progress"
3750 readonly "type": "computer_call"
3751}
3752export const OutputComputerCallItem = Schema.Struct({
3753 "action": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
3754 "call_id": Schema.String,
3755 "id": Schema.optionalKey(Schema.String),
3756 "pending_safety_checks": Schema.Array(
3757 Schema.Struct({ "code": Schema.String, "id": Schema.String, "message": Schema.String })
3758 ),
3759 "status": Schema.Literals(["completed", "incomplete", "in_progress"]),
3760 "type": Schema.Literal("computer_call")
3761}).annotate({ "identifier": "OutputComputerCallItem" })
3762export type OutputCustomToolCallItem = {
3763 readonly "call_id": string
3764 readonly "id"?: string
3765 readonly "input": string
3766 readonly "name": string
3767 readonly "namespace"?: string
3768 readonly "type": "custom_tool_call"
3769}
3770export const OutputCustomToolCallItem = Schema.Struct({
3771 "call_id": Schema.String,
3772 "id": Schema.optionalKey(Schema.String),
3773 "input": Schema.String,
3774 "name": Schema.String,
3775 "namespace": Schema.optionalKey(
3776 Schema.String.annotate({
3777 "description": "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
3778 })
3779 ),
3780 "type": Schema.Literal("custom_tool_call")
3781}).annotate({
3782 "description":
3783 "A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments.",
3784 "identifier": "OutputCustomToolCallItem"
3785})
3786export type OutputFunctionCallItem = {
3787 readonly "arguments": string
3788 readonly "call_id": string
3789 readonly "id"?: string
3790 readonly "name": string
3791 readonly "namespace"?: string
3792 readonly "status"?: "completed" | "incomplete" | "in_progress"
3793 readonly "type": "function_call"
3794}
3795export const OutputFunctionCallItem = Schema.Struct({
3796 "arguments": Schema.String,
3797 "call_id": Schema.String,
3798 "id": Schema.optionalKey(Schema.String),
3799 "name": Schema.String,
3800 "namespace": Schema.optionalKey(
3801 Schema.String.annotate({
3802 "description": "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
3803 })
3804 ),
3805 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
3806 "type": Schema.Literal("function_call")
3807}).annotate({ "identifier": "OutputFunctionCallItem" })
3808export type OutputItemCustomToolCall = {
3809 readonly "call_id": string
3810 readonly "id"?: string
3811 readonly "input": string
3812 readonly "name": string
3813 readonly "namespace"?: string
3814 readonly "type": "custom_tool_call"
3815}
3816export const OutputItemCustomToolCall = Schema.Struct({
3817 "call_id": Schema.String,
3818 "id": Schema.optionalKey(Schema.String),
3819 "input": Schema.String,
3820 "name": Schema.String,
3821 "namespace": Schema.optionalKey(
3822 Schema.String.annotate({
3823 "description": "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
3824 })
3825 ),
3826 "type": Schema.Literal("custom_tool_call")
3827}).annotate({ "identifier": "OutputItemCustomToolCall" })
3828export type OutputItemFunctionCall = {
3829 readonly "arguments": string
3830 readonly "call_id": string
3831 readonly "id"?: string
3832 readonly "name": string
3833 readonly "namespace"?: string
3834 readonly "status"?: "completed" | "incomplete" | "in_progress"
3835 readonly "type": "function_call"
3836}
3837export const OutputItemFunctionCall = Schema.Struct({
3838 "arguments": Schema.String,
3839 "call_id": Schema.String,
3840 "id": Schema.optionalKey(Schema.String),
3841 "name": Schema.String,
3842 "namespace": Schema.optionalKey(
3843 Schema.String.annotate({
3844 "description": "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
3845 })
3846 ),
3847 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
3848 "type": Schema.Literal("function_call")
3849}).annotate({ "identifier": "OutputItemFunctionCall" })
3850export type OutputModality = "text" | "image" | "embeddings" | "audio" | "video" | "rerank" | "speech" | "transcription"
3851export const OutputModality = Schema.Literals([
3852 "text",
3853 "image",
3854 "embeddings",
3855 "audio",
3856 "video",
3857 "rerank",
3858 "speech",
3859 "transcription"
3860]).annotate({ "identifier": "OutputModality" })
3861export type OutputModalityEnum = "text" | "image"
3862export const OutputModalityEnum = Schema.Literals(["text", "image"]).annotate({ "identifier": "OutputModalityEnum" })
3863export type Parameter =
3864 | "temperature"
3865 | "top_p"
3866 | "top_k"
3867 | "min_p"
3868 | "top_a"
3869 | "frequency_penalty"
3870 | "presence_penalty"
3871 | "repetition_penalty"
3872 | "max_tokens"
3873 | "max_completion_tokens"
3874 | "logit_bias"
3875 | "logprobs"
3876 | "top_logprobs"
3877 | "prediction"
3878 | "seed"
3879 | "response_format"
3880 | "structured_outputs"
3881 | "stop"
3882 | "tools"
3883 | "tool_choice"
3884 | "parallel_tool_calls"
3885 | "include_reasoning"
3886 | "reasoning"
3887 | "reasoning_effort"
3888 | "web_search_options"
3889 | "verbosity"
3890export const Parameter = Schema.Literals([
3891 "temperature",
3892 "top_p",
3893 "top_k",
3894 "min_p",
3895 "top_a",
3896 "frequency_penalty",
3897 "presence_penalty",
3898 "repetition_penalty",
3899 "max_tokens",
3900 "max_completion_tokens",
3901 "logit_bias",
3902 "logprobs",
3903 "top_logprobs",
3904 "prediction",
3905 "seed",
3906 "response_format",
3907 "structured_outputs",
3908 "stop",
3909 "tools",
3910 "tool_choice",
3911 "parallel_tool_calls",
3912 "include_reasoning",
3913 "reasoning",
3914 "reasoning_effort",
3915 "web_search_options",
3916 "verbosity"
3917]).annotate({ "identifier": "Parameter" })
3918export type ParetoRouterPlugin = {
3919 readonly "enabled"?: boolean
3920 readonly "id": "pareto-router"
3921 readonly "max_price"?: number
3922 readonly "min_coding_score"?: number
3923 readonly "price_source"?: "prompt" | "weighted_avg"
3924}
3925export const ParetoRouterPlugin = Schema.Struct({
3926 "enabled": Schema.optionalKey(
3927 Schema.Boolean.annotate({
3928 "description": "Set to false to disable the pareto-router plugin for this request. Defaults to true."
3929 })
3930 ),
3931 "id": Schema.Literal("pareto-router"),
3932 "max_price": Schema.optionalKey(
3933 Schema.Number.annotate({
3934 "description":
3935 "Maximum input price in USD per million tokens. When set, quality-tier selection (min_coding_score) is bypassed: the router computes the Pareto frontier over the top coding models and routes to the best-scoring frontier model priced at or below this cap, falling back through cheaper frontier models, then non-frontier models. Enforced against the price source given by price_source. Returns 404 when no candidate satisfies the cap.",
3936 "format": "double"
3937 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
3938 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
3939 )
3940 ),
3941 "min_coding_score": Schema.optionalKey(
3942 Schema.Number.annotate({
3943 "description":
3944 "Minimum coding quality score between 0 and 1. Maps to internal quality tiers: >= 0.66 → high (top coding models), >= 0.33 → medium (strong modern flagships), < 0.33 → low (capable coders above the median). Omit to default to the highest tier (equivalent to >= 0.66). Not used when max_price is set (price-based selection takes over).",
3945 "format": "double"
3946 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
3947 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
3948 ).check(Schema.isLessThanOrEqualTo(1).annotate({ "expected": "a value less than or equal to 1" }))
3949 ),
3950 "price_source": Schema.optionalKey(
3951 Schema.Literals(["prompt", "weighted_avg"]).annotate({
3952 "description":
3953 "Price source for the Pareto frontier cost axis and for enforcing max_price. \"prompt\" uses catalog list price (endpoint.pricing.prompt). \"weighted_avg\" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to \"prompt\"."
3954 })
3955 )
3956}).annotate({ "identifier": "ParetoRouterPlugin" })
3957export type PayloadTooLargeResponseErrorData = {
3958 readonly "code": number
3959 readonly "message": string
3960 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
3961}
3962export const PayloadTooLargeResponseErrorData = Schema.Struct({
3963 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3964 "message": Schema.String,
3965 "metadata": Schema.optionalKey(
3966 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
3967 )
3968}).annotate({
3969 "description": "Error data for PayloadTooLargeResponse",
3970 "identifier": "PayloadTooLargeResponseErrorData"
3971})
3972export type PaymentRequiredResponseErrorData = {
3973 readonly "code": number
3974 readonly "message": string
3975 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
3976}
3977export const PaymentRequiredResponseErrorData = Schema.Struct({
3978 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3979 "message": Schema.String,
3980 "metadata": Schema.optionalKey(
3981 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
3982 )
3983}).annotate({
3984 "description": "Error data for PaymentRequiredResponse",
3985 "identifier": "PaymentRequiredResponseErrorData"
3986})
3987export type PDFParserEngine = "mistral-ocr" | "native" | "cloudflare-ai" | "pdf-text"
3988export const PDFParserEngine = Schema.Union([
3989 Schema.Literals(["mistral-ocr", "native", "cloudflare-ai"]),
3990 Schema.Literal("pdf-text")
3991]).annotate({
3992 "description":
3993 "The engine to use for parsing PDF files. \"pdf-text\" is deprecated and automatically redirected to \"cloudflare-ai\".",
3994 "identifier": "PDFParserEngine"
3995})
3996export type PercentileLatencyCutoffs = {
3997 readonly "p50"?: number | null
3998 readonly "p75"?: number | null
3999 readonly "p90"?: number | null
4000 readonly "p99"?: number | null
4001}
4002export const PercentileLatencyCutoffs = Schema.Struct({
4003 "p50": Schema.optionalKey(
4004 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
4005 .annotate({ "description": "Maximum p50 latency (seconds)", "format": "double" })
4006 ),
4007 "p75": Schema.optionalKey(
4008 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
4009 .annotate({ "description": "Maximum p75 latency (seconds)", "format": "double" })
4010 ),
4011 "p90": Schema.optionalKey(
4012 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
4013 .annotate({ "description": "Maximum p90 latency (seconds)", "format": "double" })
4014 ),
4015 "p99": Schema.optionalKey(
4016 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
4017 .annotate({ "description": "Maximum p99 latency (seconds)", "format": "double" })
4018 )
4019}).annotate({
4020 "description": "Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.",
4021 "identifier": "PercentileLatencyCutoffs"
4022})
4023export type PercentileStats = {
4024 readonly "p50": number
4025 readonly "p75": number
4026 readonly "p90": number
4027 readonly "p99": number
4028 readonly [x: string]: Schema.Json
4029} | null
4030export const PercentileStats = Schema.Union([
4031 Schema.StructWithRest(
4032 Schema.Struct({
4033 "p50": Schema.Number.annotate({ "description": "Median (50th percentile)", "format": "double" }).check(
4034 Schema.isFinite().annotate({ "expected": "a finite number" })
4035 ),
4036 "p75": Schema.Number.annotate({ "description": "75th percentile", "format": "double" }).check(
4037 Schema.isFinite().annotate({ "expected": "a finite number" })
4038 ),
4039 "p90": Schema.Number.annotate({ "description": "90th percentile", "format": "double" }).check(
4040 Schema.isFinite().annotate({ "expected": "a finite number" })
4041 ),
4042 "p99": Schema.Number.annotate({ "description": "99th percentile", "format": "double" }).check(
4043 Schema.isFinite().annotate({ "expected": "a finite number" })
4044 )
4045 }),
4046 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
4047 ),
4048 Schema.Null
4049]).annotate({
4050 "description":
4051 "Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests.",
4052 "identifier": "PercentileStats"
4053})
4054export type PercentileThroughputCutoffs = {
4055 readonly "p50"?: number | null
4056 readonly "p75"?: number | null
4057 readonly "p90"?: number | null
4058 readonly "p99"?: number | null
4059}
4060export const PercentileThroughputCutoffs = Schema.Struct({
4061 "p50": Schema.optionalKey(
4062 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
4063 .annotate({ "description": "Minimum p50 throughput (tokens/sec)", "format": "double" })
4064 ),
4065 "p75": Schema.optionalKey(
4066 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
4067 .annotate({ "description": "Minimum p75 throughput (tokens/sec)", "format": "double" })
4068 ),
4069 "p90": Schema.optionalKey(
4070 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
4071 .annotate({ "description": "Minimum p90 throughput (tokens/sec)", "format": "double" })
4072 ),
4073 "p99": Schema.optionalKey(
4074 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
4075 .annotate({ "description": "Minimum p99 throughput (tokens/sec)", "format": "double" })
4076 )
4077}).annotate({
4078 "description":
4079 "Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.",
4080 "identifier": "PercentileThroughputCutoffs"
4081})
4082export type PerRequestLimits = {
4083 readonly "completion_tokens": number
4084 readonly "prompt_tokens": number
4085 readonly [x: string]: Schema.Json
4086} | null
4087export const PerRequestLimits = Schema.Union([
4088 Schema.StructWithRest(
4089 Schema.Struct({
4090 "completion_tokens": Schema.Number.annotate({ "description": "Maximum completion tokens per request" }).check(
4091 Schema.isFinite().annotate({ "expected": "a finite number" })
4092 ),
4093 "prompt_tokens": Schema.Number.annotate({ "description": "Maximum prompt tokens per request" }).check(
4094 Schema.isFinite().annotate({ "expected": "a finite number" })
4095 )
4096 }),
4097 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
4098 ),
4099 Schema.Null
4100]).annotate({ "description": "Per-request token limits", "identifier": "PerRequestLimits" })
4101export type PipelineStageType = "guardrail" | "plugin" | "server_tools" | "response_healing" | "context_compression"
4102export const PipelineStageType = Schema.Literals([
4103 "guardrail",
4104 "plugin",
4105 "server_tools",
4106 "response_healing",
4107 "context_compression"
4108]).annotate({
4109 "description":
4110 "Categorical kind of a pipeline stage. Multiple plugins can share a type (e.g. all guardrail-level plugins emit `guardrail`); the `name` field disambiguates which plugin emitted it.",
4111 "identifier": "PipelineStageType"
4112})
4113export type PredictionContentText = { readonly "text": string; readonly "type": "text" }
4114export const PredictionContentText = Schema.Struct({ "text": Schema.String, "type": Schema.Literal("text") }).annotate({
4115 "description": "Text content part for a predicted output.",
4116 "identifier": "PredictionContentText"
4117})
4118export type PresetDesignatedVersion = {
4119 readonly "config": {}
4120 readonly "created_at": string
4121 readonly "creator_id": string
4122 readonly "id": string
4123 readonly "preset_id": string
4124 readonly "system_prompt": string | null
4125 readonly "updated_at": string
4126 readonly "version": number
4127 readonly [x: string]: Schema.Json
4128} | null
4129export const PresetDesignatedVersion = Schema.Union([
4130 Schema.StructWithRest(
4131 Schema.Struct({
4132 "config": Schema.Struct({}),
4133 "created_at": Schema.String,
4134 "creator_id": Schema.String,
4135 "id": Schema.String,
4136 "preset_id": Schema.String,
4137 "system_prompt": Schema.Union([Schema.String, Schema.Null]),
4138 "updated_at": Schema.String,
4139 "version": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
4140 }),
4141 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
4142 ),
4143 Schema.Null
4144]).annotate({
4145 "description": "A specific version of a preset, containing config and optional system prompt.",
4146 "identifier": "PresetDesignatedVersion"
4147})
4148export type PresetStatus = "active" | "disabled" | "archived"
4149export const PresetStatus = Schema.Literals(["active", "disabled", "archived"]).annotate({
4150 "description": "The status of a preset.",
4151 "identifier": "PresetStatus"
4152})
4153export type Objects_18 = {
4154 readonly "city"?: string | null
4155 readonly "country"?: string | null
4156 readonly "region"?: string | null
4157 readonly "timezone"?: string | null
4158 readonly "type": "approximate"
4159 readonly [x: string]: Schema.Json
4160}
4161export const Objects_18 = Schema.StructWithRest(
4162 Schema.Struct({
4163 "city": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
4164 "country": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
4165 "region": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
4166 "timezone": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
4167 "type": Schema.Literal("approximate")
4168 }),
4169 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
4170)
4171export type PricingOverride = {
4172 readonly "audio"?: string
4173 readonly "completion"?: string
4174 readonly "input_audio_cache"?: string
4175 readonly "input_cache_read"?: string
4176 readonly "input_cache_write"?: string
4177 readonly "input_cache_write_1h"?: string
4178 readonly "min_prompt_tokens"?: number
4179 readonly "prompt"?: string
4180 readonly "utc_end"?: number
4181 readonly "utc_start"?: number
4182}
4183export const PricingOverride = Schema.Struct({
4184 "audio": Schema.optionalKey(
4185 Schema.String.annotate({ "description": "Overridden price in USD per audio input token" })
4186 ),
4187 "completion": Schema.optionalKey(
4188 Schema.String.annotate({ "description": "Overridden price in USD per token for completion (output) generation" })
4189 ),
4190 "input_audio_cache": Schema.optionalKey(
4191 Schema.String.annotate({ "description": "Overridden price in USD per cached audio input token" })
4192 ),
4193 "input_cache_read": Schema.optionalKey(
4194 Schema.String.annotate({ "description": "Overridden price in USD per cached input token (read)" })
4195 ),
4196 "input_cache_write": Schema.optionalKey(
4197 Schema.String.annotate({ "description": "Overridden price in USD per cache-write token" })
4198 ),
4199 "input_cache_write_1h": Schema.optionalKey(
4200 Schema.String.annotate({ "description": "Overridden price in USD per 1-hour cache-write token" })
4201 ),
4202 "min_prompt_tokens": Schema.optionalKey(
4203 Schema.Number.annotate({
4204 "description":
4205 "Condition: the entry applies when the total prompt tokens of a request are strictly greater than this threshold",
4206 "format": "double"
4207 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
4208 ),
4209 "prompt": Schema.optionalKey(
4210 Schema.String.annotate({ "description": "Overridden price in USD per token for prompt (input) processing" })
4211 ),
4212 "utc_end": Schema.optionalKey(
4213 Schema.Number.annotate({
4214 "description": "Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00)",
4215 "format": "double"
4216 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
4217 ),
4218 "utc_start": Schema.optionalKey(
4219 Schema.Number.annotate({
4220 "description":
4221 "Condition: inclusive start of a daily UTC time window as an HHMM clock number (e.g. 100 = 01:00, 1030 = 10:30). The entry applies while the current UTC time is inside the half-open window [utc_start, utc_end), which may wrap past midnight (utc_start > utc_end).",
4222 "format": "double"
4223 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
4224 )
4225}).annotate({
4226 "description":
4227 "A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price.",
4228 "identifier": "PricingOverride"
4229})
4230export type Objects_19 = { readonly "mode": "explicit"; readonly [x: string]: Schema.Json }
4231export const Objects_19 = Schema.StructWithRest(Schema.Struct({ "mode": Schema.Literal("explicit") }), [
4232 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))
4233])
4234export type Objects_20 = {
4235 readonly "mode": "explicit"
4236 readonly "ttl"?: string | null
4237 readonly [x: string]: Schema.Json
4238}
4239export const Objects_20 = Schema.StructWithRest(
4240 Schema.Struct({
4241 "mode": Schema.Literal("explicit"),
4242 "ttl": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
4243 }),
4244 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
4245)
4246export type PromptInjectionScanScope = "user_only" | "all_messages"
4247export const PromptInjectionScanScope = Schema.Literals(["user_only", "all_messages"]).annotate({
4248 "description":
4249 "Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages.",
4250 "identifier": "PromptInjectionScanScope"
4251})
4252export type ProviderName =
4253 | "AkashML"
4254 | "AI21"
4255 | "AionLabs"
4256 | "Alibaba"
4257 | "Ambient"
4258 | "Baidu"
4259 | "Amazon Bedrock"
4260 | "Amazon Nova"
4261 | "Anthropic"
4262 | "Arcee AI"
4263 | "AtlasCloud"
4264 | "Avian"
4265 | "Azure"
4266 | "BaseTen"
4267 | "BytePlus"
4268 | "Black Forest Labs"
4269 | "Cerebras"
4270 | "Chutes"
4271 | "Cirrascale"
4272 | "Clarifai"
4273 | "Cloudflare"
4274 | "Cohere"
4275 | "CoreWeave"
4276 | "Crucible"
4277 | "Crusoe"
4278 | "Darkbloom"
4279 | "Decart"
4280 | "Deepgram"
4281 | "DeepInfra"
4282 | "DeepSeek"
4283 | "DekaLLM"
4284 | "DigitalOcean"
4285 | "Featherless"
4286 | "Fireworks"
4287 | "Fish Audio"
4288 | "Friendli"
4289 | "GMICloud"
4290 | "Google"
4291 | "Google AI Studio"
4292 | "Groq"
4293 | "HeyGen"
4294 | "Inception"
4295 | "Inceptron"
4296 | "InferenceNet"
4297 | "Ionstream"
4298 | "Infermatic"
4299 | "Io Net"
4300 | "Inferact vLLM"
4301 | "Inflection"
4302 | "Liquid"
4303 | "Mara"
4304 | "Mancer 2"
4305 | "Meta"
4306 | "Minimax"
4307 | "ModelRun"
4308 | "Mistral"
4309 | "Modular"
4310 | "Moonshot AI"
4311 | "Morph"
4312 | "NCompass"
4313 | "Nebius"
4314 | "Nex AGI"
4315 | "NextBit"
4316 | "Novita"
4317 | "Nvidia"
4318 | "OpenAI"
4319 | "OpenInference"
4320 | "Parasail"
4321 | "Poolside"
4322 | "Perceptron"
4323 | "Perplexity"
4324 | "Phala"
4325 | "Recraft"
4326 | "Reka"
4327 | "Relace"
4328 | "Sail Research"
4329 | "Sakana AI"
4330 | "SambaNova"
4331 | "Seed"
4332 | "SiliconFlow"
4333 | "Sourceful"
4334 | "StepFun"
4335 | "Stealth"
4336 | "StreamLake"
4337 | "Switchpoint"
4338 | "Tencent"
4339 | "Tenstorrent"
4340 | "Together"
4341 | "Upstage"
4342 | "Venice"
4343 | "Wafer"
4344 | "WandB"
4345 | "Quiver"
4346 | "Krea"
4347 | "Runway"
4348 | "Xiaomi"
4349 | "xAI"
4350 | "Z.AI"
4351 | "FakeProvider"
4352export const ProviderName = Schema.Literals([
4353 "AkashML",
4354 "AI21",
4355 "AionLabs",
4356 "Alibaba",
4357 "Ambient",
4358 "Baidu",
4359 "Amazon Bedrock",
4360 "Amazon Nova",
4361 "Anthropic",
4362 "Arcee AI",
4363 "AtlasCloud",
4364 "Avian",
4365 "Azure",
4366 "BaseTen",
4367 "BytePlus",
4368 "Black Forest Labs",
4369 "Cerebras",
4370 "Chutes",
4371 "Cirrascale",
4372 "Clarifai",
4373 "Cloudflare",
4374 "Cohere",
4375 "CoreWeave",
4376 "Crucible",
4377 "Crusoe",
4378 "Darkbloom",
4379 "Decart",
4380 "Deepgram",
4381 "DeepInfra",
4382 "DeepSeek",
4383 "DekaLLM",
4384 "DigitalOcean",
4385 "Featherless",
4386 "Fireworks",
4387 "Fish Audio",
4388 "Friendli",
4389 "GMICloud",
4390 "Google",
4391 "Google AI Studio",
4392 "Groq",
4393 "HeyGen",
4394 "Inception",
4395 "Inceptron",
4396 "InferenceNet",
4397 "Ionstream",
4398 "Infermatic",
4399 "Io Net",
4400 "Inferact vLLM",
4401 "Inflection",
4402 "Liquid",
4403 "Mara",
4404 "Mancer 2",
4405 "Meta",
4406 "Minimax",
4407 "ModelRun",
4408 "Mistral",
4409 "Modular",
4410 "Moonshot AI",
4411 "Morph",
4412 "NCompass",
4413 "Nebius",
4414 "Nex AGI",
4415 "NextBit",
4416 "Novita",
4417 "Nvidia",
4418 "OpenAI",
4419 "OpenInference",
4420 "Parasail",
4421 "Poolside",
4422 "Perceptron",
4423 "Perplexity",
4424 "Phala",
4425 "Recraft",
4426 "Reka",
4427 "Relace",
4428 "Sail Research",
4429 "Sakana AI",
4430 "SambaNova",
4431 "Seed",
4432 "SiliconFlow",
4433 "Sourceful",
4434 "StepFun",
4435 "Stealth",
4436 "StreamLake",
4437 "Switchpoint",
4438 "Tencent",
4439 "Tenstorrent",
4440 "Together",
4441 "Upstage",
4442 "Venice",
4443 "Wafer",
4444 "WandB",
4445 "Quiver",
4446 "Krea",
4447 "Runway",
4448 "Xiaomi",
4449 "xAI",
4450 "Z.AI",
4451 "FakeProvider"
4452]).annotate({ "identifier": "ProviderName" })
4453export type Objects_21 = {}
4454export const Objects_21 = Schema.Struct({})
4455export type Objects_22 = {}
4456export const Objects_22 = Schema.Struct({})
4457export type Objects_23 = {}
4458export const Objects_23 = Schema.Struct({})
4459export type Objects_24 = {}
4460export const Objects_24 = Schema.Struct({})
4461export type Objects_25 = {}
4462export const Objects_25 = Schema.Struct({})
4463export type Objects_26 = {}
4464export const Objects_26 = Schema.Struct({})
4465export type Objects_27 = {}
4466export const Objects_27 = Schema.Struct({})
4467export type Objects_28 = {}
4468export const Objects_28 = Schema.Struct({})
4469export type Objects_29 = {}
4470export const Objects_29 = Schema.Struct({})
4471export type Objects_30 = {}
4472export const Objects_30 = Schema.Struct({})
4473export type Objects_31 = {}
4474export const Objects_31 = Schema.Struct({})
4475export type Objects_32 = {}
4476export const Objects_32 = Schema.Struct({})
4477export type Objects_33 = {}
4478export const Objects_33 = Schema.Struct({})
4479export type Objects_34 = {}
4480export const Objects_34 = Schema.Struct({})
4481export type Objects_35 = {}
4482export const Objects_35 = Schema.Struct({})
4483export type Objects_36 = {}
4484export const Objects_36 = Schema.Struct({})
4485export type Objects_37 = {}
4486export const Objects_37 = Schema.Struct({})
4487export type Objects_38 = {}
4488export const Objects_38 = Schema.Struct({})
4489export type Objects_39 = {}
4490export const Objects_39 = Schema.Struct({})
4491export type Objects_40 = {}
4492export const Objects_40 = Schema.Struct({})
4493export type Objects_41 = {}
4494export const Objects_41 = Schema.Struct({})
4495export type Objects_42 = {}
4496export const Objects_42 = Schema.Struct({})
4497export type Objects_43 = {}
4498export const Objects_43 = Schema.Struct({})
4499export type Objects_44 = {}
4500export const Objects_44 = Schema.Struct({})
4501export type Objects_45 = {}
4502export const Objects_45 = Schema.Struct({})
4503export type Objects_46 = {}
4504export const Objects_46 = Schema.Struct({})
4505export type Objects_47 = {}
4506export const Objects_47 = Schema.Struct({})
4507export type Objects_48 = {}
4508export const Objects_48 = Schema.Struct({})
4509export type Objects_49 = {}
4510export const Objects_49 = Schema.Struct({})
4511export type Objects_50 = {}
4512export const Objects_50 = Schema.Struct({})
4513export type Objects_51 = {}
4514export const Objects_51 = Schema.Struct({})
4515export type Objects_52 = {}
4516export const Objects_52 = Schema.Struct({})
4517export type Objects_53 = {}
4518export const Objects_53 = Schema.Struct({})
4519export type Objects_54 = {}
4520export const Objects_54 = Schema.Struct({})
4521export type Objects_55 = {}
4522export const Objects_55 = Schema.Struct({})
4523export type Objects_56 = {}
4524export const Objects_56 = Schema.Struct({})
4525export type Objects_57 = {}
4526export const Objects_57 = Schema.Struct({})
4527export type Objects_58 = {}
4528export const Objects_58 = Schema.Struct({})
4529export type Objects_59 = {}
4530export const Objects_59 = Schema.Struct({})
4531export type Objects_60 = {}
4532export const Objects_60 = Schema.Struct({})
4533export type Objects_61 = {}
4534export const Objects_61 = Schema.Struct({})
4535export type Objects_62 = {}
4536export const Objects_62 = Schema.Struct({})
4537export type Objects_63 = {}
4538export const Objects_63 = Schema.Struct({})
4539export type Objects_64 = {}
4540export const Objects_64 = Schema.Struct({})
4541export type Objects_65 = {}
4542export const Objects_65 = Schema.Struct({})
4543export type Objects_66 = {}
4544export const Objects_66 = Schema.Struct({})
4545export type Objects_67 = {}
4546export const Objects_67 = Schema.Struct({})
4547export type Objects_68 = {}
4548export const Objects_68 = Schema.Struct({})
4549export type Objects_69 = {}
4550export const Objects_69 = Schema.Struct({})
4551export type Objects_70 = {}
4552export const Objects_70 = Schema.Struct({})
4553export type Objects_71 = {}
4554export const Objects_71 = Schema.Struct({})
4555export type Objects_72 = {}
4556export const Objects_72 = Schema.Struct({})
4557export type Objects_73 = {}
4558export const Objects_73 = Schema.Struct({})
4559export type Objects_74 = {}
4560export const Objects_74 = Schema.Struct({})
4561export type Objects_75 = {}
4562export const Objects_75 = Schema.Struct({})
4563export type Objects_76 = {}
4564export const Objects_76 = Schema.Struct({})
4565export type Objects_77 = {}
4566export const Objects_77 = Schema.Struct({})
4567export type Objects_78 = {}
4568export const Objects_78 = Schema.Struct({})
4569export type Objects_79 = {}
4570export const Objects_79 = Schema.Struct({})
4571export type Objects_80 = {}
4572export const Objects_80 = Schema.Struct({})
4573export type Objects_81 = {}
4574export const Objects_81 = Schema.Struct({})
4575export type Objects_82 = {}
4576export const Objects_82 = Schema.Struct({})
4577export type Objects_83 = {}
4578export const Objects_83 = Schema.Struct({})
4579export type Objects_84 = {}
4580export const Objects_84 = Schema.Struct({})
4581export type Objects_85 = {}
4582export const Objects_85 = Schema.Struct({})
4583export type Objects_86 = {}
4584export const Objects_86 = Schema.Struct({})
4585export type Objects_87 = {}
4586export const Objects_87 = Schema.Struct({})
4587export type Objects_88 = {}
4588export const Objects_88 = Schema.Struct({})
4589export type Objects_89 = {}
4590export const Objects_89 = Schema.Struct({})
4591export type Objects_90 = {}
4592export const Objects_90 = Schema.Struct({})
4593export type Objects_91 = {}
4594export const Objects_91 = Schema.Struct({})
4595export type Objects_92 = {}
4596export const Objects_92 = Schema.Struct({})
4597export type Objects_93 = {}
4598export const Objects_93 = Schema.Struct({})
4599export type Objects_94 = {}
4600export const Objects_94 = Schema.Struct({})
4601export type Objects_95 = {}
4602export const Objects_95 = Schema.Struct({})
4603export type Objects_96 = {}
4604export const Objects_96 = Schema.Struct({})
4605export type Objects_97 = {}
4606export const Objects_97 = Schema.Struct({})
4607export type Objects_98 = {}
4608export const Objects_98 = Schema.Struct({})
4609export type Objects_99 = {}
4610export const Objects_99 = Schema.Struct({})
4611export type Objects_100 = {}
4612export const Objects_100 = Schema.Struct({})
4613export type Objects_101 = {}
4614export const Objects_101 = Schema.Struct({})
4615export type Objects_102 = {}
4616export const Objects_102 = Schema.Struct({})
4617export type Objects_103 = {}
4618export const Objects_103 = Schema.Struct({})
4619export type Objects_104 = {}
4620export const Objects_104 = Schema.Struct({})
4621export type Objects_105 = {}
4622export const Objects_105 = Schema.Struct({})
4623export type Objects_106 = {}
4624export const Objects_106 = Schema.Struct({})
4625export type Objects_107 = {}
4626export const Objects_107 = Schema.Struct({})
4627export type Objects_108 = {}
4628export const Objects_108 = Schema.Struct({})
4629export type Objects_109 = {}
4630export const Objects_109 = Schema.Struct({})
4631export type Objects_110 = {}
4632export const Objects_110 = Schema.Struct({})
4633export type Objects_111 = {}
4634export const Objects_111 = Schema.Struct({})
4635export type Objects_112 = {}
4636export const Objects_112 = Schema.Struct({})
4637export type Objects_113 = {}
4638export const Objects_113 = Schema.Struct({})
4639export type Objects_114 = {}
4640export const Objects_114 = Schema.Struct({})
4641export type Objects_115 = {}
4642export const Objects_115 = Schema.Struct({})
4643export type Objects_116 = {}
4644export const Objects_116 = Schema.Struct({})
4645export type Objects_117 = {}
4646export const Objects_117 = Schema.Struct({})
4647export type Objects_118 = {}
4648export const Objects_118 = Schema.Struct({})
4649export type Objects_119 = {}
4650export const Objects_119 = Schema.Struct({})
4651export type Objects_120 = {}
4652export const Objects_120 = Schema.Struct({})
4653export type Objects_121 = {}
4654export const Objects_121 = Schema.Struct({})
4655export type Objects_122 = {}
4656export const Objects_122 = Schema.Struct({})
4657export type Objects_123 = {}
4658export const Objects_123 = Schema.Struct({})
4659export type Objects_124 = {}
4660export const Objects_124 = Schema.Struct({})
4661export type Objects_125 = {}
4662export const Objects_125 = Schema.Struct({})
4663export type Objects_126 = {}
4664export const Objects_126 = Schema.Struct({})
4665export type Objects_127 = {}
4666export const Objects_127 = Schema.Struct({})
4667export type Objects_128 = {}
4668export const Objects_128 = Schema.Struct({})
4669export type Objects_129 = {}
4670export const Objects_129 = Schema.Struct({})
4671export type Objects_130 = {}
4672export const Objects_130 = Schema.Struct({})
4673export type Objects_131 = {}
4674export const Objects_131 = Schema.Struct({})
4675export type Objects_132 = {}
4676export const Objects_132 = Schema.Struct({})
4677export type Objects_133 = {}
4678export const Objects_133 = Schema.Struct({})
4679export type Objects_134 = {}
4680export const Objects_134 = Schema.Struct({})
4681export type Objects_135 = {}
4682export const Objects_135 = Schema.Struct({})
4683export type Objects_136 = {}
4684export const Objects_136 = Schema.Struct({})
4685export type Objects_137 = {}
4686export const Objects_137 = Schema.Struct({})
4687export type Objects_138 = {}
4688export const Objects_138 = Schema.Struct({})
4689export type Objects_139 = {}
4690export const Objects_139 = Schema.Struct({})
4691export type Objects_140 = {}
4692export const Objects_140 = Schema.Struct({})
4693export type Objects_141 = {}
4694export const Objects_141 = Schema.Struct({})
4695export type Objects_142 = {}
4696export const Objects_142 = Schema.Struct({})
4697export type Objects_143 = {}
4698export const Objects_143 = Schema.Struct({})
4699export type Objects_144 = {}
4700export const Objects_144 = Schema.Struct({})
4701export type Objects_145 = {}
4702export const Objects_145 = Schema.Struct({})
4703export type Objects_146 = {}
4704export const Objects_146 = Schema.Struct({})
4705export type Objects_147 = {}
4706export const Objects_147 = Schema.Struct({})
4707export type ProviderOverloadedResponseErrorData = {
4708 readonly "code": number
4709 readonly "message": string
4710 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
4711}
4712export const ProviderOverloadedResponseErrorData = Schema.Struct({
4713 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
4714 "message": Schema.String,
4715 "metadata": Schema.optionalKey(
4716 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
4717 )
4718}).annotate({
4719 "description": "Error data for ProviderOverloadedResponse",
4720 "identifier": "ProviderOverloadedResponseErrorData"
4721})
4722export type ProviderResponse = {
4723 readonly "endpoint_id"?: string
4724 readonly "id"?: string
4725 readonly "is_byok"?: boolean
4726 readonly "latency"?: number
4727 readonly "model_permaslug"?: string
4728 readonly "provider_name"?:
4729 | "AnyScale"
4730 | "Atoma"
4731 | "Cent-ML"
4732 | "CrofAI"
4733 | "Enfer"
4734 | "GoPomelo"
4735 | "HuggingFace"
4736 | "Hyperbolic"
4737 | "Hyperbolic 2"
4738 | "InoCloud"
4739 | "Kluster"
4740 | "Lambda"
4741 | "Lepton"
4742 | "Lynn 2"
4743 | "Lynn"
4744 | "Mancer"
4745 | "Modal"
4746 | "Nineteen"
4747 | "OctoAI"
4748 | "Recursal"
4749 | "Reflection"
4750 | "Replicate"
4751 | "SambaNova 2"
4752 | "SF Compute"
4753 | "Targon"
4754 | "Together 2"
4755 | "Ubicloud"
4756 | "01.AI"
4757 | "AkashML"
4758 | "AI21"
4759 | "AionLabs"
4760 | "Alibaba"
4761 | "Ambient"
4762 | "Baidu"
4763 | "Amazon Bedrock"
4764 | "Amazon Nova"
4765 | "Anthropic"
4766 | "Arcee AI"
4767 | "AtlasCloud"
4768 | "Avian"
4769 | "Azure"
4770 | "BaseTen"
4771 | "BytePlus"
4772 | "Black Forest Labs"
4773 | "Cerebras"
4774 | "Chutes"
4775 | "Cirrascale"
4776 | "Clarifai"
4777 | "Cloudflare"
4778 | "Cohere"
4779 | "CoreWeave"
4780 | "Crucible"
4781 | "Crusoe"
4782 | "Darkbloom"
4783 | "Decart"
4784 | "Deepgram"
4785 | "DeepInfra"
4786 | "DeepSeek"
4787 | "DekaLLM"
4788 | "DigitalOcean"
4789 | "Featherless"
4790 | "Fireworks"
4791 | "Fish Audio"
4792 | "Friendli"
4793 | "GMICloud"
4794 | "Google"
4795 | "Google AI Studio"
4796 | "Groq"
4797 | "HeyGen"
4798 | "Inception"
4799 | "Inceptron"
4800 | "InferenceNet"
4801 | "Ionstream"
4802 | "Infermatic"
4803 | "Io Net"
4804 | "Inferact vLLM"
4805 | "Inflection"
4806 | "Liquid"
4807 | "Mara"
4808 | "Mancer 2"
4809 | "Meta"
4810 | "Minimax"
4811 | "ModelRun"
4812 | "Mistral"
4813 | "Modular"
4814 | "Moonshot AI"
4815 | "Morph"
4816 | "NCompass"
4817 | "Nebius"
4818 | "Nex AGI"
4819 | "NextBit"
4820 | "Novita"
4821 | "Nvidia"
4822 | "OpenAI"
4823 | "OpenInference"
4824 | "Parasail"
4825 | "Poolside"
4826 | "Perceptron"
4827 | "Perplexity"
4828 | "Phala"
4829 | "Recraft"
4830 | "Reka"
4831 | "Relace"
4832 | "Sail Research"
4833 | "Sakana AI"
4834 | "SambaNova"
4835 | "Seed"
4836 | "SiliconFlow"
4837 | "Sourceful"
4838 | "StepFun"
4839 | "Stealth"
4840 | "StreamLake"
4841 | "Switchpoint"
4842 | "Tencent"
4843 | "Tenstorrent"
4844 | "Together"
4845 | "Upstage"
4846 | "Venice"
4847 | "Wafer"
4848 | "WandB"
4849 | "Quiver"
4850 | "Krea"
4851 | "Runway"
4852 | "Xiaomi"
4853 | "xAI"
4854 | "Z.AI"
4855 | "FakeProvider"
4856 readonly "routed_service_tier"?: "flex" | "priority"
4857 readonly "status": number | null
4858}
4859export const ProviderResponse = Schema.Struct({
4860 "endpoint_id": Schema.optionalKey(Schema.String.annotate({ "description": "Internal endpoint identifier" })),
4861 "id": Schema.optionalKey(Schema.String.annotate({ "description": "Upstream provider response identifier" })),
4862 "is_byok": Schema.optionalKey(
4863 Schema.Boolean.annotate({ "description": "Whether the request used a bring-your-own-key" })
4864 ),
4865 "latency": Schema.optionalKey(
4866 Schema.Number.annotate({ "description": "Response latency in milliseconds", "format": "double" }).check(
4867 Schema.isFinite().annotate({ "expected": "a finite number" })
4868 )
4869 ),
4870 "model_permaslug": Schema.optionalKey(Schema.String.annotate({ "description": "Canonical model slug" })),
4871 "provider_name": Schema.optionalKey(
4872 Schema.Literals([
4873 "AnyScale",
4874 "Atoma",
4875 "Cent-ML",
4876 "CrofAI",
4877 "Enfer",
4878 "GoPomelo",
4879 "HuggingFace",
4880 "Hyperbolic",
4881 "Hyperbolic 2",
4882 "InoCloud",
4883 "Kluster",
4884 "Lambda",
4885 "Lepton",
4886 "Lynn 2",
4887 "Lynn",
4888 "Mancer",
4889 "Modal",
4890 "Nineteen",
4891 "OctoAI",
4892 "Recursal",
4893 "Reflection",
4894 "Replicate",
4895 "SambaNova 2",
4896 "SF Compute",
4897 "Targon",
4898 "Together 2",
4899 "Ubicloud",
4900 "01.AI",
4901 "AkashML",
4902 "AI21",
4903 "AionLabs",
4904 "Alibaba",
4905 "Ambient",
4906 "Baidu",
4907 "Amazon Bedrock",
4908 "Amazon Nova",
4909 "Anthropic",
4910 "Arcee AI",
4911 "AtlasCloud",
4912 "Avian",
4913 "Azure",
4914 "BaseTen",
4915 "BytePlus",
4916 "Black Forest Labs",
4917 "Cerebras",
4918 "Chutes",
4919 "Cirrascale",
4920 "Clarifai",
4921 "Cloudflare",
4922 "Cohere",
4923 "CoreWeave",
4924 "Crucible",
4925 "Crusoe",
4926 "Darkbloom",
4927 "Decart",
4928 "Deepgram",
4929 "DeepInfra",
4930 "DeepSeek",
4931 "DekaLLM",
4932 "DigitalOcean",
4933 "Featherless",
4934 "Fireworks",
4935 "Fish Audio",
4936 "Friendli",
4937 "GMICloud",
4938 "Google",
4939 "Google AI Studio",
4940 "Groq",
4941 "HeyGen",
4942 "Inception",
4943 "Inceptron",
4944 "InferenceNet",
4945 "Ionstream",
4946 "Infermatic",
4947 "Io Net",
4948 "Inferact vLLM",
4949 "Inflection",
4950 "Liquid",
4951 "Mara",
4952 "Mancer 2",
4953 "Meta",
4954 "Minimax",
4955 "ModelRun",
4956 "Mistral",
4957 "Modular",
4958 "Moonshot AI",
4959 "Morph",
4960 "NCompass",
4961 "Nebius",
4962 "Nex AGI",
4963 "NextBit",
4964 "Novita",
4965 "Nvidia",
4966 "OpenAI",
4967 "OpenInference",
4968 "Parasail",
4969 "Poolside",
4970 "Perceptron",
4971 "Perplexity",
4972 "Phala",
4973 "Recraft",
4974 "Reka",
4975 "Relace",
4976 "Sail Research",
4977 "Sakana AI",
4978 "SambaNova",
4979 "Seed",
4980 "SiliconFlow",
4981 "Sourceful",
4982 "StepFun",
4983 "Stealth",
4984 "StreamLake",
4985 "Switchpoint",
4986 "Tencent",
4987 "Tenstorrent",
4988 "Together",
4989 "Upstage",
4990 "Venice",
4991 "Wafer",
4992 "WandB",
4993 "Quiver",
4994 "Krea",
4995 "Runway",
4996 "Xiaomi",
4997 "xAI",
4998 "Z.AI",
4999 "FakeProvider"
5000 ]).annotate({ "description": "Name of the provider" })
5001 ),
5002 "routed_service_tier": Schema.optionalKey(
5003 Schema.Literals(["flex", "priority"]).annotate({
5004 "description":
5005 "The service tier this request was routed to (e.g. flex, priority). The tier actually applied and billed is determined by the provider response and may differ."
5006 })
5007 ),
5008 "status": Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
5009 .annotate({ "description": "HTTP status code from the provider" })
5010}).annotate({
5011 "description": "Details of a provider response for a generation attempt",
5012 "identifier": "ProviderResponse"
5013})
5014export type ProviderSort = "price" | "throughput" | "latency" | "exacto"
5015export const ProviderSort = Schema.Literals(["price", "throughput", "latency", "exacto"]).annotate({
5016 "description": "The provider sorting strategy (price, throughput, latency)",
5017 "identifier": "ProviderSort"
5018})
5019export type ProviderSortConfig = {
5020 readonly "by"?: "price" | "throughput" | "latency" | "exacto" | null
5021 readonly "partition"?: "model" | "none" | null
5022}
5023export const ProviderSortConfig = Schema.Struct({
5024 "by": Schema.optionalKey(
5025 Schema.Union([
5026 Schema.Literal("price"),
5027 Schema.Literal("throughput"),
5028 Schema.Literal("latency"),
5029 Schema.Literal("exacto"),
5030 Schema.Null
5031 ]).annotate({ "description": "The provider sorting strategy (price, throughput, latency)" })
5032 ),
5033 "partition": Schema.optionalKey(
5034 Schema.Union([Schema.Literal("model"), Schema.Literal("none"), Schema.Null]).annotate({
5035 "description":
5036 "Partitioning strategy for sorting: \"model\" (default) groups endpoints by model before sorting (fallback models remain fallbacks), \"none\" sorts all endpoints together regardless of model."
5037 })
5038 )
5039}).annotate({
5040 "description": "The provider sorting strategy (price, throughput, latency)",
5041 "identifier": "ProviderSortConfig"
5042})
5043export type Quantization = "int4" | "int8" | "fp4" | "fp6" | "fp8" | "fp16" | "bf16" | "fp32" | "unknown"
5044export const Quantization = Schema.Literals(["int4", "int8", "fp4", "fp6", "fp8", "fp16", "bf16", "fp32", "unknown"])
5045 .annotate({ "identifier": "Quantization" })
5046export type RangeCapability = { readonly "max": number; readonly "min": number; readonly "type": "range" }
5047export const RangeCapability = Schema.Struct({
5048 "max": Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
5049 "min": Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
5050 "type": Schema.Literal("range")
5051}).annotate({
5052 "description": "A parameter that accepts any value within an inclusive numeric range.",
5053 "identifier": "RangeCapability"
5054})
5055export type RankingsDailyItem = {
5056 readonly "date": string
5057 readonly "model_permaslug": string
5058 readonly "total_tokens": string
5059}
5060export const RankingsDailyItem = Schema.Struct({
5061 "date": Schema.String.annotate({ "description": "UTC calendar date the row is aggregated over (YYYY-MM-DD)." }),
5062 "model_permaslug": Schema.String.annotate({
5063 "description":
5064 "Model variant permaslug (e.g. `openai/gpt-4o-2024-05-13`, `openai/gpt-4o-2024-05-13:free`). Non-default variants include a `:variant` suffix and are ranked as their own entry. The reserved value `other` denotes the aggregated row covering every model outside the daily top 50 for that date — always sorted last within its date."
5065 }),
5066 "total_tokens": Schema.String.annotate({
5067 "description":
5068 "Sum of `prompt_tokens + completion_tokens` for the day, returned as a decimal string so 64-bit values are not truncated."
5069 })
5070}).annotate({ "identifier": "RankingsDailyItem" })
5071export type RankingsDailyMeta = {
5072 readonly "as_of": string
5073 readonly "end_date": string
5074 readonly "start_date": string
5075 readonly "version": "v1"
5076}
5077export const RankingsDailyMeta = Schema.Struct({
5078 "as_of": Schema.String.annotate({
5079 "description":
5080 "ISO-8601 timestamp of when the response was generated. Reflects data-freshness because the underlying materialized view continuously ingests upstream events."
5081 }),
5082 "end_date": Schema.String.annotate({ "description": "Resolved end of the date window (UTC, inclusive)." }),
5083 "start_date": Schema.String.annotate({ "description": "Resolved start of the date window (UTC, inclusive)." }),
5084 "version": Schema.Literal("v1").annotate({
5085 "description": "Dataset version. Field names and grain are stable for the life of `v1`."
5086 })
5087}).annotate({ "identifier": "RankingsDailyMeta" })
5088export type ReasoningContext = "auto" | "all_turns" | "current_turn" | null
5089export const ReasoningContext = Schema.Union([
5090 Schema.Literal("auto"),
5091 Schema.Literal("all_turns"),
5092 Schema.Literal("current_turn"),
5093 Schema.Null
5094]).annotate({
5095 "description":
5096 "Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.",
5097 "identifier": "ReasoningContext"
5098})
5099export type ReasoningDeltaEvent = {
5100 readonly "content_index": number
5101 readonly "delta": string
5102 readonly "item_id": string
5103 readonly "output_index": number
5104 readonly "sequence_number": number
5105 readonly "type": "response.reasoning_text.delta"
5106}
5107export const ReasoningDeltaEvent = Schema.Struct({
5108 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5109 "delta": Schema.String,
5110 "item_id": Schema.String,
5111 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5112 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5113 "type": Schema.Literal("response.reasoning_text.delta")
5114}).annotate({
5115 "description": "Event emitted when reasoning text delta is streamed",
5116 "identifier": "ReasoningDeltaEvent"
5117})
5118export type ReasoningDoneEvent = {
5119 readonly "content_index": number
5120 readonly "item_id": string
5121 readonly "output_index": number
5122 readonly "sequence_number": number
5123 readonly "text": string
5124 readonly "type": "response.reasoning_text.done"
5125}
5126export const ReasoningDoneEvent = Schema.Struct({
5127 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5128 "item_id": Schema.String,
5129 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5130 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5131 "text": Schema.String,
5132 "type": Schema.Literal("response.reasoning_text.done")
5133}).annotate({
5134 "description": "Event emitted when reasoning text streaming is complete",
5135 "identifier": "ReasoningDoneEvent"
5136})
5137export type ReasoningEffort = "max" | "xhigh" | "high" | "medium" | "low" | "minimal" | "none" | null
5138export const ReasoningEffort = Schema.Union([
5139 Schema.Literal("max"),
5140 Schema.Literal("xhigh"),
5141 Schema.Literal("high"),
5142 Schema.Literal("medium"),
5143 Schema.Literal("low"),
5144 Schema.Literal("minimal"),
5145 Schema.Literal("none"),
5146 Schema.Null
5147]).annotate({ "identifier": "ReasoningEffort" })
5148export type ReasoningFormat =
5149 | "unknown"
5150 | "openai-responses-v1"
5151 | "azure-openai-responses-v1"
5152 | "xai-responses-v1"
5153 | "meta-responses-v1"
5154 | "anthropic-claude-v1"
5155 | "google-gemini-v1"
5156 | null
5157export const ReasoningFormat = Schema.Union([
5158 Schema.Literal("unknown"),
5159 Schema.Literal("openai-responses-v1"),
5160 Schema.Literal("azure-openai-responses-v1"),
5161 Schema.Literal("xai-responses-v1"),
5162 Schema.Literal("meta-responses-v1"),
5163 Schema.Literal("anthropic-claude-v1"),
5164 Schema.Literal("google-gemini-v1"),
5165 Schema.Null
5166]).annotate({ "identifier": "ReasoningFormat" })
5167export type ReasoningMode = "standard" | "pro" | null
5168export const ReasoningMode = Schema.Union([Schema.Literal("standard"), Schema.Literal("pro"), Schema.Null]).annotate({
5169 "description":
5170 "Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.",
5171 "identifier": "ReasoningMode"
5172})
5173export type ReasoningSummaryText = { readonly "text": string; readonly "type": "summary_text" }
5174export const ReasoningSummaryText = Schema.Struct({ "text": Schema.String, "type": Schema.Literal("summary_text") })
5175 .annotate({ "identifier": "ReasoningSummaryText" })
5176export type ReasoningSummaryTextDeltaEvent = {
5177 readonly "delta": string
5178 readonly "item_id": string
5179 readonly "output_index": number
5180 readonly "sequence_number": number
5181 readonly "summary_index": number
5182 readonly "type": "response.reasoning_summary_text.delta"
5183}
5184export const ReasoningSummaryTextDeltaEvent = Schema.Struct({
5185 "delta": Schema.String,
5186 "item_id": Schema.String,
5187 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5188 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5189 "summary_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5190 "type": Schema.Literal("response.reasoning_summary_text.delta")
5191}).annotate({
5192 "description": "Event emitted when reasoning summary text delta is streamed",
5193 "identifier": "ReasoningSummaryTextDeltaEvent"
5194})
5195export type ReasoningSummaryTextDoneEvent = {
5196 readonly "item_id": string
5197 readonly "output_index": number
5198 readonly "sequence_number": number
5199 readonly "summary_index": number
5200 readonly "text": string
5201 readonly "type": "response.reasoning_summary_text.done"
5202}
5203export const ReasoningSummaryTextDoneEvent = Schema.Struct({
5204 "item_id": Schema.String,
5205 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5206 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5207 "summary_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5208 "text": Schema.String,
5209 "type": Schema.Literal("response.reasoning_summary_text.done")
5210}).annotate({
5211 "description": "Event emitted when reasoning summary text streaming is complete",
5212 "identifier": "ReasoningSummaryTextDoneEvent"
5213})
5214export type ReasoningSummaryVerbosity = "auto" | "concise" | "detailed" | null
5215export const ReasoningSummaryVerbosity = Schema.Union([
5216 Schema.Literal("auto"),
5217 Schema.Literal("concise"),
5218 Schema.Literal("detailed"),
5219 Schema.Null
5220]).annotate({ "identifier": "ReasoningSummaryVerbosity" })
5221export type ReasoningTextContent = { readonly "text": string; readonly "type": "reasoning_text" }
5222export const ReasoningTextContent = Schema.Struct({ "text": Schema.String, "type": Schema.Literal("reasoning_text") })
5223 .annotate({ "identifier": "ReasoningTextContent" })
5224export type RefusalDeltaEvent = {
5225 readonly "content_index": number
5226 readonly "delta": string
5227 readonly "item_id": string
5228 readonly "output_index": number
5229 readonly "sequence_number": number
5230 readonly "type": "response.refusal.delta"
5231}
5232export const RefusalDeltaEvent = Schema.Struct({
5233 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5234 "delta": Schema.String,
5235 "item_id": Schema.String,
5236 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5237 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5238 "type": Schema.Literal("response.refusal.delta")
5239}).annotate({ "description": "Event emitted when a refusal delta is streamed", "identifier": "RefusalDeltaEvent" })
5240export type RefusalDoneEvent = {
5241 readonly "content_index": number
5242 readonly "item_id": string
5243 readonly "output_index": number
5244 readonly "refusal": string
5245 readonly "sequence_number": number
5246 readonly "type": "response.refusal.done"
5247}
5248export const RefusalDoneEvent = Schema.Struct({
5249 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5250 "item_id": Schema.String,
5251 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5252 "refusal": Schema.String,
5253 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5254 "type": Schema.Literal("response.refusal.done")
5255}).annotate({ "description": "Event emitted when refusal streaming is complete", "identifier": "RefusalDoneEvent" })
5256export type Objects_149 = { readonly [x: string]: string }
5257export const Objects_149 = Schema.Record(
5258 Schema.String,
5259 Schema.String.check(Schema.isMaxLength(512).annotate({ "expected": "a value with a length of at most 512" }))
5260)
5261export type RequestTimeoutResponseErrorData = {
5262 readonly "code": number
5263 readonly "message": string
5264 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
5265}
5266export const RequestTimeoutResponseErrorData = Schema.Struct({
5267 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5268 "message": Schema.String,
5269 "metadata": Schema.optionalKey(
5270 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
5271 )
5272}).annotate({ "description": "Error data for RequestTimeoutResponse", "identifier": "RequestTimeoutResponseErrorData" })
5273export type ResponseHealingPlugin = { readonly "enabled"?: boolean; readonly "id": "response-healing" }
5274export const ResponseHealingPlugin = Schema.Struct({
5275 "enabled": Schema.optionalKey(
5276 Schema.Boolean.annotate({
5277 "description": "Set to false to disable the response-healing plugin for this request. Defaults to true."
5278 })
5279 ),
5280 "id": Schema.Literal("response-healing")
5281}).annotate({ "identifier": "ResponseHealingPlugin" })
5282export type ResponseIncludesEnum =
5283 | "file_search_call.results"
5284 | "message.input_image.image_url"
5285 | "computer_call_output.output.image_url"
5286 | "reasoning.encrypted_content"
5287 | "code_interpreter_call.outputs"
5288export const ResponseIncludesEnum = Schema.Literals([
5289 "file_search_call.results",
5290 "message.input_image.image_url",
5291 "computer_call_output.output.image_url",
5292 "reasoning.encrypted_content",
5293 "code_interpreter_call.outputs"
5294]).annotate({ "identifier": "ResponseIncludesEnum" })
5295export type ResponsesErrorField = {
5296 readonly "code":
5297 | "server_error"
5298 | "rate_limit_exceeded"
5299 | "invalid_prompt"
5300 | "vector_store_timeout"
5301 | "invalid_image"
5302 | "invalid_image_format"
5303 | "invalid_base64_image"
5304 | "invalid_image_url"
5305 | "image_too_large"
5306 | "image_too_small"
5307 | "image_parse_error"
5308 | "image_content_policy_violation"
5309 | "invalid_image_mode"
5310 | "image_file_too_large"
5311 | "unsupported_image_media_type"
5312 | "empty_image_file"
5313 | "failed_to_download_image"
5314 | "image_file_not_found"
5315 | "bio_policy"
5316 readonly "message": string
5317 readonly [x: string]: Schema.Json
5318} | null
5319export const ResponsesErrorField = Schema.Union([
5320 Schema.StructWithRest(
5321 Schema.Struct({
5322 "code": Schema.Literals([
5323 "server_error",
5324 "rate_limit_exceeded",
5325 "invalid_prompt",
5326 "vector_store_timeout",
5327 "invalid_image",
5328 "invalid_image_format",
5329 "invalid_base64_image",
5330 "invalid_image_url",
5331 "image_too_large",
5332 "image_too_small",
5333 "image_parse_error",
5334 "image_content_policy_violation",
5335 "invalid_image_mode",
5336 "image_file_too_large",
5337 "unsupported_image_media_type",
5338 "empty_image_file",
5339 "failed_to_download_image",
5340 "image_file_not_found",
5341 "bio_policy"
5342 ]),
5343 "message": Schema.String
5344 }),
5345 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
5346 ),
5347 Schema.Null
5348]).annotate({ "description": "Error information returned from the API", "identifier": "ResponsesErrorField" })
5349export type RouterAttempt = { readonly "model": string; readonly "provider": string; readonly "status": number }
5350export const RouterAttempt = Schema.Struct({
5351 "model": Schema.String,
5352 "provider": Schema.String,
5353 "status": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
5354}).annotate({ "identifier": "RouterAttempt" })
5355export type RouterParams = {
5356 readonly "quality_floor"?: number
5357 readonly "throughput_floor"?: number
5358 readonly "version_group"?: string
5359}
5360export const RouterParams = Schema.Struct({
5361 "quality_floor": Schema.optionalKey(
5362 Schema.Number.annotate({ "format": "double" }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
5363 ),
5364 "throughput_floor": Schema.optionalKey(
5365 Schema.Number.annotate({ "format": "double" }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
5366 ),
5367 "version_group": Schema.optionalKey(Schema.String)
5368}).annotate({ "identifier": "RouterParams" })
5369export type RoutingStrategy =
5370 | "direct"
5371 | "auto"
5372 | "free"
5373 | "latest"
5374 | "alias"
5375 | "fallback"
5376 | "pareto"
5377 | "bodybuilder"
5378 | "fusion"
5379export const RoutingStrategy = Schema.Literals([
5380 "direct",
5381 "auto",
5382 "free",
5383 "latest",
5384 "alias",
5385 "fallback",
5386 "pareto",
5387 "bodybuilder",
5388 "fusion"
5389]).annotate({ "identifier": "RoutingStrategy" })
5390export type SandboxSleepAfterSeconds = number
5391export const SandboxSleepAfterSeconds = Schema.Number.annotate({
5392 "description":
5393 "How long (in seconds) the container stays warm after its last command before sleeping, freeing its capacity slot. Idle-based: each command renews the timer. Defaults to 900 (15 minutes); capped at 2592000 (30 days)."
5394}).check(Schema.isInt().annotate({ "expected": "an integer", "identifier": "SandboxSleepAfterSeconds" }))
5395export type SearchContextSizeEnum = "low" | "medium" | "high"
5396export const SearchContextSizeEnum = Schema.Literals(["low", "medium", "high"]).annotate({
5397 "description": "Size of the search context for web search tools",
5398 "identifier": "SearchContextSizeEnum"
5399})
5400export type SearchModelsServerToolConfig = { readonly "max_results"?: number }
5401export const SearchModelsServerToolConfig = Schema.Struct({
5402 "max_results": Schema.optionalKey(
5403 Schema.Number.annotate({ "description": "Maximum number of models to return. Defaults to 5, max 20." }).check(
5404 Schema.isInt().annotate({ "expected": "an integer" })
5405 )
5406 )
5407}).annotate({
5408 "description": "Configuration for the openrouter:experimental__search_models server tool",
5409 "identifier": "SearchModelsServerToolConfig"
5410})
5411export type SearchQualityLevel = "low" | "medium" | "high"
5412export const SearchQualityLevel = Schema.Literals(["low", "medium", "high"]).annotate({
5413 "description":
5414 "How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set.",
5415 "identifier": "SearchQualityLevel"
5416})
5417export type Objects_150 = {
5418 readonly "tool_calls_executed"?: number | null
5419 readonly "tool_calls_requested"?: number | null
5420 readonly "web_search_requests"?: number | null
5421 readonly [x: string]: Schema.Json
5422}
5423export const Objects_150 = Schema.StructWithRest(
5424 Schema.Struct({
5425 "tool_calls_executed": Schema.optionalKey(
5426 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]).annotate({
5427 "description": "Number of OpenRouter server tool calls that executed and produced a result."
5428 })
5429 ),
5430 "tool_calls_requested": Schema.optionalKey(
5431 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]).annotate({
5432 "description":
5433 "Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here."
5434 })
5435 ),
5436 "web_search_requests": Schema.optionalKey(
5437 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]).annotate({
5438 "description":
5439 "Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two."
5440 })
5441 )
5442 }),
5443 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
5444)
5445export type ServiceTier = "auto" | "default" | "flex" | "priority" | "scale" | null
5446export const ServiceTier = Schema.Union([
5447 Schema.Literal("auto"),
5448 Schema.Literal("default"),
5449 Schema.Literal("flex"),
5450 Schema.Literal("priority"),
5451 Schema.Literal("scale"),
5452 Schema.Null
5453]).annotate({ "identifier": "ServiceTier" })
5454export type ServiceUnavailableResponseErrorData = {
5455 readonly "code": number
5456 readonly "message": string
5457 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
5458}
5459export const ServiceUnavailableResponseErrorData = Schema.Struct({
5460 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5461 "message": Schema.String,
5462 "metadata": Schema.optionalKey(
5463 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
5464 )
5465}).annotate({
5466 "description": "Error data for ServiceUnavailableResponse",
5467 "identifier": "ServiceUnavailableResponseErrorData"
5468})
5469export type ShellCallStatus = "in_progress" | "completed" | "incomplete"
5470export const ShellCallStatus = Schema.Literals(["in_progress", "completed", "incomplete"]).annotate({
5471 "description": "Status of a shell call or its output.",
5472 "identifier": "ShellCallStatus"
5473})
5474export type ShellServerTool = { readonly "type": "shell" }
5475export const ShellServerTool = Schema.Struct({ "type": Schema.Literal("shell") }).annotate({
5476 "description": "Shell tool configuration",
5477 "identifier": "ShellServerTool"
5478})
5479export type ShellServerToolEngine = "auto" | "openrouter"
5480export const ShellServerToolEngine = Schema.Literals(["auto", "openrouter"]).annotate({
5481 "description":
5482 "Which shell engine to use. \"openrouter\" runs commands server-side in the OpenRouter sandbox. \"auto\" (default) keeps the provider's native hosted shell when available (OpenAI); on other providers the call is routed to the OpenRouter sandbox.",
5483 "identifier": "ShellServerToolEngine"
5484})
5485export type StopServerToolsWhenFinishReasonIs = { readonly "reason": string; readonly "type": "finish_reason_is" }
5486export const StopServerToolsWhenFinishReasonIs = Schema.Struct({
5487 "reason": Schema.String.check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })),
5488 "type": Schema.Literal("finish_reason_is")
5489}).annotate({
5490 "description": "Stop when the upstream model emits this finish reason (e.g. `length`).",
5491 "identifier": "StopServerToolsWhenFinishReasonIs"
5492})
5493export type StopServerToolsWhenHasToolCall = { readonly "tool_name": string; readonly "type": "has_tool_call" }
5494export const StopServerToolsWhenHasToolCall = Schema.Struct({
5495 "tool_name": Schema.String.check(
5496 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
5497 ),
5498 "type": Schema.Literal("has_tool_call")
5499}).annotate({
5500 "description": "Stop after a tool with this name has been called.",
5501 "identifier": "StopServerToolsWhenHasToolCall"
5502})
5503export type StopServerToolsWhenMaxCost = { readonly "max_cost_in_dollars": number; readonly "type": "max_cost" }
5504export const StopServerToolsWhenMaxCost = Schema.Struct({
5505 "max_cost_in_dollars": Schema.Number.annotate({ "format": "double" }).check(
5506 Schema.isFinite().annotate({ "expected": "a finite number" })
5507 ),
5508 "type": Schema.Literal("max_cost")
5509}).annotate({
5510 "description": "Stop once cumulative cost across the loop exceeds this dollar threshold.",
5511 "identifier": "StopServerToolsWhenMaxCost"
5512})
5513export type StopServerToolsWhenMaxTokensUsed = { readonly "max_tokens": number; readonly "type": "max_tokens_used" }
5514export const StopServerToolsWhenMaxTokensUsed = Schema.Struct({
5515 "max_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5516 "type": Schema.Literal("max_tokens_used")
5517}).annotate({
5518 "description": "Stop once cumulative token usage across the loop exceeds this threshold.",
5519 "identifier": "StopServerToolsWhenMaxTokensUsed"
5520})
5521export type StopServerToolsWhenStepCountIs = { readonly "step_count": number; readonly "type": "step_count_is" }
5522export const StopServerToolsWhenStepCountIs = Schema.Struct({
5523 "step_count": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5524 "type": Schema.Literal("step_count_is")
5525}).annotate({
5526 "description": "Stop after the agent loop has executed this many steps.",
5527 "identifier": "StopServerToolsWhenStepCountIs"
5528})
5529export type StreamLogprob = {
5530 readonly "bytes"?: ReadonlyArray<number>
5531 readonly "logprob": number
5532 readonly "token": string
5533 readonly "top_logprobs"?: ReadonlyArray<
5534 { readonly "bytes"?: ReadonlyArray<number>; readonly "logprob"?: number; readonly "token"?: string }
5535 >
5536}
5537export const StreamLogprob = Schema.Struct({
5538 "bytes": Schema.optionalKey(Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })))),
5539 "logprob": Schema.Number.annotate({ "format": "double" }).check(
5540 Schema.isFinite().annotate({ "expected": "a finite number" })
5541 ),
5542 "token": Schema.String,
5543 "top_logprobs": Schema.optionalKey(Schema.Array(
5544 Schema.Struct({
5545 "bytes": Schema.optionalKey(
5546 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })))
5547 ),
5548 "logprob": Schema.optionalKey(
5549 Schema.Number.annotate({ "format": "double" }).check(
5550 Schema.isFinite().annotate({ "expected": "a finite number" })
5551 )
5552 ),
5553 "token": Schema.optionalKey(Schema.String)
5554 }).annotate({ "description": "Alternative token with its log probability" })
5555 ))
5556}).annotate({ "description": "Log probability information for a token", "identifier": "StreamLogprob" })
5557export type StreamLogprobTopLogprob = {
5558 readonly "bytes"?: ReadonlyArray<number>
5559 readonly "logprob"?: number
5560 readonly "token"?: string
5561}
5562export const StreamLogprobTopLogprob = Schema.Struct({
5563 "bytes": Schema.optionalKey(Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })))),
5564 "logprob": Schema.optionalKey(
5565 Schema.Number.annotate({ "format": "double" }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
5566 ),
5567 "token": Schema.optionalKey(Schema.String)
5568}).annotate({ "description": "Alternative token with its log probability", "identifier": "StreamLogprobTopLogprob" })
5569export type STTInputAudio = { readonly "data": string; readonly "format": string }
5570export const STTInputAudio = Schema.Struct({
5571 "data": Schema.String.annotate({ "description": "Base64-encoded audio data (raw bytes, not a data URI)" }),
5572 "format": Schema.String.annotate({
5573 "description": "Audio format (e.g., wav, mp3, flac, m4a, ogg, webm, aac). Supported formats vary by provider."
5574 })
5575}).annotate({ "description": "Base64-encoded audio to transcribe", "identifier": "STTInputAudio" })
5576export type STTSegment = {
5577 readonly "avg_logprob"?: number
5578 readonly "compression_ratio"?: number
5579 readonly "end": number
5580 readonly "id": number
5581 readonly "no_speech_prob"?: number
5582 readonly "seek"?: number
5583 readonly "start": number
5584 readonly "temperature"?: number
5585 readonly "text": string
5586 readonly "tokens"?: ReadonlyArray<number>
5587}
5588export const STTSegment = Schema.Struct({
5589 "avg_logprob": Schema.optionalKey(
5590 Schema.Number.annotate({ "description": "Average log probability of the segment", "format": "double" }).check(
5591 Schema.isFinite().annotate({ "expected": "a finite number" })
5592 )
5593 ),
5594 "compression_ratio": Schema.optionalKey(
5595 Schema.Number.annotate({ "description": "Compression ratio of the segment", "format": "double" }).check(
5596 Schema.isFinite().annotate({ "expected": "a finite number" })
5597 )
5598 ),
5599 "end": Schema.Number.annotate({ "description": "Segment end time in seconds", "format": "double" }).check(
5600 Schema.isFinite().annotate({ "expected": "a finite number" })
5601 ),
5602 "id": Schema.Number.annotate({ "description": "Segment index within the transcript" }).check(
5603 Schema.isInt().annotate({ "expected": "an integer" })
5604 ),
5605 "no_speech_prob": Schema.optionalKey(
5606 Schema.Number.annotate({ "description": "Probability the segment contains no speech", "format": "double" }).check(
5607 Schema.isFinite().annotate({ "expected": "a finite number" })
5608 )
5609 ),
5610 "seek": Schema.optionalKey(
5611 Schema.Number.annotate({ "description": "Seek offset of the segment" }).check(
5612 Schema.isInt().annotate({ "expected": "an integer" })
5613 )
5614 ),
5615 "start": Schema.Number.annotate({ "description": "Segment start time in seconds", "format": "double" }).check(
5616 Schema.isFinite().annotate({ "expected": "a finite number" })
5617 ),
5618 "temperature": Schema.optionalKey(
5619 Schema.Number.annotate({ "description": "Temperature used for the segment", "format": "double" }).check(
5620 Schema.isFinite().annotate({ "expected": "a finite number" })
5621 )
5622 ),
5623 "text": Schema.String.annotate({ "description": "Transcribed text of the segment" }),
5624 "tokens": Schema.optionalKey(
5625 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))).annotate({
5626 "description": "Token IDs of the segment"
5627 })
5628 )
5629}).annotate({
5630 "description": "A timestamped transcript segment, returned when response_format is verbose_json",
5631 "identifier": "STTSegment"
5632})
5633export type STTTimestampGranularity = "word" | "segment"
5634export const STTTimestampGranularity = Schema.Literals(["word", "segment"]).annotate({
5635 "description": "A timestamp detail level for verbose_json transcription responses.",
5636 "identifier": "STTTimestampGranularity"
5637})
5638export type STTUsage = {
5639 readonly "cost"?: number
5640 readonly "input_tokens"?: number
5641 readonly "output_tokens"?: number
5642 readonly "seconds"?: number
5643 readonly "total_tokens"?: number
5644}
5645export const STTUsage = Schema.Struct({
5646 "cost": Schema.optionalKey(
5647 Schema.Number.annotate({ "description": "Total cost of the request in USD", "format": "double" }).check(
5648 Schema.isFinite().annotate({ "expected": "a finite number" })
5649 )
5650 ),
5651 "input_tokens": Schema.optionalKey(
5652 Schema.Number.annotate({ "description": "Number of input tokens billed for this request" }).check(
5653 Schema.isInt().annotate({ "expected": "an integer" })
5654 )
5655 ),
5656 "output_tokens": Schema.optionalKey(
5657 Schema.Number.annotate({ "description": "Number of output tokens generated" }).check(
5658 Schema.isInt().annotate({ "expected": "an integer" })
5659 )
5660 ),
5661 "seconds": Schema.optionalKey(
5662 Schema.Number.annotate({ "description": "Duration of the input audio in seconds", "format": "double" }).check(
5663 Schema.isFinite().annotate({ "expected": "a finite number" })
5664 )
5665 ),
5666 "total_tokens": Schema.optionalKey(
5667 Schema.Number.annotate({ "description": "Total number of tokens used (input + output)" }).check(
5668 Schema.isInt().annotate({ "expected": "an integer" })
5669 )
5670 )
5671}).annotate({ "description": "Aggregated usage statistics for the request", "identifier": "STTUsage" })
5672export type STTWord = {
5673 readonly "end": number
5674 readonly "speaker"?: number
5675 readonly "start": number
5676 readonly "word": string
5677}
5678export const STTWord = Schema.Struct({
5679 "end": Schema.Number.annotate({ "description": "Word end time in seconds", "format": "double" }).check(
5680 Schema.isFinite().annotate({ "expected": "a finite number" })
5681 ),
5682 "speaker": Schema.optionalKey(
5683 Schema.Number.annotate({
5684 "description": "Zero-based speaker index for the word, present when the provider returns speaker diarization"
5685 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
5686 ),
5687 "start": Schema.Number.annotate({ "description": "Word start time in seconds", "format": "double" }).check(
5688 Schema.isFinite().annotate({ "expected": "a finite number" })
5689 ),
5690 "word": Schema.String.annotate({ "description": "The transcribed word" })
5691}).annotate({
5692 "description": "A timestamped word, returned when the provider includes word-level timestamps",
5693 "identifier": "STTWord"
5694})
5695export type SubagentNestedTool = { readonly "parameters"?: {}; readonly "type": string }
5696export const SubagentNestedTool = Schema.Struct({
5697 "parameters": Schema.optionalKey(Schema.Struct({})),
5698 "type": Schema.String
5699}).annotate({
5700 "description":
5701 "A tool made available to the subagent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the worker has no way to execute them. The subagent tool may not list itself.",
5702 "identifier": "SubagentNestedTool"
5703})
5704export type SubagentReasoning = {
5705 readonly "effort"?: "max" | "xhigh" | "high" | "medium" | "low" | "minimal" | "none"
5706 readonly "max_tokens"?: number
5707}
5708export const SubagentReasoning = Schema.Struct({
5709 "effort": Schema.optionalKey(
5710 Schema.Literals(["max", "xhigh", "high", "medium", "low", "minimal", "none"]).annotate({
5711 "description": "Reasoning effort level for the subagent call."
5712 })
5713 ),
5714 "max_tokens": Schema.optionalKey(
5715 Schema.Number.annotate({
5716 "description":
5717 "Maximum number of reasoning tokens the subagent may use. Accepted and validated but not yet forwarded to the subagent call."
5718 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
5719 )
5720}).annotate({
5721 "description":
5722 "Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking.",
5723 "identifier": "SubagentReasoning"
5724})
5725export type SubmitGenerationFeedbackRequest = {
5726 readonly "category":
5727 | "latency"
5728 | "incoherence"
5729 | "incorrect_response"
5730 | "formatting"
5731 | "billing"
5732 | "api_error"
5733 | "other"
5734 readonly "comment"?: string
5735 readonly "generation_id": string
5736}
5737export const SubmitGenerationFeedbackRequest = Schema.Struct({
5738 "category": Schema.Literals([
5739 "latency",
5740 "incoherence",
5741 "incorrect_response",
5742 "formatting",
5743 "billing",
5744 "api_error",
5745 "other"
5746 ]).annotate({ "description": "The category of feedback being reported" }),
5747 "comment": Schema.optionalKey(
5748 Schema.String.annotate({ "description": "An optional free-text comment describing the feedback" }).check(
5749 Schema.isMaxLength(1000).annotate({ "expected": "a value with a length of at most 1000" })
5750 )
5751 ),
5752 "generation_id": Schema.String.annotate({ "description": "The generation to submit feedback on" }).check(
5753 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
5754 )
5755}).annotate({
5756 "description": "Structured feedback about a specific generation",
5757 "identifier": "SubmitGenerationFeedbackRequest"
5758})
5759export type SubmitGenerationFeedbackResponse = { readonly "data": { readonly "success": true } }
5760export const SubmitGenerationFeedbackResponse = Schema.Struct({
5761 "data": Schema.Struct({
5762 "success": Schema.Literal(true).annotate({ "description": "Whether the feedback was recorded" })
5763 })
5764}).annotate({
5765 "description": "Confirmation that the feedback was recorded",
5766 "identifier": "SubmitGenerationFeedbackResponse"
5767})
5768export type SupportedParameters = {}
5769export const SupportedParameters = Schema.Struct({}).annotate({
5770 "description":
5771 "Union of supported parameters across every endpoint of this model. Coarse discovery aid; the definitive per-endpoint set is behind the endpoints URL.",
5772 "identifier": "SupportedParameters"
5773})
5774export type TaskClassificationMacroCategory = {
5775 readonly "key": string
5776 readonly "label": string
5777 readonly "token_share": number
5778 readonly "usage_share": number
5779}
5780export const TaskClassificationMacroCategory = Schema.Struct({
5781 "key": Schema.String.annotate({ "description": "Macro-category identifier." }),
5782 "label": Schema.String.annotate({ "description": "Human-readable label for the macro-category." }),
5783 "token_share": Schema.Number.annotate({
5784 "description": "Combined token share of all classifications in this macro-category (0–1).",
5785 "format": "double"
5786 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
5787 "usage_share": Schema.Number.annotate({
5788 "description": "Combined usage share of all classifications in this macro-category (0–1).",
5789 "format": "double"
5790 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
5791}).annotate({ "identifier": "TaskClassificationMacroCategory" })
5792export type TaskClassificationModel = {
5793 readonly "id": string
5794 readonly "tag_token_share": number
5795 readonly "tag_usage_share": number
5796}
5797export const TaskClassificationModel = Schema.Struct({
5798 "id": Schema.String.annotate({ "description": "Model identifier (permaslug)." }),
5799 "tag_token_share": Schema.Number.annotate({
5800 "description":
5801 "Fraction of this classification's sampled token volume attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded).",
5802 "format": "double"
5803 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
5804 "tag_usage_share": Schema.Number.annotate({
5805 "description":
5806 "Fraction of this classification's sampled requests attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded).",
5807 "format": "double"
5808 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
5809}).annotate({ "identifier": "TaskClassificationModel" })
5810export type TextDeltaEvent = {
5811 readonly "content_index": number
5812 readonly "delta": string
5813 readonly "item_id": string
5814 readonly "logprobs": ReadonlyArray<
5815 {
5816 readonly "bytes"?: ReadonlyArray<number>
5817 readonly "logprob": number
5818 readonly "token": string
5819 readonly "top_logprobs"?: ReadonlyArray<
5820 { readonly "bytes"?: ReadonlyArray<number>; readonly "logprob"?: number; readonly "token"?: string }
5821 >
5822 }
5823 >
5824 readonly "output_index": number
5825 readonly "sequence_number": number
5826 readonly "type": "response.output_text.delta"
5827}
5828export const TextDeltaEvent = Schema.Struct({
5829 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5830 "delta": Schema.String,
5831 "item_id": Schema.String,
5832 "logprobs": Schema.Array(
5833 Schema.Struct({
5834 "bytes": Schema.optionalKey(
5835 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })))
5836 ),
5837 "logprob": Schema.Number.annotate({ "format": "double" }).check(
5838 Schema.isFinite().annotate({ "expected": "a finite number" })
5839 ),
5840 "token": Schema.String,
5841 "top_logprobs": Schema.optionalKey(Schema.Array(
5842 Schema.Struct({
5843 "bytes": Schema.optionalKey(
5844 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })))
5845 ),
5846 "logprob": Schema.optionalKey(
5847 Schema.Number.annotate({ "format": "double" }).check(
5848 Schema.isFinite().annotate({ "expected": "a finite number" })
5849 )
5850 ),
5851 "token": Schema.optionalKey(Schema.String)
5852 }).annotate({ "description": "Alternative token with its log probability" })
5853 ))
5854 }).annotate({ "description": "Log probability information for a token" })
5855 ),
5856 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5857 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5858 "type": Schema.Literal("response.output_text.delta")
5859}).annotate({ "description": "Event emitted when a text delta is streamed", "identifier": "TextDeltaEvent" })
5860export type TextDoneEvent = {
5861 readonly "content_index": number
5862 readonly "item_id": string
5863 readonly "logprobs": ReadonlyArray<
5864 {
5865 readonly "bytes"?: ReadonlyArray<number>
5866 readonly "logprob": number
5867 readonly "token": string
5868 readonly "top_logprobs"?: ReadonlyArray<
5869 { readonly "bytes"?: ReadonlyArray<number>; readonly "logprob"?: number; readonly "token"?: string }
5870 >
5871 }
5872 >
5873 readonly "output_index": number
5874 readonly "sequence_number": number
5875 readonly "text": string
5876 readonly "type": "response.output_text.done"
5877}
5878export const TextDoneEvent = Schema.Struct({
5879 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5880 "item_id": Schema.String,
5881 "logprobs": Schema.Array(
5882 Schema.Struct({
5883 "bytes": Schema.optionalKey(
5884 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })))
5885 ),
5886 "logprob": Schema.Number.annotate({ "format": "double" }).check(
5887 Schema.isFinite().annotate({ "expected": "a finite number" })
5888 ),
5889 "token": Schema.String,
5890 "top_logprobs": Schema.optionalKey(Schema.Array(
5891 Schema.Struct({
5892 "bytes": Schema.optionalKey(
5893 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })))
5894 ),
5895 "logprob": Schema.optionalKey(
5896 Schema.Number.annotate({ "format": "double" }).check(
5897 Schema.isFinite().annotate({ "expected": "a finite number" })
5898 )
5899 ),
5900 "token": Schema.optionalKey(Schema.String)
5901 }).annotate({ "description": "Alternative token with its log probability" })
5902 ))
5903 }).annotate({ "description": "Log probability information for a token" })
5904 ),
5905 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5906 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5907 "text": Schema.String,
5908 "type": Schema.Literal("response.output_text.done")
5909}).annotate({ "description": "Event emitted when text streaming is complete", "identifier": "TextDoneEvent" })
5910export type ToolCallStatus = "in_progress" | "completed" | "incomplete"
5911export const ToolCallStatus = Schema.Literals(["in_progress", "completed", "incomplete"]).annotate({
5912 "identifier": "ToolCallStatus"
5913})
5914export type ToolChoiceAllowed = {
5915 readonly "mode": "auto" | "required"
5916 readonly "tools": ReadonlyArray<{}>
5917 readonly "type": "allowed_tools"
5918}
5919export const ToolChoiceAllowed = Schema.Struct({
5920 "mode": Schema.Literals(["auto", "required"]),
5921 "tools": Schema.Array(Schema.Struct({})),
5922 "type": Schema.Literal("allowed_tools")
5923}).annotate({
5924 "description": "Constrains the model to a pre-defined set of allowed tools",
5925 "identifier": "ToolChoiceAllowed"
5926})
5927export type TooManyRequestsResponseErrorData = {
5928 readonly "code": number
5929 readonly "message": string
5930 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
5931}
5932export const TooManyRequestsResponseErrorData = Schema.Struct({
5933 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5934 "message": Schema.String,
5935 "metadata": Schema.optionalKey(
5936 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
5937 )
5938}).annotate({
5939 "description": "Error data for TooManyRequestsResponse",
5940 "identifier": "TooManyRequestsResponseErrorData"
5941})
5942export type TopProviderInfo = {
5943 readonly "context_length"?: number | null
5944 readonly "is_moderated": boolean
5945 readonly "max_completion_tokens"?: number | null
5946}
5947export const TopProviderInfo = Schema.Struct({
5948 "context_length": Schema.optionalKey(
5949 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]).annotate({
5950 "description": "Context length from the top provider"
5951 })
5952 ),
5953 "is_moderated": Schema.Boolean.annotate({ "description": "Whether the top provider moderates content" }),
5954 "max_completion_tokens": Schema.optionalKey(
5955 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]).annotate({
5956 "description": "Maximum completion tokens from the top provider"
5957 })
5958 )
5959}).annotate({ "description": "Information about the top provider for this model", "identifier": "TopProviderInfo" })
5960export type TraceConfig = {
5961 readonly "generation_name"?: string
5962 readonly "parent_span_id"?: string
5963 readonly "span_name"?: string
5964 readonly "trace_id"?: string
5965 readonly "trace_name"?: string
5966}
5967export const TraceConfig = Schema.Struct({
5968 "generation_name": Schema.optionalKey(Schema.String),
5969 "parent_span_id": Schema.optionalKey(Schema.String),
5970 "span_name": Schema.optionalKey(Schema.String),
5971 "trace_id": Schema.optionalKey(Schema.String),
5972 "trace_name": Schema.optionalKey(Schema.String)
5973}).annotate({
5974 "description":
5975 "Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.",
5976 "identifier": "TraceConfig"
5977})
5978export type Truncation = "auto" | "disabled" | null
5979export const Truncation = Schema.Union([Schema.Literal("auto"), Schema.Literal("disabled"), Schema.Null]).annotate({
5980 "identifier": "Truncation"
5981})
5982export type UnauthorizedResponseErrorData = {
5983 readonly "code": number
5984 readonly "message": string
5985 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
5986}
5987export const UnauthorizedResponseErrorData = Schema.Struct({
5988 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
5989 "message": Schema.String,
5990 "metadata": Schema.optionalKey(
5991 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
5992 )
5993}).annotate({ "description": "Error data for UnauthorizedResponse", "identifier": "UnauthorizedResponseErrorData" })
5994export type UnifiedBenchmarkPricing = {
5995 readonly "completion": string
5996 readonly "prompt": string
5997 readonly [x: string]: Schema.Json
5998} | null
5999export const UnifiedBenchmarkPricing = Schema.Union([
6000 Schema.StructWithRest(
6001 Schema.Struct({
6002 "completion": Schema.String.annotate({ "description": "Cost per output token (USD, decimal string)." }),
6003 "prompt": Schema.String.annotate({ "description": "Cost per input token (USD, decimal string)." })
6004 }),
6005 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
6006 ),
6007 Schema.Null
6008]).annotate({
6009 "description": "OpenRouter pricing per token for this model. Null if pricing is unavailable.",
6010 "identifier": "UnifiedBenchmarkPricing"
6011})
6012export type UnifiedBenchmarksMeta = {
6013 readonly "as_of": string
6014 readonly "citation": string | null
6015 readonly "model_count": number
6016 readonly "source": "artificial-analysis" | "design-arena" | null
6017 readonly "source_url": string | null
6018 readonly "task_type": string | null
6019 readonly "version": "v1"
6020}
6021export const UnifiedBenchmarksMeta = Schema.Struct({
6022 "as_of": Schema.String.annotate({ "description": "ISO-8601 timestamp of when this data was last updated." }),
6023 "citation": Schema.Union([Schema.String, Schema.Null]).annotate({
6024 "description":
6025 "Required attribution when republishing this data, or null when results span multiple sources (attribute each item individually by its `source` discriminator)."
6026 }),
6027 "model_count": Schema.Number.annotate({ "description": "Number of unique models in the response." }).check(
6028 Schema.isInt().annotate({ "expected": "an integer" })
6029 ),
6030 "source": Schema.Union([Schema.Literal("artificial-analysis"), Schema.Literal("design-arena"), Schema.Null]).annotate(
6031 { "description": "The source filter applied, or null when all sources are returned." }
6032 ),
6033 "source_url": Schema.Union([Schema.String, Schema.Null]).annotate({
6034 "description": "URL of the upstream data source, or null when results span multiple sources."
6035 }),
6036 "task_type": Schema.Union([Schema.String, Schema.Null]).annotate({
6037 "description": "The task_type filter applied, or null if showing all."
6038 }),
6039 "version": Schema.Literal("v1").annotate({ "description": "Dataset version." })
6040}).annotate({ "identifier": "UnifiedBenchmarksMeta" })
6041export type UnprocessableEntityResponseErrorData = {
6042 readonly "code": number
6043 readonly "message": string
6044 readonly "metadata"?: { readonly [x: string]: Schema.Json } | null
6045}
6046export const UnprocessableEntityResponseErrorData = Schema.Struct({
6047 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6048 "message": Schema.String,
6049 "metadata": Schema.optionalKey(
6050 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
6051 )
6052}).annotate({
6053 "description": "Error data for UnprocessableEntityResponse",
6054 "identifier": "UnprocessableEntityResponseErrorData"
6055})
6056export type UpdateBYOKKeyRequest = {
6057 readonly "allowed_models"?: ReadonlyArray<string> | null
6058 readonly "allowed_user_ids"?: ReadonlyArray<string> | null
6059 readonly "disabled"?: boolean
6060 readonly "is_fallback"?: boolean
6061 readonly "key"?: string
6062 readonly "name"?: string | null
6063}
6064export const UpdateBYOKKeyRequest = Schema.Struct({
6065 "allowed_models": Schema.optionalKey(
6066 Schema.Union([
6067 Schema.Array(Schema.String).check(
6068 Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" })
6069 ),
6070 Schema.Null
6071 ]).annotate({
6072 "description": "Optional allowlist of model slugs this credential may be used for. `null` means no restriction."
6073 })
6074 ),
6075 "allowed_user_ids": Schema.optionalKey(
6076 Schema.Union([
6077 Schema.Array(Schema.String).check(
6078 Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" })
6079 ),
6080 Schema.Null
6081 ]).annotate({
6082 "description": "Optional allowlist of user IDs that may use this credential. `null` means no restriction."
6083 })
6084 ),
6085 "disabled": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Whether this credential is disabled." })),
6086 "is_fallback": Schema.optionalKey(
6087 Schema.Boolean.annotate({
6088 "description":
6089 "Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried."
6090 })
6091 ),
6092 "key": Schema.optionalKey(
6093 Schema.String.annotate({
6094 "description":
6095 "A new raw provider API key to rotate the credential in-place. The previous key material is overwritten and the masked label is regenerated. Encrypted at rest and never returned in API responses."
6096 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
6097 ),
6098 "name": Schema.optionalKey(
6099 Schema.Union([
6100 Schema.String.check(Schema.isMaxLength(255).annotate({ "expected": "a value with a length of at most 255" })),
6101 Schema.Null
6102 ]).annotate({ "description": "Optional human-readable name for the credential." })
6103 )
6104}).annotate({ "identifier": "UpdateBYOKKeyRequest" })
6105export type UpdateWorkspaceRequest = {
6106 readonly "default_image_model"?: string | null
6107 readonly "default_provider_sort"?: string | null
6108 readonly "default_text_model"?: string | null
6109 readonly "description"?: string | null
6110 readonly "io_logging_api_key_ids"?: ReadonlyArray<number> | null
6111 readonly "io_logging_sampling_rate"?: number
6112 readonly "is_data_discount_logging_enabled"?: boolean
6113 readonly "is_observability_broadcast_enabled"?: boolean
6114 readonly "is_observability_io_logging_enabled"?: boolean
6115 readonly "name"?: string
6116 readonly "slug"?: string
6117}
6118export const UpdateWorkspaceRequest = Schema.Struct({
6119 "default_image_model": Schema.optionalKey(
6120 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Default image model for this workspace" })
6121 ),
6122 "default_provider_sort": Schema.optionalKey(
6123 Schema.Union([Schema.String, Schema.Null]).annotate({
6124 "description": "Default provider sort preference (price, throughput, latency, exacto)"
6125 })
6126 ),
6127 "default_text_model": Schema.optionalKey(
6128 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Default text model for this workspace" })
6129 ),
6130 "description": Schema.optionalKey(
6131 Schema.Union([
6132 Schema.String.check(Schema.isMaxLength(500).annotate({ "expected": "a value with a length of at most 500" })),
6133 Schema.Null
6134 ]).annotate({ "description": "New description for the workspace" })
6135 ),
6136 "io_logging_api_key_ids": Schema.optionalKey(
6137 Schema.Union([
6138 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
6139 Schema.Null
6140 ]).annotate({ "description": "Optional array of API key IDs to filter I/O logging" })
6141 ),
6142 "io_logging_sampling_rate": Schema.optionalKey(
6143 Schema.Number.annotate({ "description": "Sampling rate for I/O logging (0.0001-1)", "format": "double" }).check(
6144 Schema.isFinite().annotate({ "expected": "a finite number" })
6145 )
6146 ),
6147 "is_data_discount_logging_enabled": Schema.optionalKey(
6148 Schema.Boolean.annotate({ "description": "Whether data discount logging is enabled" })
6149 ),
6150 "is_observability_broadcast_enabled": Schema.optionalKey(
6151 Schema.Boolean.annotate({ "description": "Whether broadcast is enabled" })
6152 ),
6153 "is_observability_io_logging_enabled": Schema.optionalKey(
6154 Schema.Boolean.annotate({ "description": "Whether private logging is enabled" })
6155 ),
6156 "name": Schema.optionalKey(
6157 Schema.String.annotate({ "description": "New name for the workspace" }).check(
6158 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
6159 ).check(Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" }))
6160 ),
6161 "slug": Schema.optionalKey(
6162 Schema.String.annotate({
6163 "description":
6164 "New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens)"
6165 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
6166 Schema.isMaxLength(50).annotate({ "expected": "a value with a length of at most 50" })
6167 ).check(
6168 Schema.isPattern(new RegExp("^[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({
6169 "expected": "a string matching the RegExp ^[a-z0-9]+(?:-[a-z0-9]+)*$"
6170 })
6171 )
6172 )
6173}).annotate({ "identifier": "UpdateWorkspaceRequest" })
6174export type UpsertWorkspaceBudgetRequest = { readonly "limit_usd": number }
6175export const UpsertWorkspaceBudgetRequest = Schema.Struct({
6176 "limit_usd": Schema.Number.annotate({
6177 "description": "Spending limit in USD. Must be greater than 0.",
6178 "format": "double"
6179 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
6180}).annotate({ "identifier": "UpsertWorkspaceBudgetRequest" })
6181export type URLCitation = {
6182 readonly "content"?: string
6183 readonly "end_index": number
6184 readonly "start_index": number
6185 readonly "title": string
6186 readonly "type": "url_citation"
6187 readonly "url": string
6188}
6189export const URLCitation = Schema.Struct({
6190 "content": Schema.optionalKey(Schema.String),
6191 "end_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6192 "start_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6193 "title": Schema.String,
6194 "type": Schema.Literal("url_citation"),
6195 "url": Schema.String
6196}).annotate({ "identifier": "URLCitation" })
6197export type VideoGenerationUsage = { readonly "cost"?: number | null; readonly "is_byok"?: boolean }
6198export const VideoGenerationUsage = Schema.Struct({
6199 "cost": Schema.optionalKey(
6200 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
6201 .annotate({ "description": "The cost of the video generation in USD.", "format": "double" })
6202 ),
6203 "is_byok": Schema.optionalKey(
6204 Schema.Boolean.annotate({ "description": "Whether the request was made using a Bring Your Own Key configuration." })
6205 )
6206}).annotate({
6207 "description": "Usage and cost information for the video generation. Available once the job has completed.",
6208 "identifier": "VideoGenerationUsage"
6209})
6210export type VideoModel = {
6211 readonly "allowed_passthrough_parameters": ReadonlyArray<string>
6212 readonly "canonical_slug": string
6213 readonly "created": number
6214 readonly "description"?: string
6215 readonly "generate_audio": boolean | null
6216 readonly "hugging_face_id"?: string | null
6217 readonly "id": string
6218 readonly "name": string
6219 readonly "pricing_skus"?: { readonly [x: string]: string } | null
6220 readonly "seed": boolean | null
6221 readonly "supported_aspect_ratios":
6222 | ReadonlyArray<"16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "21:9" | "9:21">
6223 | null
6224 readonly "supported_durations": ReadonlyArray<number> | null
6225 readonly "supported_frame_images": ReadonlyArray<"first_frame" | "last_frame"> | null
6226 readonly "supported_resolutions": ReadonlyArray<"480p" | "720p" | "1080p" | "1K" | "2K" | "4K"> | null
6227 readonly "supported_sizes":
6228 | ReadonlyArray<
6229 | "480x480"
6230 | "480x640"
6231 | "480x720"
6232 | "480x854"
6233 | "480x1120"
6234 | "640x480"
6235 | "720x480"
6236 | "720x720"
6237 | "720x960"
6238 | "720x1080"
6239 | "720x1280"
6240 | "720x1680"
6241 | "854x480"
6242 | "960x720"
6243 | "1080x720"
6244 | "1080x1080"
6245 | "1080x1440"
6246 | "1080x1620"
6247 | "1080x1920"
6248 | "1080x2520"
6249 | "1120x480"
6250 | "1280x720"
6251 | "1440x1080"
6252 | "1620x1080"
6253 | "1680x720"
6254 | "1920x1080"
6255 | "2160x2160"
6256 | "2160x2880"
6257 | "2160x3240"
6258 | "2160x3840"
6259 | "2160x5040"
6260 | "2520x1080"
6261 | "2880x2160"
6262 | "3240x2160"
6263 | "3840x2160"
6264 | "5040x2160"
6265 >
6266 | null
6267}
6268export const VideoModel = Schema.Struct({
6269 "allowed_passthrough_parameters": Schema.Array(Schema.String).annotate({
6270 "description": "List of parameters that are allowed to be passed through to the provider"
6271 }),
6272 "canonical_slug": Schema.String.annotate({ "description": "Canonical slug for the model" }),
6273 "created": Schema.Number.annotate({ "description": "Unix timestamp of when the model was created" }).check(
6274 Schema.isInt().annotate({ "expected": "an integer" })
6275 ),
6276 "description": Schema.optionalKey(Schema.String.annotate({ "description": "Description of the model" })),
6277 "generate_audio": Schema.Union([Schema.Boolean, Schema.Null]).annotate({
6278 "description": "Whether the model supports generating audio alongside video"
6279 }),
6280 "hugging_face_id": Schema.optionalKey(
6281 Schema.Union([Schema.String, Schema.Null]).annotate({
6282 "description": "Hugging Face model identifier, if applicable"
6283 })
6284 ),
6285 "id": Schema.String.annotate({ "description": "Unique identifier for the model" }),
6286 "name": Schema.String.annotate({ "description": "Display name of the model" }),
6287 "pricing_skus": Schema.optionalKey(
6288 Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]).annotate({
6289 "description": "Pricing SKUs with provider prefix stripped, values as strings"
6290 })
6291 ),
6292 "seed": Schema.Union([Schema.Boolean, Schema.Null]).annotate({
6293 "description": "Whether the model supports deterministic generation via seed parameter"
6294 }),
6295 "supported_aspect_ratios": Schema.Union([
6296 Schema.Array(Schema.Literals(["16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9", "9:21"])),
6297 Schema.Null
6298 ]).annotate({ "description": "Supported output aspect ratios" }),
6299 "supported_durations": Schema.Union([
6300 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
6301 Schema.Null
6302 ]).annotate({ "description": "Supported video durations in seconds" }),
6303 "supported_frame_images": Schema.Union([Schema.Array(Schema.Literals(["first_frame", "last_frame"])), Schema.Null])
6304 .annotate({ "description": "Supported frame image types (e.g. first_frame, last_frame)" }),
6305 "supported_resolutions": Schema.Union([
6306 Schema.Array(Schema.Literals(["480p", "720p", "1080p", "1K", "2K", "4K"])),
6307 Schema.Null
6308 ]).annotate({ "description": "Supported output resolutions" }),
6309 "supported_sizes": Schema.Union([
6310 Schema.Array(
6311 Schema.Literals([
6312 "480x480",
6313 "480x640",
6314 "480x720",
6315 "480x854",
6316 "480x1120",
6317 "640x480",
6318 "720x480",
6319 "720x720",
6320 "720x960",
6321 "720x1080",
6322 "720x1280",
6323 "720x1680",
6324 "854x480",
6325 "960x720",
6326 "1080x720",
6327 "1080x1080",
6328 "1080x1440",
6329 "1080x1620",
6330 "1080x1920",
6331 "1080x2520",
6332 "1120x480",
6333 "1280x720",
6334 "1440x1080",
6335 "1620x1080",
6336 "1680x720",
6337 "1920x1080",
6338 "2160x2160",
6339 "2160x2880",
6340 "2160x3240",
6341 "2160x3840",
6342 "2160x5040",
6343 "2520x1080",
6344 "2880x2160",
6345 "3240x2160",
6346 "3840x2160",
6347 "5040x2160"
6348 ])
6349 ),
6350 Schema.Null
6351 ]).annotate({ "description": "Supported output sizes (width x height)" })
6352}).annotate({ "identifier": "VideoModel" })
6353export type WebFetchEngineEnum = "auto" | "native" | "openrouter" | "exa" | "parallel" | "firecrawl"
6354export const WebFetchEngineEnum = Schema.Literals(["auto", "native", "openrouter", "exa", "parallel", "firecrawl"])
6355 .annotate({
6356 "description":
6357 "Which fetch engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in fetch. \"exa\" uses Exa Contents API. \"openrouter\" uses direct HTTP fetch. \"firecrawl\" uses Firecrawl scrape (requires BYOK). \"parallel\" uses the Parallel extract API.",
6358 "identifier": "WebFetchEngineEnum"
6359 })
6360export type WebFetchPlugin = {
6361 readonly "allowed_domains"?: ReadonlyArray<string>
6362 readonly "blocked_domains"?: ReadonlyArray<string>
6363 readonly "id": "web-fetch"
6364 readonly "max_content_tokens"?: number
6365 readonly "max_uses"?: number
6366}
6367export const WebFetchPlugin = Schema.Struct({
6368 "allowed_domains": Schema.optionalKey(
6369 Schema.Array(Schema.String).annotate({ "description": "Only fetch from these domains." })
6370 ),
6371 "blocked_domains": Schema.optionalKey(
6372 Schema.Array(Schema.String).annotate({ "description": "Never fetch from these domains." })
6373 ),
6374 "id": Schema.Literal("web-fetch"),
6375 "max_content_tokens": Schema.optionalKey(
6376 Schema.Number.annotate({
6377 "description": "Maximum content length in approximate tokens. Content exceeding this limit is truncated."
6378 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
6379 ),
6380 "max_uses": Schema.optionalKey(
6381 Schema.Number.annotate({
6382 "description": "Maximum number of web fetches per request. Once exceeded, the tool returns an error."
6383 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
6384 )
6385}).annotate({ "identifier": "WebFetchPlugin" })
6386export type Arrays_13 = ReadonlyArray<string>
6387export const Arrays_13 = Schema.Array(Schema.String).annotate({ "description": "Only fetch from these domains." })
6388export type Arrays_14 = ReadonlyArray<string>
6389export const Arrays_14 = Schema.Array(Schema.String).annotate({ "description": "Never fetch from these domains." })
6390export type WebSearchCallCompletedEvent = {
6391 readonly "item_id": string
6392 readonly "output_index": number
6393 readonly "sequence_number": number
6394 readonly "type": "response.web_search_call.completed"
6395}
6396export const WebSearchCallCompletedEvent = Schema.Struct({
6397 "item_id": Schema.String,
6398 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6399 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6400 "type": Schema.Literal("response.web_search_call.completed")
6401}).annotate({ "description": "Web search call completed", "identifier": "WebSearchCallCompletedEvent" })
6402export type WebSearchCallInProgressEvent = {
6403 readonly "item_id": string
6404 readonly "output_index": number
6405 readonly "sequence_number": number
6406 readonly "type": "response.web_search_call.in_progress"
6407}
6408export const WebSearchCallInProgressEvent = Schema.Struct({
6409 "item_id": Schema.String,
6410 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6411 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6412 "type": Schema.Literal("response.web_search_call.in_progress")
6413}).annotate({ "description": "Web search call in progress", "identifier": "WebSearchCallInProgressEvent" })
6414export type WebSearchCallSearchingEvent = {
6415 readonly "item_id": string
6416 readonly "output_index": number
6417 readonly "sequence_number": number
6418 readonly "type": "response.web_search_call.searching"
6419}
6420export const WebSearchCallSearchingEvent = Schema.Struct({
6421 "item_id": Schema.String,
6422 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6423 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6424 "type": Schema.Literal("response.web_search_call.searching")
6425}).annotate({ "description": "Web search call is searching", "identifier": "WebSearchCallSearchingEvent" })
6426export type Arrays_15 = ReadonlyArray<string>
6427export const Arrays_15 = Schema.Array(Schema.String).annotate({
6428 "description":
6429 "Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains."
6430})
6431export type Arrays_16 = ReadonlyArray<string>
6432export const Arrays_16 = Schema.Array(Schema.String).annotate({
6433 "description":
6434 "Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains."
6435})
6436export type Objects_152 = {
6437 readonly "allowed_domains"?: ReadonlyArray<string> | null
6438 readonly "excluded_domains"?: ReadonlyArray<string> | null
6439 readonly [x: string]: Schema.Json
6440}
6441export const Objects_152 = Schema.StructWithRest(
6442 Schema.Struct({
6443 "allowed_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
6444 "excluded_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null]))
6445 }),
6446 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
6447)
6448export type WebSearchEngine = "native" | "exa" | "firecrawl" | "parallel" | "perplexity"
6449export const WebSearchEngine = Schema.Literals(["native", "exa", "firecrawl", "parallel", "perplexity"]).annotate({
6450 "description": "The search engine to use for web search.",
6451 "identifier": "WebSearchEngine"
6452})
6453export type WebSearchEngineEnum = "native" | "exa" | "parallel" | "firecrawl" | "perplexity" | "auto"
6454export const WebSearchEngineEnum = Schema.Literals(["native", "exa", "parallel", "firecrawl", "perplexity", "auto"])
6455 .annotate({
6456 "description":
6457 "Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search. \"exa\" forces the Exa search API. \"firecrawl\" uses Firecrawl (requires BYOK). \"parallel\" uses the Parallel search API. \"perplexity\" uses the Perplexity Search API (raw ranked results).",
6458 "identifier": "WebSearchEngineEnum"
6459 })
6460export type Arrays_17 = ReadonlyArray<string>
6461export const Arrays_17 = Schema.Array(Schema.String).annotate({
6462 "description":
6463 "Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains."
6464})
6465export type Arrays_18 = ReadonlyArray<string>
6466export const Arrays_18 = Schema.Array(Schema.String).annotate({
6467 "description":
6468 "Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains."
6469})
6470export type WebSearchSource = { readonly "type": "url"; readonly "url": string }
6471export const WebSearchSource = Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }).annotate({
6472 "identifier": "WebSearchSource"
6473})
6474export type WebSearchStatus = "completed" | "searching" | "in_progress" | "failed"
6475export const WebSearchStatus = Schema.Literals(["completed", "searching", "in_progress", "failed"]).annotate({
6476 "identifier": "WebSearchStatus"
6477})
6478export type Objects_153 = {
6479 readonly "city"?: string | null
6480 readonly "country"?: string | null
6481 readonly "region"?: string | null
6482 readonly "timezone"?: string | null
6483 readonly "type"?: "approximate"
6484 readonly [x: string]: Schema.Json
6485}
6486export const Objects_153 = Schema.StructWithRest(
6487 Schema.Struct({
6488 "city": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
6489 "country": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
6490 "region": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
6491 "timezone": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
6492 "type": Schema.optionalKey(Schema.Literal("approximate"))
6493 }),
6494 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
6495)
6496export type WebSearchUserLocationServerTool = {
6497 readonly "city"?: string | null
6498 readonly "country"?: string | null
6499 readonly "region"?: string | null
6500 readonly "timezone"?: string | null
6501 readonly "type"?: "approximate"
6502}
6503export const WebSearchUserLocationServerTool = Schema.Struct({
6504 "city": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
6505 "country": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
6506 "region": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
6507 "timezone": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
6508 "type": Schema.optionalKey(Schema.Literal("approximate"))
6509}).annotate({
6510 "description": "Approximate user location for location-biased results.",
6511 "identifier": "WebSearchUserLocationServerTool"
6512})
6513export type Workspace = {
6514 readonly "created_at": string
6515 readonly "created_by": string | null
6516 readonly "default_guardrail_id": string
6517 readonly "default_image_model": string | null
6518 readonly "default_provider_sort": string | null
6519 readonly "default_text_model": string | null
6520 readonly "description": string | null
6521 readonly "id": string
6522 readonly "io_logging_api_key_ids": ReadonlyArray<number> | null
6523 readonly "io_logging_sampling_rate": number
6524 readonly "is_data_discount_logging_enabled": boolean
6525 readonly "is_observability_broadcast_enabled": boolean
6526 readonly "is_observability_io_logging_enabled": boolean
6527 readonly "name": string
6528 readonly "slug": string
6529 readonly "updated_at": string | null
6530}
6531export const Workspace = Schema.Struct({
6532 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the workspace was created" }),
6533 "created_by": Schema.Union([Schema.String, Schema.Null]).annotate({
6534 "description": "User ID of the workspace creator"
6535 }),
6536 "default_guardrail_id": Schema.String.annotate({
6537 "description": "Deterministic ID of the workspace's implicitly-created default guardrail",
6538 "format": "uuid"
6539 }),
6540 "default_image_model": Schema.Union([Schema.String, Schema.Null]).annotate({
6541 "description": "Default image model for this workspace"
6542 }),
6543 "default_provider_sort": Schema.Union([Schema.String, Schema.Null]).annotate({
6544 "description": "Default provider sort preference (price, throughput, latency, exacto)"
6545 }),
6546 "default_text_model": Schema.Union([Schema.String, Schema.Null]).annotate({
6547 "description": "Default text model for this workspace"
6548 }),
6549 "description": Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Description of the workspace" }),
6550 "id": Schema.String.annotate({ "description": "Unique identifier for the workspace", "format": "uuid" }),
6551 "io_logging_api_key_ids": Schema.Union([
6552 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
6553 Schema.Null
6554 ]).annotate({
6555 "description": "Optional array of API key IDs to filter I/O logging. Null means all keys are logged."
6556 }),
6557 "io_logging_sampling_rate": Schema.Number.annotate({
6558 "description": "Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged.",
6559 "format": "double"
6560 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
6561 "is_data_discount_logging_enabled": Schema.Boolean.annotate({
6562 "description": "Whether data discount logging is enabled for this workspace"
6563 }),
6564 "is_observability_broadcast_enabled": Schema.Boolean.annotate({
6565 "description": "Whether broadcast is enabled for this workspace"
6566 }),
6567 "is_observability_io_logging_enabled": Schema.Boolean.annotate({
6568 "description": "Whether private logging is enabled for this workspace"
6569 }),
6570 "name": Schema.String.annotate({ "description": "Name of the workspace" }),
6571 "slug": Schema.String.annotate({ "description": "URL-friendly slug for the workspace" }),
6572 "updated_at": Schema.Union([Schema.String, Schema.Null]).annotate({
6573 "description": "ISO 8601 timestamp of when the workspace was last updated"
6574 })
6575}).annotate({ "identifier": "Workspace" })
6576export type WorkspaceBudget = {
6577 readonly "created_at": string
6578 readonly "id": string
6579 readonly "limit_usd": number
6580 readonly "reset_interval": "daily" | "weekly" | "monthly" | null
6581 readonly "updated_at": string
6582 readonly "workspace_id": string
6583}
6584export const WorkspaceBudget = Schema.Struct({
6585 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the budget was created" }),
6586 "id": Schema.String.annotate({ "description": "Unique identifier for the budget", "format": "uuid" }),
6587 "limit_usd": Schema.Number.annotate({ "description": "Spending limit in USD for this interval", "format": "double" })
6588 .check(Schema.isFinite().annotate({ "expected": "a finite number" })),
6589 "reset_interval": Schema.Union([
6590 Schema.Literal("daily"),
6591 Schema.Literal("weekly"),
6592 Schema.Literal("monthly"),
6593 Schema.Null
6594 ]).annotate({ "description": "Interval at which spend resets. Null means a lifetime (one-time) budget." }),
6595 "updated_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the budget was last updated" }),
6596 "workspace_id": Schema.String.annotate({
6597 "description": "ID of the workspace the budget belongs to",
6598 "format": "uuid"
6599 })
6600}).annotate({ "identifier": "WorkspaceBudget" })
6601export type WorkspaceBudgetInterval = "daily" | "weekly" | "monthly" | "lifetime"
6602export const WorkspaceBudgetInterval = Schema.Literals(["daily", "weekly", "monthly", "lifetime"]).annotate({
6603 "description": "Budget reset interval. Use \"lifetime\" for a one-time budget that never resets.",
6604 "identifier": "WorkspaceBudgetInterval"
6605})
6606export type WorkspaceMember = {
6607 readonly "created_at": string
6608 readonly "id": string
6609 readonly "role": "admin" | "member"
6610 readonly "user_id": string
6611 readonly "workspace_id": string
6612}
6613export const WorkspaceMember = Schema.Struct({
6614 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the membership was created" }),
6615 "id": Schema.String.annotate({ "description": "Unique identifier for the workspace membership", "format": "uuid" }),
6616 "role": Schema.Literals(["admin", "member"]).annotate({ "description": "Role of the member in the workspace" }),
6617 "user_id": Schema.String.annotate({ "description": "Clerk user ID of the member" }),
6618 "workspace_id": Schema.String.annotate({ "description": "ID of the workspace", "format": "uuid" })
6619}).annotate({ "identifier": "WorkspaceMember" })
6620export type ActivityResponse = { readonly "data": ReadonlyArray<ActivityItem> }
6621export const ActivityResponse = Schema.Struct({
6622 "data": Schema.Array(ActivityItem).annotate({ "description": "List of activity items" })
6623}).annotate({ "identifier": "ActivityResponse" })
6624export type Arrays_ = ReadonlyArray<AdvisorNestedTool>
6625export const Arrays_ = Schema.Array(AdvisorNestedTool).annotate({
6626 "description":
6627 "Tools the advisor sub-agent may use while forming its advice. The advisor runs as an agentic sub-agent over these tools, then returns its text. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the advisor tool itself."
6628})
6629export type AnthropicBashCodeExecutionResult = {
6630 readonly "content": ReadonlyArray<AnthropicBashCodeExecutionOutput>
6631 readonly "return_code": number
6632 readonly "stderr": string
6633 readonly "stdout": string
6634 readonly "type": "bash_code_execution_result"
6635}
6636export const AnthropicBashCodeExecutionResult = Schema.Struct({
6637 "content": Schema.Array(AnthropicBashCodeExecutionOutput),
6638 "return_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6639 "stderr": Schema.String,
6640 "stdout": Schema.String,
6641 "type": Schema.Literal("bash_code_execution_result")
6642}).annotate({ "identifier": "AnthropicBashCodeExecutionResult" })
6643export type AnthropicCacheControlDirective = { readonly "ttl"?: AnthropicCacheControlTtl; readonly "type": "ephemeral" }
6644export const AnthropicCacheControlDirective = Schema.Struct({
6645 "ttl": Schema.optionalKey(AnthropicCacheControlTtl),
6646 "type": Schema.Literal("ephemeral")
6647}).annotate({
6648 "description":
6649 "Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.",
6650 "identifier": "AnthropicCacheControlDirective"
6651})
6652export type ChatContentCacheControl = { readonly "ttl"?: AnthropicCacheControlTtl; readonly "type": "ephemeral" }
6653export const ChatContentCacheControl = Schema.Struct({
6654 "ttl": Schema.optionalKey(AnthropicCacheControlTtl),
6655 "type": Schema.Literal("ephemeral")
6656}).annotate({
6657 "description":
6658 "Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.",
6659 "identifier": "ChatContentCacheControl"
6660})
6661export type AnthropicCacheCreation = Objects_ | null
6662export const AnthropicCacheCreation = Schema.Union([Objects_, Schema.Null]).annotate({
6663 "identifier": "AnthropicCacheCreation"
6664})
6665export type AnthropicCitationsConfig = Objects_1 | null
6666export const AnthropicCitationsConfig = Schema.Union([Objects_1, Schema.Null]).annotate({
6667 "identifier": "AnthropicCitationsConfig"
6668})
6669export type AnthropicTextCitation =
6670 | AnthropicCitationCharLocation
6671 | AnthropicCitationPageLocation
6672 | AnthropicCitationContentBlockLocation
6673 | AnthropicCitationWebSearchResultLocation
6674 | AnthropicCitationSearchResultLocation
6675export const AnthropicTextCitation = Schema.Union([
6676 AnthropicCitationCharLocation,
6677 AnthropicCitationPageLocation,
6678 AnthropicCitationContentBlockLocation,
6679 AnthropicCitationWebSearchResultLocation,
6680 AnthropicCitationSearchResultLocation
6681], { mode: "oneOf" }).annotate({ "identifier": "AnthropicTextCitation" })
6682export type MessagesContentBlockDeltaEvent = {
6683 readonly "delta":
6684 | { readonly "text": string; readonly "type": "text_delta" }
6685 | { readonly "partial_json": string; readonly "type": "input_json_delta" }
6686 | { readonly "thinking": string; readonly "type": "thinking_delta" }
6687 | { readonly "signature": string; readonly "type": "signature_delta" }
6688 | {
6689 readonly "citation":
6690 | AnthropicCitationCharLocation
6691 | AnthropicCitationPageLocation
6692 | AnthropicCitationContentBlockLocation
6693 | AnthropicCitationWebSearchResultLocation
6694 | AnthropicCitationSearchResultLocation
6695 readonly "type": "citations_delta"
6696 }
6697 | { readonly "content": string | null; readonly "type": "compaction_delta" }
6698 readonly "index": number
6699 readonly "type": "content_block_delta"
6700}
6701export const MessagesContentBlockDeltaEvent = Schema.Struct({
6702 "delta": Schema.Union([
6703 Schema.Struct({ "text": Schema.String, "type": Schema.Literal("text_delta") }),
6704 Schema.Struct({ "partial_json": Schema.String, "type": Schema.Literal("input_json_delta") }),
6705 Schema.Struct({ "thinking": Schema.String, "type": Schema.Literal("thinking_delta") }),
6706 Schema.Struct({ "signature": Schema.String, "type": Schema.Literal("signature_delta") }),
6707 Schema.Struct({
6708 "citation": Schema.Union([
6709 AnthropicCitationCharLocation,
6710 AnthropicCitationPageLocation,
6711 AnthropicCitationContentBlockLocation,
6712 AnthropicCitationWebSearchResultLocation,
6713 AnthropicCitationSearchResultLocation
6714 ], { mode: "oneOf" }),
6715 "type": Schema.Literal("citations_delta")
6716 }),
6717 Schema.Struct({ "content": Schema.Union([Schema.String, Schema.Null]), "type": Schema.Literal("compaction_delta") })
6718 ], { mode: "oneOf" }),
6719 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6720 "type": Schema.Literal("content_block_delta")
6721}).annotate({
6722 "description": "Event sent when content is added to a content block",
6723 "identifier": "MessagesContentBlockDeltaEvent"
6724})
6725export type AnthropicCodeExecutionResult = {
6726 readonly "content": ReadonlyArray<AnthropicCodeExecutionOutput>
6727 readonly "return_code": number
6728 readonly "stderr": string
6729 readonly "stdout": string
6730 readonly "type": "code_execution_result"
6731}
6732export const AnthropicCodeExecutionResult = Schema.Struct({
6733 "content": Schema.Array(AnthropicCodeExecutionOutput),
6734 "return_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6735 "stderr": Schema.String,
6736 "stdout": Schema.String,
6737 "type": Schema.Literal("code_execution_result")
6738}).annotate({ "identifier": "AnthropicCodeExecutionResult" })
6739export type AnthropicEncryptedCodeExecutionResult = {
6740 readonly "content": ReadonlyArray<AnthropicCodeExecutionOutput>
6741 readonly "encrypted_stdout": string
6742 readonly "return_code": number
6743 readonly "stderr": string
6744 readonly "type": "encrypted_code_execution_result"
6745}
6746export const AnthropicEncryptedCodeExecutionResult = Schema.Struct({
6747 "content": Schema.Array(AnthropicCodeExecutionOutput),
6748 "encrypted_stdout": Schema.String,
6749 "return_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
6750 "stderr": Schema.String,
6751 "type": Schema.Literal("encrypted_code_execution_result")
6752}).annotate({ "identifier": "AnthropicEncryptedCodeExecutionResult" })
6753export type AnthropicCaller =
6754 | AnthropicDirectCaller
6755 | AnthropicCodeExecution20250825Caller
6756 | AnthropicCodeExecution20260120Caller
6757export const AnthropicCaller = Schema.Union([
6758 AnthropicDirectCaller,
6759 AnthropicCodeExecution20250825Caller,
6760 AnthropicCodeExecution20260120Caller
6761], { mode: "oneOf" }).annotate({ "identifier": "AnthropicCaller" })
6762export type ORAnthropicNullableCaller =
6763 | AnthropicDirectCaller
6764 | AnthropicCodeExecution20250825Caller
6765 | AnthropicCodeExecution20260120Caller
6766 | null
6767export const ORAnthropicNullableCaller = Schema.Union([
6768 AnthropicDirectCaller,
6769 AnthropicCodeExecution20250825Caller,
6770 AnthropicCodeExecution20260120Caller,
6771 Schema.Null
6772], { mode: "oneOf" }).annotate({ "identifier": "ORAnthropicNullableCaller" })
6773export type AnthropicBase64ImageSource = {
6774 readonly "data": string
6775 readonly "media_type": AnthropicImageMimeType
6776 readonly "type": "base64"
6777}
6778export const AnthropicBase64ImageSource = Schema.Struct({
6779 "data": Schema.String,
6780 "media_type": AnthropicImageMimeType,
6781 "type": Schema.Literal("base64")
6782}).annotate({ "identifier": "AnthropicBase64ImageSource" })
6783export type AnthropicInputTokensClearAtLeast = Objects_2 | null
6784export const AnthropicInputTokensClearAtLeast = Schema.Union([Objects_2, Schema.Null]).annotate({
6785 "identifier": "AnthropicInputTokensClearAtLeast"
6786})
6787export type AnthropicIterationCacheCreation = Objects_3 | null
6788export const AnthropicIterationCacheCreation = Schema.Union([Objects_3, Schema.Null]).annotate({
6789 "identifier": "AnthropicIterationCacheCreation"
6790})
6791export type AnthropicCodeExecutionToolResultError = {
6792 readonly "error_code": AnthropicServerToolErrorCode
6793 readonly "type": "code_execution_tool_result_error"
6794}
6795export const AnthropicCodeExecutionToolResultError = Schema.Struct({
6796 "error_code": AnthropicServerToolErrorCode,
6797 "type": Schema.Literal("code_execution_tool_result_error")
6798}).annotate({ "identifier": "AnthropicCodeExecutionToolResultError" })
6799export type AnthropicToolSearchResultError = {
6800 readonly "error_code": AnthropicServerToolErrorCode
6801 readonly "error_message": string | null
6802 readonly "type": "tool_search_tool_result_error"
6803}
6804export const AnthropicToolSearchResultError = Schema.Struct({
6805 "error_code": AnthropicServerToolErrorCode,
6806 "error_message": Schema.Union([Schema.String, Schema.Null]),
6807 "type": Schema.Literal("tool_search_tool_result_error")
6808}).annotate({ "identifier": "AnthropicToolSearchResultError" })
6809export type AnthropicTextEditorCodeExecutionContent =
6810 | AnthropicTextEditorCodeExecutionToolResultError
6811 | AnthropicTextEditorCodeExecutionViewResult
6812 | AnthropicTextEditorCodeExecutionCreateResult
6813 | AnthropicTextEditorCodeExecutionStrReplaceResult
6814export const AnthropicTextEditorCodeExecutionContent = Schema.Union([
6815 AnthropicTextEditorCodeExecutionToolResultError,
6816 AnthropicTextEditorCodeExecutionViewResult,
6817 AnthropicTextEditorCodeExecutionCreateResult,
6818 AnthropicTextEditorCodeExecutionStrReplaceResult
6819], { mode: "oneOf" }).annotate({ "identifier": "AnthropicTextEditorCodeExecutionContent" })
6820export type AnthropicToolSearchResult = {
6821 readonly "tool_references": ReadonlyArray<AnthropicToolReference>
6822 readonly "type": "tool_search_tool_search_result"
6823}
6824export const AnthropicToolSearchResult = Schema.Struct({
6825 "tool_references": Schema.Array(AnthropicToolReference),
6826 "type": Schema.Literal("tool_search_tool_search_result")
6827}).annotate({ "identifier": "AnthropicToolSearchResult" })
6828export type AnthropicWebSearchToolUserLocation = Objects_4 | null
6829export const AnthropicWebSearchToolUserLocation = Schema.Union([Objects_4, Schema.Null]).annotate({
6830 "identifier": "AnthropicWebSearchToolUserLocation"
6831})
6832export type MessagesErrorDetail = {
6833 readonly "error_type"?: ApiErrorType
6834 readonly "message": string
6835 readonly "type": string
6836}
6837export const MessagesErrorDetail = Schema.Struct({
6838 "error_type": Schema.optionalKey(ApiErrorType),
6839 "message": Schema.String,
6840 "type": Schema.String
6841}).annotate({ "identifier": "MessagesErrorDetail" })
6842export type ApplyPatchServerToolConfig = { readonly "engine"?: ApplyPatchEngineEnum }
6843export const ApplyPatchServerToolConfig = Schema.Struct({ "engine": Schema.optionalKey(ApplyPatchEngineEnum) })
6844 .annotate({
6845 "description": "Configuration for the openrouter:apply_patch server tool",
6846 "identifier": "ApplyPatchServerToolConfig"
6847 })
6848export type ApplyPatchCallOperation =
6849 | ApplyPatchCreateFileOperation
6850 | ApplyPatchUpdateFileOperation
6851 | ApplyPatchDeleteFileOperation
6852export const ApplyPatchCallOperation = Schema.Union([
6853 ApplyPatchCreateFileOperation,
6854 ApplyPatchUpdateFileOperation,
6855 ApplyPatchDeleteFileOperation
6856], { mode: "oneOf" }).annotate({
6857 "description":
6858 "The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it.",
6859 "identifier": "ApplyPatchCallOperation"
6860})
6861export type OutputItemApplyPatchCall = {
6862 readonly "call_id": string
6863 readonly "created_by"?: string
6864 readonly "id": string
6865 readonly "operation": ApplyPatchCreateFileOperation | ApplyPatchUpdateFileOperation | ApplyPatchDeleteFileOperation
6866 readonly "status": "in_progress" | "completed"
6867 readonly "type": "apply_patch_call"
6868}
6869export const OutputItemApplyPatchCall = Schema.Struct({
6870 "call_id": Schema.String,
6871 "created_by": Schema.optionalKey(Schema.String),
6872 "id": Schema.String,
6873 "operation": Schema.Union([
6874 ApplyPatchCreateFileOperation,
6875 ApplyPatchUpdateFileOperation,
6876 ApplyPatchDeleteFileOperation
6877 ], { mode: "oneOf" }),
6878 "status": Schema.Literals(["in_progress", "completed"]),
6879 "type": Schema.Literal("apply_patch_call")
6880}).annotate({ "identifier": "OutputItemApplyPatchCall" })
6881export type BadGatewayResponse = {
6882 readonly "error": BadGatewayResponseErrorData
6883 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
6884 readonly "user_id"?: string | null
6885}
6886export const BadGatewayResponse = Schema.Struct({
6887 "error": BadGatewayResponseErrorData,
6888 "openrouter_metadata": Schema.optionalKey(
6889 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
6890 ),
6891 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
6892}).annotate({ "description": "Bad Gateway - Provider/upstream API failure", "identifier": "BadGatewayResponse" })
6893export type BadRequestResponse = {
6894 readonly "error": BadRequestResponseErrorData
6895 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
6896 readonly "user_id"?: string | null
6897}
6898export const BadRequestResponse = Schema.Struct({
6899 "error": BadRequestResponseErrorData,
6900 "openrouter_metadata": Schema.optionalKey(
6901 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
6902 ),
6903 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
6904}).annotate({
6905 "description": "Bad Request - Invalid request parameters or malformed input",
6906 "identifier": "BadRequestResponse"
6907})
6908export type BYOKKey = {
6909 readonly "allowed_api_key_hashes": ReadonlyArray<string> | null
6910 readonly "allowed_models": ReadonlyArray<string> | null
6911 readonly "allowed_user_ids": ReadonlyArray<string> | null
6912 readonly "created_at": string
6913 readonly "disabled": boolean
6914 readonly "id": string
6915 readonly "is_fallback": boolean
6916 readonly "label": string
6917 readonly "name"?: string | null
6918 readonly "provider": BYOKProviderSlug
6919 readonly "sort_order": number
6920 readonly "workspace_id": string
6921}
6922export const BYOKKey = Schema.Struct({
6923 "allowed_api_key_hashes": Schema.Union([
6924 Schema.Array(Schema.String).check(
6925 Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" })
6926 ),
6927 Schema.Null
6928 ]).annotate({
6929 "description":
6930 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction."
6931 }),
6932 "allowed_models": Schema.Union([
6933 Schema.Array(Schema.String).check(
6934 Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" })
6935 ),
6936 Schema.Null
6937 ]).annotate({
6938 "description": "Optional allowlist of model slugs this credential may be used for. `null` means no restriction."
6939 }),
6940 "allowed_user_ids": Schema.Union([
6941 Schema.Array(Schema.String).check(
6942 Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" })
6943 ),
6944 Schema.Null
6945 ]).annotate({
6946 "description": "Optional allowlist of user IDs that may use this credential. `null` means no restriction."
6947 }),
6948 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the credential was created." }),
6949 "disabled": Schema.Boolean.annotate({ "description": "Whether this credential is currently disabled." }),
6950 "id": Schema.String.annotate({
6951 "description": "Stable public identifier for this BYOK credential.",
6952 "format": "uuid"
6953 }),
6954 "is_fallback": Schema.Boolean.annotate({
6955 "description":
6956 "Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried."
6957 }),
6958 "label": Schema.String.annotate({
6959 "description": "Short masked snippet of the key (e.g. the first/last few characters) used to identify it in the UI."
6960 }),
6961 "name": Schema.optionalKey(
6962 Schema.Union([Schema.String, Schema.Null]).annotate({
6963 "description": "Optional human-readable name for the credential."
6964 })
6965 ),
6966 "provider": BYOKProviderSlug,
6967 "sort_order": Schema.Number.annotate({
6968 "description": "Position within the provider — credentials are tried in ascending sort order."
6969 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
6970 "workspace_id": Schema.String.annotate({
6971 "description": "ID of the workspace this credential belongs to.",
6972 "format": "uuid"
6973 })
6974}).annotate({ "identifier": "BYOKKey" })
6975export type CreateBYOKKeyRequest = {
6976 readonly "allowed_models"?: ReadonlyArray<string> | null
6977 readonly "allowed_user_ids"?: ReadonlyArray<string> | null
6978 readonly "disabled"?: boolean
6979 readonly "is_fallback"?: boolean
6980 readonly "key": string
6981 readonly "name"?: string | null
6982 readonly "provider": BYOKProviderSlug
6983 readonly "workspace_id"?: string
6984}
6985export const CreateBYOKKeyRequest = Schema.Struct({
6986 "allowed_models": Schema.optionalKey(
6987 Schema.Union([
6988 Schema.Array(Schema.String).check(
6989 Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" })
6990 ),
6991 Schema.Null
6992 ]).annotate({
6993 "description": "Optional allowlist of model slugs this credential may be used for. `null` means no restriction."
6994 })
6995 ),
6996 "allowed_user_ids": Schema.optionalKey(
6997 Schema.Union([
6998 Schema.Array(Schema.String).check(
6999 Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" })
7000 ),
7001 Schema.Null
7002 ]).annotate({
7003 "description": "Optional allowlist of user IDs that may use this credential. `null` means no restriction."
7004 })
7005 ),
7006 "disabled": Schema.optionalKey(
7007 Schema.Boolean.annotate({ "description": "Whether this credential should be created in a disabled state." })
7008 ),
7009 "is_fallback": Schema.optionalKey(
7010 Schema.Boolean.annotate({
7011 "description":
7012 "Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried."
7013 })
7014 ),
7015 "key": Schema.String.annotate({
7016 "description":
7017 "The raw provider API key or credential. This value is encrypted at rest and never returned in API responses."
7018 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })),
7019 "name": Schema.optionalKey(
7020 Schema.Union([
7021 Schema.String.check(Schema.isMaxLength(255).annotate({ "expected": "a value with a length of at most 255" })),
7022 Schema.Null
7023 ]).annotate({ "description": "Optional human-readable name for the credential." })
7024 ),
7025 "provider": BYOKProviderSlug,
7026 "workspace_id": Schema.optionalKey(
7027 Schema.String.annotate({
7028 "description": "Optional workspace ID. Defaults to the authenticated entity's default workspace.",
7029 "format": "uuid"
7030 })
7031 )
7032}).annotate({ "identifier": "CreateBYOKKeyRequest" })
7033export type ChatContentVideo = { readonly "type": "video_url"; readonly "video_url": ChatContentVideoInput }
7034export const ChatContentVideo = Schema.Struct({
7035 "type": Schema.Literal("video_url"),
7036 "video_url": ChatContentVideoInput
7037}).annotate({ "description": "Video input content part", "identifier": "ChatContentVideo" })
7038export type ChatFormatJsonSchemaConfig = {
7039 readonly "json_schema": ChatJsonSchemaConfig
7040 readonly "type": "json_schema"
7041}
7042export const ChatFormatJsonSchemaConfig = Schema.Struct({
7043 "json_schema": ChatJsonSchemaConfig,
7044 "type": Schema.Literal("json_schema")
7045}).annotate({
7046 "description": "JSON Schema response format for structured outputs",
7047 "identifier": "ChatFormatJsonSchemaConfig"
7048})
7049export type ChatToolChoice = "none" | "auto" | "required" | ChatNamedToolChoice | ChatServerToolChoice
7050export const ChatToolChoice = Schema.Union([
7051 Schema.Literal("none"),
7052 Schema.Literal("auto"),
7053 Schema.Literal("required"),
7054 ChatNamedToolChoice,
7055 ChatServerToolChoice
7056]).annotate({ "description": "Tool choice configuration", "identifier": "ChatToolChoice" })
7057export type ChatStreamOptions = Objects_6 | null
7058export const ChatStreamOptions = Schema.Union([Objects_6, Schema.Null]).annotate({
7059 "description": "Streaming configuration options",
7060 "identifier": "ChatStreamOptions"
7061})
7062export type Objects_7 = {
7063 readonly "content": ReadonlyArray<ChatTokenLogprob> | null
7064 readonly "refusal"?: ReadonlyArray<ChatTokenLogprob> | null
7065 readonly [x: string]: Schema.Json
7066}
7067export const Objects_7 = Schema.StructWithRest(
7068 Schema.Struct({
7069 "content": Schema.Union([Schema.Array(ChatTokenLogprob), Schema.Null]).annotate({
7070 "description": "Log probabilities for content tokens"
7071 }),
7072 "refusal": Schema.optionalKey(
7073 Schema.Union([Schema.Array(ChatTokenLogprob), Schema.Null]).annotate({
7074 "description": "Log probabilities for refusal tokens"
7075 })
7076 )
7077 }),
7078 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
7079)
7080export type FileSearchServerTool = {
7081 readonly "filters"?:
7082 | {
7083 readonly "key": string
7084 readonly "type": "eq" | "ne" | "gt" | "gte" | "lt" | "lte"
7085 readonly "value": string | number | boolean | ReadonlyArray<string | number>
7086 }
7087 | CompoundFilter
7088 | null
7089 readonly "max_num_results"?: number
7090 readonly "ranking_options"?: {
7091 readonly "ranker"?: "auto" | "default-2024-11-15"
7092 readonly "score_threshold"?: number
7093 }
7094 readonly "type": "file_search"
7095 readonly "vector_store_ids": ReadonlyArray<string>
7096}
7097export const FileSearchServerTool = Schema.Struct({
7098 "filters": Schema.optionalKey(Schema.Union([
7099 Schema.Struct({
7100 "key": Schema.String,
7101 "type": Schema.Literals(["eq", "ne", "gt", "gte", "lt", "lte"]),
7102 "value": Schema.Union([
7103 Schema.String,
7104 Schema.Number.annotate({ "format": "double" }).check(
7105 Schema.isFinite().annotate({ "expected": "a finite number" })
7106 ),
7107 Schema.Boolean,
7108 Schema.Array(
7109 Schema.Union([
7110 Schema.String,
7111 Schema.Number.annotate({ "format": "double" }).check(
7112 Schema.isFinite().annotate({ "expected": "a finite number" })
7113 )
7114 ])
7115 )
7116 ])
7117 }),
7118 CompoundFilter,
7119 Schema.Null
7120 ])),
7121 "max_num_results": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
7122 "ranking_options": Schema.optionalKey(
7123 Schema.Struct({
7124 "ranker": Schema.optionalKey(Schema.Literals(["auto", "default-2024-11-15"])),
7125 "score_threshold": Schema.optionalKey(
7126 Schema.Number.annotate({ "format": "double" }).check(
7127 Schema.isFinite().annotate({ "expected": "a finite number" })
7128 )
7129 )
7130 })
7131 ),
7132 "type": Schema.Literal("file_search"),
7133 "vector_store_ids": Schema.Array(Schema.String)
7134}).annotate({ "description": "File search tool configuration", "identifier": "FileSearchServerTool" })
7135export type ConflictResponse = {
7136 readonly "error": ConflictResponseErrorData
7137 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
7138 readonly "user_id"?: string | null
7139}
7140export const ConflictResponse = Schema.Struct({
7141 "error": ConflictResponseErrorData,
7142 "openrouter_metadata": Schema.optionalKey(
7143 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
7144 ),
7145 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
7146}).annotate({
7147 "description": "Conflict - Resource conflict or concurrent modification",
7148 "identifier": "ConflictResponse"
7149})
7150export type BashServerToolEnvironment = ContainerAutoEnvironment | ContainerReferenceEnvironment
7151export const BashServerToolEnvironment = Schema.Union([ContainerAutoEnvironment, ContainerReferenceEnvironment], {
7152 mode: "oneOf"
7153}).annotate({
7154 "description": "Execution environment for the bash server tool.",
7155 "identifier": "BashServerToolEnvironment"
7156})
7157export type ShellServerToolEnvironment = ContainerAutoEnvironment | ContainerReferenceEnvironment
7158export const ShellServerToolEnvironment = Schema.Union([ContainerAutoEnvironment, ContainerReferenceEnvironment], {
7159 mode: "oneOf"
7160}).annotate({
7161 "description":
7162 "Server-side execution environment for the shell tool. Only container-backed environments are supported; \"local\" shells are not.",
7163 "identifier": "ShellServerToolEnvironment"
7164})
7165export type ContentFilterEntry = {
7166 readonly "action": ContentFilterAction
7167 readonly "label"?: string | null
7168 readonly "pattern": string
7169}
7170export const ContentFilterEntry = Schema.Struct({
7171 "action": ContentFilterAction,
7172 "label": Schema.optionalKey(
7173 Schema.Union([
7174 Schema.String.check(Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" })),
7175 Schema.Null
7176 ]).annotate({ "description": "Optional label used in redaction placeholders or error messages" })
7177 ),
7178 "pattern": Schema.String.annotate({ "description": "A regex pattern to match against request content" }).check(
7179 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
7180 )
7181}).annotate({
7182 "description": "A custom regex content filter that scans request messages for matching patterns.",
7183 "identifier": "ContentFilterEntry"
7184})
7185export type InputReference = ContentPartImage | ContentPartAudio | ContentPartVideo
7186export const InputReference = Schema.Union([ContentPartImage, ContentPartAudio, ContentPartVideo], { mode: "oneOf" })
7187 .annotate({
7188 "description":
7189 "A reference asset used to guide video generation. Image references are supported by all providers; audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0).",
7190 "identifier": "InputReference"
7191 })
7192export type ContextCompressionPlugin = {
7193 readonly "enabled"?: boolean
7194 readonly "engine"?: ContextCompressionEngine
7195 readonly "id": "context-compression"
7196}
7197export const ContextCompressionPlugin = Schema.Struct({
7198 "enabled": Schema.optionalKey(
7199 Schema.Boolean.annotate({
7200 "description": "Set to false to disable the context-compression plugin for this request. Defaults to true."
7201 })
7202 ),
7203 "engine": Schema.optionalKey(ContextCompressionEngine),
7204 "id": Schema.Literal("context-compression")
7205}).annotate({ "identifier": "ContextCompressionPlugin" })
7206export type CostDetails = Objects_8 | null
7207export const CostDetails = Schema.Union([Objects_8, Schema.Null]).annotate({
7208 "description": "Breakdown of upstream inference costs",
7209 "identifier": "CostDetails"
7210})
7211export type Arrays_9 = ReadonlyArray<DABenchmarkEntry>
7212export const Arrays_9 = Schema.Array(DABenchmarkEntry).annotate({
7213 "description": "Design Arena ELO rankings across arena+category pairs."
7214})
7215export type DatetimeServerTool = {
7216 readonly "parameters"?: DatetimeServerToolConfig
7217 readonly "type": "openrouter:datetime"
7218}
7219export const DatetimeServerTool = Schema.Struct({
7220 "parameters": Schema.optionalKey(DatetimeServerToolConfig),
7221 "type": Schema.Literal("openrouter:datetime")
7222}).annotate({
7223 "description": "OpenRouter built-in server tool: returns the current date and time",
7224 "identifier": "DatetimeServerTool"
7225})
7226export type EdgeNetworkTimeoutResponse = {
7227 readonly "error": EdgeNetworkTimeoutResponseErrorData
7228 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
7229 readonly "user_id"?: string | null
7230}
7231export const EdgeNetworkTimeoutResponse = Schema.Struct({
7232 "error": EdgeNetworkTimeoutResponseErrorData,
7233 "openrouter_metadata": Schema.optionalKey(
7234 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
7235 ),
7236 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
7237}).annotate({
7238 "description": "Infrastructure Timeout - Provider request timed out at edge network",
7239 "identifier": "EdgeNetworkTimeoutResponse"
7240})
7241export type EndpointsMetadata = { readonly "available": ReadonlyArray<EndpointInfo>; readonly "total": number }
7242export const EndpointsMetadata = Schema.Struct({
7243 "available": Schema.Array(EndpointInfo),
7244 "total": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
7245}).annotate({ "identifier": "EndpointsMetadata" })
7246export type FileListResponse = {
7247 readonly "cursor": string | null
7248 readonly "data": ReadonlyArray<FileMetadata>
7249 readonly "first_id": string | null
7250 readonly "has_more": boolean
7251 readonly "last_id": string | null
7252}
7253export const FileListResponse = Schema.Struct({
7254 "cursor": Schema.Union([Schema.String, Schema.Null]).annotate({
7255 "description": "Opaque cursor for the next page; null when there are no more results."
7256 }),
7257 "data": Schema.Array(FileMetadata),
7258 "first_id": Schema.Union([Schema.String, Schema.Null]),
7259 "has_more": Schema.Boolean,
7260 "last_id": Schema.Union([Schema.String, Schema.Null])
7261}).annotate({
7262 "description": "A page of files belonging to the requesting workspace.",
7263 "identifier": "FileListResponse"
7264})
7265export type FilesServerTool = { readonly "parameters"?: FilesServerToolConfig; readonly "type": "openrouter:files" }
7266export const FilesServerTool = Schema.Struct({
7267 "parameters": Schema.optionalKey(FilesServerToolConfig),
7268 "type": Schema.Literal("openrouter:files")
7269}).annotate({
7270 "description":
7271 "OpenRouter built-in server tool: read, write, edit, and list workspace files via the Files API. Requires the `x-openrouter-file-ids: openrouter` request header.",
7272 "identifier": "FilesServerTool"
7273})
7274export type ForbiddenResponse = {
7275 readonly "error": ForbiddenResponseErrorData
7276 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
7277 readonly "user_id"?: string | null
7278}
7279export const ForbiddenResponse = Schema.Struct({
7280 "error": ForbiddenResponseErrorData,
7281 "openrouter_metadata": Schema.optionalKey(
7282 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
7283 ),
7284 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
7285}).annotate({
7286 "description": "Forbidden - Authentication successful but insufficient permissions",
7287 "identifier": "ForbiddenResponse"
7288})
7289export type Formats = FormatTextConfig | FormatJsonObjectConfig | FormatJsonSchemaConfig
7290export const Formats = Schema.Union([FormatTextConfig, FormatJsonObjectConfig, FormatJsonSchemaConfig]).annotate({
7291 "description": "Text response format configuration",
7292 "identifier": "Formats"
7293})
7294export type FusionAnalysisResult = {
7295 readonly "blind_spots": Arrays_1
7296 readonly "consensus": Arrays_2
7297 readonly "contradictions": Arrays_3
7298 readonly "partial_coverage": Arrays_4
7299 readonly "unique_insights": Arrays_5
7300}
7301export const FusionAnalysisResult = Schema.Struct({
7302 "blind_spots": Arrays_1,
7303 "consensus": Arrays_2,
7304 "contradictions": Arrays_3,
7305 "partial_coverage": Arrays_4,
7306 "unique_insights": Arrays_5
7307}).annotate({
7308 "description": "Structured analysis produced by the fusion judge model.",
7309 "identifier": "FusionAnalysisResult"
7310})
7311export type GenerationContentResponse = { readonly "data": GenerationContentData }
7312export const GenerationContentResponse = Schema.Struct({ "data": GenerationContentData }).annotate({
7313 "description": "Stored prompt and completion content for a generation",
7314 "identifier": "GenerationContentResponse"
7315})
7316export type GoneResponse = {
7317 readonly "error": GoneResponseErrorData
7318 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
7319 readonly "user_id"?: string | null
7320}
7321export const GoneResponse = Schema.Struct({
7322 "error": GoneResponseErrorData,
7323 "openrouter_metadata": Schema.optionalKey(
7324 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
7325 ),
7326 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
7327}).annotate({
7328 "description": "Gone - Endpoint has been permanently removed or deprecated",
7329 "identifier": "GoneResponse"
7330})
7331export type ImageGenerationServerTool_OpenRouter = {
7332 readonly "parameters"?: ImageGenerationServerToolConfig
7333 readonly "type": "openrouter:image_generation"
7334}
7335export const ImageGenerationServerTool_OpenRouter = Schema.Struct({
7336 "parameters": Schema.optionalKey(ImageGenerationServerToolConfig),
7337 "type": Schema.Literal("openrouter:image_generation")
7338}).annotate({
7339 "description": "OpenRouter built-in server tool: generates images from text prompts using an image generation model",
7340 "identifier": "ImageGenerationServerTool_OpenRouter"
7341})
7342export type OutputImageGenerationCallItem = {
7343 readonly "id": string
7344 readonly "result"?: string | null
7345 readonly "status": ImageGenerationStatus
7346 readonly "type": "image_generation_call"
7347 readonly "prompt"?: string
7348}
7349export const OutputImageGenerationCallItem = Schema.Struct({
7350 "id": Schema.String,
7351 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
7352 "status": ImageGenerationStatus,
7353 "type": Schema.Literal("image_generation_call"),
7354 "prompt": Schema.optionalKey(
7355 Schema.String.annotate({ "description": "The prompt (possibly rewritten) that the image was generated from." })
7356 )
7357}).annotate({ "identifier": "OutputImageGenerationCallItem" })
7358export type OutputItemImageGenerationCall = {
7359 readonly "id": string
7360 readonly "result"?: string | null
7361 readonly "status": ImageGenerationStatus
7362 readonly "type": "image_generation_call"
7363}
7364export const OutputItemImageGenerationCall = Schema.Struct({
7365 "id": Schema.String,
7366 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
7367 "status": ImageGenerationStatus,
7368 "type": Schema.Literal("image_generation_call")
7369}).annotate({ "identifier": "OutputItemImageGenerationCall" })
7370export type ImageModelArchitecture = {
7371 readonly "input_modalities": ReadonlyArray<ImageInputModality>
7372 readonly "output_modalities": ReadonlyArray<ImageOutputModality>
7373}
7374export const ImageModelArchitecture = Schema.Struct({
7375 "input_modalities": Schema.Array(ImageInputModality).annotate({ "description": "Supported input modalities" }),
7376 "output_modalities": Schema.Array(ImageOutputModality).annotate({ "description": "Supported output modalities" })
7377}).annotate({ "identifier": "ImageModelArchitecture" })
7378export type InternalServerResponse = {
7379 readonly "error": InternalServerResponseErrorData
7380 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
7381 readonly "user_id"?: string | null
7382}
7383export const InternalServerResponse = Schema.Struct({
7384 "error": InternalServerResponseErrorData,
7385 "openrouter_metadata": Schema.optionalKey(
7386 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
7387 ),
7388 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
7389}).annotate({
7390 "description": "Internal Server Error - Unexpected server error",
7391 "identifier": "InternalServerResponse"
7392})
7393export type ListKeyAssignmentsResponse = {
7394 readonly "data": ReadonlyArray<KeyAssignment>
7395 readonly "total_count": number
7396}
7397export const ListKeyAssignmentsResponse = Schema.Struct({
7398 "data": Schema.Array(KeyAssignment).annotate({ "description": "List of key assignments" }),
7399 "total_count": Schema.Number.annotate({ "description": "Total number of key assignments for this guardrail" }).check(
7400 Schema.isInt().annotate({ "expected": "an integer" })
7401 )
7402}).annotate({ "identifier": "ListKeyAssignmentsResponse" })
7403export type Legacy_ChatContentVideo = {
7404 readonly "type": "input_video"
7405 readonly "video_url": Legacy_ChatContentVideoInput
7406}
7407export const Legacy_ChatContentVideo = Schema.Struct({
7408 "type": Schema.Literal("input_video"),
7409 "video_url": Legacy_ChatContentVideoInput
7410}).annotate({
7411 "description": "Video input content part (legacy format - deprecated)",
7412 "identifier": "Legacy_ChatContentVideo"
7413})
7414export type ListMemberAssignmentsResponse = {
7415 readonly "data": ReadonlyArray<MemberAssignment>
7416 readonly "total_count": number
7417}
7418export const ListMemberAssignmentsResponse = Schema.Struct({
7419 "data": Schema.Array(MemberAssignment).annotate({ "description": "List of member assignments" }),
7420 "total_count": Schema.Number.annotate({ "description": "Total number of member assignments" }).check(
7421 Schema.isInt().annotate({ "expected": "an integer" })
7422 )
7423}).annotate({ "identifier": "ListMemberAssignmentsResponse" })
7424export type MessagesOutputConfig = {
7425 readonly "effort"?: "low" | "medium" | "high" | "xhigh" | "max" | null
7426 readonly "format"?: Union_10
7427 readonly "task_budget"?: Union_11
7428}
7429export const MessagesOutputConfig = Schema.Struct({
7430 "effort": Schema.optionalKey(
7431 Schema.Union([
7432 Schema.Literal("low"),
7433 Schema.Literal("medium"),
7434 Schema.Literal("high"),
7435 Schema.Literal("xhigh"),
7436 Schema.Literal("max"),
7437 Schema.Null
7438 ]).annotate({
7439 "description":
7440 "How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, `high`, `xhigh`, or `max`."
7441 })
7442 ),
7443 "format": Schema.optionalKey(Union_10),
7444 "task_budget": Schema.optionalKey(Union_11)
7445}).annotate({
7446 "description":
7447 "Configuration for controlling output behavior. Supports the effort parameter and structured output format.",
7448 "identifier": "MessagesOutputConfig"
7449})
7450export type ChatModelNames = ReadonlyArray<ModelName>
7451export const ChatModelNames = Schema.Array(
7452 Schema.suspend((): Schema.Codec<ModelName> => ModelName).annotate({
7453 "description": "Available OpenRouter chat completion models"
7454 })
7455).annotate({ "description": "Models to use for completion", "identifier": "ChatModelNames" })
7456export type ContentPartInputAudio = { readonly "input_audio": MultimodalMedia; readonly "type": "input_audio" }
7457export const ContentPartInputAudio = Schema.Struct({
7458 "input_audio": MultimodalMedia,
7459 "type": Schema.Literal("input_audio")
7460}).annotate({ "identifier": "ContentPartInputAudio" })
7461export type ContentPartInputFile = { readonly "input_file": MultimodalMedia; readonly "type": "input_file" }
7462export const ContentPartInputFile = Schema.Struct({
7463 "input_file": MultimodalMedia,
7464 "type": Schema.Literal("input_file")
7465}).annotate({ "identifier": "ContentPartInputFile" })
7466export type ContentPartInputVideo = { readonly "input_video": MultimodalMedia; readonly "type": "input_video" }
7467export const ContentPartInputVideo = Schema.Struct({
7468 "input_video": MultimodalMedia,
7469 "type": Schema.Literal("input_video")
7470}).annotate({ "identifier": "ContentPartInputVideo" })
7471export type NamespaceTool = {
7472 readonly "description": string
7473 readonly "name": string
7474 readonly "tools": ReadonlyArray<NamespaceFunctionTool | CustomTool>
7475 readonly "type": "namespace"
7476}
7477export const NamespaceTool = Schema.Struct({
7478 "description": Schema.String,
7479 "name": Schema.String,
7480 "tools": Schema.Array(Schema.Union([NamespaceFunctionTool, CustomTool])),
7481 "type": Schema.Literal("namespace")
7482}).annotate({ "description": "Groups function/custom tools under a shared namespace", "identifier": "NamespaceTool" })
7483export type NotFoundResponse = {
7484 readonly "error": NotFoundResponseErrorData
7485 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
7486 readonly "user_id"?: string | null
7487}
7488export const NotFoundResponse = Schema.Struct({
7489 "error": NotFoundResponseErrorData,
7490 "openrouter_metadata": Schema.optionalKey(
7491 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
7492 ),
7493 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
7494}).annotate({ "description": "Not Found - Resource does not exist", "identifier": "NotFoundResponse" })
7495export type ObservabilityFilterRulesConfig = {
7496 readonly "enabled"?: boolean
7497 readonly "groups": ReadonlyArray<ObservabilityFilterRuleGroup>
7498 readonly [x: string]: Schema.Json
7499} | null
7500export const ObservabilityFilterRulesConfig = Schema.Union([
7501 Schema.StructWithRest(
7502 Schema.Struct({
7503 "enabled": Schema.optionalKey(Schema.Boolean),
7504 "groups": Schema.Array(ObservabilityFilterRuleGroup)
7505 }),
7506 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
7507 ),
7508 Schema.Null
7509]).annotate({
7510 "description": "Optional structured filter rules controlling which events are forwarded.",
7511 "identifier": "ObservabilityFilterRulesConfig"
7512})
7513export type Objects_10 = {
7514 readonly "enabled"?: boolean
7515 readonly "groups": ReadonlyArray<ObservabilityFilterRuleGroup>
7516 readonly [x: string]: Schema.Json
7517}
7518export const Objects_10 = Schema.StructWithRest(
7519 Schema.Struct({
7520 "enabled": Schema.optionalKey(Schema.Boolean),
7521 "groups": Schema.Array(ObservabilityFilterRuleGroup)
7522 }),
7523 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
7524)
7525export type OpenAIResponsesUsage = {
7526 readonly "input_tokens": number
7527 readonly "input_tokens_details": Objects_15
7528 readonly "output_tokens": number
7529 readonly "output_tokens_details": Objects_16
7530 readonly "total_tokens": number
7531}
7532export const OpenAIResponsesUsage = Schema.Struct({
7533 "input_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
7534 "input_tokens_details": Objects_15,
7535 "output_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
7536 "output_tokens_details": Objects_16,
7537 "total_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
7538}).annotate({ "identifier": "OpenAIResponsesUsage" })
7539export type OpenResponsesLogProbs = {
7540 readonly "bytes"?: ReadonlyArray<number>
7541 readonly "logprob": number
7542 readonly "token": string
7543 readonly "top_logprobs"?: ReadonlyArray<OpenResponsesTopLogprobs>
7544}
7545export const OpenResponsesLogProbs = Schema.Struct({
7546 "bytes": Schema.optionalKey(Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })))),
7547 "logprob": Schema.Number.annotate({ "format": "double" }).check(
7548 Schema.isFinite().annotate({ "expected": "a finite number" })
7549 ),
7550 "token": Schema.String,
7551 "top_logprobs": Schema.optionalKey(Schema.Array(OpenResponsesTopLogprobs))
7552}).annotate({ "description": "Log probability information for a token", "identifier": "OpenResponsesLogProbs" })
7553export type ModelArchitecture = {
7554 readonly "input_modalities": ReadonlyArray<InputModality>
7555 readonly "instruct_type"?: InstructType
7556 readonly "modality": string | null
7557 readonly "output_modalities": ReadonlyArray<OutputModality>
7558 readonly "tokenizer"?: ModelGroup
7559}
7560export const ModelArchitecture = Schema.Struct({
7561 "input_modalities": Schema.Array(InputModality).annotate({ "description": "Supported input modalities" }),
7562 "instruct_type": Schema.optionalKey(InstructType),
7563 "modality": Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Primary modality of the model" }),
7564 "output_modalities": Schema.Array(OutputModality).annotate({ "description": "Supported output modalities" }),
7565 "tokenizer": Schema.optionalKey(ModelGroup)
7566}).annotate({ "description": "Model architecture information", "identifier": "ModelArchitecture" })
7567export type PayloadTooLargeResponse = {
7568 readonly "error": PayloadTooLargeResponseErrorData
7569 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
7570 readonly "user_id"?: string | null
7571}
7572export const PayloadTooLargeResponse = Schema.Struct({
7573 "error": PayloadTooLargeResponseErrorData,
7574 "openrouter_metadata": Schema.optionalKey(
7575 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
7576 ),
7577 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
7578}).annotate({
7579 "description": "Payload Too Large - Request payload exceeds size limits",
7580 "identifier": "PayloadTooLargeResponse"
7581})
7582export type PaymentRequiredResponse = {
7583 readonly "error": PaymentRequiredResponseErrorData
7584 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
7585 readonly "user_id"?: string | null
7586}
7587export const PaymentRequiredResponse = Schema.Struct({
7588 "error": PaymentRequiredResponseErrorData,
7589 "openrouter_metadata": Schema.optionalKey(
7590 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
7591 ),
7592 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
7593}).annotate({
7594 "description": "Payment Required - Insufficient credits or quota to complete request",
7595 "identifier": "PaymentRequiredResponse"
7596})
7597export type PDFParserOptions = { readonly "engine"?: PDFParserEngine }
7598export const PDFParserOptions = Schema.Struct({ "engine": Schema.optionalKey(PDFParserEngine) }).annotate({
7599 "description": "Options for PDF parsing.",
7600 "identifier": "PDFParserOptions"
7601})
7602export type PreferredMaxLatency = number | PercentileLatencyCutoffs | null
7603export const PreferredMaxLatency = Schema.Union([
7604 Schema.Number.annotate({ "format": "double" }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
7605 PercentileLatencyCutoffs,
7606 Schema.Null
7607]).annotate({
7608 "description":
7609 "Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.",
7610 "identifier": "PreferredMaxLatency"
7611})
7612export type PreferredMinThroughput = number | PercentileThroughputCutoffs | null
7613export const PreferredMinThroughput = Schema.Union([
7614 Schema.Number.annotate({ "format": "double" }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
7615 PercentileThroughputCutoffs,
7616 Schema.Null
7617]).annotate({
7618 "description":
7619 "Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.",
7620 "identifier": "PreferredMinThroughput"
7621})
7622export type PipelineStage = {
7623 readonly "cost_usd"?: number | null
7624 readonly "data"?: {}
7625 readonly "guardrail_id"?: string
7626 readonly "guardrail_scope"?: string
7627 readonly "name": string
7628 readonly "summary"?: string
7629 readonly "type": PipelineStageType
7630}
7631export const PipelineStage = Schema.Struct({
7632 "cost_usd": Schema.optionalKey(
7633 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
7634 .annotate({ "format": "double" })
7635 ),
7636 "data": Schema.optionalKey(Schema.Struct({})),
7637 "guardrail_id": Schema.optionalKey(Schema.String),
7638 "guardrail_scope": Schema.optionalKey(Schema.String),
7639 "name": Schema.String,
7640 "summary": Schema.optionalKey(Schema.String),
7641 "type": PipelineStageType
7642}).annotate({ "identifier": "PipelineStage" })
7643export type Objects_17 = {
7644 readonly "content": string | ReadonlyArray<PredictionContentText>
7645 readonly "type": "content"
7646 readonly [x: string]: Schema.Json
7647}
7648export const Objects_17 = Schema.StructWithRest(
7649 Schema.Struct({
7650 "content": Schema.Union([Schema.String, Schema.Array(PredictionContentText)]),
7651 "type": Schema.Literal("content")
7652 }),
7653 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
7654)
7655export type GetPresetVersionResponse = { readonly "data": PresetDesignatedVersion }
7656export const GetPresetVersionResponse = Schema.Struct({ "data": PresetDesignatedVersion }).annotate({
7657 "description": "A single version of a preset.",
7658 "identifier": "GetPresetVersionResponse"
7659})
7660export type ListPresetVersionsResponse = {
7661 readonly "data": ReadonlyArray<PresetDesignatedVersion>
7662 readonly "total_count": number
7663}
7664export const ListPresetVersionsResponse = Schema.Struct({
7665 "data": Schema.Array(PresetDesignatedVersion),
7666 "total_count": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
7667}).annotate({ "description": "A paginated list of preset versions.", "identifier": "ListPresetVersionsResponse" })
7668export type Preset = {
7669 readonly "created_at": string
7670 readonly "creator_user_id": string | null
7671 readonly "description": string | null
7672 readonly "designated_version_id": string | null
7673 readonly "id": string
7674 readonly "name": string
7675 readonly "slug": string
7676 readonly "status": PresetStatus
7677 readonly "status_updated_at": string | null
7678 readonly "updated_at": string
7679 readonly "workspace_id": string | null
7680}
7681export const Preset = Schema.Struct({
7682 "created_at": Schema.String,
7683 "creator_user_id": Schema.Union([Schema.String, Schema.Null]),
7684 "description": Schema.Union([Schema.String, Schema.Null]),
7685 "designated_version_id": Schema.Union([Schema.String, Schema.Null]),
7686 "id": Schema.String,
7687 "name": Schema.String,
7688 "slug": Schema.String,
7689 "status": PresetStatus,
7690 "status_updated_at": Schema.Union([Schema.String, Schema.Null]),
7691 "updated_at": Schema.String,
7692 "workspace_id": Schema.Union([Schema.String, Schema.Null])
7693}).annotate({ "description": "A preset without version details.", "identifier": "Preset" })
7694export type PresetWithDesignatedVersion = {
7695 readonly "created_at": string
7696 readonly "creator_user_id": string | null
7697 readonly "description": string | null
7698 readonly "designated_version_id": string | null
7699 readonly "id": string
7700 readonly "name": string
7701 readonly "slug": string
7702 readonly "status": PresetStatus
7703 readonly "status_updated_at": string | null
7704 readonly "updated_at": string
7705 readonly "workspace_id": string | null
7706 readonly "designated_version": PresetDesignatedVersion
7707}
7708export const PresetWithDesignatedVersion = Schema.Struct({
7709 "created_at": Schema.String,
7710 "creator_user_id": Schema.Union([Schema.String, Schema.Null]),
7711 "description": Schema.Union([Schema.String, Schema.Null]),
7712 "designated_version_id": Schema.Union([Schema.String, Schema.Null]),
7713 "id": Schema.String,
7714 "name": Schema.String,
7715 "slug": Schema.String,
7716 "status": PresetStatus,
7717 "status_updated_at": Schema.Union([Schema.String, Schema.Null]),
7718 "updated_at": Schema.String,
7719 "workspace_id": Schema.Union([Schema.String, Schema.Null]),
7720 "designated_version": PresetDesignatedVersion
7721}).annotate({
7722 "description": "A preset with its currently designated version.",
7723 "identifier": "PresetWithDesignatedVersion"
7724})
7725export type Preview_WebSearchUserLocation = Objects_18 | null
7726export const Preview_WebSearchUserLocation = Schema.Union([Objects_18, Schema.Null]).annotate({
7727 "identifier": "Preview_WebSearchUserLocation"
7728})
7729export type PublicPricing = {
7730 readonly "audio"?: string
7731 readonly "audio_output"?: string
7732 readonly "completion": string
7733 readonly "discount"?: number
7734 readonly "image"?: string
7735 readonly "image_output"?: string
7736 readonly "image_token"?: string
7737 readonly "input_audio_cache"?: string
7738 readonly "input_cache_read"?: string
7739 readonly "input_cache_write"?: string
7740 readonly "input_cache_write_1h"?: string
7741 readonly "internal_reasoning"?: string
7742 readonly "overrides"?: ReadonlyArray<PricingOverride>
7743 readonly "prompt": string
7744 readonly "request"?: string
7745 readonly "web_search"?: string
7746}
7747export const PublicPricing = Schema.Struct({
7748 "audio": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per audio input token" })),
7749 "audio_output": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per audio output token" })),
7750 "completion": Schema.String.annotate({ "description": "Price in USD per token for completion (output) generation" }),
7751 "discount": Schema.optionalKey(
7752 Schema.Number.annotate({
7753 "description":
7754 "Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)",
7755 "format": "double"
7756 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
7757 ),
7758 "image": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per input image" })),
7759 "image_output": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per output image" })),
7760 "image_token": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per image token" })),
7761 "input_audio_cache": Schema.optionalKey(
7762 Schema.String.annotate({ "description": "Price in USD per cached audio input token" })
7763 ),
7764 "input_cache_read": Schema.optionalKey(
7765 Schema.String.annotate({ "description": "Price in USD per cached input token (read)" })
7766 ),
7767 "input_cache_write": Schema.optionalKey(
7768 Schema.String.annotate({
7769 "description":
7770 "Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate."
7771 })
7772 ),
7773 "input_cache_write_1h": Schema.optionalKey(
7774 Schema.String.annotate({
7775 "description":
7776 "Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic."
7777 })
7778 ),
7779 "internal_reasoning": Schema.optionalKey(
7780 Schema.String.annotate({ "description": "Price in USD per internal reasoning token" })
7781 ),
7782 "overrides": Schema.optionalKey(
7783 Schema.Array(PricingOverride).annotate({
7784 "description":
7785 "Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions."
7786 })
7787 ),
7788 "prompt": Schema.String.annotate({ "description": "Price in USD per token for prompt (input) processing" }),
7789 "request": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per request" })),
7790 "web_search": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per web search" }))
7791}).annotate({ "description": "Pricing information for the model", "identifier": "PublicPricing" })
7792export type PromptCacheBreakpoint = Objects_19 | null
7793export const PromptCacheBreakpoint = Schema.Union([Objects_19, Schema.Null]).annotate({
7794 "description":
7795 "Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.",
7796 "identifier": "PromptCacheBreakpoint"
7797})
7798export type PromptCacheOptions = Objects_20 | null
7799export const PromptCacheOptions = Schema.Union([Objects_20, Schema.Null]).annotate({
7800 "description":
7801 "Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.",
7802 "identifier": "PromptCacheOptions"
7803})
7804export type ContentFilterBuiltinEntry = {
7805 readonly "action": ContentFilterBuiltinAction
7806 readonly "label"?: string
7807 readonly "scan_scope"?: PromptInjectionScanScope
7808 readonly "slug": ContentFilterBuiltinSlug
7809}
7810export const ContentFilterBuiltinEntry = Schema.Struct({
7811 "action": ContentFilterBuiltinAction,
7812 "label": Schema.optionalKey(
7813 Schema.String.annotate({
7814 "description":
7815 "Read-only, system-assigned redaction placeholder derived from the slug (e.g. \"[EMAIL]\", \"[PHONE]\"). Not settable by the caller."
7816 }).check(Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" }))
7817 ),
7818 "scan_scope": Schema.optionalKey(PromptInjectionScanScope),
7819 "slug": ContentFilterBuiltinSlug
7820}).annotate({
7821 "description":
7822 "A builtin content filter entry. Builtin filters include PII detectors and the regex-based prompt injection detector.",
7823 "identifier": "ContentFilterBuiltinEntry"
7824})
7825export type ContentFilterBuiltinEntryInput = {
7826 readonly "action": ContentFilterBuiltinAction
7827 readonly "label"?: string
7828 readonly "scan_scope"?: PromptInjectionScanScope
7829 readonly "slug": ContentFilterBuiltinSlug
7830}
7831export const ContentFilterBuiltinEntryInput = Schema.Struct({
7832 "action": ContentFilterBuiltinAction,
7833 "label": Schema.optionalKey(
7834 Schema.String.annotate({
7835 "description":
7836 "Deprecated: labels are system-assigned and cannot be set by the caller. Accepted for backward compatibility but silently ignored."
7837 }).check(Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" }))
7838 ),
7839 "scan_scope": Schema.optionalKey(PromptInjectionScanScope),
7840 "slug": ContentFilterBuiltinSlug
7841}).annotate({
7842 "description":
7843 "A builtin content filter entry for create/update requests. Labels are system-assigned and cannot be set by the caller.",
7844 "identifier": "ContentFilterBuiltinEntryInput"
7845})
7846export type Union_2 = ReadonlyArray<ProviderName | string> | null
7847export const Union_2 = Schema.Union([Schema.Array(Schema.Union([ProviderName, Schema.String])), Schema.Null]).annotate({
7848 "description":
7849 "List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."
7850})
7851export type Union_3 = ReadonlyArray<ProviderName | string> | null
7852export const Union_3 = Schema.Union([Schema.Array(Schema.Union([ProviderName, Schema.String])), Schema.Null]).annotate({
7853 "description":
7854 "List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."
7855})
7856export type Union_4 = ReadonlyArray<ProviderName | string> | null
7857export const Union_4 = Schema.Union([Schema.Array(Schema.Union([ProviderName, Schema.String])), Schema.Null]).annotate({
7858 "description":
7859 "An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."
7860})
7861export type ProviderOptions = {
7862 readonly "01ai"?: Objects_21
7863 readonly "ai21"?: Objects_22
7864 readonly "aion-labs"?: Objects_23
7865 readonly "akashml"?: Objects_24
7866 readonly "alibaba"?: Objects_25
7867 readonly "amazon-bedrock"?: Objects_26
7868 readonly "amazon-nova"?: Objects_27
7869 readonly "ambient"?: Objects_28
7870 readonly "anthropic"?: Objects_29
7871 readonly "anyscale"?: Objects_30
7872 readonly "arcee-ai"?: Objects_31
7873 readonly "atlas-cloud"?: Objects_32
7874 readonly "atoma"?: Objects_33
7875 readonly "avian"?: Objects_34
7876 readonly "azure"?: Objects_35
7877 readonly "baidu"?: Objects_36
7878 readonly "baseten"?: Objects_37
7879 readonly "black-forest-labs"?: Objects_38
7880 readonly "byteplus"?: Objects_39
7881 readonly "centml"?: Objects_40
7882 readonly "cerebras"?: Objects_41
7883 readonly "chutes"?: Objects_42
7884 readonly "cirrascale"?: Objects_43
7885 readonly "clarifai"?: Objects_44
7886 readonly "cloudflare"?: Objects_45
7887 readonly "cohere"?: Objects_46
7888 readonly "coreweave"?: Objects_47
7889 readonly "crofai"?: Objects_48
7890 readonly "crucible"?: Objects_49
7891 readonly "crusoe"?: Objects_50
7892 readonly "darkbloom"?: Objects_51
7893 readonly "decart"?: Objects_52
7894 readonly "deepgram"?: Objects_53
7895 readonly "deepinfra"?: Objects_54
7896 readonly "deepseek"?: Objects_55
7897 readonly "dekallm"?: Objects_56
7898 readonly "digitalocean"?: Objects_57
7899 readonly "enfer"?: Objects_58
7900 readonly "fake-provider"?: Objects_59
7901 readonly "featherless"?: Objects_60
7902 readonly "fireworks"?: Objects_61
7903 readonly "fish-audio"?: Objects_62
7904 readonly "friendli"?: Objects_63
7905 readonly "gmicloud"?: Objects_64
7906 readonly "google-ai-studio"?: Objects_65
7907 readonly "google-vertex"?: Objects_66
7908 readonly "gopomelo"?: Objects_67
7909 readonly "groq"?: Objects_68
7910 readonly "heygen"?: Objects_69
7911 readonly "huggingface"?: Objects_70
7912 readonly "hyperbolic"?: Objects_71
7913 readonly "hyperbolic-quantized"?: Objects_72
7914 readonly "inception"?: Objects_73
7915 readonly "inceptron"?: Objects_74
7916 readonly "inferact-vllm"?: Objects_75
7917 readonly "inference-net"?: Objects_76
7918 readonly "infermatic"?: Objects_77
7919 readonly "inflection"?: Objects_78
7920 readonly "inocloud"?: Objects_79
7921 readonly "io-net"?: Objects_80
7922 readonly "ionstream"?: Objects_81
7923 readonly "klusterai"?: Objects_82
7924 readonly "krea"?: Objects_83
7925 readonly "lambda"?: Objects_84
7926 readonly "lepton"?: Objects_85
7927 readonly "liquid"?: Objects_86
7928 readonly "lynn"?: Objects_87
7929 readonly "lynn-private"?: Objects_88
7930 readonly "mancer"?: Objects_89
7931 readonly "mancer-old"?: Objects_90
7932 readonly "mara"?: Objects_91
7933 readonly "meta"?: Objects_92
7934 readonly "minimax"?: Objects_93
7935 readonly "mistral"?: Objects_94
7936 readonly "modal"?: Objects_95
7937 readonly "modelrun"?: Objects_96
7938 readonly "modular"?: Objects_97
7939 readonly "moonshotai"?: Objects_98
7940 readonly "morph"?: Objects_99
7941 readonly "ncompass"?: Objects_100
7942 readonly "nebius"?: Objects_101
7943 readonly "nex-agi"?: Objects_102
7944 readonly "nextbit"?: Objects_103
7945 readonly "nineteen"?: Objects_104
7946 readonly "novita"?: Objects_105
7947 readonly "nvidia"?: Objects_106
7948 readonly "octoai"?: Objects_107
7949 readonly "open-inference"?: Objects_108
7950 readonly "openai"?: Objects_109
7951 readonly "parasail"?: Objects_110
7952 readonly "perceptron"?: Objects_111
7953 readonly "perplexity"?: Objects_112
7954 readonly "phala"?: Objects_113
7955 readonly "poolside"?: Objects_114
7956 readonly "quiver"?: Objects_115
7957 readonly "recraft"?: Objects_116
7958 readonly "recursal"?: Objects_117
7959 readonly "reflection"?: Objects_118
7960 readonly "reka"?: Objects_119
7961 readonly "relace"?: Objects_120
7962 readonly "replicate"?: Objects_121
7963 readonly "runway"?: Objects_122
7964 readonly "sail-research"?: Objects_123
7965 readonly "sakana"?: Objects_124
7966 readonly "sambanova"?: Objects_125
7967 readonly "sambanova-cloaked"?: Objects_126
7968 readonly "seed"?: Objects_127
7969 readonly "sf-compute"?: Objects_128
7970 readonly "siliconflow"?: Objects_129
7971 readonly "sourceful"?: Objects_130
7972 readonly "stealth"?: Objects_131
7973 readonly "stepfun"?: Objects_132
7974 readonly "streamlake"?: Objects_133
7975 readonly "switchpoint"?: Objects_134
7976 readonly "targon"?: Objects_135
7977 readonly "tencent"?: Objects_136
7978 readonly "tenstorrent"?: Objects_137
7979 readonly "together"?: Objects_138
7980 readonly "together-lite"?: Objects_139
7981 readonly "ubicloud"?: Objects_140
7982 readonly "upstage"?: Objects_141
7983 readonly "venice"?: Objects_142
7984 readonly "wafer"?: Objects_143
7985 readonly "wandb"?: Objects_144
7986 readonly "xai"?: Objects_145
7987 readonly "xiaomi"?: Objects_146
7988 readonly "z-ai"?: Objects_147
7989}
7990export const ProviderOptions = Schema.Struct({
7991 "01ai": Schema.optionalKey(Objects_21),
7992 "ai21": Schema.optionalKey(Objects_22),
7993 "aion-labs": Schema.optionalKey(Objects_23),
7994 "akashml": Schema.optionalKey(Objects_24),
7995 "alibaba": Schema.optionalKey(Objects_25),
7996 "amazon-bedrock": Schema.optionalKey(Objects_26),
7997 "amazon-nova": Schema.optionalKey(Objects_27),
7998 "ambient": Schema.optionalKey(Objects_28),
7999 "anthropic": Schema.optionalKey(Objects_29),
8000 "anyscale": Schema.optionalKey(Objects_30),
8001 "arcee-ai": Schema.optionalKey(Objects_31),
8002 "atlas-cloud": Schema.optionalKey(Objects_32),
8003 "atoma": Schema.optionalKey(Objects_33),
8004 "avian": Schema.optionalKey(Objects_34),
8005 "azure": Schema.optionalKey(Objects_35),
8006 "baidu": Schema.optionalKey(Objects_36),
8007 "baseten": Schema.optionalKey(Objects_37),
8008 "black-forest-labs": Schema.optionalKey(Objects_38),
8009 "byteplus": Schema.optionalKey(Objects_39),
8010 "centml": Schema.optionalKey(Objects_40),
8011 "cerebras": Schema.optionalKey(Objects_41),
8012 "chutes": Schema.optionalKey(Objects_42),
8013 "cirrascale": Schema.optionalKey(Objects_43),
8014 "clarifai": Schema.optionalKey(Objects_44),
8015 "cloudflare": Schema.optionalKey(Objects_45),
8016 "cohere": Schema.optionalKey(Objects_46),
8017 "coreweave": Schema.optionalKey(Objects_47),
8018 "crofai": Schema.optionalKey(Objects_48),
8019 "crucible": Schema.optionalKey(Objects_49),
8020 "crusoe": Schema.optionalKey(Objects_50),
8021 "darkbloom": Schema.optionalKey(Objects_51),
8022 "decart": Schema.optionalKey(Objects_52),
8023 "deepgram": Schema.optionalKey(Objects_53),
8024 "deepinfra": Schema.optionalKey(Objects_54),
8025 "deepseek": Schema.optionalKey(Objects_55),
8026 "dekallm": Schema.optionalKey(Objects_56),
8027 "digitalocean": Schema.optionalKey(Objects_57),
8028 "enfer": Schema.optionalKey(Objects_58),
8029 "fake-provider": Schema.optionalKey(Objects_59),
8030 "featherless": Schema.optionalKey(Objects_60),
8031 "fireworks": Schema.optionalKey(Objects_61),
8032 "fish-audio": Schema.optionalKey(Objects_62),
8033 "friendli": Schema.optionalKey(Objects_63),
8034 "gmicloud": Schema.optionalKey(Objects_64),
8035 "google-ai-studio": Schema.optionalKey(Objects_65),
8036 "google-vertex": Schema.optionalKey(Objects_66),
8037 "gopomelo": Schema.optionalKey(Objects_67),
8038 "groq": Schema.optionalKey(Objects_68),
8039 "heygen": Schema.optionalKey(Objects_69),
8040 "huggingface": Schema.optionalKey(Objects_70),
8041 "hyperbolic": Schema.optionalKey(Objects_71),
8042 "hyperbolic-quantized": Schema.optionalKey(Objects_72),
8043 "inception": Schema.optionalKey(Objects_73),
8044 "inceptron": Schema.optionalKey(Objects_74),
8045 "inferact-vllm": Schema.optionalKey(Objects_75),
8046 "inference-net": Schema.optionalKey(Objects_76),
8047 "infermatic": Schema.optionalKey(Objects_77),
8048 "inflection": Schema.optionalKey(Objects_78),
8049 "inocloud": Schema.optionalKey(Objects_79),
8050 "io-net": Schema.optionalKey(Objects_80),
8051 "ionstream": Schema.optionalKey(Objects_81),
8052 "klusterai": Schema.optionalKey(Objects_82),
8053 "krea": Schema.optionalKey(Objects_83),
8054 "lambda": Schema.optionalKey(Objects_84),
8055 "lepton": Schema.optionalKey(Objects_85),
8056 "liquid": Schema.optionalKey(Objects_86),
8057 "lynn": Schema.optionalKey(Objects_87),
8058 "lynn-private": Schema.optionalKey(Objects_88),
8059 "mancer": Schema.optionalKey(Objects_89),
8060 "mancer-old": Schema.optionalKey(Objects_90),
8061 "mara": Schema.optionalKey(Objects_91),
8062 "meta": Schema.optionalKey(Objects_92),
8063 "minimax": Schema.optionalKey(Objects_93),
8064 "mistral": Schema.optionalKey(Objects_94),
8065 "modal": Schema.optionalKey(Objects_95),
8066 "modelrun": Schema.optionalKey(Objects_96),
8067 "modular": Schema.optionalKey(Objects_97),
8068 "moonshotai": Schema.optionalKey(Objects_98),
8069 "morph": Schema.optionalKey(Objects_99),
8070 "ncompass": Schema.optionalKey(Objects_100),
8071 "nebius": Schema.optionalKey(Objects_101),
8072 "nex-agi": Schema.optionalKey(Objects_102),
8073 "nextbit": Schema.optionalKey(Objects_103),
8074 "nineteen": Schema.optionalKey(Objects_104),
8075 "novita": Schema.optionalKey(Objects_105),
8076 "nvidia": Schema.optionalKey(Objects_106),
8077 "octoai": Schema.optionalKey(Objects_107),
8078 "open-inference": Schema.optionalKey(Objects_108),
8079 "openai": Schema.optionalKey(Objects_109),
8080 "parasail": Schema.optionalKey(Objects_110),
8081 "perceptron": Schema.optionalKey(Objects_111),
8082 "perplexity": Schema.optionalKey(Objects_112),
8083 "phala": Schema.optionalKey(Objects_113),
8084 "poolside": Schema.optionalKey(Objects_114),
8085 "quiver": Schema.optionalKey(Objects_115),
8086 "recraft": Schema.optionalKey(Objects_116),
8087 "recursal": Schema.optionalKey(Objects_117),
8088 "reflection": Schema.optionalKey(Objects_118),
8089 "reka": Schema.optionalKey(Objects_119),
8090 "relace": Schema.optionalKey(Objects_120),
8091 "replicate": Schema.optionalKey(Objects_121),
8092 "runway": Schema.optionalKey(Objects_122),
8093 "sail-research": Schema.optionalKey(Objects_123),
8094 "sakana": Schema.optionalKey(Objects_124),
8095 "sambanova": Schema.optionalKey(Objects_125),
8096 "sambanova-cloaked": Schema.optionalKey(Objects_126),
8097 "seed": Schema.optionalKey(Objects_127),
8098 "sf-compute": Schema.optionalKey(Objects_128),
8099 "siliconflow": Schema.optionalKey(Objects_129),
8100 "sourceful": Schema.optionalKey(Objects_130),
8101 "stealth": Schema.optionalKey(Objects_131),
8102 "stepfun": Schema.optionalKey(Objects_132),
8103 "streamlake": Schema.optionalKey(Objects_133),
8104 "switchpoint": Schema.optionalKey(Objects_134),
8105 "targon": Schema.optionalKey(Objects_135),
8106 "tencent": Schema.optionalKey(Objects_136),
8107 "tenstorrent": Schema.optionalKey(Objects_137),
8108 "together": Schema.optionalKey(Objects_138),
8109 "together-lite": Schema.optionalKey(Objects_139),
8110 "ubicloud": Schema.optionalKey(Objects_140),
8111 "upstage": Schema.optionalKey(Objects_141),
8112 "venice": Schema.optionalKey(Objects_142),
8113 "wafer": Schema.optionalKey(Objects_143),
8114 "wandb": Schema.optionalKey(Objects_144),
8115 "xai": Schema.optionalKey(Objects_145),
8116 "xiaomi": Schema.optionalKey(Objects_146),
8117 "z-ai": Schema.optionalKey(Objects_147)
8118}).annotate({
8119 "description":
8120 "Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.",
8121 "identifier": "ProviderOptions"
8122})
8123export type ProviderOverloadedResponse = {
8124 readonly "error": ProviderOverloadedResponseErrorData
8125 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
8126 readonly "user_id"?: string | null
8127}
8128export const ProviderOverloadedResponse = Schema.Struct({
8129 "error": ProviderOverloadedResponseErrorData,
8130 "openrouter_metadata": Schema.optionalKey(
8131 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
8132 ),
8133 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
8134}).annotate({
8135 "description": "Provider Overloaded - Provider is temporarily overloaded",
8136 "identifier": "ProviderOverloadedResponse"
8137})
8138export type GenerationResponse = {
8139 readonly "data": {
8140 readonly "api_type": "completions" | "embeddings" | "rerank" | "tts" | "stt" | "video" | "image" | null
8141 readonly "app_id": number | null
8142 readonly "cache_discount": number | null
8143 readonly "cancelled": boolean | null
8144 readonly "created_at": string
8145 readonly "data_region": "global" | "europe"
8146 readonly "external_user": string | null
8147 readonly "finish_reason": string | null
8148 readonly "generation_time": number | null
8149 readonly "http_referer": string | null
8150 readonly "id": string
8151 readonly "is_byok": boolean
8152 readonly "latency": number | null
8153 readonly "model": string
8154 readonly "moderation_latency": number | null
8155 readonly "native_finish_reason": string | null
8156 readonly "native_tokens_cached": number | null
8157 readonly "native_tokens_completion": number | null
8158 readonly "native_tokens_completion_images": number | null
8159 readonly "native_tokens_prompt": number | null
8160 readonly "native_tokens_reasoning": number | null
8161 readonly "num_fetches": number | null
8162 readonly "num_input_audio_prompt": number | null
8163 readonly "num_media_completion": number | null
8164 readonly "num_media_prompt": number | null
8165 readonly "num_search_results": number | null
8166 readonly "origin": string
8167 readonly "preset_id": string | null
8168 readonly "provider_name": string | null
8169 readonly "provider_responses": ReadonlyArray<ProviderResponse> | null
8170 readonly "request_id"?: string | null
8171 readonly "response_cache_source_id"?: string | null
8172 readonly "router": string | null
8173 readonly "service_tier": string | null
8174 readonly "session_id"?: string | null
8175 readonly "streamed": boolean | null
8176 readonly "tokens_completion": number | null
8177 readonly "tokens_prompt": number | null
8178 readonly "total_cost": number
8179 readonly "upstream_id": string | null
8180 readonly "upstream_inference_cost": number | null
8181 readonly "usage": number
8182 readonly "user_agent": string | null
8183 readonly "web_search_engine": string | null
8184 }
8185}
8186export const GenerationResponse = Schema.Struct({
8187 "data": Schema.Struct({
8188 "api_type": Schema.Union([
8189 Schema.Literal("completions"),
8190 Schema.Literal("embeddings"),
8191 Schema.Literal("rerank"),
8192 Schema.Literal("tts"),
8193 Schema.Literal("stt"),
8194 Schema.Literal("video"),
8195 Schema.Literal("image"),
8196 Schema.Null
8197 ]).annotate({ "description": "Type of API used for the generation" }),
8198 "app_id": Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
8199 .annotate({ "description": "ID of the app that made the request" }),
8200 "cache_discount": Schema.Union([
8201 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
8202 Schema.Null
8203 ]).annotate({ "description": "Discount applied due to caching", "format": "double" }),
8204 "cancelled": Schema.Union([Schema.Boolean, Schema.Null]).annotate({
8205 "description": "Whether the generation was cancelled"
8206 }),
8207 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the generation was created" }),
8208 "data_region": Schema.Literals(["global", "europe"]).annotate({
8209 "description":
8210 "The data region this generation was routed through. 'europe' for EU-routed requests, 'global' otherwise."
8211 }),
8212 "external_user": Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "External user identifier" }),
8213 "finish_reason": Schema.Union([Schema.String, Schema.Null]).annotate({
8214 "description": "Reason the generation finished"
8215 }),
8216 "generation_time": Schema.Union([
8217 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
8218 Schema.Null
8219 ]).annotate({ "description": "Time taken for generation in milliseconds", "format": "double" }),
8220 "http_referer": Schema.Union([Schema.String, Schema.Null]).annotate({
8221 "description": "Referer header from the request"
8222 }),
8223 "id": Schema.String.annotate({ "description": "Unique identifier for the generation" }),
8224 "is_byok": Schema.Boolean.annotate({ "description": "Whether this used bring-your-own-key" }),
8225 "latency": Schema.Union([
8226 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
8227 Schema.Null
8228 ]).annotate({ "description": "Total latency in milliseconds", "format": "double" }),
8229 "model": Schema.String.annotate({ "description": "Model used for the generation" }),
8230 "moderation_latency": Schema.Union([
8231 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
8232 Schema.Null
8233 ]).annotate({ "description": "Moderation latency in milliseconds", "format": "double" }),
8234 "native_finish_reason": Schema.Union([Schema.String, Schema.Null]).annotate({
8235 "description": "Native finish reason as reported by provider"
8236 }),
8237 "native_tokens_cached": Schema.Union([
8238 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8239 Schema.Null
8240 ]).annotate({ "description": "Native cached tokens as reported by provider" }),
8241 "native_tokens_completion": Schema.Union([
8242 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8243 Schema.Null
8244 ]).annotate({ "description": "Native completion tokens as reported by provider" }),
8245 "native_tokens_completion_images": Schema.Union([
8246 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8247 Schema.Null
8248 ]).annotate({ "description": "Native completion image tokens as reported by provider" }),
8249 "native_tokens_prompt": Schema.Union([
8250 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8251 Schema.Null
8252 ]).annotate({ "description": "Native prompt tokens as reported by provider" }),
8253 "native_tokens_reasoning": Schema.Union([
8254 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8255 Schema.Null
8256 ]).annotate({ "description": "Native reasoning tokens as reported by provider" }),
8257 "num_fetches": Schema.Union([
8258 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8259 Schema.Null
8260 ]).annotate({ "description": "Number of web fetches performed" }),
8261 "num_input_audio_prompt": Schema.Union([
8262 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8263 Schema.Null
8264 ]).annotate({ "description": "Number of audio inputs in the prompt" }),
8265 "num_media_completion": Schema.Union([
8266 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8267 Schema.Null
8268 ]).annotate({ "description": "Number of media items in the completion" }),
8269 "num_media_prompt": Schema.Union([
8270 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8271 Schema.Null
8272 ]).annotate({ "description": "Number of media items in the prompt" }),
8273 "num_search_results": Schema.Union([
8274 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8275 Schema.Null
8276 ]).annotate({ "description": "Number of search results included" }),
8277 "origin": Schema.String.annotate({ "description": "Origin URL of the request" }),
8278 "preset_id": Schema.Union([Schema.String, Schema.Null]).annotate({
8279 "description": "ID of the preset used for this generation, null if no preset was used"
8280 }),
8281 "provider_name": Schema.Union([Schema.String, Schema.Null]).annotate({
8282 "description": "Name of the provider that served the request"
8283 }),
8284 "provider_responses": Schema.Union([Schema.Array(ProviderResponse), Schema.Null]).annotate({
8285 "description": "List of provider responses for this generation, including fallback attempts"
8286 }),
8287 "request_id": Schema.optionalKey(
8288 Schema.Union([Schema.String, Schema.Null]).annotate({
8289 "description": "Unique identifier grouping all generations from a single API request"
8290 })
8291 ),
8292 "response_cache_source_id": Schema.optionalKey(
8293 Schema.Union([Schema.String, Schema.Null]).annotate({
8294 "description":
8295 "If this generation was served from response cache, contains the original generation ID. Null otherwise."
8296 })
8297 ),
8298 "router": Schema.Union([Schema.String, Schema.Null]).annotate({
8299 "description": "Router used for the request (e.g., openrouter/auto)"
8300 }),
8301 "service_tier": Schema.Union([Schema.String, Schema.Null]).annotate({
8302 "description":
8303 "Service tier the upstream provider reported running this request on, or null if it did not report one."
8304 }),
8305 "session_id": Schema.optionalKey(
8306 Schema.Union([Schema.String, Schema.Null]).annotate({
8307 "description": "Session identifier grouping multiple generations in the same session"
8308 })
8309 ),
8310 "streamed": Schema.Union([Schema.Boolean, Schema.Null]).annotate({
8311 "description": "Whether the response was streamed"
8312 }),
8313 "tokens_completion": Schema.Union([
8314 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8315 Schema.Null
8316 ]).annotate({ "description": "Number of tokens in the completion" }),
8317 "tokens_prompt": Schema.Union([
8318 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8319 Schema.Null
8320 ]).annotate({ "description": "Number of tokens in the prompt" }),
8321 "total_cost": Schema.Number.annotate({ "description": "Total cost of the generation in USD", "format": "double" })
8322 .check(Schema.isFinite().annotate({ "expected": "a finite number" })),
8323 "upstream_id": Schema.Union([Schema.String, Schema.Null]).annotate({
8324 "description": "Upstream provider's identifier for this generation"
8325 }),
8326 "upstream_inference_cost": Schema.Union([
8327 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
8328 Schema.Null
8329 ]).annotate({ "description": "Cost charged by the upstream provider", "format": "double" }),
8330 "usage": Schema.Number.annotate({ "description": "Usage amount in USD", "format": "double" }).check(
8331 Schema.isFinite().annotate({ "expected": "a finite number" })
8332 ),
8333 "user_agent": Schema.Union([Schema.String, Schema.Null]).annotate({
8334 "description": "User-Agent header from the request"
8335 }),
8336 "web_search_engine": Schema.Union([Schema.String, Schema.Null]).annotate({
8337 "description": "The resolved web search engine used for this generation (e.g. exa, firecrawl, parallel)"
8338 })
8339 }).annotate({ "description": "Generation data" })
8340}).annotate({ "description": "Generation response", "identifier": "GenerationResponse" })
8341export type Union_5 = ProviderSort | ProviderSortConfig | null
8342export const Union_5 = Schema.Union([ProviderSort, ProviderSortConfig, Schema.Null]).annotate({
8343 "description":
8344 "The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."
8345})
8346export type PublicEndpoint = {
8347 readonly "context_length": number
8348 readonly "latency_last_30m": PercentileStats
8349 readonly "max_completion_tokens": number | null
8350 readonly "max_prompt_tokens": number | null
8351 readonly "model_id": string
8352 readonly "model_name": string
8353 readonly "name": string
8354 readonly "pricing": {
8355 readonly "audio"?: string
8356 readonly "audio_output"?: string
8357 readonly "completion": string
8358 readonly "discount"?: number
8359 readonly "image"?: string
8360 readonly "image_output"?: string
8361 readonly "image_token"?: string
8362 readonly "input_audio_cache"?: string
8363 readonly "input_cache_read"?: string
8364 readonly "input_cache_write"?: string
8365 readonly "input_cache_write_1h"?: string
8366 readonly "internal_reasoning"?: string
8367 readonly "overrides"?: ReadonlyArray<PricingOverride>
8368 readonly "prompt": string
8369 readonly "request"?: string
8370 readonly "web_search"?: string
8371 }
8372 readonly "provider_name": ProviderName
8373 readonly "quantization": Quantization | null
8374 readonly "status"?: EndpointStatus
8375 readonly "supported_parameters": ReadonlyArray<Parameter>
8376 readonly "supports_implicit_caching": boolean
8377 readonly "tag": string
8378 readonly "throughput_last_30m": PercentileStats
8379 readonly "uptime_last_1d": number | null
8380 readonly "uptime_last_30m": number | null
8381 readonly "uptime_last_5m": number | null
8382}
8383export const PublicEndpoint = Schema.Struct({
8384 "context_length": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8385 "latency_last_30m": PercentileStats,
8386 "max_completion_tokens": Schema.Union([
8387 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8388 Schema.Null
8389 ]),
8390 "max_prompt_tokens": Schema.Union([
8391 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8392 Schema.Null
8393 ]),
8394 "model_id": Schema.String.annotate({ "description": "The unique identifier for the model (permaslug)" }),
8395 "model_name": Schema.String,
8396 "name": Schema.String,
8397 "pricing": Schema.Struct({
8398 "audio": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per audio input token" })),
8399 "audio_output": Schema.optionalKey(
8400 Schema.String.annotate({ "description": "Price in USD per audio output token" })
8401 ),
8402 "completion": Schema.String.annotate({
8403 "description": "Price in USD per token for completion (output) generation"
8404 }),
8405 "discount": Schema.optionalKey(
8406 Schema.Number.annotate({
8407 "description":
8408 "Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)",
8409 "format": "double"
8410 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
8411 ),
8412 "image": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per input image" })),
8413 "image_output": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per output image" })),
8414 "image_token": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per image token" })),
8415 "input_audio_cache": Schema.optionalKey(
8416 Schema.String.annotate({ "description": "Price in USD per cached audio input token" })
8417 ),
8418 "input_cache_read": Schema.optionalKey(
8419 Schema.String.annotate({ "description": "Price in USD per cached input token (read)" })
8420 ),
8421 "input_cache_write": Schema.optionalKey(
8422 Schema.String.annotate({
8423 "description":
8424 "Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate."
8425 })
8426 ),
8427 "input_cache_write_1h": Schema.optionalKey(
8428 Schema.String.annotate({
8429 "description":
8430 "Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic."
8431 })
8432 ),
8433 "internal_reasoning": Schema.optionalKey(
8434 Schema.String.annotate({ "description": "Price in USD per internal reasoning token" })
8435 ),
8436 "overrides": Schema.optionalKey(
8437 Schema.Array(PricingOverride).annotate({
8438 "description":
8439 "Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions."
8440 })
8441 ),
8442 "prompt": Schema.String.annotate({ "description": "Price in USD per token for prompt (input) processing" }),
8443 "request": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per request" })),
8444 "web_search": Schema.optionalKey(Schema.String.annotate({ "description": "Price in USD per web search" }))
8445 }),
8446 "provider_name": ProviderName,
8447 "quantization": Schema.Union([Quantization, Schema.Null]),
8448 "status": Schema.optionalKey(EndpointStatus),
8449 "supported_parameters": Schema.Array(Parameter),
8450 "supports_implicit_caching": Schema.Boolean,
8451 "tag": Schema.String,
8452 "throughput_last_30m": Schema.suspend((): Schema.Codec<PercentileStats> => PercentileStats).annotate({
8453 "description":
8454 "Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token generation speed. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests."
8455 }),
8456 "uptime_last_1d": Schema.Union([
8457 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
8458 Schema.Null
8459 ]).annotate({
8460 "description":
8461 "Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data.",
8462 "format": "double"
8463 }),
8464 "uptime_last_30m": Schema.Union([
8465 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
8466 Schema.Null
8467 ]).annotate({ "format": "double" }),
8468 "uptime_last_5m": Schema.Union([
8469 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
8470 Schema.Null
8471 ]).annotate({
8472 "description":
8473 "Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data.",
8474 "format": "double"
8475 })
8476}).annotate({ "description": "Information about a specific model endpoint", "identifier": "PublicEndpoint" })
8477export type CapabilityDescriptor = EnumCapability | RangeCapability | BooleanCapability
8478export const CapabilityDescriptor = Schema.Union([EnumCapability, RangeCapability, BooleanCapability], {
8479 mode: "oneOf"
8480}).annotate({
8481 "description": "A typed descriptor for one supported request parameter.",
8482 "identifier": "CapabilityDescriptor"
8483})
8484export type AppRankingsResponse = {
8485 readonly "data": ReadonlyArray<AppRankingsItem>
8486 readonly "meta": RankingsDailyMeta
8487}
8488export const AppRankingsResponse = Schema.Struct({
8489 "data": Schema.Array(AppRankingsItem).annotate({
8490 "description":
8491 "Apps ranked per the requested `sort`, re-numbered 1..N after category filtering. `popular` sorts by `total_tokens` descending; `trending` sorts by absolute excess token growth descending and may return fewer than `limit` rows when few apps are growing."
8492 }),
8493 "meta": RankingsDailyMeta
8494}).annotate({ "identifier": "AppRankingsResponse" })
8495export type RankingsDailyResponse = {
8496 readonly "data": ReadonlyArray<RankingsDailyItem>
8497 readonly "meta": RankingsDailyMeta
8498}
8499export const RankingsDailyResponse = Schema.Struct({
8500 "data": Schema.Array(RankingsDailyItem).annotate({
8501 "description":
8502 "Up to 51 rows per day — the top 50 public models by `total_tokens` for each UTC calendar date in the window, plus one aggregated `other` row summing every model outside that top 50 (omitted when the long tail is empty). Rows are sorted by `date` ascending, then by `total_tokens` descending, with `other` pinned last within its date. Ties between real models break alphabetically on `model_permaslug` so the order is stable across requests."
8503 }),
8504 "meta": RankingsDailyMeta
8505}).annotate({ "identifier": "RankingsDailyResponse" })
8506export type Union_12 = ReadonlyArray<ReasoningEffort> | null
8507export const Union_12 = Schema.Union([Schema.Array(ReasoningEffort), Schema.Null]).annotate({
8508 "description":
8509 "Allowed reasoning effort values for this model, in descending effort order (highest first). Null means no allowlist — all gateway effort values are accepted."
8510})
8511export type ReasoningDetailEncrypted = {
8512 readonly "data": string
8513 readonly "format"?: ReasoningFormat
8514 readonly "id"?: string | null
8515 readonly "index"?: number
8516 readonly "type": "reasoning.encrypted"
8517}
8518export const ReasoningDetailEncrypted = Schema.Struct({
8519 "data": Schema.String,
8520 "format": Schema.optionalKey(ReasoningFormat),
8521 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
8522 "index": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
8523 "type": Schema.Literal("reasoning.encrypted")
8524}).annotate({ "description": "Reasoning detail encrypted schema", "identifier": "ReasoningDetailEncrypted" })
8525export type ReasoningDetailServerToolCall = {
8526 readonly "arguments": string
8527 readonly "format"?: ReasoningFormat
8528 readonly "id"?: string | null
8529 readonly "index"?: number
8530 readonly "result": string
8531 readonly "tool_call_id"?: string | null
8532 readonly "tool_name": string
8533 readonly "type": "reasoning.server_tool_call"
8534}
8535export const ReasoningDetailServerToolCall = Schema.Struct({
8536 "arguments": Schema.String,
8537 "format": Schema.optionalKey(ReasoningFormat),
8538 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
8539 "index": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
8540 "result": Schema.String,
8541 "tool_call_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
8542 "tool_name": Schema.String,
8543 "type": Schema.Literal("reasoning.server_tool_call")
8544}).annotate({
8545 "description":
8546 "Record of an OpenRouter server-tool invocation (e.g. openrouter:fusion), carried in reasoning_details so a prior tool call can be rehydrated into a later turn of the same conversation.",
8547 "identifier": "ReasoningDetailServerToolCall"
8548})
8549export type ReasoningDetailSummary = {
8550 readonly "format"?: ReasoningFormat
8551 readonly "id"?: string | null
8552 readonly "index"?: number
8553 readonly "summary": string
8554 readonly "type": "reasoning.summary"
8555}
8556export const ReasoningDetailSummary = Schema.Struct({
8557 "format": Schema.optionalKey(ReasoningFormat),
8558 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
8559 "index": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
8560 "summary": Schema.String,
8561 "type": Schema.Literal("reasoning.summary")
8562}).annotate({ "description": "Reasoning detail summary schema", "identifier": "ReasoningDetailSummary" })
8563export type ReasoningDetailText = {
8564 readonly "format"?: ReasoningFormat
8565 readonly "id"?: string | null
8566 readonly "index"?: number
8567 readonly "signature"?: string | null
8568 readonly "text"?: string | null
8569 readonly "type": "reasoning.text"
8570}
8571export const ReasoningDetailText = Schema.Struct({
8572 "format": Schema.optionalKey(ReasoningFormat),
8573 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
8574 "index": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
8575 "signature": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
8576 "text": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
8577 "type": Schema.Literal("reasoning.text")
8578}).annotate({ "description": "Reasoning detail text schema", "identifier": "ReasoningDetailText" })
8579export type BaseReasoningSummaryPartAddedEvent = {
8580 readonly "item_id": string
8581 readonly "output_index": number
8582 readonly "part": ReasoningSummaryText
8583 readonly "sequence_number": number
8584 readonly "summary_index": number
8585 readonly "type": "response.reasoning_summary_part.added"
8586}
8587export const BaseReasoningSummaryPartAddedEvent = Schema.Struct({
8588 "item_id": Schema.String,
8589 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8590 "part": ReasoningSummaryText,
8591 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8592 "summary_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8593 "type": Schema.Literal("response.reasoning_summary_part.added")
8594}).annotate({
8595 "description": "Event emitted when a reasoning summary part is added",
8596 "identifier": "BaseReasoningSummaryPartAddedEvent"
8597})
8598export type BaseReasoningSummaryPartDoneEvent = {
8599 readonly "item_id": string
8600 readonly "output_index": number
8601 readonly "part": ReasoningSummaryText
8602 readonly "sequence_number": number
8603 readonly "summary_index": number
8604 readonly "type": "response.reasoning_summary_part.done"
8605}
8606export const BaseReasoningSummaryPartDoneEvent = Schema.Struct({
8607 "item_id": Schema.String,
8608 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8609 "part": ReasoningSummaryText,
8610 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8611 "summary_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8612 "type": Schema.Literal("response.reasoning_summary_part.done")
8613}).annotate({
8614 "description": "Event emitted when a reasoning summary part is complete",
8615 "identifier": "BaseReasoningSummaryPartDoneEvent"
8616})
8617export type OutputReasoningItem = {
8618 readonly "content"?: ReadonlyArray<{ readonly "text": string; readonly "type": "reasoning_text" }>
8619 readonly "encrypted_content"?: string | null
8620 readonly "id": string
8621 readonly "status"?: "completed" | "incomplete" | "in_progress"
8622 readonly "summary": ReadonlyArray<ReasoningSummaryText>
8623 readonly "type": "reasoning"
8624 readonly "format"?: ReasoningFormat
8625 readonly "signature"?: string | null
8626}
8627export const OutputReasoningItem = Schema.Struct({
8628 "content": Schema.optionalKey(
8629 Schema.Union([Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("reasoning_text") }))])
8630 ),
8631 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
8632 "id": Schema.String,
8633 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
8634 "summary": Schema.Array(ReasoningSummaryText),
8635 "type": Schema.Literal("reasoning"),
8636 "format": Schema.optionalKey(ReasoningFormat),
8637 "signature": Schema.optionalKey(
8638 Schema.Union([Schema.String, Schema.Null]).annotate({
8639 "description": "A signature for the reasoning content, used for verification"
8640 })
8641 )
8642}).annotate({ "description": "An output item containing reasoning", "identifier": "OutputReasoningItem" })
8643export type ReasoningItem = {
8644 readonly "content"?: ReadonlyArray<{ readonly "text": string; readonly "type": "reasoning_text" }>
8645 readonly "encrypted_content"?: string | null
8646 readonly "id": string
8647 readonly "status"?: "completed" | "incomplete" | "in_progress"
8648 readonly "summary": ReadonlyArray<ReasoningSummaryText>
8649 readonly "type": "reasoning"
8650 readonly "format"?: ReasoningFormat
8651 readonly "signature"?: string | null
8652}
8653export const ReasoningItem = Schema.Struct({
8654 "content": Schema.optionalKey(
8655 Schema.Union([Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("reasoning_text") }))])
8656 ),
8657 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
8658 "id": Schema.String,
8659 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
8660 "summary": Schema.Array(ReasoningSummaryText),
8661 "type": Schema.Literal("reasoning"),
8662 "format": Schema.optionalKey(ReasoningFormat),
8663 "signature": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
8664}).annotate({
8665 "description": "Reasoning output item with signature and format extensions",
8666 "identifier": "ReasoningItem"
8667})
8668export type ReasoningSummaryPartAddedEvent = {
8669 readonly "item_id": string
8670 readonly "output_index": number
8671 readonly "part": ReasoningSummaryText
8672 readonly "sequence_number": number
8673 readonly "summary_index": number
8674 readonly "type": "response.reasoning_summary_part.added"
8675}
8676export const ReasoningSummaryPartAddedEvent = Schema.Struct({
8677 "item_id": Schema.String,
8678 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8679 "part": ReasoningSummaryText,
8680 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8681 "summary_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8682 "type": Schema.Literal("response.reasoning_summary_part.added")
8683}).annotate({
8684 "description": "Event emitted when a reasoning summary part is added",
8685 "identifier": "ReasoningSummaryPartAddedEvent"
8686})
8687export type ReasoningSummaryPartDoneEvent = {
8688 readonly "item_id": string
8689 readonly "output_index": number
8690 readonly "part": ReasoningSummaryText
8691 readonly "sequence_number": number
8692 readonly "summary_index": number
8693 readonly "type": "response.reasoning_summary_part.done"
8694}
8695export const ReasoningSummaryPartDoneEvent = Schema.Struct({
8696 "item_id": Schema.String,
8697 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8698 "part": ReasoningSummaryText,
8699 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8700 "summary_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8701 "type": Schema.Literal("response.reasoning_summary_part.done")
8702}).annotate({
8703 "description": "Event emitted when a reasoning summary part is complete",
8704 "identifier": "ReasoningSummaryPartDoneEvent"
8705})
8706export type Objects_5 = {
8707 readonly "context"?: ReasoningContext
8708 readonly "effort"?: ReasoningEffort
8709 readonly "mode"?: ReasoningMode
8710 readonly "summary"?: ReasoningSummaryVerbosity
8711 readonly [x: string]: Schema.Json
8712}
8713export const Objects_5 = Schema.StructWithRest(
8714 Schema.Struct({
8715 "context": Schema.optionalKey(ReasoningContext),
8716 "effort": Schema.optionalKey(ReasoningEffort),
8717 "mode": Schema.optionalKey(ReasoningMode),
8718 "summary": Schema.optionalKey(ReasoningSummaryVerbosity)
8719 }),
8720 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
8721)
8722export type Union_13 = {
8723 readonly "context"?: ReasoningContext
8724 readonly "effort"?: ReasoningEffort
8725 readonly "mode"?: ReasoningMode
8726 readonly "summary"?: ReasoningSummaryVerbosity
8727 readonly "enabled"?: boolean | null
8728 readonly "max_tokens"?: number | null
8729}
8730export const Union_13 = Schema.Union([Schema.Struct({
8731 "context": Schema.optionalKey(ReasoningContext),
8732 "effort": Schema.optionalKey(ReasoningEffort),
8733 "mode": Schema.optionalKey(ReasoningMode),
8734 "summary": Schema.optionalKey(ReasoningSummaryVerbosity),
8735 "enabled": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
8736 "max_tokens": Schema.optionalKey(
8737 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
8738 )
8739})])
8740export type OutputItemReasoning = {
8741 readonly "content"?: ReadonlyArray<ReasoningTextContent>
8742 readonly "encrypted_content"?: string | null
8743 readonly "id": string
8744 readonly "status"?: "completed" | "incomplete" | "in_progress"
8745 readonly "summary": ReadonlyArray<ReasoningSummaryText>
8746 readonly "type": "reasoning"
8747}
8748export const OutputItemReasoning = Schema.Struct({
8749 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
8750 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
8751 "id": Schema.String,
8752 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
8753 "summary": Schema.Array(ReasoningSummaryText),
8754 "type": Schema.Literal("reasoning")
8755}).annotate({ "identifier": "OutputItemReasoning" })
8756export type RequestMetadata = Objects_149 | null
8757export const RequestMetadata = Schema.Union([Objects_149, Schema.Null]).annotate({
8758 "description":
8759 "Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.",
8760 "identifier": "RequestMetadata"
8761})
8762export type RequestTimeoutResponse = {
8763 readonly "error": RequestTimeoutResponseErrorData
8764 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
8765 readonly "user_id"?: string | null
8766}
8767export const RequestTimeoutResponse = Schema.Struct({
8768 "error": RequestTimeoutResponseErrorData,
8769 "openrouter_metadata": Schema.optionalKey(
8770 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
8771 ),
8772 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
8773}).annotate({
8774 "description": "Request Timeout - Operation exceeded time limit",
8775 "identifier": "RequestTimeoutResponse"
8776})
8777export type Arrays_10 = ReadonlyArray<RouterAttempt>
8778export const Arrays_10 = Schema.Array(RouterAttempt)
8779export type ChatSearchModelsServerTool = {
8780 readonly "parameters"?: SearchModelsServerToolConfig
8781 readonly "type": "openrouter:experimental__search_models"
8782}
8783export const ChatSearchModelsServerTool = Schema.Struct({
8784 "parameters": Schema.optionalKey(SearchModelsServerToolConfig),
8785 "type": Schema.Literal("openrouter:experimental__search_models")
8786}).annotate({
8787 "description": "OpenRouter built-in server tool: searches and filters AI models available on OpenRouter",
8788 "identifier": "ChatSearchModelsServerTool"
8789})
8790export type MessagesSearchModelsServerTool = {
8791 readonly "parameters"?: SearchModelsServerToolConfig
8792 readonly "type": "openrouter:experimental__search_models"
8793}
8794export const MessagesSearchModelsServerTool = Schema.Struct({
8795 "parameters": Schema.optionalKey(SearchModelsServerToolConfig),
8796 "type": Schema.Literal("openrouter:experimental__search_models")
8797}).annotate({
8798 "description": "OpenRouter built-in server tool: searches and filters AI models available on OpenRouter",
8799 "identifier": "MessagesSearchModelsServerTool"
8800})
8801export type SearchModelsServerTool_OpenRouter = {
8802 readonly "parameters"?: SearchModelsServerToolConfig
8803 readonly "type": "openrouter:experimental__search_models"
8804}
8805export const SearchModelsServerTool_OpenRouter = Schema.Struct({
8806 "parameters": Schema.optionalKey(SearchModelsServerToolConfig),
8807 "type": Schema.Literal("openrouter:experimental__search_models")
8808}).annotate({
8809 "description": "OpenRouter built-in server tool: searches and filters AI models available on OpenRouter",
8810 "identifier": "SearchModelsServerTool_OpenRouter"
8811})
8812export type ServerToolUseDetails = Objects_150 | null
8813export const ServerToolUseDetails = Schema.Union([Objects_150, Schema.Null]).annotate({
8814 "description": "Usage for server-side tool execution (e.g., web search)",
8815 "identifier": "ServerToolUseDetails"
8816})
8817export type ServiceUnavailableResponse = {
8818 readonly "error": ServiceUnavailableResponseErrorData
8819 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
8820 readonly "user_id"?: string | null
8821}
8822export const ServiceUnavailableResponse = Schema.Struct({
8823 "error": ServiceUnavailableResponseErrorData,
8824 "openrouter_metadata": Schema.optionalKey(
8825 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
8826 ),
8827 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
8828}).annotate({
8829 "description": "Service Unavailable - Service temporarily unavailable",
8830 "identifier": "ServiceUnavailableResponse"
8831})
8832export type OutputShellCallItem = {
8833 readonly "action"?: {
8834 readonly "commands": ReadonlyArray<string>
8835 readonly "max_output_length": number | null
8836 readonly "timeout_ms": number | null
8837 }
8838 readonly "call_id": string
8839 readonly "id": string
8840 readonly "status": ShellCallStatus
8841 readonly "type": "shell_call"
8842}
8843export const OutputShellCallItem = Schema.Struct({
8844 "action": Schema.optionalKey(Schema.Struct({
8845 "commands": Schema.Array(Schema.String),
8846 "max_output_length": Schema.Union([
8847 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8848 Schema.Null
8849 ]),
8850 "timeout_ms": Schema.Union([
8851 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8852 Schema.Null
8853 ])
8854 })),
8855 "call_id": Schema.String,
8856 "id": Schema.String,
8857 "status": ShellCallStatus,
8858 "type": Schema.Literal("shell_call")
8859}).annotate({
8860 "description":
8861 "A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool.",
8862 "identifier": "OutputShellCallItem"
8863})
8864export type OutputShellCallOutputItem = {
8865 readonly "call_id": string
8866 readonly "id": string
8867 readonly "max_output_length"?: number | null
8868 readonly "output": ReadonlyArray<
8869 {
8870 readonly "outcome": { readonly "exit_code": number; readonly "type": "exit" } | { readonly "type": "timeout" }
8871 readonly "stderr": string
8872 readonly "stdout": string
8873 }
8874 >
8875 readonly "status": ShellCallStatus
8876 readonly "type": "shell_call_output"
8877}
8878export const OutputShellCallOutputItem = Schema.Struct({
8879 "call_id": Schema.String,
8880 "id": Schema.String,
8881 "max_output_length": Schema.optionalKey(
8882 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
8883 ),
8884 "output": Schema.Array(Schema.Struct({
8885 "outcome": Schema.Union([
8886 Schema.Struct({
8887 "exit_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
8888 "type": Schema.Literal("exit")
8889 }),
8890 Schema.Struct({ "type": Schema.Literal("timeout") })
8891 ], { mode: "oneOf" }),
8892 "stderr": Schema.String,
8893 "stdout": Schema.String
8894 })),
8895 "status": ShellCallStatus,
8896 "type": Schema.Literal("shell_call_output")
8897}).annotate({
8898 "description":
8899 "A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome.",
8900 "identifier": "OutputShellCallOutputItem"
8901})
8902export type StopServerToolsWhenCondition =
8903 | StopServerToolsWhenStepCountIs
8904 | StopServerToolsWhenHasToolCall
8905 | StopServerToolsWhenMaxTokensUsed
8906 | StopServerToolsWhenMaxCost
8907 | StopServerToolsWhenFinishReasonIs
8908export const StopServerToolsWhenCondition = Schema.Union([
8909 StopServerToolsWhenStepCountIs,
8910 StopServerToolsWhenHasToolCall,
8911 StopServerToolsWhenMaxTokensUsed,
8912 StopServerToolsWhenMaxCost,
8913 StopServerToolsWhenFinishReasonIs
8914], { mode: "oneOf" }).annotate({
8915 "description": "A single condition that, when met, halts the server-tool agent loop.",
8916 "identifier": "StopServerToolsWhenCondition"
8917})
8918export type STTResponse = {
8919 readonly "duration"?: number
8920 readonly "language"?: string
8921 readonly "segments"?: ReadonlyArray<STTSegment>
8922 readonly "task"?: string
8923 readonly "text": string
8924 readonly "usage"?: STTUsage
8925 readonly "words"?: ReadonlyArray<STTWord>
8926}
8927export const STTResponse = Schema.Struct({
8928 "duration": Schema.optionalKey(
8929 Schema.Number.annotate({
8930 "description": "Duration of the input audio in seconds, present when response_format is verbose_json",
8931 "format": "double"
8932 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
8933 ),
8934 "language": Schema.optionalKey(
8935 Schema.String.annotate({
8936 "description": "Detected or forced language, present when response_format is verbose_json"
8937 })
8938 ),
8939 "segments": Schema.optionalKey(
8940 Schema.Array(STTSegment).annotate({
8941 "description": "Timestamped transcript segments, present when response_format is verbose_json"
8942 })
8943 ),
8944 "task": Schema.optionalKey(
8945 Schema.String.annotate({ "description": "The task performed, present when response_format is verbose_json" })
8946 ),
8947 "text": Schema.String.annotate({ "description": "The transcribed text" }),
8948 "usage": Schema.optionalKey(STTUsage),
8949 "words": Schema.optionalKey(
8950 Schema.Array(STTWord).annotate({
8951 "description": "Timestamped words, present when the provider returns word-level timestamps"
8952 })
8953 )
8954}).annotate({
8955 "description": "STT response containing transcribed text and optional usage statistics",
8956 "identifier": "STTResponse"
8957})
8958export type Arrays_12 = ReadonlyArray<SubagentNestedTool>
8959export const Arrays_12 = Schema.Array(SubagentNestedTool).annotate({
8960 "description":
8961 "Tools the subagent may use while executing a delegated task. The subagent runs as an agentic sub-agent over these tools, then returns its outcome. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the subagent tool itself."
8962})
8963export type ImageEndpoint = {
8964 readonly "allowed_passthrough_parameters": ReadonlyArray<string>
8965 readonly "pricing": ReadonlyArray<ImagePricingEntry>
8966 readonly "provider_name": string
8967 readonly "provider_slug": string
8968 readonly "provider_tag": string | null
8969 readonly "supported_parameters": SupportedParameters
8970 readonly "supports_streaming": boolean
8971}
8972export const ImageEndpoint = Schema.Struct({
8973 "allowed_passthrough_parameters": Schema.Array(Schema.String).annotate({
8974 "description": "Provider-specific options accepted under provider.options[provider_slug]."
8975 }),
8976 "pricing": Schema.Array(ImagePricingEntry).annotate({ "description": "Billable pricing lines for this endpoint." }),
8977 "provider_name": Schema.String.annotate({ "description": "Provider display name" }),
8978 "provider_slug": Schema.String.annotate({ "description": "Provider slug" }),
8979 "provider_tag": Schema.Union([Schema.String, Schema.Null]).annotate({
8980 "description": "Provider tag for request-side selection"
8981 }),
8982 "supported_parameters": Schema.suspend((): Schema.Codec<SupportedParameters> => SupportedParameters).annotate({
8983 "description": "The definitive set of parameters this endpoint accepts for this model."
8984 }),
8985 "supports_streaming": Schema.Boolean.annotate({
8986 "description": "Whether this endpoint supports native SSE streaming (`stream: true` in the request)."
8987 })
8988}).annotate({ "description": "An endpoint that serves a given image model.", "identifier": "ImageEndpoint" })
8989export type TaskClassificationItem = {
8990 readonly "category_token_share": number
8991 readonly "category_usage_share": number
8992 readonly "display_name": string
8993 readonly "macro_category": string
8994 readonly "models": ReadonlyArray<TaskClassificationModel>
8995 readonly "tag": string
8996 readonly "token_share": number
8997 readonly "usage_share": number
8998}
8999export const TaskClassificationItem = Schema.Struct({
9000 "category_token_share": Schema.Number.annotate({
9001 "description":
9002 "Fraction of this classification's token volume within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`.",
9003 "format": "double"
9004 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
9005 "category_usage_share": Schema.Number.annotate({
9006 "description":
9007 "Fraction of this classification's usage within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`.",
9008 "format": "double"
9009 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
9010 "display_name": Schema.String.annotate({ "description": "Human-readable label for the classification." }),
9011 "macro_category": Schema.String.annotate({
9012 "description": "Coarse grouping derived from the tag prefix: `code`, `data`, `agent`, or `general`."
9013 }),
9014 "models": Schema.Array(TaskClassificationModel).annotate({
9015 "description":
9016 "Top models for this classification by request volume, sorted descending. Each entry reports the model's share of this classification's requests and tokens."
9017 }),
9018 "tag": Schema.String.annotate({
9019 "description": "Classification tag identifier (e.g. `code:general_impl`, `agent:web_search`)."
9020 }),
9021 "token_share": Schema.Number.annotate({
9022 "description":
9023 "Fraction of classified sampled token volume (prompt + completion) attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator.",
9024 "format": "double"
9025 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
9026 "usage_share": Schema.Number.annotate({
9027 "description":
9028 "Fraction of classified sampled requests attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator.",
9029 "format": "double"
9030 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
9031}).annotate({ "identifier": "TaskClassificationItem" })
9032export type CodeInterpreterCallItem = {
9033 readonly "code": string | null
9034 readonly "container_id": string
9035 readonly "id": string
9036 readonly "outputs":
9037 | ReadonlyArray<
9038 { readonly "type": "image"; readonly "url": string } | { readonly "logs": string; readonly "type": "logs" }
9039 >
9040 | null
9041 readonly "status": ToolCallStatus
9042 readonly "type": "code_interpreter_call"
9043}
9044export const CodeInterpreterCallItem = Schema.Struct({
9045 "code": Schema.Union([Schema.String, Schema.Null]),
9046 "container_id": Schema.String,
9047 "id": Schema.String,
9048 "outputs": Schema.Union([
9049 Schema.Array(
9050 Schema.Union([
9051 Schema.Struct({ "type": Schema.Literal("image"), "url": Schema.String }),
9052 Schema.Struct({ "logs": Schema.String, "type": Schema.Literal("logs") })
9053 ])
9054 ),
9055 Schema.Null
9056 ]),
9057 "status": ToolCallStatus,
9058 "type": Schema.Literal("code_interpreter_call")
9059}).annotate({
9060 "description": "A code interpreter execution call with outputs",
9061 "identifier": "CodeInterpreterCallItem"
9062})
9063export type FunctionCallItem = {
9064 readonly "arguments": string
9065 readonly "call_id": string
9066 readonly "id": string
9067 readonly "name": string
9068 readonly "namespace"?: string
9069 readonly "status"?: ToolCallStatus
9070 readonly "type": "function_call"
9071}
9072export const FunctionCallItem = Schema.Struct({
9073 "arguments": Schema.String,
9074 "call_id": Schema.String,
9075 "id": Schema.String,
9076 "name": Schema.String,
9077 "namespace": Schema.optionalKey(
9078 Schema.String.annotate({
9079 "description": "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
9080 })
9081 ),
9082 "status": Schema.optionalKey(ToolCallStatus),
9083 "type": Schema.Literal("function_call")
9084}).annotate({ "description": "A function call initiated by the model", "identifier": "FunctionCallItem" })
9085export type LocalShellCallItem = {
9086 readonly "action": {
9087 readonly "command": ReadonlyArray<string>
9088 readonly "env": {}
9089 readonly "timeout_ms"?: number | null
9090 readonly "type": "exec"
9091 readonly "user"?: string | null
9092 readonly "working_directory"?: string | null
9093 }
9094 readonly "call_id": string
9095 readonly "id": string
9096 readonly "status": ToolCallStatus
9097 readonly "type": "local_shell_call"
9098}
9099export const LocalShellCallItem = Schema.Struct({
9100 "action": Schema.Struct({
9101 "command": Schema.Array(Schema.String),
9102 "env": Schema.Struct({}),
9103 "timeout_ms": Schema.optionalKey(
9104 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
9105 ),
9106 "type": Schema.Literal("exec"),
9107 "user": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
9108 "working_directory": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
9109 }),
9110 "call_id": Schema.String,
9111 "id": Schema.String,
9112 "status": ToolCallStatus,
9113 "type": Schema.Literal("local_shell_call")
9114}).annotate({ "description": "A local shell command execution call", "identifier": "LocalShellCallItem" })
9115export type LocalShellCallOutputItem = {
9116 readonly "id": string
9117 readonly "output": string
9118 readonly "status"?: ToolCallStatus | null
9119 readonly "type": "local_shell_call_output"
9120}
9121export const LocalShellCallOutputItem = Schema.Struct({
9122 "id": Schema.String,
9123 "output": Schema.String,
9124 "status": Schema.optionalKey(Schema.Union([ToolCallStatus, Schema.Null])),
9125 "type": Schema.Literal("local_shell_call_output")
9126}).annotate({ "description": "Output from a local shell command execution", "identifier": "LocalShellCallOutputItem" })
9127export type OpenAIResponseFunctionToolCall = {
9128 readonly "arguments": string
9129 readonly "call_id": string
9130 readonly "id"?: string
9131 readonly "name": string
9132 readonly "namespace"?: string
9133 readonly "status"?: ToolCallStatus
9134 readonly "type": "function_call"
9135}
9136export const OpenAIResponseFunctionToolCall = Schema.Struct({
9137 "arguments": Schema.String,
9138 "call_id": Schema.String,
9139 "id": Schema.optionalKey(Schema.String),
9140 "name": Schema.String,
9141 "namespace": Schema.optionalKey(
9142 Schema.String.annotate({
9143 "description": "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
9144 })
9145 ),
9146 "status": Schema.optionalKey(ToolCallStatus),
9147 "type": Schema.Literal("function_call")
9148}).annotate({ "identifier": "OpenAIResponseFunctionToolCall" })
9149export type OutputAdvisorServerToolItem = {
9150 readonly "advice"?: string
9151 readonly "error"?: string
9152 readonly "id"?: string
9153 readonly "instance_name"?: string
9154 readonly "model"?: string
9155 readonly "prompt"?: string
9156 readonly "status": ToolCallStatus
9157 readonly "type": "openrouter:advisor"
9158}
9159export const OutputAdvisorServerToolItem = Schema.Struct({
9160 "advice": Schema.optionalKey(
9161 Schema.String.annotate({
9162 "description": "The advisor model's response (the advice text returned to the executor)."
9163 })
9164 ),
9165 "error": Schema.optionalKey(
9166 Schema.String.annotate({ "description": "Error message when the advisor call did not produce advice." })
9167 ),
9168 "id": Schema.optionalKey(Schema.String),
9169 "instance_name": Schema.optionalKey(Schema.String.annotate({
9170 "description":
9171 "Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance."
9172 })),
9173 "model": Schema.optionalKey(
9174 Schema.String.annotate({ "description": "Slug of the advisor model that was consulted." })
9175 ),
9176 "prompt": Schema.optionalKey(
9177 Schema.String.annotate({ "description": "The prompt the executor sent to the advisor." })
9178 ),
9179 "status": ToolCallStatus,
9180 "type": Schema.Literal("openrouter:advisor")
9181}).annotate({
9182 "description": "An openrouter:advisor server tool output item",
9183 "identifier": "OutputAdvisorServerToolItem"
9184})
9185export type OutputBashServerToolItem = {
9186 readonly "arguments"?: string
9187 readonly "call_id"?: string
9188 readonly "command"?: string
9189 readonly "exitCode"?: number
9190 readonly "id"?: string
9191 readonly "status": ToolCallStatus
9192 readonly "stderr"?: string
9193 readonly "stdout"?: string
9194 readonly "type": "openrouter:bash"
9195}
9196export const OutputBashServerToolItem = Schema.Struct({
9197 "arguments": Schema.optionalKey(
9198 Schema.String.annotate({ "description": "The raw tool-call arguments string as emitted by the model." })
9199 ),
9200 "call_id": Schema.optionalKey(
9201 Schema.String.annotate({ "description": "The model-generated tool call id from the originating turn." })
9202 ),
9203 "command": Schema.optionalKey(Schema.String),
9204 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
9205 "id": Schema.optionalKey(Schema.String),
9206 "status": ToolCallStatus,
9207 "stderr": Schema.optionalKey(Schema.String),
9208 "stdout": Schema.optionalKey(Schema.String),
9209 "type": Schema.Literal("openrouter:bash")
9210}).annotate({ "description": "An openrouter:bash server tool output item", "identifier": "OutputBashServerToolItem" })
9211export type OutputBrowserUseServerToolItem = {
9212 readonly "action"?: string
9213 readonly "id"?: string
9214 readonly "screenshotB64"?: string
9215 readonly "status": ToolCallStatus
9216 readonly "type": "openrouter:browser_use"
9217}
9218export const OutputBrowserUseServerToolItem = Schema.Struct({
9219 "action": Schema.optionalKey(Schema.String),
9220 "id": Schema.optionalKey(Schema.String),
9221 "screenshotB64": Schema.optionalKey(Schema.String),
9222 "status": ToolCallStatus,
9223 "type": Schema.Literal("openrouter:browser_use")
9224}).annotate({
9225 "description": "An openrouter:browser_use server tool output item",
9226 "identifier": "OutputBrowserUseServerToolItem"
9227})
9228export type OutputCodeInterpreterCallItem = {
9229 readonly "code": string | null
9230 readonly "container_id": string
9231 readonly "id": string
9232 readonly "outputs":
9233 | ReadonlyArray<
9234 { readonly "type": "image"; readonly "url": string } | { readonly "logs": string; readonly "type": "logs" }
9235 >
9236 | null
9237 readonly "status": ToolCallStatus
9238 readonly "type": "code_interpreter_call"
9239}
9240export const OutputCodeInterpreterCallItem = Schema.Struct({
9241 "code": Schema.Union([Schema.String, Schema.Null]),
9242 "container_id": Schema.String,
9243 "id": Schema.String,
9244 "outputs": Schema.Union([
9245 Schema.Array(
9246 Schema.Union([
9247 Schema.Struct({ "type": Schema.Literal("image"), "url": Schema.String }),
9248 Schema.Struct({ "logs": Schema.String, "type": Schema.Literal("logs") })
9249 ])
9250 ),
9251 Schema.Null
9252 ]),
9253 "status": ToolCallStatus,
9254 "type": Schema.Literal("code_interpreter_call")
9255}).annotate({
9256 "description": "A code interpreter execution call with outputs",
9257 "identifier": "OutputCodeInterpreterCallItem"
9258})
9259export type OutputCodeInterpreterServerToolItem = {
9260 readonly "code"?: string
9261 readonly "exitCode"?: number
9262 readonly "id"?: string
9263 readonly "language"?: string
9264 readonly "status": ToolCallStatus
9265 readonly "stderr"?: string
9266 readonly "stdout"?: string
9267 readonly "type": "openrouter:code_interpreter"
9268}
9269export const OutputCodeInterpreterServerToolItem = Schema.Struct({
9270 "code": Schema.optionalKey(Schema.String),
9271 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
9272 "id": Schema.optionalKey(Schema.String),
9273 "language": Schema.optionalKey(Schema.String),
9274 "status": ToolCallStatus,
9275 "stderr": Schema.optionalKey(Schema.String),
9276 "stdout": Schema.optionalKey(Schema.String),
9277 "type": Schema.Literal("openrouter:code_interpreter")
9278}).annotate({
9279 "description": "An openrouter:code_interpreter server tool output item",
9280 "identifier": "OutputCodeInterpreterServerToolItem"
9281})
9282export type OutputDatetimeItem = {
9283 readonly "datetime": string
9284 readonly "id"?: string
9285 readonly "status": ToolCallStatus
9286 readonly "timezone": string
9287 readonly "type": "openrouter:datetime"
9288}
9289export const OutputDatetimeItem = Schema.Struct({
9290 "datetime": Schema.String.annotate({ "description": "ISO 8601 datetime string" }),
9291 "id": Schema.optionalKey(Schema.String),
9292 "status": ToolCallStatus,
9293 "timezone": Schema.String.annotate({ "description": "IANA timezone name" }),
9294 "type": Schema.Literal("openrouter:datetime")
9295}).annotate({ "description": "An openrouter:datetime server tool output item", "identifier": "OutputDatetimeItem" })
9296export type OutputFileSearchServerToolItem = {
9297 readonly "id"?: string
9298 readonly "queries"?: ReadonlyArray<string>
9299 readonly "status": ToolCallStatus
9300 readonly "type": "openrouter:file_search"
9301}
9302export const OutputFileSearchServerToolItem = Schema.Struct({
9303 "id": Schema.optionalKey(Schema.String),
9304 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
9305 "status": ToolCallStatus,
9306 "type": Schema.Literal("openrouter:file_search")
9307}).annotate({
9308 "description": "An openrouter:file_search server tool output item",
9309 "identifier": "OutputFileSearchServerToolItem"
9310})
9311export type OutputFilesServerToolItem = {
9312 readonly "error"?: string
9313 readonly "file_id"?: string
9314 readonly "filename"?: string
9315 readonly "id"?: string
9316 readonly "operation"?: string
9317 readonly "result"?: string
9318 readonly "status": ToolCallStatus
9319 readonly "type": "openrouter:files"
9320}
9321export const OutputFilesServerToolItem = Schema.Struct({
9322 "error": Schema.optionalKey(
9323 Schema.String.annotate({ "description": "Error message when the file operation failed." })
9324 ),
9325 "file_id": Schema.optionalKey(
9326 Schema.String.annotate({ "description": "The target file id supplied in the tool-call arguments." })
9327 ),
9328 "filename": Schema.optionalKey(
9329 Schema.String.annotate({ "description": "The target filename supplied in the tool-call arguments." })
9330 ),
9331 "id": Schema.optionalKey(Schema.String),
9332 "operation": Schema.optionalKey(
9333 Schema.String.annotate({ "description": "The file operation performed (list, read, write, or edit)." })
9334 ),
9335 "result": Schema.optionalKey(
9336 Schema.String.annotate({ "description": "JSON-serialized result of the file operation." })
9337 ),
9338 "status": ToolCallStatus,
9339 "type": Schema.Literal("openrouter:files")
9340}).annotate({ "description": "An openrouter:files server tool output item", "identifier": "OutputFilesServerToolItem" })
9341export type OutputImageGenerationServerToolItem = {
9342 readonly "id"?: string
9343 readonly "imageB64"?: string
9344 readonly "imageUrl"?: string
9345 readonly "prompt"?: string
9346 readonly "result"?: string | null
9347 readonly "revisedPrompt"?: string
9348 readonly "status": ToolCallStatus
9349 readonly "type": "openrouter:image_generation"
9350}
9351export const OutputImageGenerationServerToolItem = Schema.Struct({
9352 "id": Schema.optionalKey(Schema.String),
9353 "imageB64": Schema.optionalKey(Schema.String),
9354 "imageUrl": Schema.optionalKey(Schema.String),
9355 "prompt": Schema.optionalKey(
9356 Schema.String.annotate({ "description": "The prompt (possibly rewritten) that the image was generated from." })
9357 ),
9358 "result": Schema.optionalKey(
9359 Schema.Union([Schema.String, Schema.Null]).annotate({
9360 "description":
9361 "The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format"
9362 })
9363 ),
9364 "revisedPrompt": Schema.optionalKey(Schema.String),
9365 "status": ToolCallStatus,
9366 "type": Schema.Literal("openrouter:image_generation")
9367}).annotate({
9368 "description": "An openrouter:image_generation server tool output item",
9369 "identifier": "OutputImageGenerationServerToolItem"
9370})
9371export type OutputMcpServerToolItem = {
9372 readonly "id"?: string
9373 readonly "serverLabel"?: string
9374 readonly "status": ToolCallStatus
9375 readonly "toolName"?: string
9376 readonly "type": "openrouter:mcp"
9377}
9378export const OutputMcpServerToolItem = Schema.Struct({
9379 "id": Schema.optionalKey(Schema.String),
9380 "serverLabel": Schema.optionalKey(Schema.String),
9381 "status": ToolCallStatus,
9382 "toolName": Schema.optionalKey(Schema.String),
9383 "type": Schema.Literal("openrouter:mcp")
9384}).annotate({ "description": "An openrouter:mcp server tool output item", "identifier": "OutputMcpServerToolItem" })
9385export type OutputMemoryServerToolItem = {
9386 readonly "action"?: "read" | "write" | "delete"
9387 readonly "id"?: string
9388 readonly "key"?: string
9389 readonly "status": ToolCallStatus
9390 readonly "type": "openrouter:memory"
9391 readonly "value"?: Schema.Json
9392}
9393export const OutputMemoryServerToolItem = Schema.Struct({
9394 "action": Schema.optionalKey(Schema.Literals(["read", "write", "delete"])),
9395 "id": Schema.optionalKey(Schema.String),
9396 "key": Schema.optionalKey(Schema.String),
9397 "status": ToolCallStatus,
9398 "type": Schema.Literal("openrouter:memory"),
9399 "value": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" }))
9400}).annotate({
9401 "description": "An openrouter:memory server tool output item",
9402 "identifier": "OutputMemoryServerToolItem"
9403})
9404export type OutputSearchModelsServerToolItem = {
9405 readonly "arguments"?: string
9406 readonly "id"?: string
9407 readonly "query"?: string
9408 readonly "status": ToolCallStatus
9409 readonly "type": "openrouter:experimental__search_models"
9410}
9411export const OutputSearchModelsServerToolItem = Schema.Struct({
9412 "arguments": Schema.optionalKey(
9413 Schema.String.annotate({
9414 "description": "The JSON arguments submitted to the search tool (e.g. {\"query\":\"Claude\"})"
9415 })
9416 ),
9417 "id": Schema.optionalKey(Schema.String),
9418 "query": Schema.optionalKey(Schema.String),
9419 "status": ToolCallStatus,
9420 "type": Schema.Literal("openrouter:experimental__search_models")
9421}).annotate({
9422 "description": "An openrouter:experimental__search_models server tool output item",
9423 "identifier": "OutputSearchModelsServerToolItem"
9424})
9425export type OutputSubagentServerToolItem = {
9426 readonly "error"?: string
9427 readonly "id"?: string
9428 readonly "instance_name"?: string
9429 readonly "model"?: string
9430 readonly "name"?: string
9431 readonly "outcome"?: string
9432 readonly "status": ToolCallStatus
9433 readonly "task_description"?: string
9434 readonly "task_name"?: string
9435 readonly "type": "openrouter:subagent"
9436}
9437export const OutputSubagentServerToolItem = Schema.Struct({
9438 "error": Schema.optionalKey(
9439 Schema.String.annotate({ "description": "Error message when the subagent task did not produce an outcome." })
9440 ),
9441 "id": Schema.optionalKey(Schema.String),
9442 "instance_name": Schema.optionalKey(Schema.String.annotate({
9443 "description":
9444 "Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation."
9445 })),
9446 "model": Schema.optionalKey(
9447 Schema.String.annotate({ "description": "Slug of the worker model that executed the task." })
9448 ),
9449 "name": Schema.optionalKey(
9450 Schema.String.annotate({
9451 "description":
9452 "Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent."
9453 })
9454 ),
9455 "outcome": Schema.optionalKey(
9456 Schema.String.annotate({
9457 "description": "The worker model's result (the outcome text returned to the delegating model)."
9458 })
9459 ),
9460 "status": ToolCallStatus,
9461 "task_description": Schema.optionalKey(
9462 Schema.String.annotate({ "description": "The task description the delegating model sent to the worker." })
9463 ),
9464 "task_name": Schema.optionalKey(
9465 Schema.String.annotate({ "description": "The short task identifier the delegating model supplied." })
9466 ),
9467 "type": Schema.Literal("openrouter:subagent")
9468}).annotate({
9469 "description": "An openrouter:subagent server tool output item",
9470 "identifier": "OutputSubagentServerToolItem"
9471})
9472export type OutputTextEditorServerToolItem = {
9473 readonly "command"?: "view" | "create" | "str_replace" | "insert"
9474 readonly "filePath"?: string
9475 readonly "id"?: string
9476 readonly "status": ToolCallStatus
9477 readonly "type": "openrouter:text_editor"
9478}
9479export const OutputTextEditorServerToolItem = Schema.Struct({
9480 "command": Schema.optionalKey(Schema.Literals(["view", "create", "str_replace", "insert"])),
9481 "filePath": Schema.optionalKey(Schema.String),
9482 "id": Schema.optionalKey(Schema.String),
9483 "status": ToolCallStatus,
9484 "type": Schema.Literal("openrouter:text_editor")
9485}).annotate({
9486 "description": "An openrouter:text_editor server tool output item",
9487 "identifier": "OutputTextEditorServerToolItem"
9488})
9489export type OutputToolSearchServerToolItem = {
9490 readonly "id"?: string
9491 readonly "query"?: string
9492 readonly "status": ToolCallStatus
9493 readonly "type": "openrouter:tool_search"
9494}
9495export const OutputToolSearchServerToolItem = Schema.Struct({
9496 "id": Schema.optionalKey(Schema.String),
9497 "query": Schema.optionalKey(Schema.String),
9498 "status": ToolCallStatus,
9499 "type": Schema.Literal("openrouter:tool_search")
9500}).annotate({
9501 "description": "An openrouter:tool_search server tool output item",
9502 "identifier": "OutputToolSearchServerToolItem"
9503})
9504export type OutputWebFetchServerToolItem = {
9505 readonly "content"?: string
9506 readonly "error"?: string
9507 readonly "httpStatus"?: number
9508 readonly "id"?: string
9509 readonly "status": ToolCallStatus
9510 readonly "title"?: string
9511 readonly "type": "openrouter:web_fetch"
9512 readonly "url"?: string
9513}
9514export const OutputWebFetchServerToolItem = Schema.Struct({
9515 "content": Schema.optionalKey(Schema.String),
9516 "error": Schema.optionalKey(Schema.String.annotate({ "description": "The error message if the fetch failed." })),
9517 "httpStatus": Schema.optionalKey(
9518 Schema.Number.annotate({ "description": "The HTTP status code returned by the upstream URL fetch." }).check(
9519 Schema.isInt().annotate({ "expected": "an integer" })
9520 )
9521 ),
9522 "id": Schema.optionalKey(Schema.String),
9523 "status": ToolCallStatus,
9524 "title": Schema.optionalKey(Schema.String),
9525 "type": Schema.Literal("openrouter:web_fetch"),
9526 "url": Schema.optionalKey(Schema.String)
9527}).annotate({
9528 "description": "An openrouter:web_fetch server tool output item",
9529 "identifier": "OutputWebFetchServerToolItem"
9530})
9531export type OutputWebSearchServerToolItem = {
9532 readonly "action"?: {
9533 readonly "query": string
9534 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
9535 readonly "type": "search"
9536 }
9537 readonly "id"?: string
9538 readonly "status": ToolCallStatus
9539 readonly "type": "openrouter:web_search"
9540}
9541export const OutputWebSearchServerToolItem = Schema.Struct({
9542 "action": Schema.optionalKey(
9543 Schema.Struct({
9544 "query": Schema.String,
9545 "sources": Schema.optionalKey(
9546 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
9547 ),
9548 "type": Schema.Literal("search")
9549 }).annotate({
9550 "description":
9551 "The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider."
9552 })
9553 ),
9554 "id": Schema.optionalKey(Schema.String),
9555 "status": ToolCallStatus,
9556 "type": Schema.Literal("openrouter:web_search")
9557}).annotate({
9558 "description": "An openrouter:web_search server tool output item",
9559 "identifier": "OutputWebSearchServerToolItem"
9560})
9561export type ShellCallItem = {
9562 readonly "action": {
9563 readonly "commands": ReadonlyArray<string>
9564 readonly "max_output_length"?: number | null
9565 readonly "timeout_ms"?: number | null
9566 }
9567 readonly "call_id": string
9568 readonly "environment"?: Schema.Json
9569 readonly "id"?: string | null
9570 readonly "status"?: ToolCallStatus | null
9571 readonly "type": "shell_call"
9572}
9573export const ShellCallItem = Schema.Struct({
9574 "action": Schema.Struct({
9575 "commands": Schema.Array(Schema.String),
9576 "max_output_length": Schema.optionalKey(
9577 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
9578 ),
9579 "timeout_ms": Schema.optionalKey(
9580 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
9581 )
9582 }),
9583 "call_id": Schema.String,
9584 "environment": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
9585 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
9586 "status": Schema.optionalKey(Schema.Union([ToolCallStatus, Schema.Null])),
9587 "type": Schema.Literal("shell_call")
9588}).annotate({ "description": "A shell command execution call (newer variant)", "identifier": "ShellCallItem" })
9589export type ShellCallOutputItem = {
9590 readonly "call_id": string
9591 readonly "id"?: string | null
9592 readonly "max_output_length"?: number | null
9593 readonly "output": ReadonlyArray<
9594 { readonly "content"?: string | null; readonly "exit_code"?: number | null; readonly "type": string }
9595 >
9596 readonly "status"?: ToolCallStatus | null
9597 readonly "type": "shell_call_output"
9598}
9599export const ShellCallOutputItem = Schema.Struct({
9600 "call_id": Schema.String,
9601 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
9602 "max_output_length": Schema.optionalKey(
9603 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
9604 ),
9605 "output": Schema.Array(
9606 Schema.Struct({
9607 "content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
9608 "exit_code": Schema.optionalKey(
9609 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
9610 ),
9611 "type": Schema.String
9612 })
9613 ),
9614 "status": Schema.optionalKey(Schema.Union([ToolCallStatus, Schema.Null])),
9615 "type": Schema.Literal("shell_call_output")
9616}).annotate({
9617 "description": "Output from a shell command execution (newer variant)",
9618 "identifier": "ShellCallOutputItem"
9619})
9620export type OpenAIResponsesToolChoice =
9621 | "auto"
9622 | "none"
9623 | "required"
9624 | Objects_11
9625 | Objects_12
9626 | ToolChoiceAllowed
9627 | Objects_13
9628 | Objects_14
9629export const OpenAIResponsesToolChoice = Schema.Union([
9630 Schema.Literal("auto"),
9631 Schema.Literal("none"),
9632 Schema.Literal("required"),
9633 Objects_11,
9634 Objects_12,
9635 ToolChoiceAllowed,
9636 Objects_13,
9637 Objects_14
9638]).annotate({ "identifier": "OpenAIResponsesToolChoice" })
9639export type TooManyRequestsResponse = {
9640 readonly "error": TooManyRequestsResponseErrorData
9641 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
9642 readonly "user_id"?: string | null
9643}
9644export const TooManyRequestsResponse = Schema.Struct({
9645 "error": TooManyRequestsResponseErrorData,
9646 "openrouter_metadata": Schema.optionalKey(
9647 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
9648 ),
9649 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
9650}).annotate({ "description": "Too Many Requests - Rate limit exceeded", "identifier": "TooManyRequestsResponse" })
9651export type UnauthorizedResponse = {
9652 readonly "error": UnauthorizedResponseErrorData
9653 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
9654 readonly "user_id"?: string | null
9655}
9656export const UnauthorizedResponse = Schema.Struct({
9657 "error": UnauthorizedResponseErrorData,
9658 "openrouter_metadata": Schema.optionalKey(
9659 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
9660 ),
9661 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
9662}).annotate({
9663 "description": "Unauthorized - Authentication required or invalid credentials",
9664 "identifier": "UnauthorizedResponse"
9665})
9666export type UnifiedBenchmarksAAItem = {
9667 readonly "agentic_index": number | null
9668 readonly "coding_index": number | null
9669 readonly "display_name": string
9670 readonly "intelligence_index": number | null
9671 readonly "model_permaslug": string
9672 readonly "pricing": UnifiedBenchmarkPricing
9673 readonly "source": "artificial-analysis"
9674}
9675export const UnifiedBenchmarksAAItem = Schema.Struct({
9676 "agentic_index": Schema.Union([
9677 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
9678 Schema.Null
9679 ]).annotate({
9680 "description": "Artificial Analysis Agentic Index composite score. Higher is better.",
9681 "format": "double"
9682 }),
9683 "coding_index": Schema.Union([
9684 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
9685 Schema.Null
9686 ]).annotate({
9687 "description": "Artificial Analysis Coding Index composite score. Higher is better.",
9688 "format": "double"
9689 }),
9690 "display_name": Schema.String.annotate({ "description": "Model name as listed on Artificial Analysis." }),
9691 "intelligence_index": Schema.Union([
9692 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
9693 Schema.Null
9694 ]).annotate({
9695 "description": "Artificial Analysis Intelligence Index composite score. Higher is better.",
9696 "format": "double"
9697 }),
9698 "model_permaslug": Schema.String.annotate({ "description": "Stable OpenRouter model identifier." }),
9699 "pricing": UnifiedBenchmarkPricing,
9700 "source": Schema.Literal("artificial-analysis").annotate({ "description": "Benchmark source discriminator." })
9701}).annotate({ "identifier": "UnifiedBenchmarksAAItem" })
9702export type UnifiedBenchmarksDAItem = {
9703 readonly "arena": string
9704 readonly "avg_generation_time_ms": number | null
9705 readonly "category": string
9706 readonly "display_name": string
9707 readonly "elo": number
9708 readonly "model_permaslug": string
9709 readonly "pricing": UnifiedBenchmarkPricing
9710 readonly "source": "design-arena"
9711 readonly "tournament_stats": {
9712 readonly "first_place": number | null
9713 readonly "fourth_place": number | null
9714 readonly "second_place": number | null
9715 readonly "third_place": number | null
9716 readonly "total": number | null
9717 }
9718 readonly "win_rate": number
9719}
9720export const UnifiedBenchmarksDAItem = Schema.Struct({
9721 "arena": Schema.String.annotate({ "description": "Arena this ranking belongs to." }),
9722 "avg_generation_time_ms": Schema.Union([
9723 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
9724 Schema.Null
9725 ]).annotate({ "description": "Average generation time in milliseconds.", "format": "double" }),
9726 "category": Schema.String.annotate({ "description": "Category within the arena." }),
9727 "display_name": Schema.String.annotate({ "description": "Human-readable model name from Design Arena." }),
9728 "elo": Schema.Number.annotate({ "description": "ELO rating from head-to-head arena battles.", "format": "double" })
9729 .check(Schema.isFinite().annotate({ "expected": "a finite number" })),
9730 "model_permaslug": Schema.String.annotate({
9731 "description": "Stable OpenRouter model identifier when mapped; otherwise the upstream Design Arena model id."
9732 }),
9733 "pricing": UnifiedBenchmarkPricing,
9734 "source": Schema.Literal("design-arena").annotate({ "description": "Benchmark source discriminator." }),
9735 "tournament_stats": Schema.Struct({
9736 "first_place": Schema.Union([
9737 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
9738 Schema.Null
9739 ]),
9740 "fourth_place": Schema.Union([
9741 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
9742 Schema.Null
9743 ]),
9744 "second_place": Schema.Union([
9745 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
9746 Schema.Null
9747 ]),
9748 "third_place": Schema.Union([
9749 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
9750 Schema.Null
9751 ]),
9752 "total": Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
9753 }).annotate({ "description": "Placement distribution from tournament matches." }),
9754 "win_rate": Schema.Number.annotate({ "description": "Win rate as a percentage (0–100).", "format": "double" }).check(
9755 Schema.isFinite().annotate({ "expected": "a finite number" })
9756 )
9757}).annotate({ "identifier": "UnifiedBenchmarksDAItem" })
9758export type UnprocessableEntityResponse = {
9759 readonly "error": UnprocessableEntityResponseErrorData
9760 readonly "openrouter_metadata"?: { readonly [x: string]: Schema.Json } | null
9761 readonly "user_id"?: string | null
9762}
9763export const UnprocessableEntityResponse = Schema.Struct({
9764 "error": UnprocessableEntityResponseErrorData,
9765 "openrouter_metadata": Schema.optionalKey(
9766 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
9767 ),
9768 "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
9769}).annotate({
9770 "description": "Unprocessable Entity - Semantic validation failure",
9771 "identifier": "UnprocessableEntityResponse"
9772})
9773export type OpenAIResponsesAnnotation = FileCitation | URLCitation | FilePath
9774export const OpenAIResponsesAnnotation = Schema.Union([FileCitation, URLCitation, FilePath]).annotate({
9775 "identifier": "OpenAIResponsesAnnotation"
9776})
9777export type VideoGenerationResponse = {
9778 readonly "error"?: string
9779 readonly "generation_id"?: string
9780 readonly "id": string
9781 readonly "polling_url": string
9782 readonly "status": "pending" | "in_progress" | "completed" | "failed" | "cancelled" | "expired"
9783 readonly "unsigned_urls"?: ReadonlyArray<string>
9784 readonly "usage"?: VideoGenerationUsage
9785}
9786export const VideoGenerationResponse = Schema.Struct({
9787 "error": Schema.optionalKey(Schema.String),
9788 "generation_id": Schema.optionalKey(
9789 Schema.String.annotate({
9790 "description":
9791 "The generation ID associated with this video generation job. Available once the job has been processed."
9792 })
9793 ),
9794 "id": Schema.String,
9795 "polling_url": Schema.String,
9796 "status": Schema.Literals(["pending", "in_progress", "completed", "failed", "cancelled", "expired"]),
9797 "unsigned_urls": Schema.optionalKey(Schema.Array(Schema.String)),
9798 "usage": Schema.optionalKey(VideoGenerationUsage)
9799}).annotate({ "identifier": "VideoGenerationResponse" })
9800export type VideoModelsListResponse = { readonly "data": ReadonlyArray<VideoModel> }
9801export const VideoModelsListResponse = Schema.Struct({ "data": Schema.Array(VideoModel) }).annotate({
9802 "identifier": "VideoModelsListResponse"
9803})
9804export type WebFetchServerToolConfig = {
9805 readonly "allowed_domains"?: Arrays_13
9806 readonly "blocked_domains"?: Arrays_14
9807 readonly "engine"?: WebFetchEngineEnum
9808 readonly "max_content_tokens"?: number
9809 readonly "max_uses"?: number
9810}
9811export const WebFetchServerToolConfig = Schema.Struct({
9812 "allowed_domains": Schema.optionalKey(Arrays_13),
9813 "blocked_domains": Schema.optionalKey(Arrays_14),
9814 "engine": Schema.optionalKey(WebFetchEngineEnum),
9815 "max_content_tokens": Schema.optionalKey(
9816 Schema.Number.annotate({
9817 "description": "Maximum content length in approximate tokens. Content exceeding this limit is truncated."
9818 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
9819 ),
9820 "max_uses": Schema.optionalKey(
9821 Schema.Number.annotate({
9822 "description": "Maximum number of web fetches per request. Once exceeded, the tool returns an error."
9823 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
9824 )
9825}).annotate({
9826 "description": "Configuration for the openrouter:web_fetch server tool",
9827 "identifier": "WebFetchServerToolConfig"
9828})
9829export type WebSearchDomainFilter = Objects_152 | null
9830export const WebSearchDomainFilter = Schema.Union([Objects_152, Schema.Null]).annotate({
9831 "identifier": "WebSearchDomainFilter"
9832})
9833export type WebSearchPlugin = {
9834 readonly "enabled"?: boolean
9835 readonly "engine"?: WebSearchEngine
9836 readonly "exclude_domains"?: ReadonlyArray<string>
9837 readonly "id": "web"
9838 readonly "include_domains"?: ReadonlyArray<string>
9839 readonly "max_results"?: number
9840 readonly "max_uses"?: number
9841 readonly "search_prompt"?: string
9842 readonly "user_location"?: {
9843 readonly "city"?: string | null
9844 readonly "country"?: string | null
9845 readonly "region"?: string | null
9846 readonly "timezone"?: string | null
9847 readonly "type": "approximate"
9848 readonly [x: string]: Schema.Json
9849 }
9850}
9851export const WebSearchPlugin = Schema.Struct({
9852 "enabled": Schema.optionalKey(
9853 Schema.Boolean.annotate({
9854 "description": "Set to false to disable the web-search plugin for this request. Defaults to true."
9855 })
9856 ),
9857 "engine": Schema.optionalKey(WebSearchEngine),
9858 "exclude_domains": Schema.optionalKey(
9859 Schema.Array(Schema.String).annotate({
9860 "description":
9861 "A list of domains to exclude from web search results. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\")."
9862 })
9863 ),
9864 "id": Schema.Literal("web"),
9865 "include_domains": Schema.optionalKey(
9866 Schema.Array(Schema.String).annotate({
9867 "description":
9868 "A list of domains to restrict web search results to. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\")."
9869 })
9870 ),
9871 "max_results": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
9872 "max_uses": Schema.optionalKey(
9873 Schema.Number.annotate({
9874 "description":
9875 "Maximum number of times the model can invoke web search in a single turn. Passed through to native providers that support it (e.g. Anthropic)."
9876 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
9877 ),
9878 "search_prompt": Schema.optionalKey(Schema.String),
9879 "user_location": Schema.optionalKey(
9880 Schema.Union([
9881 Schema.StructWithRest(
9882 Schema.Struct({
9883 "city": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
9884 "country": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
9885 "region": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
9886 "timezone": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
9887 "type": Schema.Literal("approximate")
9888 }),
9889 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
9890 ).annotate({
9891 "description":
9892 "Approximate user location for location-biased search results. Passed through to native providers that support it (e.g. Anthropic)."
9893 })
9894 ]).annotate({ "description": "User location information for web search" })
9895 )
9896}).annotate({ "identifier": "WebSearchPlugin" })
9897export type OutputFileSearchCallItem = {
9898 readonly "id": string
9899 readonly "queries": ReadonlyArray<string>
9900 readonly "status": WebSearchStatus
9901 readonly "type": "file_search_call"
9902}
9903export const OutputFileSearchCallItem = Schema.Struct({
9904 "id": Schema.String,
9905 "queries": Schema.Array(Schema.String),
9906 "status": WebSearchStatus,
9907 "type": Schema.Literal("file_search_call")
9908}).annotate({ "identifier": "OutputFileSearchCallItem" })
9909export type OutputItemFileSearchCall = {
9910 readonly "id": string
9911 readonly "queries": ReadonlyArray<string>
9912 readonly "status": WebSearchStatus
9913 readonly "type": "file_search_call"
9914}
9915export const OutputItemFileSearchCall = Schema.Struct({
9916 "id": Schema.String,
9917 "queries": Schema.Array(Schema.String),
9918 "status": WebSearchStatus,
9919 "type": Schema.Literal("file_search_call")
9920}).annotate({ "identifier": "OutputItemFileSearchCall" })
9921export type OutputItemWebSearchCall = {
9922 readonly "action"?:
9923 | {
9924 readonly "queries"?: ReadonlyArray<string>
9925 readonly "query": string
9926 readonly "sources"?: ReadonlyArray<WebSearchSource>
9927 readonly "type": "search"
9928 }
9929 | { readonly "type": "open_page"; readonly "url"?: string | null }
9930 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
9931 readonly "id": string
9932 readonly "status": WebSearchStatus
9933 readonly "type": "web_search_call"
9934}
9935export const OutputItemWebSearchCall = Schema.Struct({
9936 "action": Schema.optionalKey(
9937 Schema.Union([
9938 Schema.Struct({
9939 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
9940 "query": Schema.String,
9941 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
9942 "type": Schema.Literal("search")
9943 }),
9944 Schema.Struct({
9945 "type": Schema.Literal("open_page"),
9946 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
9947 }),
9948 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
9949 ], { mode: "oneOf" })
9950 ),
9951 "id": Schema.String,
9952 "status": WebSearchStatus,
9953 "type": Schema.Literal("web_search_call")
9954}).annotate({ "identifier": "OutputItemWebSearchCall" })
9955export type OutputWebSearchCallItem = {
9956 readonly "action"?:
9957 | {
9958 readonly "queries"?: ReadonlyArray<string>
9959 readonly "query": string
9960 readonly "sources"?: ReadonlyArray<WebSearchSource>
9961 readonly "type": "search"
9962 }
9963 | { readonly "type": "open_page"; readonly "url"?: string | null }
9964 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
9965 readonly "id": string
9966 readonly "status": WebSearchStatus
9967 readonly "type": "web_search_call"
9968}
9969export const OutputWebSearchCallItem = Schema.Struct({
9970 "action": Schema.optionalKey(
9971 Schema.Union([
9972 Schema.Struct({
9973 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
9974 "query": Schema.String,
9975 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
9976 "type": Schema.Literal("search")
9977 }),
9978 Schema.Struct({
9979 "type": Schema.Literal("open_page"),
9980 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
9981 }),
9982 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
9983 ], { mode: "oneOf" })
9984 ),
9985 "id": Schema.String,
9986 "status": WebSearchStatus,
9987 "type": Schema.Literal("web_search_call")
9988}).annotate({ "identifier": "OutputWebSearchCallItem" })
9989export type WebSearchUserLocation = Objects_153 | null
9990export const WebSearchUserLocation = Schema.Union([Objects_153, Schema.Null]).annotate({
9991 "description": "User location information for web search",
9992 "identifier": "WebSearchUserLocation"
9993})
9994export type WebSearchConfig = {
9995 readonly "allowed_domains"?: Arrays_15
9996 readonly "engine"?: WebSearchEngineEnum
9997 readonly "excluded_domains"?: Arrays_16
9998 readonly "max_characters"?: number
9999 readonly "max_results"?: number
10000 readonly "max_total_results"?: number
10001 readonly "search_context_size"?: SearchQualityLevel
10002 readonly "user_location"?: WebSearchUserLocationServerTool
10003}
10004export const WebSearchConfig = Schema.Struct({
10005 "allowed_domains": Schema.optionalKey(Arrays_15),
10006 "engine": Schema.optionalKey(WebSearchEngineEnum),
10007 "excluded_domains": Schema.optionalKey(Arrays_16),
10008 "max_characters": Schema.optionalKey(
10009 Schema.Number.annotate({
10010 "description":
10011 "Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity)."
10012 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
10013 ),
10014 "max_results": Schema.optionalKey(
10015 Schema.Number.annotate({
10016 "description":
10017 "Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped."
10018 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
10019 ),
10020 "max_total_results": Schema.optionalKey(
10021 Schema.Number.annotate({
10022 "description":
10023 "Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified."
10024 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
10025 ),
10026 "search_context_size": Schema.optionalKey(SearchQualityLevel),
10027 "user_location": Schema.optionalKey(WebSearchUserLocationServerTool)
10028}).annotate({ "identifier": "WebSearchConfig" })
10029export type WebSearchServerToolConfig = {
10030 readonly "allowed_domains"?: Arrays_17
10031 readonly "engine"?: WebSearchEngineEnum
10032 readonly "excluded_domains"?: Arrays_18
10033 readonly "max_characters"?: number
10034 readonly "max_results"?: number
10035 readonly "max_total_results"?: number
10036 readonly "search_context_size"?: SearchQualityLevel
10037 readonly "user_location"?: WebSearchUserLocationServerTool
10038}
10039export const WebSearchServerToolConfig = Schema.Struct({
10040 "allowed_domains": Schema.optionalKey(Arrays_17),
10041 "engine": Schema.optionalKey(WebSearchEngineEnum),
10042 "excluded_domains": Schema.optionalKey(Arrays_18),
10043 "max_characters": Schema.optionalKey(
10044 Schema.Number.annotate({
10045 "description":
10046 "Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity)."
10047 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
10048 ),
10049 "max_results": Schema.optionalKey(
10050 Schema.Number.annotate({
10051 "description":
10052 "Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped."
10053 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
10054 ),
10055 "max_total_results": Schema.optionalKey(
10056 Schema.Number.annotate({
10057 "description":
10058 "Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified."
10059 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
10060 ),
10061 "search_context_size": Schema.optionalKey(SearchQualityLevel),
10062 "user_location": Schema.optionalKey(WebSearchUserLocationServerTool)
10063}).annotate({
10064 "description": "Configuration for the openrouter:web_search server tool",
10065 "identifier": "WebSearchServerToolConfig"
10066})
10067export type CreateWorkspaceResponse = { readonly "data": Workspace }
10068export const CreateWorkspaceResponse = Schema.Struct({
10069 "data": Schema.suspend((): Schema.Codec<Workspace> => Workspace).annotate({ "description": "The created workspace" })
10070}).annotate({ "identifier": "CreateWorkspaceResponse" })
10071export type GetWorkspaceResponse = { readonly "data": Workspace }
10072export const GetWorkspaceResponse = Schema.Struct({
10073 "data": Schema.suspend((): Schema.Codec<Workspace> => Workspace).annotate({ "description": "The workspace" })
10074}).annotate({ "identifier": "GetWorkspaceResponse" })
10075export type ListWorkspacesResponse = { readonly "data": ReadonlyArray<Workspace>; readonly "total_count": number }
10076export const ListWorkspacesResponse = Schema.Struct({
10077 "data": Schema.Array(Workspace).annotate({ "description": "List of workspaces" }),
10078 "total_count": Schema.Number.annotate({ "description": "Total number of workspaces" }).check(
10079 Schema.isInt().annotate({ "expected": "an integer" })
10080 )
10081}).annotate({ "identifier": "ListWorkspacesResponse" })
10082export type UpdateWorkspaceResponse = { readonly "data": Workspace }
10083export const UpdateWorkspaceResponse = Schema.Struct({
10084 "data": Schema.suspend((): Schema.Codec<Workspace> => Workspace).annotate({ "description": "The updated workspace" })
10085}).annotate({ "identifier": "UpdateWorkspaceResponse" })
10086export type ListWorkspaceBudgetsResponse = { readonly "data": ReadonlyArray<WorkspaceBudget> }
10087export const ListWorkspaceBudgetsResponse = Schema.Struct({
10088 "data": Schema.Array(WorkspaceBudget).annotate({ "description": "List of budgets configured for the workspace" })
10089}).annotate({ "identifier": "ListWorkspaceBudgetsResponse" })
10090export type UpsertWorkspaceBudgetResponse = { readonly "data": WorkspaceBudget }
10091export const UpsertWorkspaceBudgetResponse = Schema.Struct({
10092 "data": Schema.suspend((): Schema.Codec<WorkspaceBudget> => WorkspaceBudget).annotate({
10093 "description": "The created or updated budget"
10094 })
10095}).annotate({ "identifier": "UpsertWorkspaceBudgetResponse" })
10096export type BulkAddWorkspaceMembersResponse = {
10097 readonly "added_count": number
10098 readonly "data": ReadonlyArray<WorkspaceMember>
10099}
10100export const BulkAddWorkspaceMembersResponse = Schema.Struct({
10101 "added_count": Schema.Number.annotate({ "description": "Number of workspace memberships created or updated" }).check(
10102 Schema.isInt().annotate({ "expected": "an integer" })
10103 ),
10104 "data": Schema.Array(WorkspaceMember).annotate({ "description": "List of added workspace memberships" })
10105}).annotate({ "identifier": "BulkAddWorkspaceMembersResponse" })
10106export type ListWorkspaceMembersResponse = {
10107 readonly "data": ReadonlyArray<WorkspaceMember>
10108 readonly "total_count": number
10109}
10110export const ListWorkspaceMembersResponse = Schema.Struct({
10111 "data": Schema.Array(WorkspaceMember).annotate({ "description": "List of workspace members" }),
10112 "total_count": Schema.Number.annotate({ "description": "Total number of members in the workspace" }).check(
10113 Schema.isInt().annotate({ "expected": "an integer" })
10114 )
10115}).annotate({ "identifier": "ListWorkspaceMembersResponse" })
10116export type AdvisorServerToolConfig = {
10117 readonly "forward_transcript"?: boolean
10118 readonly "instructions"?: string
10119 readonly "max_completion_tokens"?: number
10120 readonly "max_tool_calls"?: number
10121 readonly "model"?: string
10122 readonly "name"?: string
10123 readonly "reasoning"?: AdvisorReasoning
10124 readonly "stream"?: boolean
10125 readonly "temperature"?: number
10126 readonly "tools"?: Arrays_
10127}
10128export const AdvisorServerToolConfig = Schema.Struct({
10129 "forward_transcript": Schema.optionalKey(Schema.Boolean.annotate({
10130 "description":
10131 "When true, the full parent conversation is forwarded to the advisor so it sees the same context the executor does (and the tool-call `prompt`, if given, is appended as a final user turn). When false or omitted, the advisor receives only the `prompt` the executor passes in the tool call."
10132 })),
10133 "instructions": Schema.optionalKey(
10134 Schema.String.annotate({
10135 "description":
10136 "System instructions for the advisor sub-agent. When omitted, the advisor responds with no system prompt of its own."
10137 })
10138 ),
10139 "max_completion_tokens": Schema.optionalKey(
10140 Schema.Number.annotate({
10141 "description":
10142 "Maximum number of output tokens (including reasoning) the advisor may produce. When omitted, the provider's default applies."
10143 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
10144 ),
10145 "max_tool_calls": Schema.optionalKey(
10146 Schema.Number.annotate({
10147 "description":
10148 "Maximum number of tool-calling steps the advisor sub-agent may take during its agentic loop. Capped at 25. Only relevant when the advisor is given tools."
10149 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
10150 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
10151 ).check(Schema.isLessThanOrEqualTo(25).annotate({ "expected": "a value less than or equal to 25" }))
10152 ),
10153 "model": Schema.optionalKey(
10154 Schema.String.annotate({
10155 "description":
10156 "Slug of the advisor model to consult (any OpenRouter model). When omitted, the executor can choose it via the tool call's `model` argument; if neither is set, the model from the outer API request is used. The advisor tool itself cannot be the advisor model."
10157 })
10158 ),
10159 "name": Schema.optionalKey(
10160 Schema.String.annotate({
10161 "description":
10162 "Optional name for this advisor. The model sees one tool per named advisor (and one default for an unnamed entry). Names must be unique across advisor entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars."
10163 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
10164 Schema.isMaxLength(64).annotate({ "expected": "a value with a length of at most 64" })
10165 ).check(
10166 Schema.isPattern(new RegExp("^[a-zA-Z0-9 _-]+$")).annotate({
10167 "expected": "a string matching the RegExp ^[a-zA-Z0-9 _-]+$"
10168 })
10169 )
10170 ),
10171 "reasoning": Schema.optionalKey(AdvisorReasoning),
10172 "stream": Schema.optionalKey(Schema.Boolean.annotate({
10173 "description":
10174 "When true, the advisor's advice streams incrementally as it is produced. In the Responses API this emits `response.output_text.delta` events targeting the advisor output item; the final `advice` field is still set on the completed item. Has no effect on the Chat Completions API (where the advice arrives only as the final tool result). When false or omitted, the advice arrives only as the final result."
10175 })),
10176 "temperature": Schema.optionalKey(
10177 Schema.Number.annotate({
10178 "description":
10179 "Sampling temperature forwarded to the advisor call. When omitted, the provider's default applies.",
10180 "format": "double"
10181 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
10182 ),
10183 "tools": Schema.optionalKey(Arrays_)
10184}).annotate({
10185 "description": "Configuration for one openrouter:advisor server tool entry.",
10186 "identifier": "AdvisorServerToolConfig"
10187})
10188export type AnthropicBashCodeExecutionContent =
10189 | AnthropicBashCodeExecutionToolResultError
10190 | AnthropicBashCodeExecutionResult
10191export const AnthropicBashCodeExecutionContent = Schema.Union([
10192 AnthropicBashCodeExecutionToolResultError,
10193 AnthropicBashCodeExecutionResult
10194], { mode: "oneOf" }).annotate({ "identifier": "AnthropicBashCodeExecutionContent" })
10195export type AnthropicTextBlockParam = {
10196 readonly "cache_control"?: AnthropicCacheControlDirective
10197 readonly "citations"?:
10198 | ReadonlyArray<
10199 | AnthropicCitationCharLocationParam
10200 | AnthropicCitationPageLocationParam
10201 | AnthropicCitationContentBlockLocationParam
10202 | AnthropicCitationWebSearchResultLocationParam
10203 | AnthropicCitationSearchResultLocationParam
10204 >
10205 | null
10206 readonly "text": string
10207 readonly "type": "text"
10208}
10209export const AnthropicTextBlockParam = Schema.Struct({
10210 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
10211 "citations": Schema.optionalKey(
10212 Schema.Union([
10213 Schema.Array(
10214 Schema.Union([
10215 AnthropicCitationCharLocationParam,
10216 AnthropicCitationPageLocationParam,
10217 AnthropicCitationContentBlockLocationParam,
10218 AnthropicCitationWebSearchResultLocationParam,
10219 AnthropicCitationSearchResultLocationParam
10220 ], { mode: "oneOf" })
10221 ),
10222 Schema.Null
10223 ])
10224 ),
10225 "text": Schema.String,
10226 "type": Schema.Literal("text")
10227}).annotate({ "identifier": "AnthropicTextBlockParam" })
10228export type AnthropicToolSearchToolBm25 = {
10229 readonly "allowed_callers"?: AnthropicAllowedCallers
10230 readonly "cache_control"?: AnthropicCacheControlDirective
10231 readonly "defer_loading"?: boolean
10232 readonly "name": "tool_search_tool_bm25"
10233 readonly "strict"?: boolean
10234 readonly "type": "tool_search_tool_bm25_20251119" | "tool_search_tool_bm25"
10235}
10236export const AnthropicToolSearchToolBm25 = Schema.Struct({
10237 "allowed_callers": Schema.optionalKey(AnthropicAllowedCallers),
10238 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
10239 "defer_loading": Schema.optionalKey(Schema.Boolean),
10240 "name": Schema.Literal("tool_search_tool_bm25"),
10241 "strict": Schema.optionalKey(Schema.Boolean),
10242 "type": Schema.Literals(["tool_search_tool_bm25_20251119", "tool_search_tool_bm25"])
10243}).annotate({ "identifier": "AnthropicToolSearchToolBm25" })
10244export type AnthropicToolSearchToolRegex = {
10245 readonly "allowed_callers"?: AnthropicAllowedCallers
10246 readonly "cache_control"?: AnthropicCacheControlDirective
10247 readonly "defer_loading"?: boolean
10248 readonly "name": "tool_search_tool_regex"
10249 readonly "strict"?: boolean
10250 readonly "type": "tool_search_tool_regex_20251119" | "tool_search_tool_regex"
10251}
10252export const AnthropicToolSearchToolRegex = Schema.Struct({
10253 "allowed_callers": Schema.optionalKey(AnthropicAllowedCallers),
10254 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
10255 "defer_loading": Schema.optionalKey(Schema.Boolean),
10256 "name": Schema.Literal("tool_search_tool_regex"),
10257 "strict": Schema.optionalKey(Schema.Boolean),
10258 "type": Schema.Literals(["tool_search_tool_regex_20251119", "tool_search_tool_regex"])
10259}).annotate({ "identifier": "AnthropicToolSearchToolRegex" })
10260export type FusionServerToolConfig = {
10261 readonly "analysis_models"?: Arrays_6
10262 readonly "cache_control"?: AnthropicCacheControlDirective
10263 readonly "max_completion_tokens"?: number
10264 readonly "max_tool_calls"?: number
10265 readonly "model"?: string
10266 readonly "reasoning"?: Objects_9
10267 readonly "temperature"?: number
10268 readonly "tools"?: Arrays_7
10269}
10270export const FusionServerToolConfig = Schema.Struct({
10271 "analysis_models": Schema.optionalKey(Arrays_6),
10272 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
10273 "max_completion_tokens": Schema.optionalKey(
10274 Schema.Number.annotate({
10275 "description":
10276 "Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, panelists default to 32000 and the judge to 20000."
10277 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
10278 ),
10279 "max_tool_calls": Schema.optionalKey(
10280 Schema.Number.annotate({
10281 "description":
10282 "Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16."
10283 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
10284 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
10285 ).check(Schema.isLessThanOrEqualTo(16).annotate({ "expected": "a value less than or equal to 16" }))
10286 ),
10287 "model": Schema.optionalKey(
10288 Schema.String.annotate({
10289 "description":
10290 "Slug of the judge model that produces the structured analysis JSON. Defaults to the model used in the outer API request."
10291 })
10292 ),
10293 "reasoning": Schema.optionalKey(Objects_9),
10294 "temperature": Schema.optionalKey(
10295 Schema.Number.annotate({
10296 "description":
10297 "Temperature forwarded to panelist inner calls. The judge always runs at temperature 0 regardless of this value. When omitted, the provider's default applies.",
10298 "format": "double"
10299 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
10300 ),
10301 "tools": Schema.optionalKey(Arrays_7)
10302}).annotate({
10303 "description": "Configuration for the openrouter:fusion server tool.",
10304 "identifier": "FusionServerToolConfig"
10305})
10306export type AnthropicUsage = {
10307 readonly "cache_creation": AnthropicCacheCreation
10308 readonly "cache_creation_input_tokens": number | null
10309 readonly "cache_read_input_tokens": number | null
10310 readonly "inference_geo": string | null
10311 readonly "input_tokens": number
10312 readonly "output_tokens": number
10313 readonly "output_tokens_details": AnthropicOutputTokensDetails
10314 readonly "server_tool_use": AnthropicServerToolUsage
10315 readonly "service_tier": AnthropicServiceTier
10316}
10317export const AnthropicUsage = Schema.Struct({
10318 "cache_creation": AnthropicCacheCreation,
10319 "cache_creation_input_tokens": Schema.Union([
10320 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
10321 Schema.Null
10322 ]),
10323 "cache_read_input_tokens": Schema.Union([
10324 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
10325 Schema.Null
10326 ]),
10327 "inference_geo": Schema.Union([Schema.String, Schema.Null]),
10328 "input_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
10329 "output_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
10330 "output_tokens_details": AnthropicOutputTokensDetails,
10331 "server_tool_use": AnthropicServerToolUsage,
10332 "service_tier": AnthropicServiceTier
10333}).annotate({ "identifier": "AnthropicUsage" })
10334export type AnthropicDocumentBlock = {
10335 readonly "citations"?: AnthropicCitationsConfig
10336 readonly "source": AnthropicBase64PdfSource | AnthropicPlainTextSource
10337 readonly "title": string | null
10338 readonly "type": "document"
10339}
10340export const AnthropicDocumentBlock = Schema.Struct({
10341 "citations": Schema.optionalKey(AnthropicCitationsConfig),
10342 "source": Schema.Union([AnthropicBase64PdfSource, AnthropicPlainTextSource]),
10343 "title": Schema.Union([Schema.String, Schema.Null]),
10344 "type": Schema.Literal("document")
10345}).annotate({ "identifier": "AnthropicDocumentBlock" })
10346export type AnthropicTextBlock = {
10347 readonly "citations": ReadonlyArray<AnthropicTextCitation> | null
10348 readonly "text": string
10349 readonly "type": "text"
10350}
10351export const AnthropicTextBlock = Schema.Struct({
10352 "citations": Schema.Union([Schema.Array(AnthropicTextCitation), Schema.Null]),
10353 "text": Schema.String,
10354 "type": Schema.Literal("text")
10355}).annotate({ "identifier": "AnthropicTextBlock" })
10356export type AnthropicToolUseBlock = {
10357 readonly "caller": AnthropicCaller
10358 readonly "id": string
10359 readonly "input"?: Schema.Json
10360 readonly "name": string
10361 readonly "type": "tool_use"
10362}
10363export const AnthropicToolUseBlock = Schema.Struct({
10364 "caller": AnthropicCaller,
10365 "id": Schema.String,
10366 "input": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
10367 "name": Schema.String,
10368 "type": Schema.Literal("tool_use")
10369}).annotate({ "identifier": "AnthropicToolUseBlock" })
10370export type AnthropicWebSearchToolResult = {
10371 readonly "caller": AnthropicCaller
10372 readonly "content": ReadonlyArray<AnthropicWebSearchResult> | AnthropicWebSearchToolResultError
10373 readonly "tool_use_id": string
10374 readonly "type": "web_search_tool_result"
10375}
10376export const AnthropicWebSearchToolResult = Schema.Struct({
10377 "caller": AnthropicCaller,
10378 "content": Schema.Union([Schema.Array(AnthropicWebSearchResult), AnthropicWebSearchToolResultError]),
10379 "tool_use_id": Schema.String,
10380 "type": Schema.Literal("web_search_tool_result")
10381}).annotate({ "identifier": "AnthropicWebSearchToolResult" })
10382export type ORAnthropicServerToolUseBlock = {
10383 readonly "caller"?: ORAnthropicNullableCaller
10384 readonly "id": string
10385 readonly "input"?: Schema.Json
10386 readonly "name": string
10387 readonly "type": "server_tool_use"
10388}
10389export const ORAnthropicServerToolUseBlock = Schema.Struct({
10390 "caller": Schema.optionalKey(ORAnthropicNullableCaller),
10391 "id": Schema.String,
10392 "input": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
10393 "name": Schema.String,
10394 "type": Schema.Literal("server_tool_use")
10395}).annotate({ "identifier": "ORAnthropicServerToolUseBlock" })
10396export type AnthropicImageBlockParam = {
10397 readonly "cache_control"?: AnthropicCacheControlDirective
10398 readonly "source": AnthropicBase64ImageSource | AnthropicUrlImageSource
10399 readonly "type": "image"
10400}
10401export const AnthropicImageBlockParam = Schema.Struct({
10402 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
10403 "source": Schema.Union([AnthropicBase64ImageSource, AnthropicUrlImageSource], { mode: "oneOf" }),
10404 "type": Schema.Literal("image")
10405}).annotate({ "identifier": "AnthropicImageBlockParam" })
10406export type AnthropicAdvisorMessageUsageIteration = {
10407 readonly "cache_creation"?: AnthropicIterationCacheCreation
10408 readonly "cache_creation_input_tokens"?: number
10409 readonly "cache_read_input_tokens"?: number
10410 readonly "input_tokens"?: number
10411 readonly "output_tokens"?: number
10412 readonly "model": string
10413 readonly "type": "advisor_message"
10414}
10415export const AnthropicAdvisorMessageUsageIteration = Schema.Struct({
10416 "cache_creation": Schema.optionalKey(AnthropicIterationCacheCreation),
10417 "cache_creation_input_tokens": Schema.optionalKey(
10418 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
10419 ),
10420 "cache_read_input_tokens": Schema.optionalKey(
10421 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
10422 ),
10423 "input_tokens": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
10424 "output_tokens": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
10425 "model": Schema.String,
10426 "type": Schema.Literal("advisor_message")
10427}).annotate({ "identifier": "AnthropicAdvisorMessageUsageIteration" })
10428export type AnthropicBaseUsageIteration = {
10429 readonly "cache_creation"?: AnthropicIterationCacheCreation
10430 readonly "cache_creation_input_tokens"?: number
10431 readonly "cache_read_input_tokens"?: number
10432 readonly "input_tokens"?: number
10433 readonly "output_tokens"?: number
10434}
10435export const AnthropicBaseUsageIteration = Schema.Struct({
10436 "cache_creation": Schema.optionalKey(AnthropicIterationCacheCreation),
10437 "cache_creation_input_tokens": Schema.optionalKey(
10438 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
10439 ),
10440 "cache_read_input_tokens": Schema.optionalKey(
10441 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
10442 ),
10443 "input_tokens": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
10444 "output_tokens": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })))
10445}).annotate({ "identifier": "AnthropicBaseUsageIteration" })
10446export type AnthropicCompactionUsageIteration = {
10447 readonly "cache_creation"?: AnthropicIterationCacheCreation
10448 readonly "cache_creation_input_tokens"?: number
10449 readonly "cache_read_input_tokens"?: number
10450 readonly "input_tokens"?: number
10451 readonly "output_tokens"?: number
10452 readonly "type": "compaction"
10453}
10454export const AnthropicCompactionUsageIteration = Schema.Struct({
10455 "cache_creation": Schema.optionalKey(AnthropicIterationCacheCreation),
10456 "cache_creation_input_tokens": Schema.optionalKey(
10457 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
10458 ),
10459 "cache_read_input_tokens": Schema.optionalKey(
10460 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
10461 ),
10462 "input_tokens": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
10463 "output_tokens": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
10464 "type": Schema.Literal("compaction")
10465}).annotate({ "identifier": "AnthropicCompactionUsageIteration" })
10466export type AnthropicMessageUsageIteration = {
10467 readonly "cache_creation"?: AnthropicIterationCacheCreation
10468 readonly "cache_creation_input_tokens"?: number
10469 readonly "cache_read_input_tokens"?: number
10470 readonly "input_tokens"?: number
10471 readonly "output_tokens"?: number
10472 readonly "model"?: string
10473 readonly "type": "message"
10474}
10475export const AnthropicMessageUsageIteration = Schema.Struct({
10476 "cache_creation": Schema.optionalKey(AnthropicIterationCacheCreation),
10477 "cache_creation_input_tokens": Schema.optionalKey(
10478 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
10479 ),
10480 "cache_read_input_tokens": Schema.optionalKey(
10481 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
10482 ),
10483 "input_tokens": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
10484 "output_tokens": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
10485 "model": Schema.optionalKey(Schema.String),
10486 "type": Schema.Literal("message")
10487}).annotate({ "identifier": "AnthropicMessageUsageIteration" })
10488export type AnthropicUnknownUsageIteration = {
10489 readonly "cache_creation"?: AnthropicIterationCacheCreation
10490 readonly "cache_creation_input_tokens"?: number
10491 readonly "cache_read_input_tokens"?: number
10492 readonly "input_tokens"?: number
10493 readonly "output_tokens"?: number
10494 readonly "type": string
10495}
10496export const AnthropicUnknownUsageIteration = Schema.Struct({
10497 "cache_creation": Schema.optionalKey(AnthropicIterationCacheCreation),
10498 "cache_creation_input_tokens": Schema.optionalKey(
10499 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
10500 ),
10501 "cache_read_input_tokens": Schema.optionalKey(
10502 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
10503 ),
10504 "input_tokens": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
10505 "output_tokens": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
10506 "type": Schema.String
10507}).annotate({ "identifier": "AnthropicUnknownUsageIteration" })
10508export type AnthropicCodeExecutionContent =
10509 | AnthropicCodeExecutionToolResultError
10510 | AnthropicCodeExecutionResult
10511 | AnthropicEncryptedCodeExecutionResult
10512export const AnthropicCodeExecutionContent = Schema.Union([
10513 AnthropicCodeExecutionToolResultError,
10514 AnthropicCodeExecutionResult,
10515 AnthropicEncryptedCodeExecutionResult
10516], { mode: "oneOf" }).annotate({ "identifier": "AnthropicCodeExecutionContent" })
10517export type AnthropicTextEditorCodeExecutionToolResult = {
10518 readonly "content": AnthropicTextEditorCodeExecutionContent
10519 readonly "tool_use_id": string
10520 readonly "type": "text_editor_code_execution_tool_result"
10521}
10522export const AnthropicTextEditorCodeExecutionToolResult = Schema.Struct({
10523 "content": AnthropicTextEditorCodeExecutionContent,
10524 "tool_use_id": Schema.String,
10525 "type": Schema.Literal("text_editor_code_execution_tool_result")
10526}).annotate({ "identifier": "AnthropicTextEditorCodeExecutionToolResult" })
10527export type AnthropicToolSearchContent = AnthropicToolSearchResultError | AnthropicToolSearchResult
10528export const AnthropicToolSearchContent = Schema.Union([AnthropicToolSearchResultError, AnthropicToolSearchResult], {
10529 mode: "oneOf"
10530}).annotate({ "identifier": "AnthropicToolSearchContent" })
10531export type MessagesErrorResponse = { readonly "error": MessagesErrorDetail; readonly "type": "error" }
10532export const MessagesErrorResponse = Schema.Struct({ "error": MessagesErrorDetail, "type": Schema.Literal("error") })
10533 .annotate({ "identifier": "MessagesErrorResponse" })
10534export type ApplyPatchServerTool_OpenRouter = {
10535 readonly "parameters"?: ApplyPatchServerToolConfig
10536 readonly "type": "openrouter:apply_patch"
10537}
10538export const ApplyPatchServerTool_OpenRouter = Schema.Struct({
10539 "parameters": Schema.optionalKey(ApplyPatchServerToolConfig),
10540 "type": Schema.Literal("openrouter:apply_patch")
10541}).annotate({
10542 "description":
10543 "OpenRouter built-in server tool: validates V4A diff patches for file operations (create, update, delete). Restricted to the Responses API.",
10544 "identifier": "ApplyPatchServerTool_OpenRouter"
10545})
10546export type ApplyPatchCallItem = {
10547 readonly "call_id": string
10548 readonly "id"?: string | null
10549 readonly "operation": ApplyPatchCallOperation
10550 readonly "status": ApplyPatchCallStatus
10551 readonly "type": "apply_patch_call"
10552}
10553export const ApplyPatchCallItem = Schema.Struct({
10554 "call_id": Schema.String,
10555 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
10556 "operation": ApplyPatchCallOperation,
10557 "status": ApplyPatchCallStatus,
10558 "type": Schema.Literal("apply_patch_call")
10559}).annotate({
10560 "description":
10561 "A tool call emitted by the model requesting a V4A patch operation. The client applies the patch and echoes an `apply_patch_call_output` on the next turn.",
10562 "identifier": "ApplyPatchCallItem"
10563})
10564export type OutputApplyPatchCallItem = {
10565 readonly "call_id": string
10566 readonly "id": string
10567 readonly "operation": ApplyPatchCallOperation
10568 readonly "status": ApplyPatchCallStatus
10569 readonly "type": "apply_patch_call"
10570}
10571export const OutputApplyPatchCallItem = Schema.Struct({
10572 "call_id": Schema.String,
10573 "id": Schema.String,
10574 "operation": ApplyPatchCallOperation,
10575 "status": ApplyPatchCallStatus,
10576 "type": Schema.Literal("apply_patch_call")
10577}).annotate({
10578 "description":
10579 "A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand.",
10580 "identifier": "OutputApplyPatchCallItem"
10581})
10582export type OutputApplyPatchServerToolItem = {
10583 readonly "call_id"?: string
10584 readonly "id"?: string
10585 readonly "operation"?: ApplyPatchCallOperation
10586 readonly "status": ToolCallStatus
10587 readonly "type": "openrouter:apply_patch"
10588}
10589export const OutputApplyPatchServerToolItem = Schema.Struct({
10590 "call_id": Schema.optionalKey(Schema.String),
10591 "id": Schema.optionalKey(Schema.String),
10592 "operation": Schema.optionalKey(ApplyPatchCallOperation),
10593 "status": ToolCallStatus,
10594 "type": Schema.Literal("openrouter:apply_patch")
10595}).annotate({
10596 "description":
10597 "An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn.",
10598 "identifier": "OutputApplyPatchServerToolItem"
10599})
10600export type CreateBYOKKeyResponse = { readonly "data": BYOKKey }
10601export const CreateBYOKKeyResponse = Schema.Struct({
10602 "data": Schema.suspend((): Schema.Codec<BYOKKey> => BYOKKey).annotate({
10603 "description": "The created BYOK credential."
10604 })
10605}).annotate({ "identifier": "CreateBYOKKeyResponse" })
10606export type GetBYOKKeyResponse = { readonly "data": BYOKKey }
10607export const GetBYOKKeyResponse = Schema.Struct({
10608 "data": Schema.suspend((): Schema.Codec<BYOKKey> => BYOKKey).annotate({ "description": "The BYOK credential." })
10609}).annotate({ "identifier": "GetBYOKKeyResponse" })
10610export type ListBYOKKeysResponse = { readonly "data": ReadonlyArray<BYOKKey>; readonly "total_count": number }
10611export const ListBYOKKeysResponse = Schema.Struct({
10612 "data": Schema.Array(BYOKKey).annotate({ "description": "List of BYOK credentials." }),
10613 "total_count": Schema.Number.annotate({ "description": "Total number of BYOK credentials matching the filters." })
10614 .check(Schema.isInt().annotate({ "expected": "an integer" }))
10615}).annotate({ "identifier": "ListBYOKKeysResponse" })
10616export type UpdateBYOKKeyResponse = { readonly "data": BYOKKey }
10617export const UpdateBYOKKeyResponse = Schema.Struct({
10618 "data": Schema.suspend((): Schema.Codec<BYOKKey> => BYOKKey).annotate({
10619 "description": "The updated BYOK credential."
10620 })
10621}).annotate({ "identifier": "UpdateBYOKKeyResponse" })
10622export type ChatTokenLogprobs = Objects_7 | null
10623export const ChatTokenLogprobs = Schema.Union([Objects_7, Schema.Null]).annotate({
10624 "description": "Log probabilities for the completion",
10625 "identifier": "ChatTokenLogprobs"
10626})
10627export type BashServerToolConfig = {
10628 readonly "engine"?: BashServerToolEngine
10629 readonly "environment"?: BashServerToolEnvironment
10630 readonly "sleep_after_seconds"?: SandboxSleepAfterSeconds
10631}
10632export const BashServerToolConfig = Schema.Struct({
10633 "engine": Schema.optionalKey(BashServerToolEngine),
10634 "environment": Schema.optionalKey(BashServerToolEnvironment),
10635 "sleep_after_seconds": Schema.optionalKey(SandboxSleepAfterSeconds)
10636}).annotate({
10637 "description": "Configuration for the openrouter:bash server tool",
10638 "identifier": "BashServerToolConfig"
10639})
10640export type ShellServerToolConfig = {
10641 readonly "engine"?: ShellServerToolEngine
10642 readonly "environment"?: ShellServerToolEnvironment
10643 readonly "sleep_after_seconds"?: SandboxSleepAfterSeconds
10644}
10645export const ShellServerToolConfig = Schema.Struct({
10646 "engine": Schema.optionalKey(ShellServerToolEngine),
10647 "environment": Schema.optionalKey(ShellServerToolEnvironment),
10648 "sleep_after_seconds": Schema.optionalKey(SandboxSleepAfterSeconds)
10649}).annotate({
10650 "description": "Configuration for the openrouter:shell server tool",
10651 "identifier": "ShellServerToolConfig"
10652})
10653export type ModelBenchmarks = { readonly "artificial_analysis"?: AABenchmarkEntry; readonly "design_arena": Arrays_9 }
10654export const ModelBenchmarks = Schema.Struct({
10655 "artificial_analysis": Schema.optionalKey(AABenchmarkEntry),
10656 "design_arena": Arrays_9
10657}).annotate({
10658 "description": "Third-party benchmark rankings for this model. Omitted when no benchmark data is available.",
10659 "identifier": "ModelBenchmarks"
10660})
10661export type TextConfig = { readonly "format"?: Formats; readonly "verbosity"?: "high" | "low" | "medium" | null }
10662export const TextConfig = Schema.Struct({
10663 "format": Schema.optionalKey(Formats),
10664 "verbosity": Schema.optionalKey(
10665 Schema.Union([Schema.Literal("high"), Schema.Literal("low"), Schema.Literal("medium"), Schema.Null])
10666 )
10667}).annotate({ "description": "Text output configuration including format and verbosity", "identifier": "TextConfig" })
10668export type TextExtendedConfig = {
10669 readonly "format"?: Formats
10670 readonly "verbosity"?: "high" | "low" | "medium" | null
10671}
10672export const TextExtendedConfig = Schema.Struct({
10673 "format": Schema.optionalKey(Formats),
10674 "verbosity": Schema.optionalKey(
10675 Schema.Union([Schema.Literal("high"), Schema.Literal("low"), Schema.Literal("medium"), Schema.Union([Schema.Null])])
10676 )
10677}).annotate({
10678 "description": "Text output configuration including format and verbosity",
10679 "identifier": "TextExtendedConfig"
10680})
10681export type FusionCallAnalysisCompletedEvent = {
10682 readonly "analysis": FusionAnalysisResult
10683 readonly "item_id": string
10684 readonly "output_index": number
10685 readonly "sequence_number": number
10686 readonly "type": "response.fusion_call.analysis.completed"
10687}
10688export const FusionCallAnalysisCompletedEvent = Schema.Struct({
10689 "analysis": FusionAnalysisResult,
10690 "item_id": Schema.String,
10691 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
10692 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
10693 "type": Schema.Literal("response.fusion_call.analysis.completed")
10694}).annotate({
10695 "description": "Emitted when the fusion judge completes with the structured analysis.",
10696 "identifier": "FusionCallAnalysisCompletedEvent"
10697})
10698export type OutputFusionServerToolItem = {
10699 readonly "analysis"?: FusionAnalysisResult
10700 readonly "error"?: string
10701 readonly "failed_models"?: ReadonlyArray<
10702 { readonly "error": string; readonly "model": string; readonly "status_code"?: number }
10703 >
10704 readonly "failure_reason"?: string
10705 readonly "id"?: string
10706 readonly "responses"?: ReadonlyArray<{ readonly "content"?: string; readonly "model": string }>
10707 readonly "sources"?: ReadonlyArray<FusionSource>
10708 readonly "status": ToolCallStatus
10709 readonly "type": "openrouter:fusion"
10710}
10711export const OutputFusionServerToolItem = Schema.Struct({
10712 "analysis": Schema.optionalKey(FusionAnalysisResult),
10713 "error": Schema.optionalKey(
10714 Schema.String.annotate({ "description": "Error message when the fusion run did not produce an analysis result." })
10715 ),
10716 "failed_models": Schema.optionalKey(
10717 Schema.Array(Schema.Struct({
10718 "error": Schema.String.annotate({ "description": "Error message describing why the model failed." }),
10719 "model": Schema.String.annotate({ "description": "Slug of the analysis model that failed." }),
10720 "status_code": Schema.optionalKey(
10721 Schema.Number.annotate({
10722 "description": "HTTP status code from the upstream response, when available (e.g. 402, 429)."
10723 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
10724 )
10725 })).annotate({
10726 "description":
10727 "Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel."
10728 })
10729 ),
10730 "failure_reason": Schema.optionalKey(
10731 Schema.String.annotate({
10732 "description":
10733 "Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion."
10734 })
10735 ),
10736 "id": Schema.optionalKey(Schema.String),
10737 "responses": Schema.optionalKey(
10738 Schema.Array(Schema.Struct({ "content": Schema.optionalKey(Schema.String), "model": Schema.String })).annotate({
10739 "description":
10740 "Analysis models that produced a response in this fusion run, with each model's full panel content."
10741 })
10742 ),
10743 "sources": Schema.optionalKey(
10744 Schema.Array(FusionSource).annotate({
10745 "description":
10746 "Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source."
10747 })
10748 ),
10749 "status": ToolCallStatus,
10750 "type": Schema.Literal("openrouter:fusion")
10751}).annotate({
10752 "description": "An openrouter:fusion server tool output item",
10753 "identifier": "OutputFusionServerToolItem"
10754})
10755export type ImageModelListItem = {
10756 readonly "architecture": ImageModelArchitecture
10757 readonly "created": number
10758 readonly "description": string
10759 readonly "endpoints": string
10760 readonly "id": string
10761 readonly "name": string
10762 readonly "supported_parameters": SupportedParameters
10763 readonly "supports_streaming": boolean
10764}
10765export const ImageModelListItem = Schema.Struct({
10766 "architecture": ImageModelArchitecture,
10767 "created": Schema.Number.annotate({ "description": "Unix timestamp (seconds) of when the model was created" }).check(
10768 Schema.isInt().annotate({ "expected": "an integer" })
10769 ),
10770 "description": Schema.String,
10771 "endpoints": Schema.String.annotate({
10772 "description": "Relative URL to the full per-endpoint records for this model"
10773 }),
10774 "id": Schema.String.annotate({ "description": "Model slug" }),
10775 "name": Schema.String.annotate({ "description": "Display name" }),
10776 "supported_parameters": SupportedParameters,
10777 "supports_streaming": Schema.Boolean.annotate({
10778 "description":
10779 "Whether any endpoint of this model supports native SSE streaming on the dedicated Image API (i.e. `stream: true` in the request). OR across endpoints."
10780 })
10781}).annotate({ "description": "A single image model in the discovery listing.", "identifier": "ImageModelListItem" })
10782export type ObservabilityArizeDestination = {
10783 readonly "api_key_hashes": ReadonlyArray<string> | null
10784 readonly "config": {
10785 readonly "apiKey": string
10786 readonly "baseUrl"?: string
10787 readonly "headers"?: {}
10788 readonly "modelId": string
10789 readonly "spaceKey": string
10790 }
10791 readonly "created_at": string
10792 readonly "enabled": boolean
10793 readonly "filter_rules": ObservabilityFilterRulesConfig
10794 readonly "id": string
10795 readonly "name": string | null
10796 readonly "privacy_mode": boolean
10797 readonly "sampling_rate": number
10798 readonly "type": "arize"
10799 readonly "updated_at": string
10800 readonly "workspace_id": string
10801}
10802export const ObservabilityArizeDestination = Schema.Struct({
10803 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
10804 "description":
10805 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
10806 }),
10807 "config": Schema.Struct({
10808 "apiKey": Schema.String.check(
10809 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
10810 ),
10811 "baseUrl": Schema.optionalKey(Schema.String),
10812 "headers": Schema.optionalKey(
10813 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
10814 ),
10815 "modelId": Schema.String.annotate({ "description": "The name of the tracing project in Arize AX" }).check(
10816 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
10817 ),
10818 "spaceKey": Schema.String.check(
10819 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
10820 )
10821 }),
10822 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
10823 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
10824 "filter_rules": ObservabilityFilterRulesConfig,
10825 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
10826 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
10827 "description": "Human-readable name for the destination."
10828 }),
10829 "privacy_mode": Schema.Boolean.annotate({
10830 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
10831 }),
10832 "sampling_rate": Schema.Number.annotate({
10833 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
10834 "format": "double"
10835 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
10836 "type": Schema.Literal("arize"),
10837 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
10838 "workspace_id": Schema.String.annotate({
10839 "description": "ID of the workspace this destination belongs to.",
10840 "format": "uuid"
10841 })
10842}).annotate({ "identifier": "ObservabilityArizeDestination" })
10843export type ObservabilityBraintrustDestination = {
10844 readonly "api_key_hashes": ReadonlyArray<string> | null
10845 readonly "config": {
10846 readonly "apiKey": string
10847 readonly "baseUrl"?: string
10848 readonly "headers"?: {}
10849 readonly "projectId": string
10850 }
10851 readonly "created_at": string
10852 readonly "enabled": boolean
10853 readonly "filter_rules": ObservabilityFilterRulesConfig
10854 readonly "id": string
10855 readonly "name": string | null
10856 readonly "privacy_mode": boolean
10857 readonly "sampling_rate": number
10858 readonly "type": "braintrust"
10859 readonly "updated_at": string
10860 readonly "workspace_id": string
10861}
10862export const ObservabilityBraintrustDestination = Schema.Struct({
10863 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
10864 "description":
10865 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
10866 }),
10867 "config": Schema.Struct({
10868 "apiKey": Schema.String.check(
10869 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
10870 ),
10871 "baseUrl": Schema.optionalKey(Schema.String),
10872 "headers": Schema.optionalKey(
10873 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
10874 ),
10875 "projectId": Schema.String.check(
10876 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
10877 )
10878 }),
10879 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
10880 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
10881 "filter_rules": ObservabilityFilterRulesConfig,
10882 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
10883 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
10884 "description": "Human-readable name for the destination."
10885 }),
10886 "privacy_mode": Schema.Boolean.annotate({
10887 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
10888 }),
10889 "sampling_rate": Schema.Number.annotate({
10890 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
10891 "format": "double"
10892 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
10893 "type": Schema.Literal("braintrust"),
10894 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
10895 "workspace_id": Schema.String.annotate({
10896 "description": "ID of the workspace this destination belongs to.",
10897 "format": "uuid"
10898 })
10899}).annotate({ "identifier": "ObservabilityBraintrustDestination" })
10900export type ObservabilityClickhouseDestination = {
10901 readonly "api_key_hashes": ReadonlyArray<string> | null
10902 readonly "config": {
10903 readonly "database": string
10904 readonly "headers"?: {}
10905 readonly "host": string
10906 readonly "password": string
10907 readonly "table"?: string
10908 readonly "username": string
10909 }
10910 readonly "created_at": string
10911 readonly "enabled": boolean
10912 readonly "filter_rules": ObservabilityFilterRulesConfig
10913 readonly "id": string
10914 readonly "name": string | null
10915 readonly "privacy_mode": boolean
10916 readonly "sampling_rate": number
10917 readonly "type": "clickhouse"
10918 readonly "updated_at": string
10919 readonly "workspace_id": string
10920}
10921export const ObservabilityClickhouseDestination = Schema.Struct({
10922 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
10923 "description":
10924 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
10925 }),
10926 "config": Schema.Struct({
10927 "database": Schema.String.check(
10928 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
10929 ),
10930 "headers": Schema.optionalKey(
10931 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
10932 ),
10933 "host": Schema.String.check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })),
10934 "password": Schema.String.check(
10935 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
10936 ),
10937 "table": Schema.optionalKey(Schema.String),
10938 "username": Schema.String.annotate({
10939 "description": "If you have not set a specific username in ClickHouse, simply type in 'default' below."
10940 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
10941 }),
10942 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
10943 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
10944 "filter_rules": ObservabilityFilterRulesConfig,
10945 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
10946 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
10947 "description": "Human-readable name for the destination."
10948 }),
10949 "privacy_mode": Schema.Boolean.annotate({
10950 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
10951 }),
10952 "sampling_rate": Schema.Number.annotate({
10953 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
10954 "format": "double"
10955 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
10956 "type": Schema.Literal("clickhouse"),
10957 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
10958 "workspace_id": Schema.String.annotate({
10959 "description": "ID of the workspace this destination belongs to.",
10960 "format": "uuid"
10961 })
10962}).annotate({ "identifier": "ObservabilityClickhouseDestination" })
10963export type ObservabilityDatadogDestination = {
10964 readonly "api_key_hashes": ReadonlyArray<string> | null
10965 readonly "config": {
10966 readonly "apiKey": string
10967 readonly "headers"?: {}
10968 readonly "mlApp": string
10969 readonly "url"?: string
10970 }
10971 readonly "created_at": string
10972 readonly "enabled": boolean
10973 readonly "filter_rules": ObservabilityFilterRulesConfig
10974 readonly "id": string
10975 readonly "name": string | null
10976 readonly "privacy_mode": boolean
10977 readonly "sampling_rate": number
10978 readonly "type": "datadog"
10979 readonly "updated_at": string
10980 readonly "workspace_id": string
10981}
10982export const ObservabilityDatadogDestination = Schema.Struct({
10983 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
10984 "description":
10985 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
10986 }),
10987 "config": Schema.Struct({
10988 "apiKey": Schema.String.annotate({
10989 "description": "Datadog API key must have LLM Observability permissions. Create at: "
10990 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })),
10991 "headers": Schema.optionalKey(
10992 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
10993 ),
10994 "mlApp": Schema.String.annotate({ "description": "Name to identify your application in Datadog LLM Observability" })
10995 .check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })),
10996 "url": Schema.optionalKey(
10997 Schema.String.annotate({
10998 "description":
10999 "Datadog API URL for your region (e.g., https://api.datadoghq.com, https://api.us3.datadoghq.com, https://api.datadoghq.eu)"
11000 })
11001 )
11002 }),
11003 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11004 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11005 "filter_rules": ObservabilityFilterRulesConfig,
11006 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11007 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11008 "description": "Human-readable name for the destination."
11009 }),
11010 "privacy_mode": Schema.Boolean.annotate({
11011 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11012 }),
11013 "sampling_rate": Schema.Number.annotate({
11014 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11015 "format": "double"
11016 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11017 "type": Schema.Literal("datadog"),
11018 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11019 "workspace_id": Schema.String.annotate({
11020 "description": "ID of the workspace this destination belongs to.",
11021 "format": "uuid"
11022 })
11023}).annotate({ "identifier": "ObservabilityDatadogDestination" })
11024export type ObservabilityGrafanaDestination = {
11025 readonly "api_key_hashes": ReadonlyArray<string> | null
11026 readonly "config": {
11027 readonly "apiKey": string
11028 readonly "baseUrl"?: string
11029 readonly "headers"?: {}
11030 readonly "instanceId": string
11031 }
11032 readonly "created_at": string
11033 readonly "enabled": boolean
11034 readonly "filter_rules": ObservabilityFilterRulesConfig
11035 readonly "id": string
11036 readonly "name": string | null
11037 readonly "privacy_mode": boolean
11038 readonly "sampling_rate": number
11039 readonly "type": "grafana"
11040 readonly "updated_at": string
11041 readonly "workspace_id": string
11042}
11043export const ObservabilityGrafanaDestination = Schema.Struct({
11044 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11045 "description":
11046 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11047 }),
11048 "config": Schema.Struct({
11049 "apiKey": Schema.String.check(
11050 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11051 ),
11052 "baseUrl": Schema.optionalKey(Schema.String),
11053 "headers": Schema.optionalKey(
11054 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
11055 ),
11056 "instanceId": Schema.String.check(
11057 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11058 )
11059 }),
11060 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11061 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11062 "filter_rules": ObservabilityFilterRulesConfig,
11063 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11064 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11065 "description": "Human-readable name for the destination."
11066 }),
11067 "privacy_mode": Schema.Boolean.annotate({
11068 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11069 }),
11070 "sampling_rate": Schema.Number.annotate({
11071 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11072 "format": "double"
11073 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11074 "type": Schema.Literal("grafana"),
11075 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11076 "workspace_id": Schema.String.annotate({
11077 "description": "ID of the workspace this destination belongs to.",
11078 "format": "uuid"
11079 })
11080}).annotate({ "identifier": "ObservabilityGrafanaDestination" })
11081export type ObservabilityLangfuseDestination = {
11082 readonly "api_key_hashes": ReadonlyArray<string> | null
11083 readonly "config": {
11084 readonly "baseUrl"?: string
11085 readonly "headers"?: {}
11086 readonly "publicKey": string
11087 readonly "secretKey": string
11088 }
11089 readonly "created_at": string
11090 readonly "enabled": boolean
11091 readonly "filter_rules": ObservabilityFilterRulesConfig
11092 readonly "id": string
11093 readonly "name": string | null
11094 readonly "privacy_mode": boolean
11095 readonly "sampling_rate": number
11096 readonly "type": "langfuse"
11097 readonly "updated_at": string
11098 readonly "workspace_id": string
11099}
11100export const ObservabilityLangfuseDestination = Schema.Struct({
11101 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11102 "description":
11103 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11104 }),
11105 "config": Schema.Struct({
11106 "baseUrl": Schema.optionalKey(Schema.String),
11107 "headers": Schema.optionalKey(
11108 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
11109 ),
11110 "publicKey": Schema.String.check(
11111 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11112 ),
11113 "secretKey": Schema.String.check(
11114 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11115 )
11116 }),
11117 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11118 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11119 "filter_rules": ObservabilityFilterRulesConfig,
11120 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11121 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11122 "description": "Human-readable name for the destination."
11123 }),
11124 "privacy_mode": Schema.Boolean.annotate({
11125 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11126 }),
11127 "sampling_rate": Schema.Number.annotate({
11128 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11129 "format": "double"
11130 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11131 "type": Schema.Literal("langfuse"),
11132 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11133 "workspace_id": Schema.String.annotate({
11134 "description": "ID of the workspace this destination belongs to.",
11135 "format": "uuid"
11136 })
11137}).annotate({ "identifier": "ObservabilityLangfuseDestination" })
11138export type ObservabilityLangsmithDestination = {
11139 readonly "api_key_hashes": ReadonlyArray<string> | null
11140 readonly "config": {
11141 readonly "apiKey": string
11142 readonly "endpoint"?: string
11143 readonly "headers"?: {}
11144 readonly "project"?: string
11145 readonly "workspaceId"?: string
11146 }
11147 readonly "created_at": string
11148 readonly "enabled": boolean
11149 readonly "filter_rules": ObservabilityFilterRulesConfig
11150 readonly "id": string
11151 readonly "name": string | null
11152 readonly "privacy_mode": boolean
11153 readonly "sampling_rate": number
11154 readonly "type": "langsmith"
11155 readonly "updated_at": string
11156 readonly "workspace_id": string
11157}
11158export const ObservabilityLangsmithDestination = Schema.Struct({
11159 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11160 "description":
11161 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11162 }),
11163 "config": Schema.Struct({
11164 "apiKey": Schema.String.check(
11165 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11166 ),
11167 "endpoint": Schema.optionalKey(Schema.String),
11168 "headers": Schema.optionalKey(
11169 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
11170 ),
11171 "project": Schema.optionalKey(
11172 Schema.String.annotate({
11173 "description": "The name for this project, such as pr-openrouter-demo. Defaults to \"main\" if not set."
11174 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
11175 ),
11176 "workspaceId": Schema.optionalKey(
11177 Schema.String.annotate({
11178 "description": "Required for org-scoped API keys. Find this in your LangSmith workspace settings."
11179 })
11180 )
11181 }),
11182 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11183 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11184 "filter_rules": ObservabilityFilterRulesConfig,
11185 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11186 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11187 "description": "Human-readable name for the destination."
11188 }),
11189 "privacy_mode": Schema.Boolean.annotate({
11190 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11191 }),
11192 "sampling_rate": Schema.Number.annotate({
11193 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11194 "format": "double"
11195 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11196 "type": Schema.Literal("langsmith"),
11197 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11198 "workspace_id": Schema.String.annotate({
11199 "description": "ID of the workspace this destination belongs to.",
11200 "format": "uuid"
11201 })
11202}).annotate({ "identifier": "ObservabilityLangsmithDestination" })
11203export type ObservabilityNewrelicDestination = {
11204 readonly "api_key_hashes": ReadonlyArray<string> | null
11205 readonly "config": { readonly "headers"?: {}; readonly "licenseKey": string; readonly "region"?: "us" | "eu" }
11206 readonly "created_at": string
11207 readonly "enabled": boolean
11208 readonly "filter_rules": ObservabilityFilterRulesConfig
11209 readonly "id": string
11210 readonly "name": string | null
11211 readonly "privacy_mode": boolean
11212 readonly "sampling_rate": number
11213 readonly "type": "newrelic"
11214 readonly "updated_at": string
11215 readonly "workspace_id": string
11216}
11217export const ObservabilityNewrelicDestination = Schema.Struct({
11218 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11219 "description":
11220 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11221 }),
11222 "config": Schema.Struct({
11223 "headers": Schema.optionalKey(
11224 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
11225 ),
11226 "licenseKey": Schema.String.check(
11227 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11228 ),
11229 "region": Schema.optionalKey(Schema.Literals(["us", "eu"]))
11230 }),
11231 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11232 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11233 "filter_rules": ObservabilityFilterRulesConfig,
11234 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11235 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11236 "description": "Human-readable name for the destination."
11237 }),
11238 "privacy_mode": Schema.Boolean.annotate({
11239 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11240 }),
11241 "sampling_rate": Schema.Number.annotate({
11242 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11243 "format": "double"
11244 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11245 "type": Schema.Literal("newrelic"),
11246 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11247 "workspace_id": Schema.String.annotate({
11248 "description": "ID of the workspace this destination belongs to.",
11249 "format": "uuid"
11250 })
11251}).annotate({ "identifier": "ObservabilityNewrelicDestination" })
11252export type ObservabilityOpikDestination = {
11253 readonly "api_key_hashes": ReadonlyArray<string> | null
11254 readonly "config": {
11255 readonly "apiKey": string
11256 readonly "headers"?: {}
11257 readonly "projectName": string
11258 readonly "workspace": string
11259 }
11260 readonly "created_at": string
11261 readonly "enabled": boolean
11262 readonly "filter_rules": ObservabilityFilterRulesConfig
11263 readonly "id": string
11264 readonly "name": string | null
11265 readonly "privacy_mode": boolean
11266 readonly "sampling_rate": number
11267 readonly "type": "opik"
11268 readonly "updated_at": string
11269 readonly "workspace_id": string
11270}
11271export const ObservabilityOpikDestination = Schema.Struct({
11272 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11273 "description":
11274 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11275 }),
11276 "config": Schema.Struct({
11277 "apiKey": Schema.String.check(
11278 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11279 ),
11280 "headers": Schema.optionalKey(
11281 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
11282 ),
11283 "projectName": Schema.String.check(
11284 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11285 ),
11286 "workspace": Schema.String.check(
11287 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11288 )
11289 }),
11290 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11291 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11292 "filter_rules": ObservabilityFilterRulesConfig,
11293 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11294 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11295 "description": "Human-readable name for the destination."
11296 }),
11297 "privacy_mode": Schema.Boolean.annotate({
11298 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11299 }),
11300 "sampling_rate": Schema.Number.annotate({
11301 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11302 "format": "double"
11303 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11304 "type": Schema.Literal("opik"),
11305 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11306 "workspace_id": Schema.String.annotate({
11307 "description": "ID of the workspace this destination belongs to.",
11308 "format": "uuid"
11309 })
11310}).annotate({ "identifier": "ObservabilityOpikDestination" })
11311export type ObservabilityOtelCollectorDestination = {
11312 readonly "api_key_hashes": ReadonlyArray<string> | null
11313 readonly "config": { readonly "endpoint": string; readonly "headers"?: {} }
11314 readonly "created_at": string
11315 readonly "enabled": boolean
11316 readonly "filter_rules": ObservabilityFilterRulesConfig
11317 readonly "id": string
11318 readonly "name": string | null
11319 readonly "privacy_mode": boolean
11320 readonly "sampling_rate": number
11321 readonly "type": "otel-collector"
11322 readonly "updated_at": string
11323 readonly "workspace_id": string
11324}
11325export const ObservabilityOtelCollectorDestination = Schema.Struct({
11326 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11327 "description":
11328 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11329 }),
11330 "config": Schema.Struct({
11331 "endpoint": Schema.String,
11332 "headers": Schema.optionalKey(
11333 Schema.Struct({}).annotate({
11334 "description":
11335 "Custom HTTP headers as a JSON object. For Axiom, use {\"Authorization\": \"Bearer xaat-xxx\", \"X-Axiom-Dataset\": \"your-dataset\"}"
11336 })
11337 )
11338 }),
11339 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11340 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11341 "filter_rules": ObservabilityFilterRulesConfig,
11342 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11343 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11344 "description": "Human-readable name for the destination."
11345 }),
11346 "privacy_mode": Schema.Boolean.annotate({
11347 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11348 }),
11349 "sampling_rate": Schema.Number.annotate({
11350 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11351 "format": "double"
11352 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11353 "type": Schema.Literal("otel-collector"),
11354 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11355 "workspace_id": Schema.String.annotate({
11356 "description": "ID of the workspace this destination belongs to.",
11357 "format": "uuid"
11358 })
11359}).annotate({ "identifier": "ObservabilityOtelCollectorDestination" })
11360export type ObservabilityPosthogDestination = {
11361 readonly "api_key_hashes": ReadonlyArray<string> | null
11362 readonly "config": { readonly "apiKey": string; readonly "endpoint"?: string; readonly "headers"?: {} }
11363 readonly "created_at": string
11364 readonly "enabled": boolean
11365 readonly "filter_rules": ObservabilityFilterRulesConfig
11366 readonly "id": string
11367 readonly "name": string | null
11368 readonly "privacy_mode": boolean
11369 readonly "sampling_rate": number
11370 readonly "type": "posthog"
11371 readonly "updated_at": string
11372 readonly "workspace_id": string
11373}
11374export const ObservabilityPosthogDestination = Schema.Struct({
11375 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11376 "description":
11377 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11378 }),
11379 "config": Schema.Struct({
11380 "apiKey": Schema.String.check(
11381 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11382 ),
11383 "endpoint": Schema.optionalKey(Schema.String),
11384 "headers": Schema.optionalKey(
11385 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
11386 )
11387 }),
11388 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11389 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11390 "filter_rules": ObservabilityFilterRulesConfig,
11391 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11392 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11393 "description": "Human-readable name for the destination."
11394 }),
11395 "privacy_mode": Schema.Boolean.annotate({
11396 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11397 }),
11398 "sampling_rate": Schema.Number.annotate({
11399 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11400 "format": "double"
11401 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11402 "type": Schema.Literal("posthog"),
11403 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11404 "workspace_id": Schema.String.annotate({
11405 "description": "ID of the workspace this destination belongs to.",
11406 "format": "uuid"
11407 })
11408}).annotate({ "identifier": "ObservabilityPosthogDestination" })
11409export type ObservabilityRampDestination = {
11410 readonly "api_key_hashes": ReadonlyArray<string> | null
11411 readonly "config": { readonly "apiKey": string; readonly "baseUrl"?: string; readonly "headers"?: {} }
11412 readonly "created_at": string
11413 readonly "enabled": boolean
11414 readonly "filter_rules": ObservabilityFilterRulesConfig
11415 readonly "id": string
11416 readonly "name": string | null
11417 readonly "privacy_mode": boolean
11418 readonly "sampling_rate": number
11419 readonly "type": "ramp"
11420 readonly "updated_at": string
11421 readonly "workspace_id": string
11422}
11423export const ObservabilityRampDestination = Schema.Struct({
11424 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11425 "description":
11426 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11427 }),
11428 "config": Schema.Struct({
11429 "apiKey": Schema.String.annotate({ "description": "Generate this in your Ramp integration settings." }).check(
11430 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11431 ),
11432 "baseUrl": Schema.optionalKey(Schema.String),
11433 "headers": Schema.optionalKey(
11434 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to Ramp." })
11435 )
11436 }),
11437 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11438 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11439 "filter_rules": ObservabilityFilterRulesConfig,
11440 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11441 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11442 "description": "Human-readable name for the destination."
11443 }),
11444 "privacy_mode": Schema.Boolean.annotate({
11445 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11446 }),
11447 "sampling_rate": Schema.Number.annotate({
11448 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11449 "format": "double"
11450 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11451 "type": Schema.Literal("ramp"),
11452 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11453 "workspace_id": Schema.String.annotate({
11454 "description": "ID of the workspace this destination belongs to.",
11455 "format": "uuid"
11456 })
11457}).annotate({ "identifier": "ObservabilityRampDestination" })
11458export type ObservabilityS3Destination = {
11459 readonly "api_key_hashes": ReadonlyArray<string> | null
11460 readonly "config": {
11461 readonly "accessKeyId": string
11462 readonly "bucketName": string
11463 readonly "endpoint"?: string
11464 readonly "headers"?: {}
11465 readonly "pathTemplate"?: string
11466 readonly "prefix"?: string
11467 readonly "region"?: string
11468 readonly "secretAccessKey": string
11469 readonly "sessionToken"?: string
11470 }
11471 readonly "created_at": string
11472 readonly "enabled": boolean
11473 readonly "filter_rules": ObservabilityFilterRulesConfig
11474 readonly "id": string
11475 readonly "name": string | null
11476 readonly "privacy_mode": boolean
11477 readonly "sampling_rate": number
11478 readonly "type": "s3"
11479 readonly "updated_at": string
11480 readonly "workspace_id": string
11481}
11482export const ObservabilityS3Destination = Schema.Struct({
11483 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11484 "description":
11485 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11486 }),
11487 "config": Schema.Struct({
11488 "accessKeyId": Schema.String.check(
11489 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11490 ),
11491 "bucketName": Schema.String.check(
11492 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11493 ),
11494 "endpoint": Schema.optionalKey(
11495 Schema.String.annotate({
11496 "description":
11497 "Only for S3-compatible services like Cloudflare R2 (https://account-id.r2.cloudflarestorage.com) or MinIO. Leave blank for standard AWS S3.",
11498 "format": "uri"
11499 })
11500 ),
11501 "headers": Schema.optionalKey(
11502 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
11503 ),
11504 "pathTemplate": Schema.optionalKey(
11505 Schema.String.annotate({
11506 "description":
11507 "Template for S3 object path. The filename ({traceId}-{timestamp}.json) is automatically appended. Available variables: {prefix}, {date}, {year}, {month}, {day}, {apiKeyName}"
11508 })
11509 ),
11510 "prefix": Schema.optionalKey(Schema.String),
11511 "region": Schema.optionalKey(Schema.String),
11512 "secretAccessKey": Schema.String.check(
11513 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11514 ),
11515 "sessionToken": Schema.optionalKey(Schema.String)
11516 }),
11517 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11518 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11519 "filter_rules": ObservabilityFilterRulesConfig,
11520 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11521 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11522 "description": "Human-readable name for the destination."
11523 }),
11524 "privacy_mode": Schema.Boolean.annotate({
11525 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11526 }),
11527 "sampling_rate": Schema.Number.annotate({
11528 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11529 "format": "double"
11530 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11531 "type": Schema.Literal("s3"),
11532 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11533 "workspace_id": Schema.String.annotate({
11534 "description": "ID of the workspace this destination belongs to.",
11535 "format": "uuid"
11536 })
11537}).annotate({ "identifier": "ObservabilityS3Destination" })
11538export type ObservabilitySentryDestination = {
11539 readonly "api_key_hashes": ReadonlyArray<string> | null
11540 readonly "config": { readonly "dsn": string; readonly "headers"?: {}; readonly "otlpEndpoint": string }
11541 readonly "created_at": string
11542 readonly "enabled": boolean
11543 readonly "filter_rules": ObservabilityFilterRulesConfig
11544 readonly "id": string
11545 readonly "name": string | null
11546 readonly "privacy_mode": boolean
11547 readonly "sampling_rate": number
11548 readonly "type": "sentry"
11549 readonly "updated_at": string
11550 readonly "workspace_id": string
11551}
11552export const ObservabilitySentryDestination = Schema.Struct({
11553 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11554 "description":
11555 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11556 }),
11557 "config": Schema.Struct({
11558 "dsn": Schema.String.check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
11559 .check(
11560 Schema.isPattern(new RegExp("^https:\\/\\/([^:@]+)(?::[^@]*)?@([^/]+)(?:\\/[^/]+)*\\/(\\d+)\\/?$")).annotate({
11561 "expected": "a string matching the RegExp ^https:\\/\\/([^:@]+)(?::[^@]*)?@([^/]+)(?:\\/[^/]+)*\\/(\\d+)\\/?$"
11562 })
11563 ),
11564 "headers": Schema.optionalKey(
11565 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
11566 ),
11567 "otlpEndpoint": Schema.String
11568 }),
11569 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11570 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11571 "filter_rules": ObservabilityFilterRulesConfig,
11572 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11573 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11574 "description": "Human-readable name for the destination."
11575 }),
11576 "privacy_mode": Schema.Boolean.annotate({
11577 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11578 }),
11579 "sampling_rate": Schema.Number.annotate({
11580 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11581 "format": "double"
11582 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11583 "type": Schema.Literal("sentry"),
11584 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11585 "workspace_id": Schema.String.annotate({
11586 "description": "ID of the workspace this destination belongs to.",
11587 "format": "uuid"
11588 })
11589}).annotate({ "identifier": "ObservabilitySentryDestination" })
11590export type ObservabilitySnowflakeDestination = {
11591 readonly "api_key_hashes": ReadonlyArray<string> | null
11592 readonly "config": {
11593 readonly "account": string
11594 readonly "database"?: string
11595 readonly "headers"?: {}
11596 readonly "schema"?: string
11597 readonly "table"?: string
11598 readonly "token": string
11599 readonly "warehouse"?: string
11600 }
11601 readonly "created_at": string
11602 readonly "enabled": boolean
11603 readonly "filter_rules": ObservabilityFilterRulesConfig
11604 readonly "id": string
11605 readonly "name": string | null
11606 readonly "privacy_mode": boolean
11607 readonly "sampling_rate": number
11608 readonly "type": "snowflake"
11609 readonly "updated_at": string
11610 readonly "workspace_id": string
11611}
11612export const ObservabilitySnowflakeDestination = Schema.Struct({
11613 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11614 "description":
11615 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11616 }),
11617 "config": Schema.Struct({
11618 "account": Schema.String.check(
11619 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11620 ),
11621 "database": Schema.optionalKey(Schema.String),
11622 "headers": Schema.optionalKey(
11623 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
11624 ),
11625 "schema": Schema.optionalKey(Schema.String),
11626 "table": Schema.optionalKey(Schema.String),
11627 "token": Schema.String.check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })),
11628 "warehouse": Schema.optionalKey(Schema.String)
11629 }),
11630 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11631 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11632 "filter_rules": ObservabilityFilterRulesConfig,
11633 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11634 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11635 "description": "Human-readable name for the destination."
11636 }),
11637 "privacy_mode": Schema.Boolean.annotate({
11638 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11639 }),
11640 "sampling_rate": Schema.Number.annotate({
11641 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11642 "format": "double"
11643 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11644 "type": Schema.Literal("snowflake"),
11645 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11646 "workspace_id": Schema.String.annotate({
11647 "description": "ID of the workspace this destination belongs to.",
11648 "format": "uuid"
11649 })
11650}).annotate({ "identifier": "ObservabilitySnowflakeDestination" })
11651export type ObservabilityWeaveDestination = {
11652 readonly "api_key_hashes": ReadonlyArray<string> | null
11653 readonly "config": {
11654 readonly "apiKey": string
11655 readonly "baseUrl"?: string
11656 readonly "entity": string
11657 readonly "headers"?: {}
11658 readonly "project": string
11659 }
11660 readonly "created_at": string
11661 readonly "enabled": boolean
11662 readonly "filter_rules": ObservabilityFilterRulesConfig
11663 readonly "id": string
11664 readonly "name": string | null
11665 readonly "privacy_mode": boolean
11666 readonly "sampling_rate": number
11667 readonly "type": "weave"
11668 readonly "updated_at": string
11669 readonly "workspace_id": string
11670}
11671export const ObservabilityWeaveDestination = Schema.Struct({
11672 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11673 "description":
11674 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11675 }),
11676 "config": Schema.Struct({
11677 "apiKey": Schema.String.check(
11678 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11679 ),
11680 "baseUrl": Schema.optionalKey(Schema.String),
11681 "entity": Schema.String.check(
11682 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11683 ),
11684 "headers": Schema.optionalKey(
11685 Schema.Struct({}).annotate({ "description": "Custom HTTP headers to include in requests to this destination." })
11686 ),
11687 "project": Schema.String.check(
11688 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
11689 )
11690 }),
11691 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11692 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11693 "filter_rules": ObservabilityFilterRulesConfig,
11694 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11695 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11696 "description": "Human-readable name for the destination."
11697 }),
11698 "privacy_mode": Schema.Boolean.annotate({
11699 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11700 }),
11701 "sampling_rate": Schema.Number.annotate({
11702 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11703 "format": "double"
11704 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11705 "type": Schema.Literal("weave"),
11706 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11707 "workspace_id": Schema.String.annotate({
11708 "description": "ID of the workspace this destination belongs to.",
11709 "format": "uuid"
11710 })
11711}).annotate({ "identifier": "ObservabilityWeaveDestination" })
11712export type ObservabilityWebhookDestination = {
11713 readonly "api_key_hashes": ReadonlyArray<string> | null
11714 readonly "config": { readonly "headers"?: {}; readonly "method"?: "POST" | "PUT"; readonly "url": string }
11715 readonly "created_at": string
11716 readonly "enabled": boolean
11717 readonly "filter_rules": ObservabilityFilterRulesConfig
11718 readonly "id": string
11719 readonly "name": string | null
11720 readonly "privacy_mode": boolean
11721 readonly "sampling_rate": number
11722 readonly "type": "webhook"
11723 readonly "updated_at": string
11724 readonly "workspace_id": string
11725}
11726export const ObservabilityWebhookDestination = Schema.Struct({
11727 "api_key_hashes": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
11728 "description":
11729 "Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."
11730 }),
11731 "config": Schema.Struct({
11732 "headers": Schema.optionalKey(Schema.Struct({})),
11733 "method": Schema.optionalKey(Schema.Literals(["POST", "PUT"])),
11734 "url": Schema.String
11735 }),
11736 "created_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was created." }),
11737 "enabled": Schema.Boolean.annotate({ "description": "Whether this destination is currently enabled." }),
11738 "filter_rules": ObservabilityFilterRulesConfig,
11739 "id": Schema.String.annotate({ "description": "Stable public identifier for this destination.", "format": "uuid" }),
11740 "name": Schema.Union([Schema.String, Schema.Null]).annotate({
11741 "description": "Human-readable name for the destination."
11742 }),
11743 "privacy_mode": Schema.Boolean.annotate({
11744 "description": "When true, request/response bodies are not forwarded to this destination — only metadata."
11745 }),
11746 "sampling_rate": Schema.Number.annotate({
11747 "description": "Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%).",
11748 "format": "double"
11749 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
11750 "type": Schema.Literal("webhook"),
11751 "updated_at": Schema.String.annotate({ "description": "ISO timestamp of when the destination was last updated." }),
11752 "workspace_id": Schema.String.annotate({
11753 "description": "ID of the workspace this destination belongs to.",
11754 "format": "uuid"
11755 })
11756}).annotate({ "identifier": "ObservabilityWebhookDestination" })
11757export type ObservabilityFilterRulesConfigNullable = Objects_10 | null
11758export const ObservabilityFilterRulesConfigNullable = Schema.Union([Objects_10, Schema.Null]).annotate({
11759 "description": "Optional structured filter rules controlling which events are forwarded.",
11760 "identifier": "ObservabilityFilterRulesConfigNullable"
11761})
11762export type BaseTextDeltaEvent = {
11763 readonly "content_index": number
11764 readonly "delta": string
11765 readonly "item_id": string
11766 readonly "logprobs": ReadonlyArray<OpenResponsesLogProbs>
11767 readonly "output_index": number
11768 readonly "sequence_number": number
11769 readonly "type": "response.output_text.delta"
11770}
11771export const BaseTextDeltaEvent = Schema.Struct({
11772 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
11773 "delta": Schema.String,
11774 "item_id": Schema.String,
11775 "logprobs": Schema.Array(OpenResponsesLogProbs),
11776 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
11777 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
11778 "type": Schema.Literal("response.output_text.delta")
11779}).annotate({ "description": "Event emitted when a text delta is streamed", "identifier": "BaseTextDeltaEvent" })
11780export type BaseTextDoneEvent = {
11781 readonly "content_index": number
11782 readonly "item_id": string
11783 readonly "logprobs": ReadonlyArray<OpenResponsesLogProbs>
11784 readonly "output_index": number
11785 readonly "sequence_number": number
11786 readonly "text": string
11787 readonly "type": "response.output_text.done"
11788}
11789export const BaseTextDoneEvent = Schema.Struct({
11790 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
11791 "item_id": Schema.String,
11792 "logprobs": Schema.Array(OpenResponsesLogProbs),
11793 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
11794 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
11795 "text": Schema.String,
11796 "type": Schema.Literal("response.output_text.done")
11797}).annotate({ "description": "Event emitted when text streaming is complete", "identifier": "BaseTextDoneEvent" })
11798export type FileParserPlugin = {
11799 readonly "enabled"?: boolean
11800 readonly "id": "file-parser"
11801 readonly "pdf"?: PDFParserOptions
11802}
11803export const FileParserPlugin = Schema.Struct({
11804 "enabled": Schema.optionalKey(
11805 Schema.Boolean.annotate({
11806 "description": "Set to false to disable the file-parser plugin for this request. Defaults to true."
11807 })
11808 ),
11809 "id": Schema.Literal("file-parser"),
11810 "pdf": Schema.optionalKey(PDFParserOptions)
11811}).annotate({ "identifier": "FileParserPlugin" })
11812export type Objects_148 = {
11813 readonly "allow_fallbacks"?: boolean | null
11814 readonly "data_collection"?: "deny" | "allow" | null
11815 readonly "enforce_distillable_text"?: boolean | null
11816 readonly "ignore"?: ReadonlyArray<ProviderName | string> | null
11817 readonly "max_price"?: {
11818 readonly "audio"?: string
11819 readonly "completion"?: string
11820 readonly "image"?: string
11821 readonly "prompt"?: string
11822 readonly "request"?: string
11823 }
11824 readonly "only"?: ReadonlyArray<ProviderName | string> | null
11825 readonly "order"?: ReadonlyArray<ProviderName | string> | null
11826 readonly "preferred_max_latency"?: PreferredMaxLatency
11827 readonly "preferred_min_throughput"?: PreferredMinThroughput
11828 readonly "quantizations"?: ReadonlyArray<Quantization> | null
11829 readonly "require_parameters"?: boolean | null
11830 readonly "sort"?: ProviderSort | ProviderSortConfig | null
11831 readonly "zdr"?: boolean | null
11832}
11833export const Objects_148 = Schema.Struct({
11834 "allow_fallbacks": Schema.optionalKey(
11835 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
11836 "description":
11837 "Whether to allow backup providers to serve requests\n- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.\n- false: use only the primary/custom provider, and return the upstream error if it's unavailable.\n"
11838 })
11839 ),
11840 "data_collection": Schema.optionalKey(
11841 Schema.Union([Schema.Literal("deny"), Schema.Literal("allow"), Schema.Null]).annotate({
11842 "description":
11843 "Data collection setting. If no available model provider meets the requirement, your request will return an error.\n- allow: (default) allow providers which store user data non-transiently and may train on it\n\n- deny: use only providers which do not collect user data."
11844 })
11845 ),
11846 "enforce_distillable_text": Schema.optionalKey(
11847 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
11848 "description":
11849 "Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used."
11850 })
11851 ),
11852 "ignore": Schema.optionalKey(
11853 Schema.Union([Schema.Array(Schema.Union([ProviderName, Schema.String])), Schema.Null]).annotate({
11854 "description":
11855 "List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."
11856 })
11857 ),
11858 "max_price": Schema.optionalKey(
11859 Schema.Struct({
11860 "audio": Schema.optionalKey(Schema.String.annotate({ "description": "Maximum price in USD per audio unit" })),
11861 "completion": Schema.optionalKey(
11862 Schema.String.annotate({ "description": "Maximum price in USD per million completion tokens" })
11863 ),
11864 "image": Schema.optionalKey(Schema.String.annotate({ "description": "Maximum price in USD per image" })),
11865 "prompt": Schema.optionalKey(
11866 Schema.String.annotate({ "description": "Maximum price in USD per million prompt tokens" })
11867 ),
11868 "request": Schema.optionalKey(Schema.String.annotate({ "description": "Maximum price in USD per request" }))
11869 }).annotate({
11870 "description":
11871 "The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."
11872 })
11873 ),
11874 "only": Schema.optionalKey(
11875 Schema.Union([Schema.Array(Schema.Union([ProviderName, Schema.String])), Schema.Null]).annotate({
11876 "description":
11877 "List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."
11878 })
11879 ),
11880 "order": Schema.optionalKey(
11881 Schema.Union([Schema.Array(Schema.Union([ProviderName, Schema.String])), Schema.Null]).annotate({
11882 "description":
11883 "An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."
11884 })
11885 ),
11886 "preferred_max_latency": Schema.optionalKey(PreferredMaxLatency),
11887 "preferred_min_throughput": Schema.optionalKey(PreferredMinThroughput),
11888 "quantizations": Schema.optionalKey(
11889 Schema.Union([Schema.Array(Quantization), Schema.Null]).annotate({
11890 "description": "A list of quantization levels to filter the provider by."
11891 })
11892 ),
11893 "require_parameters": Schema.optionalKey(
11894 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
11895 "description":
11896 "Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest."
11897 })
11898 ),
11899 "sort": Schema.optionalKey(
11900 Schema.Union([ProviderSort, ProviderSortConfig, Schema.Null]).annotate({
11901 "description":
11902 "The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."
11903 })
11904 ),
11905 "zdr": Schema.optionalKey(
11906 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
11907 "description":
11908 "Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."
11909 })
11910 )
11911})
11912export type Arrays_11 = ReadonlyArray<PipelineStage>
11913export const Arrays_11 = Schema.Array(PipelineStage)
11914export type Prediction = Objects_17 | null
11915export const Prediction = Schema.Union([Objects_17, Schema.Null]).annotate({
11916 "description":
11917 "Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.",
11918 "identifier": "Prediction"
11919})
11920export type ListPresetsResponse = { readonly "data": ReadonlyArray<Preset>; readonly "total_count": number }
11921export const ListPresetsResponse = Schema.Struct({
11922 "data": Schema.Array(Preset),
11923 "total_count": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
11924}).annotate({ "description": "A paginated list of presets.", "identifier": "ListPresetsResponse" })
11925export type CreatePresetFromInferenceResponse = { readonly "data": PresetWithDesignatedVersion }
11926export const CreatePresetFromInferenceResponse = Schema.Struct({ "data": PresetWithDesignatedVersion }).annotate({
11927 "description": "Response containing the created preset with its designated version.",
11928 "identifier": "CreatePresetFromInferenceResponse"
11929})
11930export type GetPresetResponse = { readonly "data": PresetWithDesignatedVersion }
11931export const GetPresetResponse = Schema.Struct({ "data": PresetWithDesignatedVersion }).annotate({
11932 "description": "A preset with its currently designated version.",
11933 "identifier": "GetPresetResponse"
11934})
11935export type ChatContentText = {
11936 readonly "cache_control"?: ChatContentCacheControl
11937 readonly "prompt_cache_breakpoint"?: PromptCacheBreakpoint
11938 readonly "text": string
11939 readonly "type": "text"
11940}
11941export const ChatContentText = Schema.Struct({
11942 "cache_control": Schema.optionalKey(ChatContentCacheControl),
11943 "prompt_cache_breakpoint": Schema.optionalKey(PromptCacheBreakpoint),
11944 "text": Schema.String,
11945 "type": Schema.Literal("text")
11946}).annotate({ "description": "Text content part", "identifier": "ChatContentText" })
11947export type CustomToolCallOutputItem = {
11948 readonly "call_id": string
11949 readonly "id"?: string
11950 readonly "output":
11951 | string
11952 | ReadonlyArray<
11953 {
11954 readonly "prompt_cache_breakpoint"?: { readonly "mode": "explicit"; readonly [x: string]: Schema.Json } | null
11955 readonly "text": string
11956 readonly "type": "input_text"
11957 } | {
11958 readonly "detail": "auto" | "high" | "low" | "original"
11959 readonly "image_url"?: string | null
11960 readonly "type": never
11961 readonly "prompt_cache_breakpoint"?: PromptCacheBreakpoint
11962 readonly "text": string
11963 } | {
11964 readonly "file_data"?: string
11965 readonly "file_id"?: string | null
11966 readonly "file_url"?: string
11967 readonly "filename"?: string
11968 readonly "type": never
11969 readonly "prompt_cache_breakpoint"?: PromptCacheBreakpoint
11970 readonly "text": string
11971 } | {
11972 readonly "prompt_cache_breakpoint"?: PromptCacheBreakpoint
11973 readonly "text": string
11974 readonly "type": never
11975 readonly "detail": "auto" | "high" | "low" | "original"
11976 readonly "image_url"?: string | null
11977 } | {
11978 readonly "detail": "auto" | "high" | "low" | "original"
11979 readonly "image_url"?: string | null
11980 readonly "type": "input_image"
11981 } | {
11982 readonly "file_data"?: string
11983 readonly "file_id"?: string | null
11984 readonly "file_url"?: string
11985 readonly "filename"?: string
11986 readonly "type": never
11987 readonly "detail": "auto" | "high" | "low" | "original"
11988 readonly "image_url"?: string | null
11989 } | {
11990 readonly "prompt_cache_breakpoint"?: PromptCacheBreakpoint
11991 readonly "text": string
11992 readonly "type": never
11993 readonly "file_data"?: string
11994 readonly "file_id"?: string | null
11995 readonly "file_url"?: string
11996 readonly "filename"?: string
11997 } | {
11998 readonly "detail": "auto" | "high" | "low" | "original"
11999 readonly "image_url"?: string | null
12000 readonly "type": never
12001 readonly "file_data"?: string
12002 readonly "file_id"?: string | null
12003 readonly "file_url"?: string
12004 readonly "filename"?: string
12005 } | {
12006 readonly "file_data"?: string
12007 readonly "file_id"?: string | null
12008 readonly "file_url"?: string
12009 readonly "filename"?: string
12010 readonly "type": "input_file"
12011 }
12012 >
12013 readonly "type": "custom_tool_call_output"
12014}
12015export const CustomToolCallOutputItem = Schema.Struct({
12016 "call_id": Schema.String,
12017 "id": Schema.optionalKey(Schema.String),
12018 "output": Schema.Union([
12019 Schema.Union([Schema.String]),
12020 Schema.Union([Schema.Array(Schema.Union([
12021 Schema.Union([
12022 Schema.Struct({
12023 "prompt_cache_breakpoint": Schema.optionalKey(
12024 Schema.Union([
12025 Schema.Union([
12026 Schema.StructWithRest(Schema.Struct({ "mode": Schema.Literal("explicit") }), [
12027 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))
12028 ])
12029 ]).annotate({
12030 "description":
12031 "Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically."
12032 }),
12033 Schema.Union([Schema.Null]).annotate({
12034 "description":
12035 "Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically."
12036 })
12037 ]).annotate({
12038 "description":
12039 "Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically."
12040 })
12041 ),
12042 "text": Schema.String,
12043 "type": Schema.Literal("input_text")
12044 }).annotate({ "description": "Text input content item" }),
12045 Schema.Struct({
12046 "detail": Schema.Literals(["auto", "high", "low", "original"]),
12047 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12048 "type": Schema.Never,
12049 "prompt_cache_breakpoint": Schema.optionalKey(PromptCacheBreakpoint),
12050 "text": Schema.String
12051 }).annotate({ "description": "Text input content item" }),
12052 Schema.Struct({
12053 "file_data": Schema.optionalKey(Schema.String),
12054 "file_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12055 "file_url": Schema.optionalKey(Schema.String),
12056 "filename": Schema.optionalKey(Schema.String),
12057 "type": Schema.Never,
12058 "prompt_cache_breakpoint": Schema.optionalKey(PromptCacheBreakpoint),
12059 "text": Schema.String
12060 }).annotate({ "description": "Text input content item" })
12061 ], { mode: "oneOf" }),
12062 Schema.Union([
12063 Schema.Struct({
12064 "prompt_cache_breakpoint": Schema.optionalKey(PromptCacheBreakpoint),
12065 "text": Schema.String,
12066 "type": Schema.Never,
12067 "detail": Schema.Literals(["auto", "high", "low", "original"]),
12068 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
12069 }).annotate({ "description": "Image input content item" }),
12070 Schema.Struct({
12071 "detail": Schema.Union([
12072 Schema.Literal("auto"),
12073 Schema.Literal("high"),
12074 Schema.Literal("low"),
12075 Schema.Literal("original")
12076 ]),
12077 "image_url": Schema.optionalKey(Schema.Union([Schema.Union([Schema.String]), Schema.Union([Schema.Null])])),
12078 "type": Schema.Literal("input_image")
12079 }).annotate({ "description": "Image input content item" }),
12080 Schema.Struct({
12081 "file_data": Schema.optionalKey(Schema.String),
12082 "file_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12083 "file_url": Schema.optionalKey(Schema.String),
12084 "filename": Schema.optionalKey(Schema.String),
12085 "type": Schema.Never,
12086 "detail": Schema.Literals(["auto", "high", "low", "original"]),
12087 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
12088 }).annotate({ "description": "Image input content item" })
12089 ], { mode: "oneOf" }),
12090 Schema.Union([
12091 Schema.Struct({
12092 "prompt_cache_breakpoint": Schema.optionalKey(PromptCacheBreakpoint),
12093 "text": Schema.String,
12094 "type": Schema.Never,
12095 "file_data": Schema.optionalKey(Schema.String),
12096 "file_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12097 "file_url": Schema.optionalKey(Schema.String),
12098 "filename": Schema.optionalKey(Schema.String)
12099 }).annotate({ "description": "File input content item" }),
12100 Schema.Struct({
12101 "detail": Schema.Literals(["auto", "high", "low", "original"]),
12102 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12103 "type": Schema.Never,
12104 "file_data": Schema.optionalKey(Schema.String),
12105 "file_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12106 "file_url": Schema.optionalKey(Schema.String),
12107 "filename": Schema.optionalKey(Schema.String)
12108 }).annotate({ "description": "File input content item" }),
12109 Schema.Struct({
12110 "file_data": Schema.optionalKey(Schema.String),
12111 "file_id": Schema.optionalKey(Schema.Union([Schema.Union([Schema.String]), Schema.Union([Schema.Null])])),
12112 "file_url": Schema.optionalKey(Schema.String),
12113 "filename": Schema.optionalKey(Schema.String),
12114 "type": Schema.Literal("input_file")
12115 }).annotate({ "description": "File input content item" })
12116 ], { mode: "oneOf" })
12117 ], { mode: "oneOf" }))])
12118 ]),
12119 "type": Schema.Literal("custom_tool_call_output")
12120}).annotate({
12121 "description":
12122 "The output from a custom (freeform-grammar) tool call execution. Mirrors `function_call_output` but is matched to a `custom_tool_call` rather than a `function_call`.",
12123 "identifier": "CustomToolCallOutputItem"
12124})
12125export type FunctionCallOutputItem = {
12126 readonly "call_id": string
12127 readonly "id"?: string | null
12128 readonly "output":
12129 | string
12130 | ReadonlyArray<
12131 {
12132 readonly "prompt_cache_breakpoint"?: { readonly "mode": "explicit"; readonly [x: string]: Schema.Json } | null
12133 readonly "text": string
12134 readonly "type": "input_text"
12135 } | {
12136 readonly "detail": "auto" | "high" | "low" | "original"
12137 readonly "image_url"?: string | null
12138 readonly "type": never
12139 readonly "prompt_cache_breakpoint"?: PromptCacheBreakpoint
12140 readonly "text": string
12141 } | {
12142 readonly "file_data"?: string
12143 readonly "file_id"?: string | null
12144 readonly "file_url"?: string
12145 readonly "filename"?: string
12146 readonly "type": never
12147 readonly "prompt_cache_breakpoint"?: PromptCacheBreakpoint
12148 readonly "text": string
12149 } | {
12150 readonly "prompt_cache_breakpoint"?: PromptCacheBreakpoint
12151 readonly "text": string
12152 readonly "type": never
12153 readonly "detail": "auto" | "high" | "low" | "original"
12154 readonly "image_url"?: string | null
12155 } | {
12156 readonly "detail": "auto" | "high" | "low" | "original"
12157 readonly "image_url"?: string | null
12158 readonly "type": "input_image"
12159 } | {
12160 readonly "file_data"?: string
12161 readonly "file_id"?: string | null
12162 readonly "file_url"?: string
12163 readonly "filename"?: string
12164 readonly "type": never
12165 readonly "detail": "auto" | "high" | "low" | "original"
12166 readonly "image_url"?: string | null
12167 } | {
12168 readonly "prompt_cache_breakpoint"?: PromptCacheBreakpoint
12169 readonly "text": string
12170 readonly "type": never
12171 readonly "file_data"?: string
12172 readonly "file_id"?: string | null
12173 readonly "file_url"?: string
12174 readonly "filename"?: string
12175 } | {
12176 readonly "detail": "auto" | "high" | "low" | "original"
12177 readonly "image_url"?: string | null
12178 readonly "type": never
12179 readonly "file_data"?: string
12180 readonly "file_id"?: string | null
12181 readonly "file_url"?: string
12182 readonly "filename"?: string
12183 } | {
12184 readonly "file_data"?: string
12185 readonly "file_id"?: string | null
12186 readonly "file_url"?: string
12187 readonly "filename"?: string
12188 readonly "type": "input_file"
12189 }
12190 >
12191 readonly "status"?: ToolCallStatus | null
12192 readonly "type": "function_call_output"
12193}
12194export const FunctionCallOutputItem = Schema.Struct({
12195 "call_id": Schema.String,
12196 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12197 "output": Schema.Union([
12198 Schema.Union([Schema.String]),
12199 Schema.Union([Schema.Array(Schema.Union([
12200 Schema.Union([
12201 Schema.Struct({
12202 "prompt_cache_breakpoint": Schema.optionalKey(
12203 Schema.Union([
12204 Schema.Union([
12205 Schema.StructWithRest(Schema.Struct({ "mode": Schema.Literal("explicit") }), [
12206 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))
12207 ])
12208 ]).annotate({
12209 "description":
12210 "Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically."
12211 }),
12212 Schema.Union([Schema.Null]).annotate({
12213 "description":
12214 "Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically."
12215 })
12216 ]).annotate({
12217 "description":
12218 "Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically."
12219 })
12220 ),
12221 "text": Schema.String,
12222 "type": Schema.Literal("input_text")
12223 }).annotate({ "description": "Text input content item" }),
12224 Schema.Struct({
12225 "detail": Schema.Literals(["auto", "high", "low", "original"]),
12226 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12227 "type": Schema.Never,
12228 "prompt_cache_breakpoint": Schema.optionalKey(PromptCacheBreakpoint),
12229 "text": Schema.String
12230 }).annotate({ "description": "Text input content item" }),
12231 Schema.Struct({
12232 "file_data": Schema.optionalKey(Schema.String),
12233 "file_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12234 "file_url": Schema.optionalKey(Schema.String),
12235 "filename": Schema.optionalKey(Schema.String),
12236 "type": Schema.Never,
12237 "prompt_cache_breakpoint": Schema.optionalKey(PromptCacheBreakpoint),
12238 "text": Schema.String
12239 }).annotate({ "description": "Text input content item" })
12240 ], { mode: "oneOf" }),
12241 Schema.Union([
12242 Schema.Struct({
12243 "prompt_cache_breakpoint": Schema.optionalKey(PromptCacheBreakpoint),
12244 "text": Schema.String,
12245 "type": Schema.Never,
12246 "detail": Schema.Literals(["auto", "high", "low", "original"]),
12247 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
12248 }).annotate({ "description": "Image input content item" }),
12249 Schema.Struct({
12250 "detail": Schema.Union([
12251 Schema.Literal("auto"),
12252 Schema.Literal("high"),
12253 Schema.Literal("low"),
12254 Schema.Literal("original")
12255 ]),
12256 "image_url": Schema.optionalKey(Schema.Union([Schema.Union([Schema.String]), Schema.Union([Schema.Null])])),
12257 "type": Schema.Literal("input_image")
12258 }).annotate({ "description": "Image input content item" }),
12259 Schema.Struct({
12260 "file_data": Schema.optionalKey(Schema.String),
12261 "file_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12262 "file_url": Schema.optionalKey(Schema.String),
12263 "filename": Schema.optionalKey(Schema.String),
12264 "type": Schema.Never,
12265 "detail": Schema.Literals(["auto", "high", "low", "original"]),
12266 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
12267 }).annotate({ "description": "Image input content item" })
12268 ], { mode: "oneOf" }),
12269 Schema.Union([
12270 Schema.Struct({
12271 "prompt_cache_breakpoint": Schema.optionalKey(PromptCacheBreakpoint),
12272 "text": Schema.String,
12273 "type": Schema.Never,
12274 "file_data": Schema.optionalKey(Schema.String),
12275 "file_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12276 "file_url": Schema.optionalKey(Schema.String),
12277 "filename": Schema.optionalKey(Schema.String)
12278 }).annotate({ "description": "File input content item" }),
12279 Schema.Struct({
12280 "detail": Schema.Literals(["auto", "high", "low", "original"]),
12281 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12282 "type": Schema.Never,
12283 "file_data": Schema.optionalKey(Schema.String),
12284 "file_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
12285 "file_url": Schema.optionalKey(Schema.String),
12286 "filename": Schema.optionalKey(Schema.String)
12287 }).annotate({ "description": "File input content item" }),
12288 Schema.Struct({
12289 "file_data": Schema.optionalKey(Schema.String),
12290 "file_id": Schema.optionalKey(Schema.Union([Schema.Union([Schema.String]), Schema.Union([Schema.Null])])),
12291 "file_url": Schema.optionalKey(Schema.String),
12292 "filename": Schema.optionalKey(Schema.String),
12293 "type": Schema.Literal("input_file")
12294 }).annotate({ "description": "File input content item" })
12295 ], { mode: "oneOf" })
12296 ], { mode: "oneOf" }))])
12297 ]),
12298 "status": Schema.optionalKey(Schema.Union([ToolCallStatus, Schema.Null])),
12299 "type": Schema.Literal("function_call_output")
12300}).annotate({ "description": "The output from a function call execution", "identifier": "FunctionCallOutputItem" })
12301export type InputText = {
12302 readonly "prompt_cache_breakpoint"?: PromptCacheBreakpoint
12303 readonly "text": string
12304 readonly "type": "input_text"
12305}
12306export const InputText = Schema.Struct({
12307 "prompt_cache_breakpoint": Schema.optionalKey(PromptCacheBreakpoint),
12308 "text": Schema.String,
12309 "type": Schema.Literal("input_text")
12310}).annotate({ "description": "Text input content item", "identifier": "InputText" })
12311export type Guardrail = {
12312 readonly "allowed_models"?: ReadonlyArray<string> | null
12313 readonly "allowed_providers"?: ReadonlyArray<string> | null
12314 readonly "content_filter_builtins"?: ReadonlyArray<ContentFilterBuiltinEntry> | null
12315 readonly "content_filters"?: ReadonlyArray<ContentFilterEntry> | null
12316 readonly "created_at": string
12317 readonly "description"?: string | null
12318 readonly "enforce_zdr"?: boolean | null
12319 readonly "enforce_zdr_anthropic"?: boolean | null
12320 readonly "enforce_zdr_google"?: boolean | null
12321 readonly "enforce_zdr_openai"?: boolean | null
12322 readonly "enforce_zdr_other"?: boolean | null
12323 readonly "enforce_zdr_xai"?: boolean | null
12324 readonly "id": string
12325 readonly "ignored_models"?: ReadonlyArray<string> | null
12326 readonly "ignored_providers"?: ReadonlyArray<string> | null
12327 readonly "limit_usd"?: number | null
12328 readonly "name": string
12329 readonly "reset_interval"?: GuardrailInterval
12330 readonly "updated_at"?: string | null
12331 readonly "workspace_id": string
12332}
12333export const Guardrail = Schema.Struct({
12334 "allowed_models": Schema.optionalKey(
12335 Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
12336 "description": "Array of model canonical_slugs (immutable identifiers)"
12337 })
12338 ),
12339 "allowed_providers": Schema.optionalKey(
12340 Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({ "description": "List of allowed provider IDs" })
12341 ),
12342 "content_filter_builtins": Schema.optionalKey(
12343 Schema.Union([Schema.Array(ContentFilterBuiltinEntry), Schema.Null]).annotate({
12344 "description":
12345 "Builtin content filters applied to requests. Includes PII detectors and the regex-based prompt injection detector."
12346 })
12347 ),
12348 "content_filters": Schema.optionalKey(
12349 Schema.Union([Schema.Array(ContentFilterEntry), Schema.Null]).annotate({
12350 "description": "Custom regex content filters applied to request messages"
12351 })
12352 ),
12353 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the guardrail was created" }),
12354 "description": Schema.optionalKey(
12355 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Description of the guardrail" })
12356 ),
12357 "enforce_zdr": Schema.optionalKey(
12358 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12359 "description":
12360 "Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request."
12361 })
12362 ),
12363 "enforce_zdr_anthropic": Schema.optionalKey(
12364 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12365 "description":
12366 "Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided."
12367 })
12368 ),
12369 "enforce_zdr_google": Schema.optionalKey(
12370 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12371 "description":
12372 "Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided."
12373 })
12374 ),
12375 "enforce_zdr_openai": Schema.optionalKey(
12376 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12377 "description":
12378 "Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided."
12379 })
12380 ),
12381 "enforce_zdr_other": Schema.optionalKey(
12382 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12383 "description":
12384 "Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided."
12385 })
12386 ),
12387 "enforce_zdr_xai": Schema.optionalKey(
12388 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12389 "description":
12390 "Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided."
12391 })
12392 ),
12393 "id": Schema.String.annotate({ "description": "Unique identifier for the guardrail", "format": "uuid" }),
12394 "ignored_models": Schema.optionalKey(
12395 Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
12396 "description": "Array of model canonical_slugs to exclude from routing"
12397 })
12398 ),
12399 "ignored_providers": Schema.optionalKey(
12400 Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
12401 "description": "List of provider IDs to exclude from routing"
12402 })
12403 ),
12404 "limit_usd": Schema.optionalKey(
12405 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
12406 .annotate({ "description": "Spending limit in USD", "format": "double" })
12407 ),
12408 "name": Schema.String.annotate({ "description": "Name of the guardrail" }),
12409 "reset_interval": Schema.optionalKey(GuardrailInterval),
12410 "updated_at": Schema.optionalKey(
12411 Schema.Union([Schema.String, Schema.Null]).annotate({
12412 "description": "ISO 8601 timestamp of when the guardrail was last updated"
12413 })
12414 ),
12415 "workspace_id": Schema.String.annotate({ "description": "The workspace ID this guardrail belongs to." })
12416}).annotate({ "identifier": "Guardrail" })
12417export type CreateGuardrailRequest = {
12418 readonly "allowed_models"?: ReadonlyArray<string> | null
12419 readonly "allowed_providers"?: ReadonlyArray<string> | null
12420 readonly "content_filter_builtins"?: ReadonlyArray<ContentFilterBuiltinEntryInput> | null
12421 readonly "content_filters"?: ReadonlyArray<ContentFilterEntry> | null
12422 readonly "description"?: string | null
12423 readonly "enforce_zdr"?: boolean | null
12424 readonly "enforce_zdr_anthropic"?: boolean | null
12425 readonly "enforce_zdr_google"?: boolean | null
12426 readonly "enforce_zdr_openai"?: boolean | null
12427 readonly "enforce_zdr_other"?: boolean | null
12428 readonly "enforce_zdr_xai"?: boolean | null
12429 readonly "ignored_models"?: ReadonlyArray<string> | null
12430 readonly "ignored_providers"?: ReadonlyArray<string> | null
12431 readonly "limit_usd"?: number | null
12432 readonly "name": string
12433 readonly "reset_interval"?: GuardrailInterval
12434 readonly "workspace_id"?: string
12435}
12436export const CreateGuardrailRequest = Schema.Struct({
12437 "allowed_models": Schema.optionalKey(
12438 Schema.Union([
12439 Schema.Array(Schema.String).check(
12440 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
12441 ),
12442 Schema.Null
12443 ]).annotate({ "description": "Array of model identifiers (slug or canonical_slug accepted)" })
12444 ),
12445 "allowed_providers": Schema.optionalKey(
12446 Schema.Union([
12447 Schema.Array(Schema.String).check(
12448 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
12449 ),
12450 Schema.Null
12451 ]).annotate({ "description": "List of allowed provider IDs" })
12452 ),
12453 "content_filter_builtins": Schema.optionalKey(
12454 Schema.Union([Schema.Array(ContentFilterBuiltinEntryInput), Schema.Null]).annotate({
12455 "description":
12456 "Builtin content filters to apply. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action."
12457 })
12458 ),
12459 "content_filters": Schema.optionalKey(
12460 Schema.Union([Schema.Array(ContentFilterEntry), Schema.Null]).annotate({
12461 "description": "Custom regex content filters to apply to request messages"
12462 })
12463 ),
12464 "description": Schema.optionalKey(
12465 Schema.Union([
12466 Schema.String.check(Schema.isMaxLength(1000).annotate({ "expected": "a value with a length of at most 1000" })),
12467 Schema.Null
12468 ]).annotate({ "description": "Description of the guardrail" })
12469 ),
12470 "enforce_zdr": Schema.optionalKey(
12471 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12472 "description":
12473 "Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request."
12474 })
12475 ),
12476 "enforce_zdr_anthropic": Schema.optionalKey(
12477 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12478 "description":
12479 "Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided."
12480 })
12481 ),
12482 "enforce_zdr_google": Schema.optionalKey(
12483 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12484 "description":
12485 "Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided."
12486 })
12487 ),
12488 "enforce_zdr_openai": Schema.optionalKey(
12489 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12490 "description":
12491 "Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided."
12492 })
12493 ),
12494 "enforce_zdr_other": Schema.optionalKey(
12495 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12496 "description":
12497 "Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided."
12498 })
12499 ),
12500 "enforce_zdr_xai": Schema.optionalKey(
12501 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12502 "description":
12503 "Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided."
12504 })
12505 ),
12506 "ignored_models": Schema.optionalKey(
12507 Schema.Union([
12508 Schema.Array(Schema.String).check(
12509 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
12510 ),
12511 Schema.Null
12512 ]).annotate({
12513 "description": "Array of model identifiers to exclude from routing (slug or canonical_slug accepted)"
12514 })
12515 ),
12516 "ignored_providers": Schema.optionalKey(
12517 Schema.Union([
12518 Schema.Array(Schema.String).check(
12519 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
12520 ),
12521 Schema.Null
12522 ]).annotate({ "description": "List of provider IDs to exclude from routing" })
12523 ),
12524 "limit_usd": Schema.optionalKey(
12525 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
12526 .annotate({ "description": "Spending limit in USD", "format": "double" })
12527 ),
12528 "name": Schema.String.annotate({ "description": "Name for the new guardrail" }).check(
12529 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
12530 ).check(Schema.isMaxLength(200).annotate({ "expected": "a value with a length of at most 200" })),
12531 "reset_interval": Schema.optionalKey(GuardrailInterval),
12532 "workspace_id": Schema.optionalKey(
12533 Schema.String.annotate({
12534 "description": "The workspace to create the guardrail in. Defaults to the default workspace if not provided.",
12535 "format": "uuid"
12536 })
12537 )
12538}).annotate({ "identifier": "CreateGuardrailRequest" })
12539export type UpdateGuardrailRequest = {
12540 readonly "allowed_models"?: ReadonlyArray<string> | null
12541 readonly "allowed_providers"?: ReadonlyArray<string> | null
12542 readonly "content_filter_builtins"?: ReadonlyArray<ContentFilterBuiltinEntryInput> | null
12543 readonly "content_filters"?: ReadonlyArray<ContentFilterEntry> | null
12544 readonly "description"?: string | null
12545 readonly "enforce_zdr"?: boolean | null
12546 readonly "enforce_zdr_anthropic"?: boolean | null
12547 readonly "enforce_zdr_google"?: boolean | null
12548 readonly "enforce_zdr_openai"?: boolean | null
12549 readonly "enforce_zdr_other"?: boolean | null
12550 readonly "enforce_zdr_xai"?: boolean | null
12551 readonly "ignored_models"?: ReadonlyArray<string> | null
12552 readonly "ignored_providers"?: ReadonlyArray<string> | null
12553 readonly "limit_usd"?: number | null
12554 readonly "name"?: string
12555 readonly "reset_interval"?: GuardrailInterval
12556}
12557export const UpdateGuardrailRequest = Schema.Struct({
12558 "allowed_models": Schema.optionalKey(
12559 Schema.Union([
12560 Schema.Array(Schema.String).check(
12561 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
12562 ),
12563 Schema.Null
12564 ]).annotate({ "description": "Array of model identifiers (slug or canonical_slug accepted)" })
12565 ),
12566 "allowed_providers": Schema.optionalKey(
12567 Schema.Union([
12568 Schema.Array(Schema.String).check(
12569 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
12570 ),
12571 Schema.Null
12572 ]).annotate({ "description": "New list of allowed provider IDs" })
12573 ),
12574 "content_filter_builtins": Schema.optionalKey(
12575 Schema.Union([Schema.Array(ContentFilterBuiltinEntryInput), Schema.Null]).annotate({
12576 "description":
12577 "Builtin content filters to apply. Set to null to remove. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action."
12578 })
12579 ),
12580 "content_filters": Schema.optionalKey(
12581 Schema.Union([Schema.Array(ContentFilterEntry), Schema.Null]).annotate({
12582 "description": "Custom regex content filters to apply. Set to null to remove."
12583 })
12584 ),
12585 "description": Schema.optionalKey(
12586 Schema.Union([
12587 Schema.String.check(Schema.isMaxLength(1000).annotate({ "expected": "a value with a length of at most 1000" })),
12588 Schema.Null
12589 ]).annotate({ "description": "New description for the guardrail" })
12590 ),
12591 "enforce_zdr": Schema.optionalKey(
12592 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12593 "description":
12594 "Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request."
12595 })
12596 ),
12597 "enforce_zdr_anthropic": Schema.optionalKey(
12598 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12599 "description":
12600 "Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided."
12601 })
12602 ),
12603 "enforce_zdr_google": Schema.optionalKey(
12604 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12605 "description":
12606 "Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided."
12607 })
12608 ),
12609 "enforce_zdr_openai": Schema.optionalKey(
12610 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12611 "description":
12612 "Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided."
12613 })
12614 ),
12615 "enforce_zdr_other": Schema.optionalKey(
12616 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12617 "description":
12618 "Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided."
12619 })
12620 ),
12621 "enforce_zdr_xai": Schema.optionalKey(
12622 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12623 "description":
12624 "Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided."
12625 })
12626 ),
12627 "ignored_models": Schema.optionalKey(
12628 Schema.Union([
12629 Schema.Array(Schema.String).check(
12630 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
12631 ),
12632 Schema.Null
12633 ]).annotate({
12634 "description": "Array of model identifiers to exclude from routing (slug or canonical_slug accepted)"
12635 })
12636 ),
12637 "ignored_providers": Schema.optionalKey(
12638 Schema.Union([
12639 Schema.Array(Schema.String).check(
12640 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
12641 ),
12642 Schema.Null
12643 ]).annotate({ "description": "List of provider IDs to exclude from routing" })
12644 ),
12645 "limit_usd": Schema.optionalKey(
12646 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
12647 .annotate({ "description": "New spending limit in USD", "format": "double" })
12648 ),
12649 "name": Schema.optionalKey(
12650 Schema.String.annotate({ "description": "New name for the guardrail" }).check(
12651 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
12652 ).check(Schema.isMaxLength(200).annotate({ "expected": "a value with a length of at most 200" }))
12653 ),
12654 "reset_interval": Schema.optionalKey(GuardrailInterval)
12655}).annotate({ "identifier": "UpdateGuardrailRequest" })
12656export type SpeechRequest = {
12657 readonly "input": string
12658 readonly "model": string
12659 readonly "provider"?: { readonly "options"?: ProviderOptions }
12660 readonly "response_format"?: "mp3" | "pcm"
12661 readonly "speed"?: number
12662 readonly "voice": string
12663}
12664export const SpeechRequest = Schema.Struct({
12665 "input": Schema.String.annotate({ "description": "Text to synthesize" }),
12666 "model": Schema.String.annotate({ "description": "TTS model identifier" }),
12667 "provider": Schema.optionalKey(
12668 Schema.Struct({ "options": Schema.optionalKey(ProviderOptions) }).annotate({
12669 "description": "Provider-specific passthrough configuration"
12670 })
12671 ),
12672 "response_format": Schema.optionalKey(
12673 Schema.Literals(["mp3", "pcm"]).annotate({ "description": "Audio output format" })
12674 ),
12675 "speed": Schema.optionalKey(
12676 Schema.Number.annotate({
12677 "description":
12678 "Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers.",
12679 "format": "double"
12680 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
12681 ),
12682 "voice": Schema.String.annotate({ "description": "Voice identifier (provider-specific)." })
12683}).annotate({ "description": "Text-to-speech request input", "identifier": "SpeechRequest" })
12684export type STTRequest = {
12685 readonly "input_audio": STTInputAudio
12686 readonly "language"?: string
12687 readonly "model": string
12688 readonly "provider"?: { readonly "options"?: ProviderOptions }
12689 readonly "response_format"?: "json" | "verbose_json"
12690 readonly "temperature"?: number
12691 readonly "timestamp_granularities"?: ReadonlyArray<STTTimestampGranularity>
12692}
12693export const STTRequest = Schema.Struct({
12694 "input_audio": STTInputAudio,
12695 "language": Schema.optionalKey(
12696 Schema.String.annotate({
12697 "description": "ISO-639-1 language code (e.g., \"en\", \"ja\"). Auto-detected if omitted."
12698 })
12699 ),
12700 "model": Schema.String.annotate({ "description": "STT model identifier" }),
12701 "provider": Schema.optionalKey(
12702 Schema.Struct({ "options": Schema.optionalKey(ProviderOptions) }).annotate({
12703 "description": "Provider-specific passthrough configuration"
12704 })
12705 ),
12706 "response_format": Schema.optionalKey(
12707 Schema.Literals(["json", "verbose_json"]).annotate({
12708 "description":
12709 "Output format. \"json\" (default) returns { text, usage }. \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers."
12710 })
12711 ),
12712 "temperature": Schema.optionalKey(
12713 Schema.Number.annotate({ "description": "Sampling temperature for transcription", "format": "double" }).check(
12714 Schema.isFinite().annotate({ "expected": "a finite number" })
12715 )
12716 ),
12717 "timestamp_granularities": Schema.optionalKey(
12718 Schema.Array(STTTimestampGranularity).annotate({
12719 "description":
12720 "Timestamp detail levels to include when response_format is \"verbose_json\". \"segment\" returns segment-level timestamps; \"word\" additionally returns word-level timestamps in the words array. Ignored unless response_format is \"verbose_json\"."
12721 })
12722 )
12723}).annotate({
12724 "description": "Speech-to-text request input. Accepts a JSON body with input_audio containing base64-encoded audio.",
12725 "identifier": "STTRequest"
12726})
12727export type VideoGenerationRequest = {
12728 readonly "aspect_ratio"?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "21:9" | "9:21"
12729 readonly "callback_url"?: string
12730 readonly "duration"?: number
12731 readonly "frame_images"?: ReadonlyArray<FrameImage>
12732 readonly "generate_audio"?: boolean
12733 readonly "input_references"?: ReadonlyArray<InputReference>
12734 readonly "model": string
12735 readonly "prompt"?: string
12736 readonly "provider"?: { readonly "options"?: ProviderOptions }
12737 readonly "resolution"?: "480p" | "720p" | "1080p" | "1K" | "2K" | "4K"
12738 readonly "seed"?: number
12739 readonly "size"?: string
12740}
12741export const VideoGenerationRequest = Schema.Struct({
12742 "aspect_ratio": Schema.optionalKey(
12743 Schema.Literals(["16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9", "9:21"]).annotate({
12744 "description": "Aspect ratio of the generated video"
12745 })
12746 ),
12747 "callback_url": Schema.optionalKey(
12748 Schema.String.annotate({
12749 "description":
12750 "URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS.",
12751 "format": "uri"
12752 })
12753 ),
12754 "duration": Schema.optionalKey(
12755 Schema.Number.annotate({ "description": "Duration of the generated video in seconds" }).check(
12756 Schema.isInt().annotate({ "expected": "an integer" })
12757 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" }))
12758 ),
12759 "frame_images": Schema.optionalKey(
12760 Schema.Array(FrameImage).annotate({
12761 "description":
12762 "Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame."
12763 })
12764 ),
12765 "generate_audio": Schema.optionalKey(
12766 Schema.Boolean.annotate({
12767 "description":
12768 "Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set."
12769 })
12770 ),
12771 "input_references": Schema.optionalKey(
12772 Schema.Array(InputReference).annotate({
12773 "description":
12774 "Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0); other providers use image references and ignore the rest."
12775 })
12776 ),
12777 "model": Schema.String,
12778 "prompt": Schema.optionalKey(
12779 Schema.String.annotate({
12780 "description":
12781 "Text prompt describing the video to generate. Optional for models that support generating a video from image input alone; required by all other models."
12782 })
12783 ),
12784 "provider": Schema.optionalKey(
12785 Schema.Struct({ "options": Schema.optionalKey(ProviderOptions) }).annotate({
12786 "description": "Provider-specific passthrough configuration"
12787 })
12788 ),
12789 "resolution": Schema.optionalKey(
12790 Schema.Literals(["480p", "720p", "1080p", "1K", "2K", "4K"]).annotate({
12791 "description": "Resolution of the generated video"
12792 })
12793 ),
12794 "seed": Schema.optionalKey(
12795 Schema.Number.annotate({
12796 "description":
12797 "If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers."
12798 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
12799 ),
12800 "size": Schema.optionalKey(
12801 Schema.String.annotate({
12802 "description":
12803 "Exact pixel dimensions of the generated video in \"WIDTHxHEIGHT\" format (e.g. \"1280x720\"). Interchangeable with resolution + aspect_ratio."
12804 })
12805 )
12806}).annotate({ "identifier": "VideoGenerationRequest" })
12807export type ImageGenerationProviderPreferences = {
12808 readonly "allow_fallbacks"?: boolean | null
12809 readonly "ignore"?: Union_2
12810 readonly "only"?: Union_3
12811 readonly "options"?: ProviderOptions
12812 readonly "order"?: Union_4
12813 readonly "sort"?: Union_5
12814}
12815export const ImageGenerationProviderPreferences = Schema.Struct({
12816 "allow_fallbacks": Schema.optionalKey(
12817 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
12818 "description":
12819 "Whether to allow backup providers to serve requests\n- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.\n- false: use only the primary/custom provider, and return the upstream error if it's unavailable.\n"
12820 })
12821 ),
12822 "ignore": Schema.optionalKey(Union_2),
12823 "only": Schema.optionalKey(Union_3),
12824 "options": Schema.optionalKey(ProviderOptions),
12825 "order": Schema.optionalKey(Union_4),
12826 "sort": Schema.optionalKey(Union_5)
12827}).annotate({
12828 "description": "Provider routing preferences and provider-specific passthrough configuration.",
12829 "identifier": "ImageGenerationProviderPreferences"
12830})
12831export type ListEndpointsResponse = {
12832 readonly "architecture": {
12833 readonly "input_modalities": ReadonlyArray<"text" | "image" | "file" | "audio" | "video">
12834 readonly "instruct_type":
12835 | "none"
12836 | "airoboros"
12837 | "alpaca"
12838 | "alpaca-modif"
12839 | "chatml"
12840 | "claude"
12841 | "code-llama"
12842 | "gemma"
12843 | "llama2"
12844 | "llama3"
12845 | "mistral"
12846 | "nemotron"
12847 | "neural"
12848 | "openchat"
12849 | "phi3"
12850 | "rwkv"
12851 | "vicuna"
12852 | "zephyr"
12853 | "deepseek-r1"
12854 | "deepseek-v3.1"
12855 | "qwq"
12856 | "qwen3"
12857 | null
12858 readonly "modality": string | null
12859 readonly "output_modalities": ReadonlyArray<
12860 "text" | "image" | "embeddings" | "audio" | "video" | "rerank" | "speech" | "transcription"
12861 >
12862 readonly "tokenizer":
12863 | "Router"
12864 | "Media"
12865 | "Other"
12866 | "GPT"
12867 | "Claude"
12868 | "Gemini"
12869 | "Gemma"
12870 | "Grok"
12871 | "Cohere"
12872 | "Nova"
12873 | "Qwen"
12874 | "Yi"
12875 | "DeepSeek"
12876 | "Mistral"
12877 | "Llama2"
12878 | "Llama3"
12879 | "Llama4"
12880 | "PaLM"
12881 | "RWKV"
12882 | "Qwen3"
12883 }
12884 readonly "created": number
12885 readonly "description": string
12886 readonly "endpoints": ReadonlyArray<PublicEndpoint>
12887 readonly "id": string
12888 readonly "name": string
12889}
12890export const ListEndpointsResponse = Schema.Struct({
12891 "architecture": Schema.Struct({
12892 "input_modalities": Schema.Array(
12893 Schema.Union([
12894 Schema.Literal("text"),
12895 Schema.Literal("image"),
12896 Schema.Literal("file"),
12897 Schema.Literal("audio"),
12898 Schema.Literal("video")
12899 ])
12900 ).annotate({ "description": "Supported input modalities" }),
12901 "instruct_type": Schema.Union([
12902 Schema.Literal("none").annotate({ "description": "Instruction format type" }),
12903 Schema.Literal("airoboros").annotate({ "description": "Instruction format type" }),
12904 Schema.Literal("alpaca").annotate({ "description": "Instruction format type" }),
12905 Schema.Literal("alpaca-modif").annotate({ "description": "Instruction format type" }),
12906 Schema.Literal("chatml").annotate({ "description": "Instruction format type" }),
12907 Schema.Literal("claude").annotate({ "description": "Instruction format type" }),
12908 Schema.Literal("code-llama").annotate({ "description": "Instruction format type" }),
12909 Schema.Literal("gemma").annotate({ "description": "Instruction format type" }),
12910 Schema.Literal("llama2").annotate({ "description": "Instruction format type" }),
12911 Schema.Literal("llama3").annotate({ "description": "Instruction format type" }),
12912 Schema.Literal("mistral").annotate({ "description": "Instruction format type" }),
12913 Schema.Literal("nemotron").annotate({ "description": "Instruction format type" }),
12914 Schema.Literal("neural").annotate({ "description": "Instruction format type" }),
12915 Schema.Literal("openchat").annotate({ "description": "Instruction format type" }),
12916 Schema.Literal("phi3").annotate({ "description": "Instruction format type" }),
12917 Schema.Literal("rwkv").annotate({ "description": "Instruction format type" }),
12918 Schema.Literal("vicuna").annotate({ "description": "Instruction format type" }),
12919 Schema.Literal("zephyr").annotate({ "description": "Instruction format type" }),
12920 Schema.Literal("deepseek-r1").annotate({ "description": "Instruction format type" }),
12921 Schema.Literal("deepseek-v3.1").annotate({ "description": "Instruction format type" }),
12922 Schema.Literal("qwq").annotate({ "description": "Instruction format type" }),
12923 Schema.Literal("qwen3").annotate({ "description": "Instruction format type" }),
12924 Schema.Union([Schema.Null]).annotate({ "description": "Instruction format type" })
12925 ]).annotate({ "description": "Instruction format type" }),
12926 "modality": Schema.Union([
12927 Schema.Union([Schema.String]).annotate({ "description": "Primary modality of the model" }),
12928 Schema.Union([Schema.Null]).annotate({ "description": "Primary modality of the model" })
12929 ]).annotate({ "description": "Primary modality of the model" }),
12930 "output_modalities": Schema.Array(
12931 Schema.Union([
12932 Schema.Literal("text"),
12933 Schema.Literal("image"),
12934 Schema.Literal("embeddings"),
12935 Schema.Literal("audio"),
12936 Schema.Literal("video"),
12937 Schema.Literal("rerank"),
12938 Schema.Literal("speech"),
12939 Schema.Literal("transcription")
12940 ])
12941 ).annotate({ "description": "Supported output modalities" }),
12942 "tokenizer": Schema.Union([
12943 Schema.Union([Schema.Literal("Router").annotate({ "description": "Tokenizer type used by the model" })]),
12944 Schema.Union([Schema.Literal("Media").annotate({ "description": "Tokenizer type used by the model" })]),
12945 Schema.Union([Schema.Literal("Other").annotate({ "description": "Tokenizer type used by the model" })]),
12946 Schema.Union([Schema.Literal("GPT").annotate({ "description": "Tokenizer type used by the model" })]),
12947 Schema.Union([Schema.Literal("Claude").annotate({ "description": "Tokenizer type used by the model" })]),
12948 Schema.Union([Schema.Literal("Gemini").annotate({ "description": "Tokenizer type used by the model" })]),
12949 Schema.Union([Schema.Literal("Gemma").annotate({ "description": "Tokenizer type used by the model" })]),
12950 Schema.Union([Schema.Literal("Grok").annotate({ "description": "Tokenizer type used by the model" })]),
12951 Schema.Union([Schema.Literal("Cohere").annotate({ "description": "Tokenizer type used by the model" })]),
12952 Schema.Union([Schema.Literal("Nova").annotate({ "description": "Tokenizer type used by the model" })]),
12953 Schema.Union([Schema.Literal("Qwen").annotate({ "description": "Tokenizer type used by the model" })]),
12954 Schema.Union([Schema.Literal("Yi").annotate({ "description": "Tokenizer type used by the model" })]),
12955 Schema.Union([Schema.Literal("DeepSeek").annotate({ "description": "Tokenizer type used by the model" })]),
12956 Schema.Union([Schema.Literal("Mistral").annotate({ "description": "Tokenizer type used by the model" })]),
12957 Schema.Union([Schema.Literal("Llama2").annotate({ "description": "Tokenizer type used by the model" })]),
12958 Schema.Union([Schema.Literal("Llama3").annotate({ "description": "Tokenizer type used by the model" })]),
12959 Schema.Union([Schema.Literal("Llama4").annotate({ "description": "Tokenizer type used by the model" })]),
12960 Schema.Union([Schema.Literal("PaLM").annotate({ "description": "Tokenizer type used by the model" })]),
12961 Schema.Union([Schema.Literal("RWKV").annotate({ "description": "Tokenizer type used by the model" })]),
12962 Schema.Union([Schema.Literal("Qwen3").annotate({ "description": "Tokenizer type used by the model" })])
12963 ]).annotate({ "description": "Tokenizer type used by the model" })
12964 }).annotate({ "description": "Model architecture information" }),
12965 "created": Schema.Number.annotate({ "description": "Unix timestamp of when the model was created" }).check(
12966 Schema.isInt().annotate({ "expected": "an integer" })
12967 ),
12968 "description": Schema.String.annotate({ "description": "Description of the model" }),
12969 "endpoints": Schema.Array(PublicEndpoint).annotate({ "description": "List of available endpoints for this model" }),
12970 "id": Schema.String.annotate({ "description": "Unique identifier for the model" }),
12971 "name": Schema.String.annotate({ "description": "Display name of the model" })
12972}).annotate({ "description": "List of available endpoints for a model", "identifier": "ListEndpointsResponse" })
12973export type ModelReasoning = {
12974 readonly "default_effort"?: ReasoningEffort
12975 readonly "default_enabled"?: boolean
12976 readonly "mandatory": boolean
12977 readonly "supported_efforts"?: Union_12
12978 readonly "supports_max_tokens"?: boolean
12979}
12980export const ModelReasoning = Schema.Struct({
12981 "default_effort": Schema.optionalKey(
12982 Schema.suspend((): Schema.Codec<ReasoningEffort> => ReasoningEffort).annotate({
12983 "description":
12984 "Default reasoning effort when the client enables reasoning without specifying effort. Maps to `reasoning.effort` in chat requests. When `\"none\"`, prefer omitting effort unless the user explicitly disables reasoning."
12985 })
12986 ),
12987 "default_enabled": Schema.optionalKey(
12988 Schema.Boolean.annotate({
12989 "description": "Default reasoning enabled state when the client does not set `reasoning.enabled`."
12990 })
12991 ),
12992 "mandatory": Schema.Boolean.annotate({
12993 "description": "When true, reasoning cannot be disabled and effort \"none\" is rejected."
12994 }),
12995 "supported_efforts": Schema.optionalKey(Union_12),
12996 "supports_max_tokens": Schema.optionalKey(
12997 Schema.Boolean.annotate({
12998 "description":
12999 "Present and `true` when the model accepts `reasoning.max_tokens` in requests (Anthropic-style) instead of or in addition to `reasoning.effort`. Omitted otherwise."
13000 })
13001 )
13002}).annotate({
13003 "description": "Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models.",
13004 "identifier": "ModelReasoning"
13005})
13006export type ReasoningDetailUnion =
13007 | ReasoningDetailSummary
13008 | ReasoningDetailEncrypted
13009 | ReasoningDetailText
13010 | ReasoningDetailServerToolCall
13011export const ReasoningDetailUnion = Schema.Union([
13012 ReasoningDetailSummary,
13013 ReasoningDetailEncrypted,
13014 ReasoningDetailText,
13015 ReasoningDetailServerToolCall
13016], { mode: "oneOf" }).annotate({ "description": "Reasoning detail union schema", "identifier": "ReasoningDetailUnion" })
13017export type BaseReasoningConfig = Objects_5 | null
13018export const BaseReasoningConfig = Schema.Union([Objects_5, Schema.Null]).annotate({
13019 "identifier": "BaseReasoningConfig"
13020})
13021export type ReasoningConfig = Union_13 | null
13022export const ReasoningConfig = Schema.Union([Union_13, Schema.Null]).annotate({
13023 "description": "Configuration for reasoning mode in the response",
13024 "identifier": "ReasoningConfig"
13025})
13026export type ChatUsage = {
13027 readonly "completion_tokens": number
13028 readonly "completion_tokens_details"?: Union_
13029 readonly "cost"?: number | null
13030 readonly "cost_details"?: CostDetails
13031 readonly "is_byok"?: boolean
13032 readonly "prompt_tokens": number
13033 readonly "prompt_tokens_details"?: Union_1
13034 readonly "server_tool_use_details"?: ServerToolUseDetails
13035 readonly "total_tokens": number
13036}
13037export const ChatUsage = Schema.Struct({
13038 "completion_tokens": Schema.Number.annotate({ "description": "Number of tokens in the completion" }).check(
13039 Schema.isInt().annotate({ "expected": "an integer" })
13040 ),
13041 "completion_tokens_details": Schema.optionalKey(Union_),
13042 "cost": Schema.optionalKey(
13043 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
13044 .annotate({ "description": "Cost of the completion", "format": "double" })
13045 ),
13046 "cost_details": Schema.optionalKey(CostDetails),
13047 "is_byok": Schema.optionalKey(
13048 Schema.Boolean.annotate({ "description": "Whether a request was made using a Bring Your Own Key configuration" })
13049 ),
13050 "prompt_tokens": Schema.Number.annotate({ "description": "Number of tokens in the prompt" }).check(
13051 Schema.isInt().annotate({ "expected": "an integer" })
13052 ),
13053 "prompt_tokens_details": Schema.optionalKey(Union_1),
13054 "server_tool_use_details": Schema.optionalKey(ServerToolUseDetails),
13055 "total_tokens": Schema.Number.annotate({ "description": "Total number of tokens" }).check(
13056 Schema.isInt().annotate({ "expected": "an integer" })
13057 )
13058}).annotate({ "description": "Token usage statistics", "identifier": "ChatUsage" })
13059export type Usage = {
13060 readonly "input_tokens": number
13061 readonly "input_tokens_details": { readonly "cache_write_tokens"?: number | null; readonly "cached_tokens": number }
13062 readonly "output_tokens": number
13063 readonly "output_tokens_details": { readonly "reasoning_tokens": number }
13064 readonly "total_tokens": number
13065 readonly "cost"?: number | null
13066 readonly "cost_details"?: {
13067 readonly "upstream_inference_cost"?: number | null
13068 readonly "upstream_inference_input_cost": number
13069 readonly "upstream_inference_output_cost": number
13070 }
13071 readonly "is_byok"?: boolean
13072 readonly "server_tool_use_details"?: ServerToolUseDetails
13073} | null
13074export const Usage = Schema.Union([
13075 Schema.Struct({
13076 "input_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13077 "input_tokens_details": Schema.Struct({
13078 "cache_write_tokens": Schema.optionalKey(
13079 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
13080 ),
13081 "cached_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
13082 }),
13083 "output_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13084 "output_tokens_details": Schema.Struct({
13085 "reasoning_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
13086 }),
13087 "total_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13088 "cost": Schema.optionalKey(
13089 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
13090 .annotate({ "description": "Cost of the completion", "format": "double" })
13091 ),
13092 "cost_details": Schema.optionalKey(Schema.Struct({
13093 "upstream_inference_cost": Schema.optionalKey(
13094 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
13095 .annotate({ "format": "double" })
13096 ),
13097 "upstream_inference_input_cost": Schema.Number.annotate({ "format": "double" }).check(
13098 Schema.isFinite().annotate({ "expected": "a finite number" })
13099 ),
13100 "upstream_inference_output_cost": Schema.Number.annotate({ "format": "double" }).check(
13101 Schema.isFinite().annotate({ "expected": "a finite number" })
13102 )
13103 })),
13104 "is_byok": Schema.optionalKey(
13105 Schema.Boolean.annotate({ "description": "Whether a request was made using a Bring Your Own Key configuration" })
13106 ),
13107 "server_tool_use_details": Schema.optionalKey(ServerToolUseDetails)
13108 }),
13109 Schema.Null
13110]).annotate({ "description": "Token usage information for the response", "identifier": "Usage" })
13111export type StopServerToolsWhen = ReadonlyArray<StopServerToolsWhenCondition>
13112export const StopServerToolsWhen = Schema.Array(StopServerToolsWhenCondition).annotate({
13113 "description":
13114 "Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. When a condition fires while the model is still emitting tool calls, the pending tool calls are executed and one final turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call."
13115}).check(
13116 Schema.isMinLength(1).annotate({
13117 "expected": "a value with a length of at least 1",
13118 "identifier": "StopServerToolsWhen"
13119 })
13120)
13121export type SubagentServerToolConfig = {
13122 readonly "instructions"?: string
13123 readonly "max_completion_tokens"?: number
13124 readonly "max_tool_calls"?: number
13125 readonly "model"?: string
13126 readonly "name"?: string
13127 readonly "reasoning"?: SubagentReasoning
13128 readonly "temperature"?: number
13129 readonly "tools"?: Arrays_12
13130}
13131export const SubagentServerToolConfig = Schema.Struct({
13132 "instructions": Schema.optionalKey(
13133 Schema.String.annotate({
13134 "description":
13135 "System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own."
13136 })
13137 ),
13138 "max_completion_tokens": Schema.optionalKey(
13139 Schema.Number.annotate({
13140 "description":
13141 "Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies."
13142 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
13143 ),
13144 "max_tool_calls": Schema.optionalKey(
13145 Schema.Number.annotate({
13146 "description":
13147 "Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Accepted and validated but not yet enforced on the subagent call."
13148 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
13149 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
13150 ).check(Schema.isLessThanOrEqualTo(25).annotate({ "expected": "a value less than or equal to 25" }))
13151 ),
13152 "model": Schema.optionalKey(
13153 Schema.String.annotate({
13154 "description":
13155 "Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model."
13156 })
13157 ),
13158 "name": Schema.optionalKey(
13159 Schema.String.annotate({
13160 "description":
13161 "Optional name for this subagent. The model sees one tool per named subagent (and one default for an unnamed entry). Names must be unique across subagent entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars."
13162 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
13163 Schema.isMaxLength(64).annotate({ "expected": "a value with a length of at most 64" })
13164 ).check(
13165 Schema.isPattern(new RegExp("^[a-zA-Z0-9 _-]+$")).annotate({
13166 "expected": "a string matching the RegExp ^[a-zA-Z0-9 _-]+$"
13167 })
13168 )
13169 ),
13170 "reasoning": Schema.optionalKey(SubagentReasoning),
13171 "temperature": Schema.optionalKey(
13172 Schema.Number.annotate({
13173 "description":
13174 "Sampling temperature forwarded to the subagent call. When omitted, the provider's default applies.",
13175 "format": "double"
13176 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
13177 ),
13178 "tools": Schema.optionalKey(Arrays_12)
13179}).annotate({
13180 "description": "Configuration for one openrouter:subagent server tool entry.",
13181 "identifier": "SubagentServerToolConfig"
13182})
13183export type ImageModelEndpointsResponse = { readonly "endpoints": ReadonlyArray<ImageEndpoint>; readonly "id": string }
13184export const ImageModelEndpointsResponse = Schema.Struct({
13185 "endpoints": Schema.Array(ImageEndpoint),
13186 "id": Schema.String.annotate({ "description": "Model slug" })
13187}).annotate({
13188 "description": "The full per-endpoint records for an image model.",
13189 "identifier": "ImageModelEndpointsResponse"
13190})
13191export type TaskClassificationResponse = {
13192 readonly "data": {
13193 readonly "as_of": string
13194 readonly "classifications": ReadonlyArray<TaskClassificationItem>
13195 readonly "macro_categories": ReadonlyArray<TaskClassificationMacroCategory>
13196 readonly "window_days": number
13197 }
13198}
13199export const TaskClassificationResponse = Schema.Struct({
13200 "data": Schema.Struct({
13201 "as_of": Schema.String.annotate({
13202 "description":
13203 "UTC date (YYYY-MM-DD) of the window upper bound (yesterday). Data is exclusive of the current incomplete UTC day. This is the expected latest date in the snapshot; it does not confirm data presence for that date."
13204 }),
13205 "classifications": Schema.Array(TaskClassificationItem).annotate({
13206 "description": "Per-task classification market-share data, sorted by usage_share descending."
13207 }),
13208 "macro_categories": Schema.Array(TaskClassificationMacroCategory).annotate({
13209 "description": "Aggregate market-share data per macro-category (code, data, agent, general)."
13210 }),
13211 "window_days": Schema.Number.annotate({ "description": "Number of trailing days covered by this snapshot." }).check(
13212 Schema.isInt().annotate({ "expected": "an integer" })
13213 )
13214 })
13215}).annotate({ "identifier": "TaskClassificationResponse" })
13216export type UnifiedBenchmarksResponse = {
13217 readonly "data": ReadonlyArray<UnifiedBenchmarksAAItem | UnifiedBenchmarksDAItem>
13218 readonly "meta": UnifiedBenchmarksMeta
13219}
13220export const UnifiedBenchmarksResponse = Schema.Struct({
13221 "data": Schema.Array(Schema.Union([UnifiedBenchmarksAAItem, UnifiedBenchmarksDAItem], { mode: "oneOf" })),
13222 "meta": UnifiedBenchmarksMeta
13223}).annotate({ "identifier": "UnifiedBenchmarksResponse" })
13224export type AnnotationAddedEvent = {
13225 readonly "annotation": OpenAIResponsesAnnotation
13226 readonly "annotation_index": number
13227 readonly "content_index": number
13228 readonly "item_id": string
13229 readonly "output_index": number
13230 readonly "sequence_number": number
13231 readonly "type": "response.output_text.annotation.added"
13232}
13233export const AnnotationAddedEvent = Schema.Struct({
13234 "annotation": OpenAIResponsesAnnotation,
13235 "annotation_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13236 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13237 "item_id": Schema.String,
13238 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13239 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13240 "type": Schema.Literal("response.output_text.annotation.added")
13241}).annotate({
13242 "description": "Event emitted when a text annotation is added to output",
13243 "identifier": "AnnotationAddedEvent"
13244})
13245export type BaseAnnotationAddedEvent = {
13246 readonly "annotation": OpenAIResponsesAnnotation
13247 readonly "annotation_index": number
13248 readonly "content_index": number
13249 readonly "item_id": string
13250 readonly "output_index": number
13251 readonly "sequence_number": number
13252 readonly "type": "response.output_text.annotation.added"
13253}
13254export const BaseAnnotationAddedEvent = Schema.Struct({
13255 "annotation": OpenAIResponsesAnnotation,
13256 "annotation_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13257 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13258 "item_id": Schema.String,
13259 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13260 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13261 "type": Schema.Literal("response.output_text.annotation.added")
13262}).annotate({
13263 "description": "Event emitted when a text annotation is added to output",
13264 "identifier": "BaseAnnotationAddedEvent"
13265})
13266export type ResponseOutputText = {
13267 readonly "annotations"?: ReadonlyArray<OpenAIResponsesAnnotation>
13268 readonly "logprobs"?: ReadonlyArray<
13269 {
13270 readonly "bytes": ReadonlyArray<number>
13271 readonly "logprob": number
13272 readonly "token": string
13273 readonly "top_logprobs": ReadonlyArray<
13274 { readonly "bytes": ReadonlyArray<number>; readonly "logprob": number; readonly "token": string }
13275 >
13276 }
13277 >
13278 readonly "text": string
13279 readonly "type": "output_text"
13280}
13281export const ResponseOutputText = Schema.Struct({
13282 "annotations": Schema.optionalKey(Schema.Array(OpenAIResponsesAnnotation)),
13283 "logprobs": Schema.optionalKey(Schema.Array(Schema.Struct({
13284 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
13285 "logprob": Schema.Number.annotate({ "format": "double" }).check(
13286 Schema.isFinite().annotate({ "expected": "a finite number" })
13287 ),
13288 "token": Schema.String,
13289 "top_logprobs": Schema.Array(
13290 Schema.Struct({
13291 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
13292 "logprob": Schema.Number.annotate({ "format": "double" }).check(
13293 Schema.isFinite().annotate({ "expected": "a finite number" })
13294 ),
13295 "token": Schema.String
13296 })
13297 )
13298 }))),
13299 "text": Schema.String,
13300 "type": Schema.Literal("output_text")
13301}).annotate({ "identifier": "ResponseOutputText" })
13302export type WebFetchServerTool = {
13303 readonly "parameters"?: WebFetchServerToolConfig
13304 readonly "type": "openrouter:web_fetch"
13305}
13306export const WebFetchServerTool = Schema.Struct({
13307 "parameters": Schema.optionalKey(WebFetchServerToolConfig),
13308 "type": Schema.Literal("openrouter:web_fetch")
13309}).annotate({
13310 "description": "OpenRouter built-in server tool: fetches full content from a URL (web page or PDF)",
13311 "identifier": "WebFetchServerTool"
13312})
13313export type Preview_20250311_WebSearchServerTool = {
13314 readonly "engine"?: WebSearchEngineEnum
13315 readonly "filters"?: WebSearchDomainFilter
13316 readonly "max_results"?: number
13317 readonly "search_context_size"?: SearchContextSizeEnum
13318 readonly "type": "web_search_preview_2025_03_11"
13319 readonly "user_location"?: Preview_WebSearchUserLocation
13320}
13321export const Preview_20250311_WebSearchServerTool = Schema.Struct({
13322 "engine": Schema.optionalKey(WebSearchEngineEnum),
13323 "filters": Schema.optionalKey(WebSearchDomainFilter),
13324 "max_results": Schema.optionalKey(
13325 Schema.Number.annotate({
13326 "description":
13327 "Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped."
13328 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
13329 ),
13330 "search_context_size": Schema.optionalKey(SearchContextSizeEnum),
13331 "type": Schema.Literal("web_search_preview_2025_03_11"),
13332 "user_location": Schema.optionalKey(Preview_WebSearchUserLocation)
13333}).annotate({
13334 "description": "Web search preview tool configuration (2025-03-11 version)",
13335 "identifier": "Preview_20250311_WebSearchServerTool"
13336})
13337export type Preview_WebSearchServerTool = {
13338 readonly "engine"?: WebSearchEngineEnum
13339 readonly "filters"?: WebSearchDomainFilter
13340 readonly "max_results"?: number
13341 readonly "search_context_size"?: SearchContextSizeEnum
13342 readonly "type": "web_search_preview"
13343 readonly "user_location"?: Preview_WebSearchUserLocation
13344}
13345export const Preview_WebSearchServerTool = Schema.Struct({
13346 "engine": Schema.optionalKey(WebSearchEngineEnum),
13347 "filters": Schema.optionalKey(WebSearchDomainFilter),
13348 "max_results": Schema.optionalKey(
13349 Schema.Number.annotate({
13350 "description":
13351 "Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped."
13352 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
13353 ),
13354 "search_context_size": Schema.optionalKey(SearchContextSizeEnum),
13355 "type": Schema.Literal("web_search_preview"),
13356 "user_location": Schema.optionalKey(Preview_WebSearchUserLocation)
13357}).annotate({ "description": "Web search preview tool configuration", "identifier": "Preview_WebSearchServerTool" })
13358export type Legacy_WebSearchServerTool = {
13359 readonly "engine"?: WebSearchEngineEnum
13360 readonly "filters"?: WebSearchDomainFilter
13361 readonly "max_results"?: number
13362 readonly "search_context_size"?: SearchContextSizeEnum
13363 readonly "type": "web_search"
13364 readonly "user_location"?: WebSearchUserLocation
13365}
13366export const Legacy_WebSearchServerTool = Schema.Struct({
13367 "engine": Schema.optionalKey(WebSearchEngineEnum),
13368 "filters": Schema.optionalKey(WebSearchDomainFilter),
13369 "max_results": Schema.optionalKey(
13370 Schema.Number.annotate({
13371 "description":
13372 "Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped."
13373 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
13374 ),
13375 "search_context_size": Schema.optionalKey(SearchContextSizeEnum),
13376 "type": Schema.Literal("web_search"),
13377 "user_location": Schema.optionalKey(WebSearchUserLocation)
13378}).annotate({ "description": "Web search tool configuration", "identifier": "Legacy_WebSearchServerTool" })
13379export type WebSearchServerTool = {
13380 readonly "engine"?: WebSearchEngineEnum
13381 readonly "filters"?: WebSearchDomainFilter
13382 readonly "max_results"?: number
13383 readonly "search_context_size"?: SearchContextSizeEnum
13384 readonly "type": "web_search_2025_08_26"
13385 readonly "user_location"?: WebSearchUserLocation
13386}
13387export const WebSearchServerTool = Schema.Struct({
13388 "engine": Schema.optionalKey(WebSearchEngineEnum),
13389 "filters": Schema.optionalKey(WebSearchDomainFilter),
13390 "max_results": Schema.optionalKey(
13391 Schema.Number.annotate({
13392 "description":
13393 "Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped."
13394 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
13395 ),
13396 "search_context_size": Schema.optionalKey(SearchContextSizeEnum),
13397 "type": Schema.Literal("web_search_2025_08_26"),
13398 "user_location": Schema.optionalKey(WebSearchUserLocation)
13399}).annotate({
13400 "description": "Web search tool configuration (2025-08-26 version)",
13401 "identifier": "WebSearchServerTool"
13402})
13403export type ChatWebSearchShorthand = {
13404 readonly "allowed_domains"?: ReadonlyArray<string>
13405 readonly "engine"?: WebSearchEngineEnum
13406 readonly "excluded_domains"?: ReadonlyArray<string>
13407 readonly "max_characters"?: number
13408 readonly "max_results"?: number
13409 readonly "max_total_results"?: number
13410 readonly "parameters"?: WebSearchConfig
13411 readonly "search_context_size"?: SearchQualityLevel
13412 readonly "type": "web_search" | "web_search_preview" | "web_search_preview_2025_03_11" | "web_search_2025_08_26"
13413 readonly "user_location"?: WebSearchUserLocationServerTool
13414}
13415export const ChatWebSearchShorthand = Schema.Struct({
13416 "allowed_domains": Schema.optionalKey(
13417 Schema.Array(Schema.String).annotate({
13418 "description":
13419 "Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains."
13420 })
13421 ),
13422 "engine": Schema.optionalKey(WebSearchEngineEnum),
13423 "excluded_domains": Schema.optionalKey(
13424 Schema.Array(Schema.String).annotate({
13425 "description":
13426 "Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains."
13427 })
13428 ),
13429 "max_characters": Schema.optionalKey(
13430 Schema.Number.annotate({
13431 "description":
13432 "Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity)."
13433 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
13434 ),
13435 "max_results": Schema.optionalKey(
13436 Schema.Number.annotate({
13437 "description":
13438 "Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped."
13439 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
13440 ),
13441 "max_total_results": Schema.optionalKey(
13442 Schema.Number.annotate({
13443 "description":
13444 "Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified."
13445 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
13446 ),
13447 "parameters": Schema.optionalKey(WebSearchConfig),
13448 "search_context_size": Schema.optionalKey(SearchQualityLevel),
13449 "type": Schema.Literals([
13450 "web_search",
13451 "web_search_preview",
13452 "web_search_preview_2025_03_11",
13453 "web_search_2025_08_26"
13454 ]),
13455 "user_location": Schema.optionalKey(WebSearchUserLocationServerTool)
13456}).annotate({
13457 "description": "Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.",
13458 "identifier": "ChatWebSearchShorthand"
13459})
13460export type OpenRouterWebSearchServerTool = {
13461 readonly "parameters"?: WebSearchConfig
13462 readonly "type": "openrouter:web_search"
13463}
13464export const OpenRouterWebSearchServerTool = Schema.Struct({
13465 "parameters": Schema.optionalKey(WebSearchConfig),
13466 "type": Schema.Literal("openrouter:web_search")
13467}).annotate({
13468 "description": "OpenRouter built-in server tool: searches the web for current information",
13469 "identifier": "OpenRouterWebSearchServerTool"
13470})
13471export type WebSearchServerTool_OpenRouter = {
13472 readonly "parameters"?: WebSearchServerToolConfig
13473 readonly "type": "openrouter:web_search"
13474}
13475export const WebSearchServerTool_OpenRouter = Schema.Struct({
13476 "parameters": Schema.optionalKey(WebSearchServerToolConfig),
13477 "type": Schema.Literal("openrouter:web_search")
13478}).annotate({
13479 "description": "OpenRouter built-in server tool: searches the web for current information",
13480 "identifier": "WebSearchServerTool_OpenRouter"
13481})
13482export type AdvisorServerTool_OpenRouter = {
13483 readonly "parameters"?: AdvisorServerToolConfig
13484 readonly "type": "openrouter:advisor"
13485}
13486export const AdvisorServerTool_OpenRouter = Schema.Struct({
13487 "parameters": Schema.optionalKey(AdvisorServerToolConfig),
13488 "type": Schema.Literal("openrouter:advisor")
13489}).annotate({
13490 "description":
13491 "OpenRouter built-in server tool: consults a higher-intelligence advisor model (any OpenRouter model) for guidance mid-generation and returns its response. The advisor may run as a sub-agent with its own tools. Include multiple entries to offer several named advisors; at most one entry may omit `name` to act as the default advisor.",
13492 "identifier": "AdvisorServerTool_OpenRouter"
13493})
13494export type AnthropicBashCodeExecutionToolResult = {
13495 readonly "content": AnthropicBashCodeExecutionContent
13496 readonly "tool_use_id": string
13497 readonly "type": "bash_code_execution_tool_result"
13498}
13499export const AnthropicBashCodeExecutionToolResult = Schema.Struct({
13500 "content": AnthropicBashCodeExecutionContent,
13501 "tool_use_id": Schema.String,
13502 "type": Schema.Literal("bash_code_execution_tool_result")
13503}).annotate({ "identifier": "AnthropicBashCodeExecutionToolResult" })
13504export type AnthropicSearchResultBlockParam = {
13505 readonly "cache_control"?: AnthropicCacheControlDirective
13506 readonly "citations"?: { readonly "enabled"?: boolean }
13507 readonly "content": ReadonlyArray<AnthropicTextBlockParam>
13508 readonly "source": string
13509 readonly "title": string
13510 readonly "type": "search_result"
13511}
13512export const AnthropicSearchResultBlockParam = Schema.Struct({
13513 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
13514 "citations": Schema.optionalKey(Schema.Struct({ "enabled": Schema.optionalKey(Schema.Boolean) })),
13515 "content": Schema.Array(AnthropicTextBlockParam),
13516 "source": Schema.String,
13517 "title": Schema.String,
13518 "type": Schema.Literal("search_result")
13519}).annotate({ "identifier": "AnthropicSearchResultBlockParam" })
13520export type FusionServerTool_OpenRouter = {
13521 readonly "parameters"?: FusionServerToolConfig
13522 readonly "type": "openrouter:fusion"
13523}
13524export const FusionServerTool_OpenRouter = Schema.Struct({
13525 "parameters": Schema.optionalKey(FusionServerToolConfig),
13526 "type": Schema.Literal("openrouter:fusion")
13527}).annotate({
13528 "description":
13529 "OpenRouter built-in server tool: fans out the user prompt to a panel of analysis models, then asks a judge model to summarize their collective output as structured JSON the outer model can synthesize from.",
13530 "identifier": "FusionServerTool_OpenRouter"
13531})
13532export type AnthropicWebFetchBlock = {
13533 readonly "content": AnthropicDocumentBlock
13534 readonly "retrieved_at": string | null
13535 readonly "type": "web_fetch_result"
13536 readonly "url": string
13537}
13538export const AnthropicWebFetchBlock = Schema.Struct({
13539 "content": AnthropicDocumentBlock,
13540 "retrieved_at": Schema.Union([Schema.String, Schema.Null]),
13541 "type": Schema.Literal("web_fetch_result"),
13542 "url": Schema.String
13543}).annotate({ "identifier": "AnthropicWebFetchBlock" })
13544export type AnthropicDocumentBlockParam = {
13545 readonly "cache_control"?: AnthropicCacheControlDirective
13546 readonly "citations"?: { readonly "enabled"?: boolean; readonly [x: string]: Schema.Json } | null
13547 readonly "context"?: string | null
13548 readonly "source":
13549 | AnthropicBase64PdfSource
13550 | AnthropicPlainTextSource
13551 | {
13552 readonly "content": string | ReadonlyArray<AnthropicTextBlockParam | AnthropicImageBlockParam>
13553 readonly "type": "content"
13554 }
13555 | AnthropicUrlPdfSource
13556 | AnthropicFileDocumentSource
13557 readonly "title"?: string | null
13558 readonly "type": "document"
13559}
13560export const AnthropicDocumentBlockParam = Schema.Struct({
13561 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
13562 "citations": Schema.optionalKey(
13563 Schema.Union([
13564 Schema.StructWithRest(Schema.Struct({ "enabled": Schema.optionalKey(Schema.Boolean) }), [
13565 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))
13566 ]),
13567 Schema.Null
13568 ])
13569 ),
13570 "context": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
13571 "source": Schema.Union([
13572 AnthropicBase64PdfSource,
13573 AnthropicPlainTextSource,
13574 Schema.Struct({
13575 "content": Schema.Union([
13576 Schema.String,
13577 Schema.Array(Schema.Union([AnthropicTextBlockParam, AnthropicImageBlockParam], { mode: "oneOf" }))
13578 ]),
13579 "type": Schema.Literal("content")
13580 }),
13581 AnthropicUrlPdfSource,
13582 AnthropicFileDocumentSource
13583 ], { mode: "oneOf" }),
13584 "title": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
13585 "type": Schema.Literal("document")
13586}).annotate({ "identifier": "AnthropicDocumentBlockParam" })
13587export type AnthropicUsageIteration =
13588 | AnthropicCompactionUsageIteration
13589 | AnthropicMessageUsageIteration
13590 | AnthropicAdvisorMessageUsageIteration
13591 | AnthropicUnknownUsageIteration
13592export const AnthropicUsageIteration = Schema.Union([
13593 AnthropicCompactionUsageIteration,
13594 AnthropicMessageUsageIteration,
13595 AnthropicAdvisorMessageUsageIteration,
13596 AnthropicUnknownUsageIteration
13597]).annotate({ "identifier": "AnthropicUsageIteration" })
13598export type AnthropicCodeExecutionToolResult = {
13599 readonly "content": AnthropicCodeExecutionContent
13600 readonly "tool_use_id": string
13601 readonly "type": "code_execution_tool_result"
13602}
13603export const AnthropicCodeExecutionToolResult = Schema.Struct({
13604 "content": AnthropicCodeExecutionContent,
13605 "tool_use_id": Schema.String,
13606 "type": Schema.Literal("code_execution_tool_result")
13607}).annotate({ "identifier": "AnthropicCodeExecutionToolResult" })
13608export type AnthropicToolSearchToolResult = {
13609 readonly "content": AnthropicToolSearchContent
13610 readonly "tool_use_id": string
13611 readonly "type": "tool_search_tool_result"
13612}
13613export const AnthropicToolSearchToolResult = Schema.Struct({
13614 "content": AnthropicToolSearchContent,
13615 "tool_use_id": Schema.String,
13616 "type": Schema.Literal("tool_search_tool_result")
13617}).annotate({ "identifier": "AnthropicToolSearchToolResult" })
13618export type BashServerTool = { readonly "parameters"?: BashServerToolConfig; readonly "type": "openrouter:bash" }
13619export const BashServerTool = Schema.Struct({
13620 "parameters": Schema.optionalKey(BashServerToolConfig),
13621 "type": Schema.Literal("openrouter:bash")
13622}).annotate({
13623 "description": "OpenRouter built-in server tool: runs shell commands server-side in a sandboxed container",
13624 "identifier": "BashServerTool"
13625})
13626export type ShellServerTool_OpenRouter = {
13627 readonly "parameters"?: ShellServerToolConfig
13628 readonly "type": "openrouter:shell"
13629}
13630export const ShellServerTool_OpenRouter = Schema.Struct({
13631 "parameters": Schema.optionalKey(ShellServerToolConfig),
13632 "type": Schema.Literal("openrouter:shell")
13633}).annotate({
13634 "description":
13635 "OpenRouter built-in server tool: runs shell commands server-side in a sandboxed container (a sandbox-backed clone of OpenAI's hosted shell tool)",
13636 "identifier": "ShellServerTool_OpenRouter"
13637})
13638export type ImageModelsListResponse = { readonly "data": ReadonlyArray<ImageModelListItem> }
13639export const ImageModelsListResponse = Schema.Struct({ "data": Schema.Array(ImageModelListItem) }).annotate({
13640 "description": "List of image generation models.",
13641 "identifier": "ImageModelsListResponse"
13642})
13643export type ObservabilityDestination =
13644 | ObservabilityArizeDestination
13645 | ObservabilityBraintrustDestination
13646 | ObservabilityClickhouseDestination
13647 | ObservabilityDatadogDestination
13648 | ObservabilityGrafanaDestination
13649 | ObservabilityLangfuseDestination
13650 | ObservabilityLangsmithDestination
13651 | ObservabilityNewrelicDestination
13652 | ObservabilityOpikDestination
13653 | ObservabilityOtelCollectorDestination
13654 | ObservabilityPosthogDestination
13655 | ObservabilityRampDestination
13656 | ObservabilityS3Destination
13657 | ObservabilitySentryDestination
13658 | ObservabilitySnowflakeDestination
13659 | ObservabilityWeaveDestination
13660 | ObservabilityWebhookDestination
13661export const ObservabilityDestination = Schema.Union([
13662 ObservabilityArizeDestination,
13663 ObservabilityBraintrustDestination,
13664 ObservabilityClickhouseDestination,
13665 ObservabilityDatadogDestination,
13666 ObservabilityGrafanaDestination,
13667 ObservabilityLangfuseDestination,
13668 ObservabilityLangsmithDestination,
13669 ObservabilityNewrelicDestination,
13670 ObservabilityOpikDestination,
13671 ObservabilityOtelCollectorDestination,
13672 ObservabilityPosthogDestination,
13673 ObservabilityRampDestination,
13674 ObservabilityS3Destination,
13675 ObservabilitySentryDestination,
13676 ObservabilitySnowflakeDestination,
13677 ObservabilityWeaveDestination,
13678 ObservabilityWebhookDestination
13679], { mode: "oneOf" }).annotate({ "identifier": "ObservabilityDestination" })
13680export type CreateObservabilityDestinationRequest = {
13681 readonly "api_key_hashes"?: ReadonlyArray<string> | null
13682 readonly "config": {}
13683 readonly "enabled"?: boolean
13684 readonly "filter_rules"?: ObservabilityFilterRulesConfigNullable
13685 readonly "name": string
13686 readonly "privacy_mode"?: boolean
13687 readonly "sampling_rate"?: number
13688 readonly "type":
13689 | "arize"
13690 | "braintrust"
13691 | "clickhouse"
13692 | "datadog"
13693 | "grafana"
13694 | "langfuse"
13695 | "langsmith"
13696 | "newrelic"
13697 | "opik"
13698 | "otel-collector"
13699 | "posthog"
13700 | "ramp"
13701 | "s3"
13702 | "sentry"
13703 | "snowflake"
13704 | "weave"
13705 | "webhook"
13706 readonly "workspace_id"?: string
13707}
13708export const CreateObservabilityDestinationRequest = Schema.Struct({
13709 "api_key_hashes": Schema.optionalKey(
13710 Schema.Union([
13711 Schema.Array(Schema.String).check(
13712 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
13713 ),
13714 Schema.Null
13715 ]).annotate({
13716 "description":
13717 "Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided."
13718 })
13719 ),
13720 "config": Schema.Struct({}).annotate({
13721 "description": "Provider-specific configuration. The shape depends on `type` and is validated server-side."
13722 }),
13723 "enabled": Schema.optionalKey(
13724 Schema.Boolean.annotate({ "description": "Whether this destination should be enabled immediately." })
13725 ),
13726 "filter_rules": Schema.optionalKey(ObservabilityFilterRulesConfigNullable),
13727 "name": Schema.String.annotate({ "description": "Human-readable name for the destination." }),
13728 "privacy_mode": Schema.optionalKey(
13729 Schema.Boolean.annotate({ "description": "When true, request/response bodies are not forwarded — only metadata." })
13730 ),
13731 "sampling_rate": Schema.optionalKey(
13732 Schema.Number.annotate({ "description": "Sampling rate between 0.0001 and 1 (1 = 100%).", "format": "double" })
13733 .check(Schema.isFinite().annotate({ "expected": "a finite number" }))
13734 ),
13735 "type": Schema.Literals([
13736 "arize",
13737 "braintrust",
13738 "clickhouse",
13739 "datadog",
13740 "grafana",
13741 "langfuse",
13742 "langsmith",
13743 "newrelic",
13744 "opik",
13745 "otel-collector",
13746 "posthog",
13747 "ramp",
13748 "s3",
13749 "sentry",
13750 "snowflake",
13751 "weave",
13752 "webhook"
13753 ]).annotate({ "description": "The destination type. Only stable destination types are accepted." }),
13754 "workspace_id": Schema.optionalKey(
13755 Schema.String.annotate({
13756 "description": "Optional workspace ID. Defaults to the authenticated entity's default workspace.",
13757 "format": "uuid"
13758 })
13759 )
13760}).annotate({ "identifier": "CreateObservabilityDestinationRequest" })
13761export type UpdateObservabilityDestinationRequest = {
13762 readonly "api_key_hashes"?: ReadonlyArray<string> | null
13763 readonly "config"?: {}
13764 readonly "enabled"?: boolean
13765 readonly "filter_rules"?: ObservabilityFilterRulesConfigNullable
13766 readonly "name"?: string
13767 readonly "privacy_mode"?: boolean
13768 readonly "sampling_rate"?: number
13769}
13770export const UpdateObservabilityDestinationRequest = Schema.Struct({
13771 "api_key_hashes": Schema.optionalKey(
13772 Schema.Union([
13773 Schema.Array(Schema.String).check(
13774 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
13775 ),
13776 Schema.Null
13777 ]).annotate({
13778 "description":
13779 "Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided."
13780 })
13781 ),
13782 "config": Schema.optionalKey(
13783 Schema.Struct({}).annotate({
13784 "description":
13785 "Provider-specific configuration fields to update. Masked values are ignored; unset fields keep their current value."
13786 })
13787 ),
13788 "enabled": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Whether the destination is enabled." })),
13789 "filter_rules": Schema.optionalKey(
13790 Schema.suspend((): Schema.Codec<ObservabilityFilterRulesConfigNullable> => ObservabilityFilterRulesConfigNullable)
13791 .annotate({
13792 "description": "Optional structured filter rules. `null` clears the rules. Omitting keeps the current value."
13793 })
13794 ),
13795 "name": Schema.optionalKey(Schema.String.annotate({ "description": "Human-readable name for the destination." })),
13796 "privacy_mode": Schema.optionalKey(
13797 Schema.Boolean.annotate({ "description": "When true, request/response bodies are not forwarded — only metadata." })
13798 ),
13799 "sampling_rate": Schema.optionalKey(
13800 Schema.Number.annotate({ "description": "Sampling rate between 0.0001 and 1 (1 = 100%).", "format": "double" })
13801 .check(Schema.isFinite().annotate({ "expected": "a finite number" }))
13802 )
13803}).annotate({ "identifier": "UpdateObservabilityDestinationRequest" })
13804export type ProviderPreferences = Objects_148 | null
13805export const ProviderPreferences = Schema.Union([Objects_148, Schema.Null]).annotate({
13806 "description": "When multiple model providers are available, optionally indicate your routing preference.",
13807 "identifier": "ProviderPreferences"
13808})
13809export type OpenRouterMetadata = {
13810 readonly "attempt": number
13811 readonly "attempts"?: Arrays_10
13812 readonly "endpoints": EndpointsMetadata
13813 readonly "is_byok": boolean
13814 readonly "params"?: RouterParams
13815 readonly "pipeline"?: Arrays_11
13816 readonly "region": string | null
13817 readonly "requested": string
13818 readonly "strategy": RoutingStrategy
13819 readonly "summary": string
13820}
13821export const OpenRouterMetadata = Schema.Struct({
13822 "attempt": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
13823 "attempts": Schema.optionalKey(Arrays_10),
13824 "endpoints": EndpointsMetadata,
13825 "is_byok": Schema.Boolean,
13826 "params": Schema.optionalKey(RouterParams),
13827 "pipeline": Schema.optionalKey(Arrays_11),
13828 "region": Schema.Union([Schema.String, Schema.Null]),
13829 "requested": Schema.String,
13830 "strategy": RoutingStrategy,
13831 "summary": Schema.String
13832}).annotate({ "identifier": "OpenRouterMetadata" })
13833export type ChatContentItems =
13834 | ChatContentText
13835 | ChatContentImage
13836 | ChatContentAudio
13837 | Legacy_ChatContentVideo
13838 | ChatContentVideo
13839 | ChatContentFile
13840export const ChatContentItems = Schema.Union([
13841 ChatContentText,
13842 ChatContentImage,
13843 ChatContentAudio,
13844 Legacy_ChatContentVideo,
13845 ChatContentVideo,
13846 ChatContentFile
13847], { mode: "oneOf" }).annotate({
13848 "description": "Content part for chat completion messages",
13849 "identifier": "ChatContentItems"
13850})
13851export type ChatDeveloperMessage = {
13852 readonly "content": string | ReadonlyArray<ChatContentText>
13853 readonly "name"?: string
13854 readonly "role": "developer"
13855}
13856export const ChatDeveloperMessage = Schema.Struct({
13857 "content": Schema.Union([Schema.String, Schema.Array(ChatContentText)]).annotate({
13858 "description": "Developer message content"
13859 }),
13860 "name": Schema.optionalKey(Schema.String.annotate({ "description": "Optional name for the developer message" })),
13861 "role": Schema.Literal("developer")
13862}).annotate({ "description": "Developer message", "identifier": "ChatDeveloperMessage" })
13863export type ChatSystemMessage = {
13864 readonly "content": string | ReadonlyArray<ChatContentText>
13865 readonly "name"?: string
13866 readonly "role": "system"
13867}
13868export const ChatSystemMessage = Schema.Struct({
13869 "content": Schema.Union([Schema.String, Schema.Array(ChatContentText)]).annotate({
13870 "description": "System message content"
13871 }),
13872 "name": Schema.optionalKey(Schema.String.annotate({ "description": "Optional name for the system message" })),
13873 "role": Schema.Literal("system")
13874}).annotate({ "description": "System message for setting behavior", "identifier": "ChatSystemMessage" })
13875export type AgentMessageItem = {
13876 readonly "agent"?: { readonly "agent_name": string; readonly [x: string]: Schema.Json } | null
13877 readonly "author": string
13878 readonly "content": ReadonlyArray<
13879 InputText | {
13880 readonly "detail": "auto" | "high" | "low" | "original"
13881 readonly "image_url"?: string | null
13882 readonly "type": "input_image"
13883 } | { readonly "encrypted_content": string; readonly "type": "encrypted_content" }
13884 >
13885 readonly "id"?: string | null
13886 readonly "recipient": string
13887 readonly "type": "agent_message"
13888}
13889export const AgentMessageItem = Schema.Struct({
13890 "agent": Schema.optionalKey(
13891 Schema.Union([
13892 Schema.StructWithRest(Schema.Struct({ "agent_name": Schema.String }), [
13893 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))
13894 ]),
13895 Schema.Null
13896 ])
13897 ),
13898 "author": Schema.String,
13899 "content": Schema.Array(
13900 Schema.Union([
13901 InputText,
13902 Schema.Struct({
13903 "detail": Schema.Literals(["auto", "high", "low", "original"]),
13904 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
13905 "type": Schema.Literal("input_image")
13906 }).annotate({ "description": "Image input content item" }),
13907 Schema.Struct({ "encrypted_content": Schema.String, "type": Schema.Literal("encrypted_content") })
13908 ], { mode: "oneOf" })
13909 ),
13910 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
13911 "recipient": Schema.String,
13912 "type": Schema.Literal("agent_message")
13913}).annotate({
13914 "description": "A message routed between agents in a multi-agent session",
13915 "identifier": "AgentMessageItem"
13916})
13917export type EasyInputMessage = {
13918 readonly "content"?:
13919 | ReadonlyArray<
13920 | InputText
13921 | {
13922 readonly "detail": "auto" | "high" | "low" | "original"
13923 readonly "image_url"?: string | null
13924 readonly "type": "input_image"
13925 }
13926 | InputFile
13927 | InputAudio
13928 | InputVideo
13929 >
13930 | string
13931 | null
13932 readonly "phase"?: "commentary" | "final_answer" | null
13933 readonly "role": "user" | "system" | "assistant" | "developer"
13934 readonly "type"?: "message"
13935}
13936export const EasyInputMessage = Schema.Struct({
13937 "content": Schema.optionalKey(
13938 Schema.Union([
13939 Schema.Array(
13940 Schema.Union([
13941 InputText,
13942 Schema.Struct({
13943 "detail": Schema.Literals(["auto", "high", "low", "original"]),
13944 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
13945 "type": Schema.Literal("input_image")
13946 }).annotate({ "description": "Image input content item" }),
13947 InputFile,
13948 InputAudio,
13949 InputVideo
13950 ], { mode: "oneOf" })
13951 ),
13952 Schema.String,
13953 Schema.Null
13954 ])
13955 ),
13956 "phase": Schema.optionalKey(
13957 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
13958 "description":
13959 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
13960 })
13961 ),
13962 "role": Schema.Literals(["user", "system", "assistant", "developer"]),
13963 "type": Schema.optionalKey(Schema.Literal("message"))
13964}).annotate({ "identifier": "EasyInputMessage" })
13965export type InputMessageItem = {
13966 readonly "content"?:
13967 | ReadonlyArray<
13968 | InputText
13969 | {
13970 readonly "detail": "auto" | "high" | "low" | "original"
13971 readonly "image_url"?: string | null
13972 readonly "type": "input_image"
13973 }
13974 | InputFile
13975 | InputAudio
13976 | InputVideo
13977 >
13978 | null
13979 readonly "id"?: string
13980 readonly "role": "user" | "system" | "developer"
13981 readonly "type"?: "message"
13982}
13983export const InputMessageItem = Schema.Struct({
13984 "content": Schema.optionalKey(
13985 Schema.Union([
13986 Schema.Array(
13987 Schema.Union([
13988 InputText,
13989 Schema.Struct({
13990 "detail": Schema.Literals(["auto", "high", "low", "original"]),
13991 "image_url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
13992 "type": Schema.Literal("input_image")
13993 }).annotate({ "description": "Image input content item" }),
13994 InputFile,
13995 InputAudio,
13996 InputVideo
13997 ], { mode: "oneOf" })
13998 ),
13999 Schema.Null
14000 ])
14001 ),
14002 "id": Schema.optionalKey(Schema.String),
14003 "role": Schema.Literals(["user", "system", "developer"]),
14004 "type": Schema.optionalKey(Schema.Literal("message"))
14005}).annotate({ "identifier": "InputMessageItem" })
14006export type OpenAIResponseCustomToolCallOutput = {
14007 readonly "call_id": string
14008 readonly "id"?: string
14009 readonly "output": string | ReadonlyArray<InputText | InputImage | InputFile>
14010 readonly "type": "custom_tool_call_output"
14011}
14012export const OpenAIResponseCustomToolCallOutput = Schema.Struct({
14013 "call_id": Schema.String,
14014 "id": Schema.optionalKey(Schema.String),
14015 "output": Schema.Union([
14016 Schema.String,
14017 Schema.Array(Schema.Union([InputText, InputImage, InputFile], { mode: "oneOf" }))
14018 ]),
14019 "type": Schema.Literal("custom_tool_call_output")
14020}).annotate({ "identifier": "OpenAIResponseCustomToolCallOutput" })
14021export type OpenAIResponseFunctionToolCallOutput = {
14022 readonly "call_id": string
14023 readonly "id"?: string | null
14024 readonly "output": string | ReadonlyArray<InputText | InputImage | InputFile>
14025 readonly "status"?: ToolCallStatus | null
14026 readonly "type": "function_call_output"
14027}
14028export const OpenAIResponseFunctionToolCallOutput = Schema.Struct({
14029 "call_id": Schema.String,
14030 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
14031 "output": Schema.Union([
14032 Schema.String,
14033 Schema.Array(Schema.Union([InputText, InputImage, InputFile], { mode: "oneOf" }))
14034 ]),
14035 "status": Schema.optionalKey(Schema.Union([ToolCallStatus, Schema.Null])),
14036 "type": Schema.Literal("function_call_output")
14037}).annotate({ "identifier": "OpenAIResponseFunctionToolCallOutput" })
14038export type OpenAIResponseInputMessageItem = {
14039 readonly "content": ReadonlyArray<InputText | InputImage | InputFile | InputAudio>
14040 readonly "id": string
14041 readonly "role": "user" | "system" | "developer"
14042 readonly "type"?: "message"
14043}
14044export const OpenAIResponseInputMessageItem = Schema.Struct({
14045 "content": Schema.Array(Schema.Union([InputText, InputImage, InputFile, InputAudio], { mode: "oneOf" })),
14046 "id": Schema.String,
14047 "role": Schema.Literals(["user", "system", "developer"]),
14048 "type": Schema.optionalKey(Schema.Literal("message"))
14049}).annotate({ "identifier": "OpenAIResponseInputMessageItem" })
14050export type Objects_151 = {
14051 readonly "id": string
14052 readonly "variables"?: { readonly [x: string]: string | InputText | InputImage | InputFile } | null
14053 readonly [x: string]: Schema.Json
14054}
14055export const Objects_151 = Schema.StructWithRest(
14056 Schema.Struct({
14057 "id": Schema.String,
14058 "variables": Schema.optionalKey(
14059 Schema.Union([
14060 Schema.Record(Schema.String, Schema.Union([Schema.String, InputText, InputImage, InputFile])),
14061 Schema.Null
14062 ])
14063 )
14064 }),
14065 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
14066)
14067export type CreateGuardrailResponse = { readonly "data": Guardrail }
14068export const CreateGuardrailResponse = Schema.Struct({
14069 "data": Schema.suspend((): Schema.Codec<Guardrail> => Guardrail).annotate({ "description": "The created guardrail" })
14070}).annotate({ "identifier": "CreateGuardrailResponse" })
14071export type GetGuardrailResponse = { readonly "data": Guardrail }
14072export const GetGuardrailResponse = Schema.Struct({
14073 "data": Schema.suspend((): Schema.Codec<Guardrail> => Guardrail).annotate({ "description": "The guardrail" })
14074}).annotate({ "identifier": "GetGuardrailResponse" })
14075export type ListGuardrailsResponse = { readonly "data": ReadonlyArray<Guardrail>; readonly "total_count": number }
14076export const ListGuardrailsResponse = Schema.Struct({
14077 "data": Schema.Array(Guardrail).annotate({ "description": "List of guardrails" }),
14078 "total_count": Schema.Number.annotate({ "description": "Total number of guardrails" }).check(
14079 Schema.isInt().annotate({ "expected": "an integer" })
14080 )
14081}).annotate({ "identifier": "ListGuardrailsResponse" })
14082export type UpdateGuardrailResponse = { readonly "data": Guardrail }
14083export const UpdateGuardrailResponse = Schema.Struct({
14084 "data": Schema.suspend((): Schema.Codec<Guardrail> => Guardrail).annotate({ "description": "The updated guardrail" })
14085}).annotate({ "identifier": "UpdateGuardrailResponse" })
14086export type ImageGenerationRequest = {
14087 readonly "aspect_ratio"?:
14088 | "1:1"
14089 | "1:2"
14090 | "1:4"
14091 | "1:8"
14092 | "2:1"
14093 | "2:3"
14094 | "3:2"
14095 | "3:4"
14096 | "4:1"
14097 | "4:3"
14098 | "4:5"
14099 | "5:4"
14100 | "8:1"
14101 | "9:16"
14102 | "16:9"
14103 | "9:19.5"
14104 | "19.5:9"
14105 | "9:20"
14106 | "20:9"
14107 | "9:21"
14108 | "21:9"
14109 | "auto"
14110 readonly "background"?: "auto" | "transparent" | "opaque"
14111 readonly "input_references"?: ReadonlyArray<ContentPartImage>
14112 readonly "model": string
14113 readonly "n"?: number
14114 readonly "output_compression"?: number
14115 readonly "output_format"?: "png" | "jpeg" | "webp" | "svg"
14116 readonly "prompt": string
14117 readonly "provider"?: ImageGenerationProviderPreferences
14118 readonly "quality"?: "auto" | "low" | "medium" | "high"
14119 readonly "resolution"?: "512" | "1K" | "2K" | "4K"
14120 readonly "seed"?: number
14121 readonly "size"?: string
14122 readonly "stream"?: boolean
14123}
14124export const ImageGenerationRequest = Schema.Struct({
14125 "aspect_ratio": Schema.optionalKey(
14126 Schema.Literals([
14127 "1:1",
14128 "1:2",
14129 "1:4",
14130 "1:8",
14131 "2:1",
14132 "2:3",
14133 "3:2",
14134 "3:4",
14135 "4:1",
14136 "4:3",
14137 "4:5",
14138 "5:4",
14139 "8:1",
14140 "9:16",
14141 "16:9",
14142 "9:19.5",
14143 "19.5:9",
14144 "9:20",
14145 "20:9",
14146 "9:21",
14147 "21:9",
14148 "auto"
14149 ]).annotate({
14150 "description": "Normalized aspect ratio of the generated image. Providers clamp to their supported subset."
14151 })
14152 ),
14153 "background": Schema.optionalKey(
14154 Schema.Literals(["auto", "transparent", "opaque"]).annotate({
14155 "description": "Background treatment. `transparent` requires an output_format that supports alpha (png or webp)."
14156 })
14157 ),
14158 "input_references": Schema.optionalKey(
14159 Schema.Array(ContentPartImage).annotate({
14160 "description": "Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs."
14161 }).check(Schema.isMaxLength(16).annotate({ "expected": "a value with a length of at most 16" }))
14162 ),
14163 "model": Schema.String.annotate({ "description": "The image generation model to use" }),
14164 "n": Schema.optionalKey(
14165 Schema.Number.annotate({
14166 "description":
14167 "Number of images to generate (1-10). Providers that only support single-image generation reject n > 1."
14168 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
14169 ),
14170 "output_compression": Schema.optionalKey(
14171 Schema.Number.annotate({
14172 "description":
14173 "Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob."
14174 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
14175 ),
14176 "output_format": Schema.optionalKey(
14177 Schema.Literals(["png", "jpeg", "webp", "svg"]).annotate({
14178 "description":
14179 "Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`."
14180 })
14181 ),
14182 "prompt": Schema.String.annotate({ "description": "Text description of the desired image" }).check(
14183 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
14184 ),
14185 "provider": Schema.optionalKey(ImageGenerationProviderPreferences),
14186 "quality": Schema.optionalKey(
14187 Schema.Literals(["auto", "low", "medium", "high"]).annotate({
14188 "description": "Rendering quality. Providers without a quality knob ignore this."
14189 })
14190 ),
14191 "resolution": Schema.optionalKey(
14192 Schema.Literals(["512", "1K", "2K", "4K"]).annotate({
14193 "description":
14194 "Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider."
14195 })
14196 ),
14197 "seed": Schema.optionalKey(
14198 Schema.Number.annotate({
14199 "description":
14200 "If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers."
14201 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
14202 ),
14203 "size": Schema.optionalKey(Schema.String.annotate({
14204 "description":
14205 "Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400."
14206 })),
14207 "stream": Schema.optionalKey(
14208 Schema.Boolean.annotate({
14209 "description":
14210 "If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response."
14211 })
14212 )
14213}).annotate({ "description": "Image generation request input", "identifier": "ImageGenerationRequest" })
14214export type Model = {
14215 readonly "architecture": ModelArchitecture
14216 readonly "benchmarks"?: ModelBenchmarks
14217 readonly "canonical_slug": string
14218 readonly "context_length": number | null
14219 readonly "created": number
14220 readonly "default_parameters": DefaultParameters
14221 readonly "description"?: string
14222 readonly "expiration_date"?: string | null
14223 readonly "hugging_face_id"?: string | null
14224 readonly "id": string
14225 readonly "knowledge_cutoff"?: string | null
14226 readonly "links": ModelLinks
14227 readonly "name": string
14228 readonly "per_request_limits": PerRequestLimits
14229 readonly "pricing": PublicPricing
14230 readonly "reasoning"?: ModelReasoning
14231 readonly "supported_parameters": ReadonlyArray<Parameter>
14232 readonly "supported_voices": ReadonlyArray<string> | null
14233 readonly "top_provider": TopProviderInfo
14234}
14235export const Model = Schema.Struct({
14236 "architecture": ModelArchitecture,
14237 "benchmarks": Schema.optionalKey(ModelBenchmarks),
14238 "canonical_slug": Schema.String.annotate({ "description": "Canonical slug for the model" }),
14239 "context_length": Schema.Union([
14240 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14241 Schema.Null
14242 ]).annotate({ "description": "Maximum context length in tokens" }),
14243 "created": Schema.Number.annotate({ "description": "Unix timestamp of when the model was created" }).check(
14244 Schema.isInt().annotate({ "expected": "an integer" })
14245 ),
14246 "default_parameters": DefaultParameters,
14247 "description": Schema.optionalKey(Schema.String.annotate({ "description": "Description of the model" })),
14248 "expiration_date": Schema.optionalKey(
14249 Schema.Union([Schema.String, Schema.Null]).annotate({
14250 "description":
14251 "The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration."
14252 })
14253 ),
14254 "hugging_face_id": Schema.optionalKey(
14255 Schema.Union([Schema.String, Schema.Null]).annotate({
14256 "description": "Hugging Face model identifier, if applicable"
14257 })
14258 ),
14259 "id": Schema.String.annotate({ "description": "Unique identifier for the model" }),
14260 "knowledge_cutoff": Schema.optionalKey(
14261 Schema.Union([Schema.String, Schema.Null]).annotate({
14262 "description":
14263 "The date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown."
14264 })
14265 ),
14266 "links": ModelLinks,
14267 "name": Schema.String.annotate({ "description": "Display name of the model" }),
14268 "per_request_limits": PerRequestLimits,
14269 "pricing": PublicPricing,
14270 "reasoning": Schema.optionalKey(ModelReasoning),
14271 "supported_parameters": Schema.Array(Parameter).annotate({
14272 "description": "List of supported parameters for this model"
14273 }),
14274 "supported_voices": Schema.Union([Schema.Array(Schema.String), Schema.Null]).annotate({
14275 "description": "List of supported voice identifiers for TTS models. Null for non-TTS models."
14276 }),
14277 "top_provider": TopProviderInfo
14278}).annotate({ "description": "Information about an AI model available on OpenRouter", "identifier": "Model" })
14279export type ChatReasoningDetails = ReadonlyArray<ReasoningDetailUnion>
14280export const ChatReasoningDetails = Schema.Array(ReasoningDetailUnion).annotate({
14281 "description": "Reasoning details for extended thinking models",
14282 "identifier": "ChatReasoningDetails"
14283})
14284export type ChatStreamReasoningDetails = ReadonlyArray<ReasoningDetailUnion>
14285export const ChatStreamReasoningDetails = Schema.Array(ReasoningDetailUnion).annotate({
14286 "description": "Reasoning details for extended thinking models",
14287 "identifier": "ChatStreamReasoningDetails"
14288})
14289export type SubagentServerTool_OpenRouter = {
14290 readonly "parameters"?: SubagentServerToolConfig
14291 readonly "type": "openrouter:subagent"
14292}
14293export const SubagentServerTool_OpenRouter = Schema.Struct({
14294 "parameters": Schema.optionalKey(SubagentServerToolConfig),
14295 "type": Schema.Literal("openrouter:subagent")
14296}).annotate({
14297 "description":
14298 "OpenRouter built-in server tool: delegates self-contained tasks to a smaller, cheaper, faster worker model (any OpenRouter model) mid-generation and returns its outcome. The worker may run as a sub-agent with its own tools.",
14299 "identifier": "SubagentServerTool_OpenRouter"
14300})
14301export type BaseContentPartAddedEvent = {
14302 readonly "content_index": number
14303 readonly "item_id": string
14304 readonly "output_index": number
14305 readonly "part": ResponseOutputText | OpenAIResponsesRefusalContent
14306 readonly "sequence_number": number
14307 readonly "type": "response.content_part.added"
14308}
14309export const BaseContentPartAddedEvent = Schema.Struct({
14310 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14311 "item_id": Schema.String,
14312 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14313 "part": Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent]),
14314 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14315 "type": Schema.Literal("response.content_part.added")
14316}).annotate({
14317 "description": "Event emitted when a new content part is added to an output item",
14318 "identifier": "BaseContentPartAddedEvent"
14319})
14320export type BaseContentPartDoneEvent = {
14321 readonly "content_index": number
14322 readonly "item_id": string
14323 readonly "output_index": number
14324 readonly "part": ResponseOutputText | OpenAIResponsesRefusalContent
14325 readonly "sequence_number": number
14326 readonly "type": "response.content_part.done"
14327}
14328export const BaseContentPartDoneEvent = Schema.Struct({
14329 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14330 "item_id": Schema.String,
14331 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14332 "part": Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent]),
14333 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14334 "type": Schema.Literal("response.content_part.done")
14335}).annotate({
14336 "description": "Event emitted when a content part is complete",
14337 "identifier": "BaseContentPartDoneEvent"
14338})
14339export type ContentPartAddedEvent = {
14340 readonly "content_index": number
14341 readonly "item_id": string
14342 readonly "output_index": number
14343 readonly "part": ResponseOutputText | ReasoningTextContent | OpenAIResponsesRefusalContent
14344 readonly "sequence_number": number
14345 readonly "type": "response.content_part.added"
14346}
14347export const ContentPartAddedEvent = Schema.Struct({
14348 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14349 "item_id": Schema.String,
14350 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14351 "part": Schema.Union([ResponseOutputText, ReasoningTextContent, OpenAIResponsesRefusalContent]),
14352 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14353 "type": Schema.Literal("response.content_part.added")
14354}).annotate({
14355 "description": "Event emitted when a new content part is added to an output item",
14356 "identifier": "ContentPartAddedEvent"
14357})
14358export type ContentPartDoneEvent = {
14359 readonly "content_index": number
14360 readonly "item_id": string
14361 readonly "output_index": number
14362 readonly "part": ResponseOutputText | ReasoningTextContent | OpenAIResponsesRefusalContent
14363 readonly "sequence_number": number
14364 readonly "type": "response.content_part.done"
14365}
14366export const ContentPartDoneEvent = Schema.Struct({
14367 "content_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14368 "item_id": Schema.String,
14369 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14370 "part": Schema.Union([ResponseOutputText, ReasoningTextContent, OpenAIResponsesRefusalContent]),
14371 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14372 "type": Schema.Literal("response.content_part.done")
14373}).annotate({ "description": "Event emitted when a content part is complete", "identifier": "ContentPartDoneEvent" })
14374export type OutputMessage = {
14375 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
14376 readonly "id": string
14377 readonly "phase"?: "commentary" | "final_answer" | null
14378 readonly "role": "assistant"
14379 readonly "status"?: "completed" | "incomplete" | "in_progress"
14380 readonly "type": "message"
14381}
14382export const OutputMessage = Schema.Struct({
14383 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
14384 "id": Schema.String,
14385 "phase": Schema.optionalKey(
14386 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
14387 "description":
14388 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
14389 })
14390 ),
14391 "role": Schema.Literal("assistant"),
14392 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
14393 "type": Schema.Literal("message")
14394}).annotate({ "identifier": "OutputMessage" })
14395export type OutputMessageItem = {
14396 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
14397 readonly "id": string
14398 readonly "phase"?: "commentary" | "final_answer" | null
14399 readonly "role": "assistant"
14400 readonly "status"?: "completed" | "incomplete" | "in_progress"
14401 readonly "type": "message"
14402}
14403export const OutputMessageItem = Schema.Struct({
14404 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
14405 "id": Schema.String,
14406 "phase": Schema.optionalKey(
14407 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
14408 "description":
14409 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
14410 })
14411 ),
14412 "role": Schema.Literal("assistant"),
14413 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
14414 "type": Schema.Literal("message")
14415}).annotate({ "description": "An output message item", "identifier": "OutputMessageItem" })
14416export type AnthropicWebFetchContent = AnthropicWebFetchToolResultError | AnthropicWebFetchBlock
14417export const AnthropicWebFetchContent = Schema.Union([AnthropicWebFetchToolResultError, AnthropicWebFetchBlock], {
14418 mode: "oneOf"
14419}).annotate({ "identifier": "AnthropicWebFetchContent" })
14420export type MessagesMessageParam = {
14421 readonly "content":
14422 | string
14423 | ReadonlyArray<
14424 | AnthropicTextBlockParam
14425 | AnthropicImageBlockParam
14426 | AnthropicDocumentBlockParam
14427 | {
14428 readonly "cache_control"?: AnthropicCacheControlDirective
14429 readonly "id": string
14430 readonly "input"?: Schema.Json
14431 readonly "name": string
14432 readonly "type": "tool_use"
14433 }
14434 | {
14435 readonly "cache_control"?: AnthropicCacheControlDirective
14436 readonly "content"?:
14437 | string
14438 | ReadonlyArray<
14439 | AnthropicTextBlockParam
14440 | AnthropicImageBlockParam
14441 | { readonly "tool_name": string; readonly "type": "tool_reference" }
14442 | AnthropicSearchResultBlockParam
14443 | AnthropicDocumentBlockParam
14444 >
14445 readonly "is_error"?: boolean
14446 readonly "tool_use_id": string
14447 readonly "type": "tool_result"
14448 }
14449 | { readonly "signature": string; readonly "thinking": string; readonly "type": "thinking" }
14450 | { readonly "data": string; readonly "type": "redacted_thinking" }
14451 | {
14452 readonly "cache_control"?: AnthropicCacheControlDirective
14453 readonly "id": string
14454 readonly "input"?: Schema.Json
14455 readonly "name": string
14456 readonly "type": "server_tool_use"
14457 }
14458 | {
14459 readonly "cache_control"?: AnthropicCacheControlDirective
14460 readonly "content": ReadonlyArray<AnthropicWebSearchResultBlockParam> | {
14461 readonly "error_code":
14462 | "invalid_tool_input"
14463 | "unavailable"
14464 | "max_uses_exceeded"
14465 | "too_many_requests"
14466 | "query_too_long"
14467 readonly "type": "web_search_tool_result_error"
14468 }
14469 readonly "tool_use_id": string
14470 readonly "type": "web_search_tool_result"
14471 }
14472 | AnthropicSearchResultBlockParam
14473 | {
14474 readonly "cache_control"?: AnthropicCacheControlDirective
14475 readonly "content": string | null
14476 readonly "type": "compaction"
14477 }
14478 | MessagesAdvisorToolResultBlock
14479 >
14480 readonly "role": "user" | "assistant" | "system"
14481}
14482export const MessagesMessageParam = Schema.Struct({
14483 "content": Schema.Union([
14484 Schema.String,
14485 Schema.Array(
14486 Schema.Union([
14487 AnthropicTextBlockParam,
14488 AnthropicImageBlockParam,
14489 AnthropicDocumentBlockParam,
14490 Schema.Struct({
14491 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
14492 "id": Schema.String,
14493 "input": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
14494 "name": Schema.String,
14495 "type": Schema.Literal("tool_use")
14496 }),
14497 Schema.Struct({
14498 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
14499 "content": Schema.optionalKey(
14500 Schema.Union([
14501 Schema.String,
14502 Schema.Array(
14503 Schema.Union([
14504 AnthropicTextBlockParam,
14505 AnthropicImageBlockParam,
14506 Schema.Struct({ "tool_name": Schema.String, "type": Schema.Literal("tool_reference") }),
14507 AnthropicSearchResultBlockParam,
14508 AnthropicDocumentBlockParam
14509 ])
14510 )
14511 ])
14512 ),
14513 "is_error": Schema.optionalKey(Schema.Boolean),
14514 "tool_use_id": Schema.String,
14515 "type": Schema.Literal("tool_result")
14516 }),
14517 Schema.Struct({ "signature": Schema.String, "thinking": Schema.String, "type": Schema.Literal("thinking") }),
14518 Schema.Struct({ "data": Schema.String, "type": Schema.Literal("redacted_thinking") }),
14519 Schema.Struct({
14520 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
14521 "id": Schema.String,
14522 "input": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
14523 "name": Schema.String,
14524 "type": Schema.Literal("server_tool_use")
14525 }),
14526 Schema.Struct({
14527 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
14528 "content": Schema.Union([
14529 Schema.Array(AnthropicWebSearchResultBlockParam),
14530 Schema.Struct({
14531 "error_code": Schema.Literals([
14532 "invalid_tool_input",
14533 "unavailable",
14534 "max_uses_exceeded",
14535 "too_many_requests",
14536 "query_too_long"
14537 ]),
14538 "type": Schema.Literal("web_search_tool_result_error")
14539 })
14540 ]),
14541 "tool_use_id": Schema.String,
14542 "type": Schema.Literal("web_search_tool_result")
14543 }),
14544 AnthropicSearchResultBlockParam,
14545 Schema.Struct({
14546 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
14547 "content": Schema.Union([Schema.String, Schema.Null]),
14548 "type": Schema.Literal("compaction")
14549 }),
14550 MessagesAdvisorToolResultBlock
14551 ], { mode: "oneOf" })
14552 )
14553 ]),
14554 "role": Schema.Literals(["user", "assistant", "system"])
14555}).annotate({ "description": "Anthropic message with OpenRouter extensions", "identifier": "MessagesMessageParam" })
14556export type Union_7 = ReadonlyArray<AnthropicUsageIteration> | null
14557export const Union_7 = Schema.Union([Schema.Array(AnthropicUsageIteration), Schema.Null])
14558export type MessagesDeltaEvent = {
14559 readonly "delta": {
14560 readonly "container": AnthropicContainer
14561 readonly "stop_details": AnthropicRefusalStopDetails
14562 readonly "stop_reason": ORAnthropicStopReason
14563 readonly "stop_sequence": string | null
14564 }
14565 readonly "type": "message_delta"
14566 readonly "usage": {
14567 readonly "cache_creation"?: AnthropicCacheCreation
14568 readonly "cache_creation_input_tokens": number | null
14569 readonly "cache_read_input_tokens": number | null
14570 readonly "input_tokens": number | null
14571 readonly "iterations"?: ReadonlyArray<AnthropicUsageIteration>
14572 readonly "output_tokens": number
14573 readonly "output_tokens_details": AnthropicOutputTokensDetails
14574 readonly "server_tool_use": {
14575 readonly "web_fetch_requests": number
14576 readonly "web_search_requests": number
14577 readonly [x: string]: Schema.Json
14578 } | null
14579 }
14580}
14581export const MessagesDeltaEvent = Schema.Struct({
14582 "delta": Schema.Struct({
14583 "container": AnthropicContainer,
14584 "stop_details": AnthropicRefusalStopDetails,
14585 "stop_reason": ORAnthropicStopReason,
14586 "stop_sequence": Schema.Union([Schema.String, Schema.Null])
14587 }),
14588 "type": Schema.Literal("message_delta"),
14589 "usage": Schema.Struct({
14590 "cache_creation": Schema.optionalKey(AnthropicCacheCreation),
14591 "cache_creation_input_tokens": Schema.Union([
14592 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14593 Schema.Null
14594 ]),
14595 "cache_read_input_tokens": Schema.Union([
14596 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14597 Schema.Null
14598 ]),
14599 "input_tokens": Schema.Union([
14600 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14601 Schema.Null
14602 ]),
14603 "iterations": Schema.optionalKey(Schema.Array(AnthropicUsageIteration)),
14604 "output_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14605 "output_tokens_details": AnthropicOutputTokensDetails,
14606 "server_tool_use": Schema.Union([
14607 Schema.StructWithRest(
14608 Schema.Struct({
14609 "web_fetch_requests": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
14610 "web_search_requests": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
14611 }),
14612 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
14613 ),
14614 Schema.Null
14615 ])
14616 })
14617}).annotate({
14618 "description": "Event sent when the message metadata changes (e.g., stop_reason)",
14619 "identifier": "MessagesDeltaEvent"
14620})
14621export type CreateObservabilityDestinationResponse = { readonly "data": ObservabilityDestination }
14622export const CreateObservabilityDestinationResponse = Schema.Struct({
14623 "data": Schema.suspend((): Schema.Codec<ObservabilityDestination> => ObservabilityDestination).annotate({
14624 "description": "The newly created observability destination."
14625 })
14626}).annotate({ "identifier": "CreateObservabilityDestinationResponse" })
14627export type GetObservabilityDestinationResponse = { readonly "data": ObservabilityDestination }
14628export const GetObservabilityDestinationResponse = Schema.Struct({
14629 "data": Schema.suspend((): Schema.Codec<ObservabilityDestination> => ObservabilityDestination).annotate({
14630 "description": "The observability destination."
14631 })
14632}).annotate({ "identifier": "GetObservabilityDestinationResponse" })
14633export type ListObservabilityDestinationsResponse = {
14634 readonly "data": ReadonlyArray<ObservabilityDestination>
14635 readonly "total_count": number
14636}
14637export const ListObservabilityDestinationsResponse = Schema.Struct({
14638 "data": Schema.Array(ObservabilityDestination).annotate({ "description": "List of observability destinations." }),
14639 "total_count": Schema.Number.annotate({ "description": "Total number of destinations matching the filters." }).check(
14640 Schema.isInt().annotate({ "expected": "an integer" })
14641 )
14642}).annotate({ "identifier": "ListObservabilityDestinationsResponse" })
14643export type UpdateObservabilityDestinationResponse = { readonly "data": ObservabilityDestination }
14644export const UpdateObservabilityDestinationResponse = Schema.Struct({
14645 "data": Schema.suspend((): Schema.Codec<ObservabilityDestination> => ObservabilityDestination).annotate({
14646 "description": "The updated observability destination."
14647 })
14648}).annotate({ "identifier": "UpdateObservabilityDestinationResponse" })
14649export type MessagesErrorEvent = {
14650 readonly "error": { readonly "error_type"?: ApiErrorType; readonly "message": string; readonly "type": string }
14651 readonly "openrouter_metadata"?: OpenRouterMetadata
14652 readonly "type": "error"
14653}
14654export const MessagesErrorEvent = Schema.Struct({
14655 "error": Schema.Struct({
14656 "error_type": Schema.optionalKey(ApiErrorType),
14657 "message": Schema.String,
14658 "type": Schema.String
14659 }),
14660 "openrouter_metadata": Schema.optionalKey(OpenRouterMetadata),
14661 "type": Schema.Literal("error")
14662}).annotate({ "description": "Error event in the stream", "identifier": "MessagesErrorEvent" })
14663export type MessagesStopEvent = { readonly "openrouter_metadata"?: OpenRouterMetadata; readonly "type": "message_stop" }
14664export const MessagesStopEvent = Schema.Struct({
14665 "openrouter_metadata": Schema.optionalKey(OpenRouterMetadata),
14666 "type": Schema.Literal("message_stop")
14667}).annotate({ "description": "Event sent when the message is complete", "identifier": "MessagesStopEvent" })
14668export type ChatToolMessage = {
14669 readonly "content": string | ReadonlyArray<ChatContentItems>
14670 readonly "role": "tool"
14671 readonly "tool_call_id": string
14672}
14673export const ChatToolMessage = Schema.Struct({
14674 "content": Schema.Union([Schema.String, Schema.Array(ChatContentItems)]).annotate({
14675 "description": "Tool response content"
14676 }),
14677 "role": Schema.Literal("tool"),
14678 "tool_call_id": Schema.String.annotate({
14679 "description": "ID of the assistant message tool call this message responds to"
14680 })
14681}).annotate({ "description": "Tool response message", "identifier": "ChatToolMessage" })
14682export type ChatUserMessage = {
14683 readonly "content": string | ReadonlyArray<ChatContentItems>
14684 readonly "name"?: string
14685 readonly "role": "user"
14686}
14687export const ChatUserMessage = Schema.Struct({
14688 "content": Schema.Union([Schema.String, Schema.Array(ChatContentItems)]).annotate({
14689 "description": "User message content"
14690 }),
14691 "name": Schema.optionalKey(Schema.String.annotate({ "description": "Optional name for the user" })),
14692 "role": Schema.Literal("user")
14693}).annotate({ "description": "User message", "identifier": "ChatUserMessage" })
14694export type StoredPromptTemplate = Objects_151 | null
14695export const StoredPromptTemplate = Schema.Union([Objects_151, Schema.Null]).annotate({
14696 "identifier": "StoredPromptTemplate"
14697})
14698export type ModelResponse = { readonly "data": Model }
14699export const ModelResponse = Schema.Struct({ "data": Model }).annotate({
14700 "description": "Single model response",
14701 "identifier": "ModelResponse"
14702})
14703export type ModelsListResponseData = ReadonlyArray<Model>
14704export const ModelsListResponseData = Schema.Array(Model).annotate({
14705 "description": "List of available models",
14706 "identifier": "ModelsListResponseData"
14707})
14708export type ChatAssistantMessage = {
14709 readonly "audio"?: ChatAudioOutput
14710 readonly "content"?: string | ReadonlyArray<ChatContentItems> | null
14711 readonly "images"?:
14712 | ReadonlyArray<{ readonly "type": "image_url"; readonly "image_url": { readonly "url": string } }>
14713 | null
14714 readonly "model"?: string
14715 readonly "name"?: string
14716 readonly "reasoning"?: string | null
14717 readonly "reasoning_details"?: ChatReasoningDetails
14718 readonly "refusal"?: string | null
14719 readonly "role": "assistant"
14720 readonly "tool_calls"?: ReadonlyArray<ChatToolCall>
14721 readonly "annotations"?:
14722 | ReadonlyArray<
14723 {
14724 readonly "type": "url_citation"
14725 readonly "url_citation": {
14726 readonly "url": string
14727 readonly "title"?: string
14728 readonly "start_index"?: number
14729 readonly "end_index"?: number
14730 readonly "content"?: string
14731 }
14732 } | {
14733 readonly "type": "file_annotation"
14734 readonly "file_annotation": { readonly "file_id": string; readonly "quote"?: string }
14735 } | {
14736 readonly "type": "file"
14737 readonly "file": {
14738 readonly "hash": string
14739 readonly "name": string
14740 readonly "content"?: ReadonlyArray<{ readonly "type": string; readonly "text"?: string }>
14741 }
14742 }
14743 >
14744 | null
14745}
14746export const ChatAssistantMessage = Schema.Struct({
14747 "audio": Schema.optionalKey(ChatAudioOutput),
14748 "content": Schema.optionalKey(
14749 Schema.Union([Schema.String, Schema.Array(ChatContentItems), Schema.Null]).annotate({
14750 "description": "Assistant message content"
14751 })
14752 ),
14753 "images": Schema.optionalKey(
14754 Schema.Union([
14755 Schema.Array(
14756 Schema.Struct({ "type": Schema.Literal("image_url"), "image_url": Schema.Struct({ "url": Schema.String }) })
14757 ),
14758 Schema.Null
14759 ])
14760 ),
14761 "model": Schema.optionalKey(Schema.String.annotate({ "description": "Model that generated this assistant message" })),
14762 "name": Schema.optionalKey(Schema.String.annotate({ "description": "Optional name for the assistant" })),
14763 "reasoning": Schema.optionalKey(
14764 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Reasoning output" })
14765 ),
14766 "reasoning_details": Schema.optionalKey(ChatReasoningDetails),
14767 "refusal": Schema.optionalKey(
14768 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Refusal message if content was refused" })
14769 ),
14770 "role": Schema.Literal("assistant"),
14771 "tool_calls": Schema.optionalKey(
14772 Schema.Array(ChatToolCall).annotate({ "description": "Tool calls made by the assistant" })
14773 ),
14774 "annotations": Schema.optionalKey(Schema.Union([
14775 Schema.Array(Schema.Union([
14776 Schema.Struct({
14777 "type": Schema.Literal("url_citation"),
14778 "url_citation": Schema.Struct({
14779 "url": Schema.String,
14780 "title": Schema.optionalKey(Schema.String),
14781 "start_index": Schema.optionalKey(
14782 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" }))
14783 ),
14784 "end_index": Schema.optionalKey(
14785 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" }))
14786 ),
14787 "content": Schema.optionalKey(Schema.String)
14788 })
14789 }),
14790 Schema.Struct({
14791 "type": Schema.Literal("file_annotation"),
14792 "file_annotation": Schema.Struct({ "file_id": Schema.String, "quote": Schema.optionalKey(Schema.String) })
14793 }),
14794 Schema.Struct({
14795 "type": Schema.Literal("file"),
14796 "file": Schema.Struct({
14797 "hash": Schema.String,
14798 "name": Schema.String,
14799 "content": Schema.optionalKey(
14800 Schema.Array(Schema.Struct({ "type": Schema.String, "text": Schema.optionalKey(Schema.String) }))
14801 )
14802 })
14803 })
14804 ], { mode: "oneOf" })),
14805 Schema.Null
14806 ]))
14807}).annotate({ "description": "Assistant message for requests and responses", "identifier": "ChatAssistantMessage" })
14808export type ChatStreamDelta = {
14809 readonly "audio"?: ChatAudioOutput
14810 readonly "content"?: string | null
14811 readonly "reasoning"?: string | null
14812 readonly "reasoning_details"?: ChatStreamReasoningDetails
14813 readonly "refusal"?: string | null
14814 readonly "role"?: "assistant"
14815 readonly "tool_calls"?: ReadonlyArray<ChatStreamToolCall>
14816 readonly "images"?:
14817 | ReadonlyArray<{ readonly "type": "image_url"; readonly "image_url": { readonly "url": string } }>
14818 | null
14819 readonly "annotations"?:
14820 | ReadonlyArray<
14821 {
14822 readonly "type": "url_citation"
14823 readonly "url_citation": {
14824 readonly "url": string
14825 readonly "title"?: string
14826 readonly "start_index"?: number
14827 readonly "end_index"?: number
14828 readonly "content"?: string
14829 }
14830 } | {
14831 readonly "type": "file_annotation"
14832 readonly "file_annotation": { readonly "file_id": string; readonly "quote"?: string }
14833 } | {
14834 readonly "type": "file"
14835 readonly "file": {
14836 readonly "hash": string
14837 readonly "name": string
14838 readonly "content"?: ReadonlyArray<{ readonly "type": string; readonly "text"?: string }>
14839 }
14840 }
14841 >
14842 | null
14843}
14844export const ChatStreamDelta = Schema.Struct({
14845 "audio": Schema.optionalKey(
14846 Schema.suspend((): Schema.Codec<ChatAudioOutput> => ChatAudioOutput).annotate({
14847 "description": "Audio output data"
14848 })
14849 ),
14850 "content": Schema.optionalKey(
14851 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Message content delta" })
14852 ),
14853 "reasoning": Schema.optionalKey(
14854 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Reasoning content delta" })
14855 ),
14856 "reasoning_details": Schema.optionalKey(ChatStreamReasoningDetails),
14857 "refusal": Schema.optionalKey(
14858 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Refusal message delta" })
14859 ),
14860 "role": Schema.optionalKey(Schema.Literal("assistant").annotate({ "description": "The role of the message author" })),
14861 "tool_calls": Schema.optionalKey(Schema.Array(ChatStreamToolCall).annotate({ "description": "Tool calls delta" })),
14862 "images": Schema.optionalKey(
14863 Schema.Union([
14864 Schema.Array(
14865 Schema.Struct({ "type": Schema.Literal("image_url"), "image_url": Schema.Struct({ "url": Schema.String }) })
14866 ),
14867 Schema.Null
14868 ])
14869 ),
14870 "annotations": Schema.optionalKey(Schema.Union([
14871 Schema.Array(Schema.Union([
14872 Schema.Struct({
14873 "type": Schema.Literal("url_citation"),
14874 "url_citation": Schema.Struct({
14875 "url": Schema.String,
14876 "title": Schema.optionalKey(Schema.String),
14877 "start_index": Schema.optionalKey(
14878 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" }))
14879 ),
14880 "end_index": Schema.optionalKey(
14881 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" }))
14882 ),
14883 "content": Schema.optionalKey(Schema.String)
14884 })
14885 }),
14886 Schema.Struct({
14887 "type": Schema.Literal("file_annotation"),
14888 "file_annotation": Schema.Struct({ "file_id": Schema.String, "quote": Schema.optionalKey(Schema.String) })
14889 }),
14890 Schema.Struct({
14891 "type": Schema.Literal("file"),
14892 "file": Schema.Struct({
14893 "hash": Schema.String,
14894 "name": Schema.String,
14895 "content": Schema.optionalKey(
14896 Schema.Array(Schema.Struct({ "type": Schema.String, "text": Schema.optionalKey(Schema.String) }))
14897 )
14898 })
14899 })
14900 ], { mode: "oneOf" })),
14901 Schema.Null
14902 ]))
14903}).annotate({ "description": "Delta changes in streaming response", "identifier": "ChatStreamDelta" })
14904export type AdditionalToolsItem = {
14905 readonly "id"?: string | null
14906 readonly "role": "unknown" | "user" | "assistant" | "system" | "critic" | "discriminator" | "developer" | "tool"
14907 readonly "tools": ReadonlyArray<
14908 | {
14909 readonly "description"?: string | null
14910 readonly "name": string
14911 readonly "parameters": { readonly [x: string]: Schema.Json } | null
14912 readonly "strict"?: boolean | null
14913 readonly "type": "function"
14914 }
14915 | Preview_WebSearchServerTool
14916 | Preview_20250311_WebSearchServerTool
14917 | Legacy_WebSearchServerTool
14918 | WebSearchServerTool
14919 | FileSearchServerTool
14920 | ComputerUseServerTool
14921 | CodeInterpreterServerTool
14922 | McpServerTool
14923 | ImageGenerationServerTool
14924 | CodexLocalShellTool
14925 | ShellServerTool
14926 | ApplyPatchServerTool
14927 | CustomTool
14928 | NamespaceTool
14929 | AdvisorServerTool_OpenRouter
14930 | SubagentServerTool_OpenRouter
14931 | DatetimeServerTool
14932 | FilesServerTool
14933 | FusionServerTool_OpenRouter
14934 | ImageGenerationServerTool_OpenRouter
14935 | SearchModelsServerTool_OpenRouter
14936 | WebFetchServerTool
14937 | WebSearchServerTool_OpenRouter
14938 | ApplyPatchServerTool_OpenRouter
14939 | BashServerTool
14940 | ShellServerTool_OpenRouter
14941 | { readonly "type": string }
14942 >
14943 readonly "type": "additional_tools"
14944}
14945export const AdditionalToolsItem = Schema.Struct({
14946 "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
14947 "role": Schema.Literals(["unknown", "user", "assistant", "system", "critic", "discriminator", "developer", "tool"]),
14948 "tools": Schema.Array(Schema.Union([
14949 Schema.Struct({
14950 "description": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
14951 "name": Schema.String,
14952 "parameters": Schema.Union([
14953 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })),
14954 Schema.Null
14955 ]),
14956 "strict": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
14957 "type": Schema.Literal("function")
14958 }).annotate({ "description": "Function tool definition" }),
14959 Preview_WebSearchServerTool,
14960 Preview_20250311_WebSearchServerTool,
14961 Legacy_WebSearchServerTool,
14962 WebSearchServerTool,
14963 FileSearchServerTool,
14964 ComputerUseServerTool,
14965 CodeInterpreterServerTool,
14966 McpServerTool,
14967 ImageGenerationServerTool,
14968 CodexLocalShellTool,
14969 ShellServerTool,
14970 ApplyPatchServerTool,
14971 CustomTool,
14972 NamespaceTool,
14973 AdvisorServerTool_OpenRouter,
14974 SubagentServerTool_OpenRouter,
14975 DatetimeServerTool,
14976 FilesServerTool,
14977 FusionServerTool_OpenRouter,
14978 ImageGenerationServerTool_OpenRouter,
14979 SearchModelsServerTool_OpenRouter,
14980 WebFetchServerTool,
14981 WebSearchServerTool_OpenRouter,
14982 ApplyPatchServerTool_OpenRouter,
14983 BashServerTool,
14984 ShellServerTool_OpenRouter,
14985 Schema.Struct({ "type": Schema.String })
14986 ])),
14987 "type": Schema.Literal("additional_tools")
14988}).annotate({
14989 "description": "Additional tools made available to the model at this point in the input",
14990 "identifier": "AdditionalToolsItem"
14991})
14992export type ChatFunctionTool =
14993 | {
14994 readonly "cache_control"?: ChatContentCacheControl
14995 readonly "function": {
14996 readonly "description"?: string
14997 readonly "name": string
14998 readonly "parameters"?: {}
14999 readonly "strict"?: boolean | null
15000 }
15001 readonly "type": "function"
15002 }
15003 | AdvisorServerTool_OpenRouter
15004 | BashServerTool
15005 | DatetimeServerTool
15006 | FilesServerTool
15007 | FusionServerTool_OpenRouter
15008 | ImageGenerationServerTool_OpenRouter
15009 | ChatSearchModelsServerTool
15010 | SubagentServerTool_OpenRouter
15011 | WebFetchServerTool
15012 | OpenRouterWebSearchServerTool
15013 | ChatWebSearchShorthand
15014export const ChatFunctionTool = Schema.Union([
15015 Schema.Struct({
15016 "cache_control": Schema.optionalKey(ChatContentCacheControl),
15017 "function": Schema.Struct({
15018 "description": Schema.optionalKey(
15019 Schema.String.annotate({ "description": "Function description for the model" })
15020 ),
15021 "name": Schema.String.annotate({
15022 "description": "Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)"
15023 }).check(Schema.isMaxLength(64).annotate({ "expected": "a value with a length of at most 64" })),
15024 "parameters": Schema.optionalKey(
15025 Schema.Struct({}).annotate({ "description": "Function parameters as JSON Schema object" })
15026 ),
15027 "strict": Schema.optionalKey(
15028 Schema.Union([Schema.Boolean, Schema.Null]).annotate({ "description": "Enable strict schema adherence" })
15029 )
15030 }).annotate({ "description": "Function definition for tool calling" }),
15031 "type": Schema.Literal("function")
15032 }),
15033 AdvisorServerTool_OpenRouter,
15034 BashServerTool,
15035 DatetimeServerTool,
15036 FilesServerTool,
15037 FusionServerTool_OpenRouter,
15038 ImageGenerationServerTool_OpenRouter,
15039 ChatSearchModelsServerTool,
15040 SubagentServerTool_OpenRouter,
15041 WebFetchServerTool,
15042 OpenRouterWebSearchServerTool,
15043 ChatWebSearchShorthand
15044]).annotate({
15045 "description": "Tool definition for function calling (regular function or OpenRouter built-in server tool)",
15046 "identifier": "ChatFunctionTool"
15047})
15048export type BaseInputs =
15049 | string
15050 | ReadonlyArray<
15051 | {
15052 readonly "content": ReadonlyArray<InputText | InputImage | InputFile | InputAudio> | string
15053 readonly "phase"?: "commentary" | "final_answer" | null
15054 readonly "role": "user" | "system" | "assistant" | "developer"
15055 readonly "type"?: "message"
15056 }
15057 | OpenAIResponseInputMessageItem
15058 | OpenAIResponseFunctionToolCallOutput
15059 | OpenAIResponseFunctionToolCall
15060 | OutputItemImageGenerationCall
15061 | OutputMessage
15062 | OpenAIResponseCustomToolCall
15063 | OpenAIResponseCustomToolCallOutput
15064 | ApplyPatchCallItem
15065 | ApplyPatchCallOutputItem
15066 >
15067 | null
15068export const BaseInputs = Schema.Union([
15069 Schema.String,
15070 Schema.Array(Schema.Union([
15071 Schema.Struct({
15072 "content": Schema.Union([
15073 Schema.Array(Schema.Union([InputText, InputImage, InputFile, InputAudio], { mode: "oneOf" })),
15074 Schema.String
15075 ]),
15076 "phase": Schema.optionalKey(
15077 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null])
15078 ),
15079 "role": Schema.Literals(["user", "system", "assistant", "developer"]),
15080 "type": Schema.optionalKey(Schema.Literal("message"))
15081 }),
15082 OpenAIResponseInputMessageItem,
15083 OpenAIResponseFunctionToolCallOutput,
15084 OpenAIResponseFunctionToolCall,
15085 OutputItemImageGenerationCall,
15086 OutputMessage,
15087 OpenAIResponseCustomToolCall,
15088 OpenAIResponseCustomToolCallOutput,
15089 ApplyPatchCallItem,
15090 ApplyPatchCallOutputItem
15091 ])),
15092 Schema.Null
15093]).annotate({ "identifier": "BaseInputs" })
15094export type OutputItemAddedEvent = {
15095 readonly "item":
15096 | OutputMessage
15097 | OutputItemReasoning
15098 | OutputItemFunctionCall
15099 | OutputItemCustomToolCall
15100 | OutputItemWebSearchCall
15101 | OutputItemFileSearchCall
15102 | OutputItemImageGenerationCall
15103 | OutputItemApplyPatchCall
15104 readonly "output_index": number
15105 readonly "sequence_number": number
15106 readonly "type": "response.output_item.added"
15107}
15108export const OutputItemAddedEvent = Schema.Struct({
15109 "item": Schema.Union([
15110 OutputMessage,
15111 OutputItemReasoning,
15112 OutputItemFunctionCall,
15113 OutputItemCustomToolCall,
15114 OutputItemWebSearchCall,
15115 OutputItemFileSearchCall,
15116 OutputItemImageGenerationCall,
15117 OutputItemApplyPatchCall
15118 ], { mode: "oneOf" }),
15119 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15120 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15121 "type": Schema.Literal("response.output_item.added")
15122}).annotate({
15123 "description": "Event emitted when a new output item is added to the response",
15124 "identifier": "OutputItemAddedEvent"
15125})
15126export type OutputItemDoneEvent = {
15127 readonly "item":
15128 | OutputMessage
15129 | OutputItemReasoning
15130 | OutputItemFunctionCall
15131 | OutputItemCustomToolCall
15132 | OutputItemWebSearchCall
15133 | OutputItemFileSearchCall
15134 | OutputItemImageGenerationCall
15135 | OutputItemApplyPatchCall
15136 readonly "output_index": number
15137 readonly "sequence_number": number
15138 readonly "type": "response.output_item.done"
15139}
15140export const OutputItemDoneEvent = Schema.Struct({
15141 "item": Schema.Union([
15142 OutputMessage,
15143 OutputItemReasoning,
15144 OutputItemFunctionCall,
15145 OutputItemCustomToolCall,
15146 OutputItemWebSearchCall,
15147 OutputItemFileSearchCall,
15148 OutputItemImageGenerationCall,
15149 OutputItemApplyPatchCall
15150 ], { mode: "oneOf" }),
15151 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15152 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15153 "type": Schema.Literal("response.output_item.done")
15154}).annotate({ "description": "Event emitted when an output item is complete", "identifier": "OutputItemDoneEvent" })
15155export type OutputItems =
15156 | OutputMessageItem
15157 | OutputReasoningItem
15158 | OutputFunctionCallItem
15159 | OutputWebSearchCallItem
15160 | OutputFileSearchCallItem
15161 | OutputImageGenerationCallItem
15162 | OutputCodeInterpreterCallItem
15163 | OutputComputerCallItem
15164 | OutputDatetimeItem
15165 | OutputWebSearchServerToolItem
15166 | OutputCodeInterpreterServerToolItem
15167 | OutputFileSearchServerToolItem
15168 | OutputImageGenerationServerToolItem
15169 | OutputBrowserUseServerToolItem
15170 | OutputBashServerToolItem
15171 | OutputTextEditorServerToolItem
15172 | OutputApplyPatchServerToolItem
15173 | OutputApplyPatchCallItem
15174 | OutputShellCallItem
15175 | OutputShellCallOutputItem
15176 | OutputWebFetchServerToolItem
15177 | OutputToolSearchServerToolItem
15178 | OutputMemoryServerToolItem
15179 | OutputMcpServerToolItem
15180 | OutputSearchModelsServerToolItem
15181 | OutputFusionServerToolItem
15182 | OutputAdvisorServerToolItem
15183 | OutputSubagentServerToolItem
15184 | OutputFilesServerToolItem
15185 | OutputCustomToolCallItem
15186export const OutputItems = Schema.Union([
15187 OutputMessageItem,
15188 OutputReasoningItem,
15189 OutputFunctionCallItem,
15190 OutputWebSearchCallItem,
15191 OutputFileSearchCallItem,
15192 OutputImageGenerationCallItem,
15193 OutputCodeInterpreterCallItem,
15194 OutputComputerCallItem,
15195 OutputDatetimeItem,
15196 OutputWebSearchServerToolItem,
15197 OutputCodeInterpreterServerToolItem,
15198 OutputFileSearchServerToolItem,
15199 OutputImageGenerationServerToolItem,
15200 OutputBrowserUseServerToolItem,
15201 OutputBashServerToolItem,
15202 OutputTextEditorServerToolItem,
15203 OutputApplyPatchServerToolItem,
15204 OutputApplyPatchCallItem,
15205 OutputShellCallItem,
15206 OutputShellCallOutputItem,
15207 OutputWebFetchServerToolItem,
15208 OutputToolSearchServerToolItem,
15209 OutputMemoryServerToolItem,
15210 OutputMcpServerToolItem,
15211 OutputSearchModelsServerToolItem,
15212 OutputFusionServerToolItem,
15213 OutputAdvisorServerToolItem,
15214 OutputSubagentServerToolItem,
15215 OutputFilesServerToolItem,
15216 OutputCustomToolCallItem
15217], { mode: "oneOf" }).annotate({ "description": "An output item from the response", "identifier": "OutputItems" })
15218export type AnthropicWebFetchToolResult = {
15219 readonly "caller": AnthropicCaller
15220 readonly "content": AnthropicWebFetchContent
15221 readonly "tool_use_id": string
15222 readonly "type": "web_fetch_tool_result"
15223}
15224export const AnthropicWebFetchToolResult = Schema.Struct({
15225 "caller": AnthropicCaller,
15226 "content": AnthropicWebFetchContent,
15227 "tool_use_id": Schema.String,
15228 "type": Schema.Literal("web_fetch_tool_result")
15229}).annotate({ "identifier": "AnthropicWebFetchToolResult" })
15230export type MessagesRequest = {
15231 readonly "cache_control"?: AnthropicCacheControlDirective
15232 readonly "context_management"?: {
15233 readonly "edits"?: ReadonlyArray<
15234 {
15235 readonly "clear_at_least"?: AnthropicInputTokensClearAtLeast
15236 readonly "clear_tool_inputs"?: boolean | ReadonlyArray<string> | null
15237 readonly "exclude_tools"?: ReadonlyArray<string> | null
15238 readonly "keep"?: AnthropicToolUsesKeep
15239 readonly "trigger"?: AnthropicInputTokensTrigger | AnthropicToolUsesTrigger
15240 readonly "type": "clear_tool_uses_20250919"
15241 } | {
15242 readonly "keep"?: AnthropicThinkingTurns | { readonly "type": "all" } | "all"
15243 readonly "type": "clear_thinking_20251015"
15244 } | {
15245 readonly "instructions"?: string | null
15246 readonly "pause_after_compaction"?: boolean
15247 readonly "trigger"?: { readonly "type": "input_tokens"; readonly "value": number } | null
15248 readonly "type": "compact_20260112"
15249 }
15250 >
15251 readonly [x: string]: Schema.Json
15252 } | null
15253 readonly "fallbacks"?: ReadonlyArray<MessagesFallbackParam> | null
15254 readonly "max_tokens"?: number
15255 readonly "messages": ReadonlyArray<MessagesMessageParam> | null
15256 readonly "metadata"?: { readonly "user_id"?: string | null }
15257 readonly "model": string
15258 readonly "models"?: ReadonlyArray<string>
15259 readonly "output_config"?: MessagesOutputConfig
15260 readonly "plugins"?: ReadonlyArray<
15261 | AutoRouterPlugin
15262 | AutoBetaRouterPlugin
15263 | ModerationPlugin
15264 | WebSearchPlugin
15265 | WebFetchPlugin
15266 | FileParserPlugin
15267 | ResponseHealingPlugin
15268 | ContextCompressionPlugin
15269 | ParetoRouterPlugin
15270 | FusionPlugin
15271 >
15272 readonly "provider"?: ProviderPreferences
15273 readonly "route"?: DeprecatedRoute
15274 readonly "service_tier"?: string
15275 readonly "session_id"?: string
15276 readonly "speed"?: AnthropicSpeed
15277 readonly "stop_sequences"?: ReadonlyArray<string>
15278 readonly "stop_server_tools_when"?: StopServerToolsWhen
15279 readonly "stream"?: boolean
15280 readonly "system"?: string | ReadonlyArray<AnthropicTextBlockParam>
15281 readonly "temperature"?: number
15282 readonly "thinking"?:
15283 | { readonly "budget_tokens": number; readonly "display"?: AnthropicThinkingDisplay; readonly "type": "enabled" }
15284 | { readonly "type": "disabled" }
15285 | { readonly "display"?: AnthropicThinkingDisplay; readonly "type": "adaptive" }
15286 readonly "tool_choice"?:
15287 | { readonly "disable_parallel_tool_use"?: boolean; readonly "type": "auto" }
15288 | { readonly "disable_parallel_tool_use"?: boolean; readonly "type": "any" }
15289 | { readonly "type": "none" }
15290 | { readonly "disable_parallel_tool_use"?: boolean; readonly "name": string; readonly "type": "tool" }
15291 readonly "tools"?: ReadonlyArray<
15292 | {
15293 readonly "cache_control"?: AnthropicCacheControlDirective
15294 readonly "description"?: string
15295 readonly "input_schema": {
15296 readonly "properties"?: Schema.Json
15297 readonly "required"?: ReadonlyArray<string> | null
15298 readonly "type"?: string
15299 }
15300 readonly "name": string
15301 readonly "type"?: "custom"
15302 }
15303 | {
15304 readonly "cache_control"?: AnthropicCacheControlDirective
15305 readonly "name": "bash"
15306 readonly "type": "bash_20250124"
15307 }
15308 | {
15309 readonly "cache_control"?: AnthropicCacheControlDirective
15310 readonly "name": "str_replace_editor"
15311 readonly "type": "text_editor_20250124"
15312 }
15313 | {
15314 readonly "allowed_domains"?: ReadonlyArray<string> | null
15315 readonly "blocked_domains"?: ReadonlyArray<string> | null
15316 readonly "cache_control"?: AnthropicCacheControlDirective
15317 readonly "max_uses"?: number | null
15318 readonly "name": "web_search"
15319 readonly "type": "web_search_20250305"
15320 readonly "user_location"?: AnthropicWebSearchToolUserLocation
15321 }
15322 | {
15323 readonly "allowed_callers"?: AnthropicAllowedCallers
15324 readonly "allowed_domains"?: ReadonlyArray<string> | null
15325 readonly "blocked_domains"?: ReadonlyArray<string> | null
15326 readonly "cache_control"?: AnthropicCacheControlDirective
15327 readonly "max_uses"?: number | null
15328 readonly "name": "web_search"
15329 readonly "type": "web_search_20260209"
15330 readonly "user_location"?: AnthropicWebSearchToolUserLocation
15331 }
15332 | {
15333 readonly "allowed_callers"?: AnthropicAllowedCallers
15334 readonly "cache_control"?: AnthropicCacheControlDirective
15335 readonly "caching"?: AnthropicCacheControlDirective | null
15336 readonly "defer_loading"?: boolean
15337 readonly "max_uses"?: number
15338 readonly "model": string
15339 readonly "name": "advisor"
15340 readonly "type": "advisor_20260301"
15341 }
15342 | BashServerTool
15343 | DatetimeServerTool
15344 | ImageGenerationServerTool_OpenRouter
15345 | MessagesSearchModelsServerTool
15346 | WebFetchServerTool
15347 | OpenRouterWebSearchServerTool
15348 | { readonly "type": string }
15349 | AnthropicToolSearchToolBm25
15350 | AnthropicToolSearchToolRegex
15351 >
15352 readonly "top_k"?: number
15353 readonly "top_p"?: number
15354 readonly "trace"?: TraceConfig
15355 readonly "user"?: string
15356}
15357export const MessagesRequest = Schema.Struct({
15358 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
15359 "context_management": Schema.optionalKey(Schema.Union([
15360 Schema.StructWithRest(
15361 Schema.Struct({
15362 "edits": Schema.optionalKey(Schema.Array(Schema.Union([
15363 Schema.Struct({
15364 "clear_at_least": Schema.optionalKey(AnthropicInputTokensClearAtLeast),
15365 "clear_tool_inputs": Schema.optionalKey(
15366 Schema.Union([Schema.Boolean, Schema.Array(Schema.String), Schema.Null])
15367 ),
15368 "exclude_tools": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
15369 "keep": Schema.optionalKey(AnthropicToolUsesKeep),
15370 "trigger": Schema.optionalKey(
15371 Schema.Union([AnthropicInputTokensTrigger, AnthropicToolUsesTrigger], { mode: "oneOf" })
15372 ),
15373 "type": Schema.Literal("clear_tool_uses_20250919")
15374 }),
15375 Schema.Struct({
15376 "keep": Schema.optionalKey(
15377 Schema.Union([
15378 AnthropicThinkingTurns,
15379 Schema.Struct({ "type": Schema.Literal("all") }),
15380 Schema.Literal("all")
15381 ])
15382 ),
15383 "type": Schema.Literal("clear_thinking_20251015")
15384 }),
15385 Schema.Struct({
15386 "instructions": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
15387 "pause_after_compaction": Schema.optionalKey(Schema.Boolean),
15388 "trigger": Schema.optionalKey(
15389 Schema.Union([
15390 Schema.Struct({
15391 "type": Schema.Literal("input_tokens"),
15392 "value": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
15393 }),
15394 Schema.Null
15395 ])
15396 ),
15397 "type": Schema.Literal("compact_20260112")
15398 })
15399 ], { mode: "oneOf" })))
15400 }),
15401 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
15402 ),
15403 Schema.Null
15404 ])),
15405 "fallbacks": Schema.optionalKey(
15406 Schema.Union([Schema.Array(MessagesFallbackParam), Schema.Null]).annotate({
15407 "description":
15408 "Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries."
15409 })
15410 ),
15411 "max_tokens": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
15412 "messages": Schema.Union([Schema.Array(MessagesMessageParam), Schema.Null]),
15413 "metadata": Schema.optionalKey(
15414 Schema.Struct({ "user_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])) })
15415 ),
15416 "model": Schema.String,
15417 "models": Schema.optionalKey(Schema.Array(Schema.String)),
15418 "output_config": Schema.optionalKey(MessagesOutputConfig),
15419 "plugins": Schema.optionalKey(
15420 Schema.Array(
15421 Schema.Union([
15422 AutoRouterPlugin,
15423 AutoBetaRouterPlugin,
15424 ModerationPlugin,
15425 WebSearchPlugin,
15426 WebFetchPlugin,
15427 FileParserPlugin,
15428 ResponseHealingPlugin,
15429 ContextCompressionPlugin,
15430 ParetoRouterPlugin,
15431 FusionPlugin
15432 ], { mode: "oneOf" })
15433 ).annotate({ "description": "Plugins you want to enable for this request, including their settings." })
15434 ),
15435 "provider": Schema.optionalKey(ProviderPreferences),
15436 "route": Schema.optionalKey(DeprecatedRoute),
15437 "service_tier": Schema.optionalKey(Schema.String),
15438 "session_id": Schema.optionalKey(
15439 Schema.String.annotate({
15440 "description":
15441 "A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters."
15442 }).check(Schema.isMaxLength(256).annotate({ "expected": "a value with a length of at most 256" }))
15443 ),
15444 "speed": Schema.optionalKey(
15445 Schema.suspend((): Schema.Codec<AnthropicSpeed> => AnthropicSpeed).annotate({
15446 "description":
15447 "Controls output generation speed. When set to `fast`, uses a higher-speed inference configuration at premium pricing. Defaults to `standard` when omitted."
15448 })
15449 ),
15450 "stop_sequences": Schema.optionalKey(Schema.Array(Schema.String)),
15451 "stop_server_tools_when": Schema.optionalKey(StopServerToolsWhen),
15452 "stream": Schema.optionalKey(Schema.Boolean),
15453 "system": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(AnthropicTextBlockParam)])),
15454 "temperature": Schema.optionalKey(
15455 Schema.Number.annotate({ "format": "double" }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
15456 ),
15457 "thinking": Schema.optionalKey(
15458 Schema.Union([
15459 Schema.Struct({
15460 "budget_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15461 "display": Schema.optionalKey(AnthropicThinkingDisplay),
15462 "type": Schema.Literal("enabled")
15463 }),
15464 Schema.Struct({ "type": Schema.Literal("disabled") }),
15465 Schema.Struct({ "display": Schema.optionalKey(AnthropicThinkingDisplay), "type": Schema.Literal("adaptive") })
15466 ], { mode: "oneOf" })
15467 ),
15468 "tool_choice": Schema.optionalKey(
15469 Schema.Union([
15470 Schema.Struct({
15471 "disable_parallel_tool_use": Schema.optionalKey(Schema.Boolean),
15472 "type": Schema.Literal("auto")
15473 }),
15474 Schema.Struct({ "disable_parallel_tool_use": Schema.optionalKey(Schema.Boolean), "type": Schema.Literal("any") }),
15475 Schema.Struct({ "type": Schema.Literal("none") }),
15476 Schema.Struct({
15477 "disable_parallel_tool_use": Schema.optionalKey(Schema.Boolean),
15478 "name": Schema.String,
15479 "type": Schema.Literal("tool")
15480 })
15481 ], { mode: "oneOf" })
15482 ),
15483 "tools": Schema.optionalKey(Schema.Array(Schema.Union([
15484 Schema.Struct({
15485 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
15486 "description": Schema.optionalKey(Schema.String),
15487 "input_schema": Schema.Struct({
15488 "properties": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
15489 "required": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
15490 "type": Schema.optionalKey(Schema.String)
15491 }),
15492 "name": Schema.String,
15493 "type": Schema.optionalKey(Schema.Literal("custom"))
15494 }),
15495 Schema.Struct({
15496 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
15497 "name": Schema.Literal("bash"),
15498 "type": Schema.Literal("bash_20250124")
15499 }),
15500 Schema.Struct({
15501 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
15502 "name": Schema.Literal("str_replace_editor"),
15503 "type": Schema.Literal("text_editor_20250124")
15504 }),
15505 Schema.Struct({
15506 "allowed_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
15507 "blocked_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
15508 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
15509 "max_uses": Schema.optionalKey(
15510 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
15511 ),
15512 "name": Schema.Literal("web_search"),
15513 "type": Schema.Literal("web_search_20250305"),
15514 "user_location": Schema.optionalKey(AnthropicWebSearchToolUserLocation)
15515 }),
15516 Schema.Struct({
15517 "allowed_callers": Schema.optionalKey(AnthropicAllowedCallers),
15518 "allowed_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
15519 "blocked_domains": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
15520 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
15521 "max_uses": Schema.optionalKey(
15522 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
15523 ),
15524 "name": Schema.Literal("web_search"),
15525 "type": Schema.Literal("web_search_20260209"),
15526 "user_location": Schema.optionalKey(AnthropicWebSearchToolUserLocation)
15527 }),
15528 Schema.Struct({
15529 "allowed_callers": Schema.optionalKey(AnthropicAllowedCallers),
15530 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
15531 "caching": Schema.optionalKey(Schema.Union([AnthropicCacheControlDirective, Schema.Null])),
15532 "defer_loading": Schema.optionalKey(Schema.Boolean),
15533 "max_uses": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
15534 "model": Schema.String,
15535 "name": Schema.Literal("advisor"),
15536 "type": Schema.Literal("advisor_20260301")
15537 }),
15538 BashServerTool,
15539 DatetimeServerTool,
15540 ImageGenerationServerTool_OpenRouter,
15541 MessagesSearchModelsServerTool,
15542 WebFetchServerTool,
15543 OpenRouterWebSearchServerTool,
15544 Schema.Struct({ "type": Schema.String }),
15545 AnthropicToolSearchToolBm25,
15546 AnthropicToolSearchToolRegex
15547 ]))),
15548 "top_k": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
15549 "top_p": Schema.optionalKey(
15550 Schema.Number.annotate({ "format": "double" }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
15551 ),
15552 "trace": Schema.optionalKey(TraceConfig),
15553 "user": Schema.optionalKey(
15554 Schema.String.annotate({
15555 "description":
15556 "A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters."
15557 }).check(Schema.isMaxLength(256).annotate({ "expected": "a value with a length of at most 256" }))
15558 )
15559}).annotate({ "description": "Request schema for Anthropic Messages API endpoint", "identifier": "MessagesRequest" })
15560export type ImageGenerationUsage = {
15561 readonly "cache_creation"?: AnthropicCacheCreation
15562 readonly "completion_tokens": number
15563 readonly "completion_tokens_details"?: Union_6
15564 readonly "cost"?: number | null
15565 readonly "cost_details"?: CostDetails
15566 readonly "is_byok"?: boolean
15567 readonly "iterations"?: Union_7
15568 readonly "prompt_tokens": number
15569 readonly "prompt_tokens_details"?: Union_8
15570 readonly "server_tool_use"?: Union_9
15571 readonly "service_tier"?: string | null
15572 readonly "speed"?: AnthropicSpeed
15573 readonly "total_tokens": number
15574}
15575export const ImageGenerationUsage = Schema.Struct({
15576 "cache_creation": Schema.optionalKey(AnthropicCacheCreation),
15577 "completion_tokens": Schema.Number.annotate({ "description": "The tokens generated" }).check(
15578 Schema.isInt().annotate({ "expected": "an integer" })
15579 ),
15580 "completion_tokens_details": Schema.optionalKey(Union_6),
15581 "cost": Schema.optionalKey(
15582 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
15583 .annotate({ "description": "Cost of the completion", "format": "double" })
15584 ),
15585 "cost_details": Schema.optionalKey(CostDetails),
15586 "is_byok": Schema.optionalKey(
15587 Schema.Boolean.annotate({ "description": "Whether a request was made using a Bring Your Own Key configuration" })
15588 ),
15589 "iterations": Schema.optionalKey(Union_7),
15590 "prompt_tokens": Schema.Number.annotate({ "description": "Including images, input audio, and tools if any" }).check(
15591 Schema.isInt().annotate({ "expected": "an integer" })
15592 ),
15593 "prompt_tokens_details": Schema.optionalKey(Union_8),
15594 "server_tool_use": Schema.optionalKey(Union_9),
15595 "service_tier": Schema.optionalKey(
15596 Schema.Union([Schema.String, Schema.Null]).annotate({
15597 "description": "The service tier used by the upstream provider for this request"
15598 })
15599 ),
15600 "speed": Schema.optionalKey(AnthropicSpeed),
15601 "total_tokens": Schema.Number.annotate({ "description": "Sum of the above two fields" }).check(
15602 Schema.isInt().annotate({ "expected": "an integer" })
15603 )
15604}).annotate({
15605 "description": "Token and cost usage for the image generation request, when available",
15606 "identifier": "ImageGenerationUsage"
15607})
15608export type ModelsListResponse = {
15609 readonly "data": ModelsListResponseData
15610 readonly "links": { readonly "next": string | null }
15611 readonly "total_count": number
15612}
15613export const ModelsListResponse = Schema.Struct({
15614 "data": ModelsListResponseData,
15615 "links": Schema.Struct({
15616 "next": Schema.Union([Schema.String, Schema.Null]).annotate({
15617 "description": "URL for the next page of results, or null if this is the last page"
15618 })
15619 }).annotate({ "description": "Pagination links" }),
15620 "total_count": Schema.Number.annotate({ "description": "Total number of models matching the query" }).check(
15621 Schema.isInt().annotate({ "expected": "an integer" })
15622 )
15623}).annotate({ "description": "List of available models", "identifier": "ModelsListResponse" })
15624export type ChatChoice = {
15625 readonly "finish_reason": ChatFinishReasonEnum
15626 readonly "index": number
15627 readonly "logprobs"?: ChatTokenLogprobs
15628 readonly "message": ChatAssistantMessage
15629}
15630export const ChatChoice = Schema.Struct({
15631 "finish_reason": ChatFinishReasonEnum,
15632 "index": Schema.Number.annotate({ "description": "Choice index" }).check(
15633 Schema.isInt().annotate({ "expected": "an integer" })
15634 ),
15635 "logprobs": Schema.optionalKey(ChatTokenLogprobs),
15636 "message": ChatAssistantMessage
15637}).annotate({ "description": "Chat completion choice", "identifier": "ChatChoice" })
15638export type ChatMessages =
15639 | ChatSystemMessage
15640 | ChatUserMessage
15641 | ChatDeveloperMessage
15642 | ChatAssistantMessage
15643 | ChatToolMessage
15644export const ChatMessages = Schema.Union([
15645 ChatSystemMessage,
15646 ChatUserMessage,
15647 ChatDeveloperMessage,
15648 ChatAssistantMessage,
15649 ChatToolMessage
15650], { mode: "oneOf" }).annotate({
15651 "description": "Chat completion message with role-based discrimination",
15652 "identifier": "ChatMessages"
15653})
15654export type ChatStreamChoice = {
15655 readonly "delta": ChatStreamDelta
15656 readonly "finish_reason"?: ChatFinishReasonEnum
15657 readonly "index": number
15658 readonly "logprobs"?: ChatTokenLogprobs
15659}
15660export const ChatStreamChoice = Schema.Struct({
15661 "delta": ChatStreamDelta,
15662 "finish_reason": Schema.optionalKey(ChatFinishReasonEnum),
15663 "index": Schema.Number.annotate({ "description": "Choice index" }).check(
15664 Schema.isInt().annotate({ "expected": "an integer" })
15665 ),
15666 "logprobs": Schema.optionalKey(ChatTokenLogprobs)
15667}).annotate({ "description": "Streaming completion choice chunk", "identifier": "ChatStreamChoice" })
15668export type Arrays_8 = ReadonlyArray<
15669 | ReasoningItem
15670 | EasyInputMessage
15671 | InputMessageItem
15672 | FunctionCallItem
15673 | FunctionCallOutputItem
15674 | ApplyPatchCallItem
15675 | ApplyPatchCallOutputItem
15676 | {
15677 readonly "content": ReadonlyArray<
15678 {
15679 readonly "annotations"?: ReadonlyArray<
15680 {
15681 readonly "file_id": string
15682 readonly "filename": string
15683 readonly "index": number
15684 readonly "type": "file_citation"
15685 } | {
15686 readonly "content"?: string
15687 readonly "end_index": number
15688 readonly "start_index": number
15689 readonly "title": string
15690 readonly "type": never
15691 readonly "url": string
15692 readonly "file_id": string
15693 readonly "filename": string
15694 readonly "index": number
15695 } | {
15696 readonly "file_id": string
15697 readonly "index": number
15698 readonly "type": never
15699 readonly "filename": string
15700 } | {
15701 readonly "file_id": string
15702 readonly "filename": string
15703 readonly "index": number
15704 readonly "type": never
15705 readonly "content"?: string
15706 readonly "end_index": number
15707 readonly "start_index": number
15708 readonly "title": string
15709 readonly "url": string
15710 } | {
15711 readonly "content"?: string
15712 readonly "end_index": number
15713 readonly "start_index": number
15714 readonly "title": string
15715 readonly "type": "url_citation"
15716 readonly "url": string
15717 } | {
15718 readonly "file_id": string
15719 readonly "index": number
15720 readonly "type": never
15721 readonly "content"?: string
15722 readonly "end_index": number
15723 readonly "start_index": number
15724 readonly "title": string
15725 readonly "url": string
15726 } | {
15727 readonly "file_id": string
15728 readonly "filename": string
15729 readonly "index": number
15730 readonly "type": never
15731 } | {
15732 readonly "content"?: string
15733 readonly "end_index": number
15734 readonly "start_index": number
15735 readonly "title": string
15736 readonly "type": never
15737 readonly "url": string
15738 readonly "file_id": string
15739 readonly "index": number
15740 } | { readonly "file_id": string; readonly "index": number; readonly "type": "file_path" }
15741 >
15742 readonly "logprobs"?: ReadonlyArray<
15743 {
15744 readonly "bytes": ReadonlyArray<number>
15745 readonly "logprob": number
15746 readonly "token": string
15747 readonly "top_logprobs": ReadonlyArray<
15748 { readonly "bytes": ReadonlyArray<number>; readonly "logprob": number; readonly "token": string }
15749 >
15750 }
15751 >
15752 readonly "text": string
15753 readonly "type": "output_text"
15754 } | {
15755 readonly "refusal": string
15756 readonly "type": never
15757 readonly "annotations"?: ReadonlyArray<OpenAIResponsesAnnotation>
15758 readonly "logprobs"?: ReadonlyArray<
15759 {
15760 readonly "bytes": ReadonlyArray<number>
15761 readonly "logprob": number
15762 readonly "token": string
15763 readonly "top_logprobs": ReadonlyArray<
15764 { readonly "bytes": ReadonlyArray<number>; readonly "logprob": number; readonly "token": string }
15765 >
15766 }
15767 >
15768 readonly "text": string
15769 } | {
15770 readonly "annotations"?: ReadonlyArray<OpenAIResponsesAnnotation>
15771 readonly "logprobs"?: ReadonlyArray<
15772 {
15773 readonly "bytes": ReadonlyArray<number>
15774 readonly "logprob": number
15775 readonly "token": string
15776 readonly "top_logprobs": ReadonlyArray<
15777 { readonly "bytes": ReadonlyArray<number>; readonly "logprob": number; readonly "token": string }
15778 >
15779 }
15780 >
15781 readonly "text": string
15782 readonly "type": never
15783 readonly "refusal": string
15784 } | { readonly "refusal": string; readonly "type": "refusal" }
15785 >
15786 readonly "id": string
15787 readonly "phase"?: "commentary" | "final_answer" | null
15788 readonly "role": "assistant"
15789 readonly "status"?: "completed" | "incomplete" | "in_progress"
15790 readonly "type": "message"
15791 }
15792 | {
15793 readonly "content"?: ReadonlyArray<{ readonly "text": string; readonly "type": "reasoning_text" }>
15794 readonly "encrypted_content"?: string | null
15795 readonly "id": string
15796 readonly "status"?: "completed" | "incomplete" | "in_progress"
15797 readonly "summary": ReadonlyArray<{ readonly "text": string; readonly "type": "summary_text" }>
15798 readonly "type": "reasoning"
15799 readonly "format"?: ReasoningFormat
15800 readonly "signature"?: string | null
15801 }
15802 | OutputFunctionCallItem
15803 | OutputCustomToolCallItem
15804 | OutputWebSearchCallItem
15805 | OutputFileSearchCallItem
15806 | OutputImageGenerationCallItem
15807 | OutputCodeInterpreterCallItem
15808 | OutputComputerCallItem
15809 | OutputDatetimeItem
15810 | OutputWebSearchServerToolItem
15811 | OutputCodeInterpreterServerToolItem
15812 | OutputFileSearchServerToolItem
15813 | OutputImageGenerationServerToolItem
15814 | OutputBrowserUseServerToolItem
15815 | OutputBashServerToolItem
15816 | OutputTextEditorServerToolItem
15817 | OutputApplyPatchServerToolItem
15818 | OutputWebFetchServerToolItem
15819 | OutputToolSearchServerToolItem
15820 | OutputMemoryServerToolItem
15821 | OutputMcpServerToolItem
15822 | OutputSearchModelsServerToolItem
15823 | OutputFusionServerToolItem
15824 | OutputAdvisorServerToolItem
15825 | OutputSubagentServerToolItem
15826 | OutputFilesServerToolItem
15827 | LocalShellCallItem
15828 | LocalShellCallOutputItem
15829 | ShellCallItem
15830 | ShellCallOutputItem
15831 | McpListToolsItem
15832 | McpApprovalRequestItem
15833 | McpApprovalResponseItem
15834 | McpCallItem
15835 | CustomToolCallItem
15836 | CustomToolCallOutputItem
15837 | CompactionItem
15838 | ContextCompactionItem
15839 | ItemReferenceItem
15840 | AdditionalToolsItem
15841 | AgentMessageItem
15842>
15843export const Arrays_8 = Schema.Array(
15844 Schema.Union([
15845 ReasoningItem,
15846 EasyInputMessage,
15847 InputMessageItem,
15848 FunctionCallItem,
15849 FunctionCallOutputItem,
15850 ApplyPatchCallItem,
15851 ApplyPatchCallOutputItem,
15852 Schema.Struct({
15853 "content": Schema.Union([Schema.Array(Schema.Union([
15854 Schema.Union([
15855 Schema.Struct({
15856 "annotations": Schema.optionalKey(
15857 Schema.Array(
15858 Schema.Union([
15859 Schema.Union([
15860 Schema.Struct({
15861 "file_id": Schema.String,
15862 "filename": Schema.String,
15863 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15864 "type": Schema.Literal("file_citation")
15865 }),
15866 Schema.Struct({
15867 "content": Schema.optionalKey(Schema.String),
15868 "end_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15869 "start_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15870 "title": Schema.String,
15871 "type": Schema.Never,
15872 "url": Schema.String,
15873 "file_id": Schema.String,
15874 "filename": Schema.String,
15875 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
15876 }),
15877 Schema.Struct({
15878 "file_id": Schema.String,
15879 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15880 "type": Schema.Never,
15881 "filename": Schema.String
15882 })
15883 ]),
15884 Schema.Union([
15885 Schema.Struct({
15886 "file_id": Schema.String,
15887 "filename": Schema.String,
15888 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15889 "type": Schema.Never,
15890 "content": Schema.optionalKey(Schema.String),
15891 "end_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15892 "start_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15893 "title": Schema.String,
15894 "url": Schema.String
15895 }),
15896 Schema.Struct({
15897 "content": Schema.optionalKey(Schema.String),
15898 "end_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15899 "start_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15900 "title": Schema.String,
15901 "type": Schema.Literal("url_citation"),
15902 "url": Schema.String
15903 }),
15904 Schema.Struct({
15905 "file_id": Schema.String,
15906 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15907 "type": Schema.Never,
15908 "content": Schema.optionalKey(Schema.String),
15909 "end_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15910 "start_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15911 "title": Schema.String,
15912 "url": Schema.String
15913 })
15914 ]),
15915 Schema.Union([
15916 Schema.Struct({
15917 "file_id": Schema.String,
15918 "filename": Schema.String,
15919 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15920 "type": Schema.Never
15921 }),
15922 Schema.Struct({
15923 "content": Schema.optionalKey(Schema.String),
15924 "end_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15925 "start_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15926 "title": Schema.String,
15927 "type": Schema.Never,
15928 "url": Schema.String,
15929 "file_id": Schema.String,
15930 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
15931 }),
15932 Schema.Struct({
15933 "file_id": Schema.String,
15934 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
15935 "type": Schema.Literal("file_path")
15936 })
15937 ])
15938 ])
15939 )
15940 ),
15941 "logprobs": Schema.optionalKey(Schema.Array(Schema.Struct({
15942 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
15943 "logprob": Schema.Number.annotate({ "format": "double" }).check(
15944 Schema.isFinite().annotate({ "expected": "a finite number" })
15945 ),
15946 "token": Schema.String,
15947 "top_logprobs": Schema.Array(
15948 Schema.Struct({
15949 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
15950 "logprob": Schema.Number.annotate({ "format": "double" }).check(
15951 Schema.isFinite().annotate({ "expected": "a finite number" })
15952 ),
15953 "token": Schema.String
15954 })
15955 )
15956 }))),
15957 "text": Schema.String,
15958 "type": Schema.Literal("output_text")
15959 }),
15960 Schema.Struct({
15961 "refusal": Schema.String,
15962 "type": Schema.Never,
15963 "annotations": Schema.optionalKey(Schema.Array(OpenAIResponsesAnnotation)),
15964 "logprobs": Schema.optionalKey(Schema.Array(Schema.Struct({
15965 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
15966 "logprob": Schema.Number.annotate({ "format": "double" }).check(
15967 Schema.isFinite().annotate({ "expected": "a finite number" })
15968 ),
15969 "token": Schema.String,
15970 "top_logprobs": Schema.Array(
15971 Schema.Struct({
15972 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
15973 "logprob": Schema.Number.annotate({ "format": "double" }).check(
15974 Schema.isFinite().annotate({ "expected": "a finite number" })
15975 ),
15976 "token": Schema.String
15977 })
15978 )
15979 }))),
15980 "text": Schema.String
15981 })
15982 ]),
15983 Schema.Union([
15984 Schema.Struct({
15985 "annotations": Schema.optionalKey(Schema.Array(OpenAIResponsesAnnotation)),
15986 "logprobs": Schema.optionalKey(Schema.Array(Schema.Struct({
15987 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
15988 "logprob": Schema.Number.annotate({ "format": "double" }).check(
15989 Schema.isFinite().annotate({ "expected": "a finite number" })
15990 ),
15991 "token": Schema.String,
15992 "top_logprobs": Schema.Array(
15993 Schema.Struct({
15994 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
15995 "logprob": Schema.Number.annotate({ "format": "double" }).check(
15996 Schema.isFinite().annotate({ "expected": "a finite number" })
15997 ),
15998 "token": Schema.String
15999 })
16000 )
16001 }))),
16002 "text": Schema.String,
16003 "type": Schema.Never,
16004 "refusal": Schema.String
16005 }),
16006 Schema.Struct({ "refusal": Schema.String, "type": Schema.Literal("refusal") })
16007 ])
16008 ]))]),
16009 "id": Schema.String,
16010 "phase": Schema.optionalKey(
16011 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
16012 "description":
16013 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
16014 })
16015 ),
16016 "role": Schema.Literal("assistant"),
16017 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
16018 "type": Schema.Literal("message")
16019 }).annotate({ "description": "An output message item" }),
16020 Schema.Struct({
16021 "content": Schema.optionalKey(
16022 Schema.Union([Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("reasoning_text") }))])
16023 ),
16024 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
16025 "id": Schema.String,
16026 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
16027 "summary": Schema.Union([
16028 Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("summary_text") }))
16029 ]),
16030 "type": Schema.Literal("reasoning"),
16031 "format": Schema.optionalKey(ReasoningFormat),
16032 "signature": Schema.optionalKey(
16033 Schema.Union([Schema.String, Schema.Null]).annotate({
16034 "description": "A signature for the reasoning content, used for verification"
16035 })
16036 )
16037 }).annotate({ "description": "An output item containing reasoning" }),
16038 OutputFunctionCallItem,
16039 OutputCustomToolCallItem,
16040 OutputWebSearchCallItem,
16041 OutputFileSearchCallItem,
16042 OutputImageGenerationCallItem,
16043 OutputCodeInterpreterCallItem,
16044 OutputComputerCallItem,
16045 OutputDatetimeItem,
16046 OutputWebSearchServerToolItem,
16047 OutputCodeInterpreterServerToolItem,
16048 OutputFileSearchServerToolItem,
16049 OutputImageGenerationServerToolItem,
16050 OutputBrowserUseServerToolItem,
16051 OutputBashServerToolItem,
16052 OutputTextEditorServerToolItem,
16053 OutputApplyPatchServerToolItem,
16054 OutputWebFetchServerToolItem,
16055 OutputToolSearchServerToolItem,
16056 OutputMemoryServerToolItem,
16057 OutputMcpServerToolItem,
16058 OutputSearchModelsServerToolItem,
16059 OutputFusionServerToolItem,
16060 OutputAdvisorServerToolItem,
16061 OutputSubagentServerToolItem,
16062 OutputFilesServerToolItem,
16063 LocalShellCallItem,
16064 LocalShellCallOutputItem,
16065 ShellCallItem,
16066 ShellCallOutputItem,
16067 McpListToolsItem,
16068 McpApprovalRequestItem,
16069 McpApprovalResponseItem,
16070 McpCallItem,
16071 CustomToolCallItem,
16072 CustomToolCallOutputItem,
16073 CompactionItem,
16074 ContextCompactionItem,
16075 ItemReferenceItem,
16076 AdditionalToolsItem,
16077 AgentMessageItem
16078 ])
16079)
16080export type BaseResponsesResult = {
16081 readonly "background"?: boolean | null
16082 readonly "completed_at": number | null
16083 readonly "created_at": number
16084 readonly "error": ResponsesErrorField
16085 readonly "frequency_penalty": number | null
16086 readonly "id": string
16087 readonly "incomplete_details": IncompleteDetails
16088 readonly "instructions": BaseInputs
16089 readonly "max_output_tokens"?: number | null
16090 readonly "max_tool_calls"?: number | null
16091 readonly "metadata": RequestMetadata
16092 readonly "model": string
16093 readonly "object": "response"
16094 readonly "output": ReadonlyArray<
16095 | OutputMessage
16096 | OutputItemReasoning
16097 | OutputItemFunctionCall
16098 | OutputItemCustomToolCall
16099 | OutputItemWebSearchCall
16100 | OutputItemFileSearchCall
16101 | OutputItemImageGenerationCall
16102 | OutputItemApplyPatchCall
16103 >
16104 readonly "output_text"?: string
16105 readonly "parallel_tool_calls": boolean
16106 readonly "presence_penalty": number | null
16107 readonly "previous_response_id"?: string | null
16108 readonly "prompt"?: StoredPromptTemplate
16109 readonly "prompt_cache_key"?: string | null
16110 readonly "prompt_cache_options"?: PromptCacheOptions
16111 readonly "reasoning"?: BaseReasoningConfig
16112 readonly "safety_identifier"?: string | null
16113 readonly "service_tier"?: ServiceTier
16114 readonly "status": OpenAIResponsesResponseStatus
16115 readonly "store"?: boolean
16116 readonly "temperature": number | null
16117 readonly "text"?: TextConfig
16118 readonly "tool_choice": OpenAIResponsesToolChoice
16119 readonly "tools": ReadonlyArray<
16120 | {
16121 readonly "description"?: string | null
16122 readonly "name": string
16123 readonly "parameters": { readonly [x: string]: Schema.Json } | null
16124 readonly "strict"?: boolean | null
16125 readonly "type": "function"
16126 }
16127 | Preview_WebSearchServerTool
16128 | Preview_20250311_WebSearchServerTool
16129 | Legacy_WebSearchServerTool
16130 | WebSearchServerTool
16131 | FileSearchServerTool
16132 | ComputerUseServerTool
16133 | CodeInterpreterServerTool
16134 | McpServerTool
16135 | ImageGenerationServerTool
16136 | CodexLocalShellTool
16137 | ShellServerTool
16138 | ApplyPatchServerTool
16139 | CustomTool
16140 | NamespaceTool
16141 >
16142 readonly "top_logprobs"?: number
16143 readonly "top_p": number | null
16144 readonly "truncation"?: Truncation
16145 readonly "usage"?: OpenAIResponsesUsage
16146 readonly "user"?: string | null
16147}
16148export const BaseResponsesResult = Schema.Struct({
16149 "background": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
16150 "completed_at": Schema.Union([
16151 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
16152 Schema.Null
16153 ]),
16154 "created_at": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
16155 "error": ResponsesErrorField,
16156 "frequency_penalty": Schema.Union([
16157 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
16158 Schema.Null
16159 ]).annotate({ "format": "double" }),
16160 "id": Schema.String,
16161 "incomplete_details": IncompleteDetails,
16162 "instructions": BaseInputs,
16163 "max_output_tokens": Schema.optionalKey(
16164 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
16165 ),
16166 "max_tool_calls": Schema.optionalKey(
16167 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
16168 ),
16169 "metadata": RequestMetadata,
16170 "model": Schema.String,
16171 "object": Schema.Literal("response"),
16172 "output": Schema.Array(
16173 Schema.Union([
16174 OutputMessage,
16175 OutputItemReasoning,
16176 OutputItemFunctionCall,
16177 OutputItemCustomToolCall,
16178 OutputItemWebSearchCall,
16179 OutputItemFileSearchCall,
16180 OutputItemImageGenerationCall,
16181 OutputItemApplyPatchCall
16182 ], { mode: "oneOf" })
16183 ),
16184 "output_text": Schema.optionalKey(Schema.String),
16185 "parallel_tool_calls": Schema.Boolean,
16186 "presence_penalty": Schema.Union([
16187 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
16188 Schema.Null
16189 ]).annotate({ "format": "double" }),
16190 "previous_response_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
16191 "prompt": Schema.optionalKey(StoredPromptTemplate),
16192 "prompt_cache_key": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
16193 "prompt_cache_options": Schema.optionalKey(PromptCacheOptions),
16194 "reasoning": Schema.optionalKey(BaseReasoningConfig),
16195 "safety_identifier": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
16196 "service_tier": Schema.optionalKey(ServiceTier),
16197 "status": OpenAIResponsesResponseStatus,
16198 "store": Schema.optionalKey(Schema.Boolean),
16199 "temperature": Schema.Union([
16200 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
16201 Schema.Null
16202 ]).annotate({ "format": "double" }),
16203 "text": Schema.optionalKey(TextConfig),
16204 "tool_choice": OpenAIResponsesToolChoice,
16205 "tools": Schema.Array(Schema.Union([
16206 Schema.Struct({
16207 "description": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
16208 "name": Schema.String,
16209 "parameters": Schema.Union([
16210 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })),
16211 Schema.Null
16212 ]),
16213 "strict": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
16214 "type": Schema.Literal("function")
16215 }).annotate({ "description": "Function tool definition" }),
16216 Preview_WebSearchServerTool,
16217 Preview_20250311_WebSearchServerTool,
16218 Legacy_WebSearchServerTool,
16219 WebSearchServerTool,
16220 FileSearchServerTool,
16221 ComputerUseServerTool,
16222 CodeInterpreterServerTool,
16223 McpServerTool,
16224 ImageGenerationServerTool,
16225 CodexLocalShellTool,
16226 ShellServerTool,
16227 ApplyPatchServerTool,
16228 CustomTool,
16229 NamespaceTool
16230 ], { mode: "oneOf" })),
16231 "top_logprobs": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
16232 "top_p": Schema.Union([
16233 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
16234 Schema.Null
16235 ]).annotate({ "format": "double" }),
16236 "truncation": Schema.optionalKey(Truncation),
16237 "usage": Schema.optionalKey(OpenAIResponsesUsage),
16238 "user": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
16239}).annotate({ "identifier": "BaseResponsesResult" })
16240export type OpenResponsesResult = {
16241 readonly "background"?: boolean | null
16242 readonly "completed_at": number | null
16243 readonly "created_at": number
16244 readonly "error": ResponsesErrorField
16245 readonly "frequency_penalty": number | null
16246 readonly "id": string
16247 readonly "incomplete_details": IncompleteDetails
16248 readonly "instructions": BaseInputs
16249 readonly "max_output_tokens"?: number | null
16250 readonly "max_tool_calls"?: number | null
16251 readonly "metadata": RequestMetadata
16252 readonly "model": string
16253 readonly "object": "response"
16254 readonly "output": ReadonlyArray<
16255 {
16256 readonly "content": ReadonlyArray<
16257 {
16258 readonly "annotations"?: ReadonlyArray<
16259 {
16260 readonly "file_id": string
16261 readonly "filename": string
16262 readonly "index": number
16263 readonly "type": "file_citation"
16264 } | {
16265 readonly "content"?: string
16266 readonly "end_index": number
16267 readonly "start_index": number
16268 readonly "title": string
16269 readonly "type": never
16270 readonly "url": string
16271 readonly "file_id": string
16272 readonly "filename": string
16273 readonly "index": number
16274 } | {
16275 readonly "file_id": string
16276 readonly "index": number
16277 readonly "type": never
16278 readonly "filename": string
16279 } | {
16280 readonly "file_id": string
16281 readonly "filename": string
16282 readonly "index": number
16283 readonly "type": never
16284 readonly "content"?: string
16285 readonly "end_index": number
16286 readonly "start_index": number
16287 readonly "title": string
16288 readonly "url": string
16289 } | {
16290 readonly "content"?: string
16291 readonly "end_index": number
16292 readonly "start_index": number
16293 readonly "title": string
16294 readonly "type": "url_citation"
16295 readonly "url": string
16296 } | {
16297 readonly "file_id": string
16298 readonly "index": number
16299 readonly "type": never
16300 readonly "content"?: string
16301 readonly "end_index": number
16302 readonly "start_index": number
16303 readonly "title": string
16304 readonly "url": string
16305 } | {
16306 readonly "file_id": string
16307 readonly "filename": string
16308 readonly "index": number
16309 readonly "type": never
16310 } | {
16311 readonly "content"?: string
16312 readonly "end_index": number
16313 readonly "start_index": number
16314 readonly "title": string
16315 readonly "type": never
16316 readonly "url": string
16317 readonly "file_id": string
16318 readonly "index": number
16319 } | { readonly "file_id": string; readonly "index": number; readonly "type": "file_path" }
16320 >
16321 readonly "logprobs"?: ReadonlyArray<
16322 {
16323 readonly "bytes": ReadonlyArray<number>
16324 readonly "logprob": number
16325 readonly "token": string
16326 readonly "top_logprobs": ReadonlyArray<
16327 { readonly "bytes": ReadonlyArray<number>; readonly "logprob": number; readonly "token": string }
16328 >
16329 }
16330 >
16331 readonly "text": string
16332 readonly "type": "output_text"
16333 } | {
16334 readonly "refusal": string
16335 readonly "type": never
16336 readonly "annotations"?: ReadonlyArray<OpenAIResponsesAnnotation>
16337 readonly "logprobs"?: ReadonlyArray<
16338 {
16339 readonly "bytes": ReadonlyArray<number>
16340 readonly "logprob": number
16341 readonly "token": string
16342 readonly "top_logprobs": ReadonlyArray<
16343 { readonly "bytes": ReadonlyArray<number>; readonly "logprob": number; readonly "token": string }
16344 >
16345 }
16346 >
16347 readonly "text": string
16348 } | {
16349 readonly "annotations"?: ReadonlyArray<OpenAIResponsesAnnotation>
16350 readonly "logprobs"?: ReadonlyArray<
16351 {
16352 readonly "bytes": ReadonlyArray<number>
16353 readonly "logprob": number
16354 readonly "token": string
16355 readonly "top_logprobs": ReadonlyArray<
16356 { readonly "bytes": ReadonlyArray<number>; readonly "logprob": number; readonly "token": string }
16357 >
16358 }
16359 >
16360 readonly "text": string
16361 readonly "type": never
16362 readonly "refusal": string
16363 } | { readonly "refusal": string; readonly "type": "refusal" }
16364 >
16365 readonly "id": string
16366 readonly "phase"?: "commentary" | "final_answer" | null
16367 readonly "role": "assistant"
16368 readonly "status"?: "completed" | "incomplete" | "in_progress"
16369 readonly "type": "message"
16370 } | {
16371 readonly "content": ReadonlyArray<
16372 {
16373 readonly "annotations"?: ReadonlyArray<OpenAIResponsesAnnotation>
16374 readonly "logprobs"?: ReadonlyArray<
16375 {
16376 readonly "bytes": ReadonlyArray<number>
16377 readonly "logprob": number
16378 readonly "token": string
16379 readonly "top_logprobs": ReadonlyArray<
16380 { readonly "bytes": ReadonlyArray<number>; readonly "logprob": number; readonly "token": string }
16381 >
16382 }
16383 >
16384 readonly "text": string
16385 readonly "type": never
16386 } | { readonly "refusal": string; readonly "type": never; readonly "text": string }
16387 >
16388 readonly "encrypted_content"?: string | null
16389 readonly "id": string
16390 readonly "status"?: "completed" | "incomplete" | "in_progress"
16391 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16392 readonly "type": never
16393 readonly "format"?: ReasoningFormat
16394 readonly "signature"?: string | null
16395 readonly "phase"?: "commentary" | "final_answer" | null
16396 readonly "role": "assistant"
16397 } | {
16398 readonly "arguments": string
16399 readonly "call_id": string
16400 readonly "id": string
16401 readonly "name": string
16402 readonly "namespace"?: string
16403 readonly "status"?: "completed" | "incomplete" | "in_progress"
16404 readonly "type": never
16405 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16406 readonly "phase"?: "commentary" | "final_answer" | null
16407 readonly "role": "assistant"
16408 } | {
16409 readonly "action"?:
16410 | {
16411 readonly "queries"?: ReadonlyArray<string>
16412 readonly "query": string
16413 readonly "sources"?: ReadonlyArray<WebSearchSource>
16414 readonly "type": "search"
16415 }
16416 | { readonly "type": "open_page"; readonly "url"?: string | null }
16417 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
16418 readonly "id": string
16419 readonly "status": "completed" | "in_progress"
16420 readonly "type": never
16421 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16422 readonly "phase"?: "commentary" | "final_answer" | null
16423 readonly "role": "assistant"
16424 } | {
16425 readonly "id": string
16426 readonly "queries": ReadonlyArray<string>
16427 readonly "status": "completed" | "in_progress"
16428 readonly "type": never
16429 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16430 readonly "phase"?: "commentary" | "final_answer" | null
16431 readonly "role": "assistant"
16432 } | {
16433 readonly "id": string
16434 readonly "result"?: string | null
16435 readonly "status": "in_progress" | "completed"
16436 readonly "type": never
16437 readonly "prompt"?: string
16438 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16439 readonly "phase"?: "commentary" | "final_answer" | null
16440 readonly "role": "assistant"
16441 } | {
16442 readonly "code": string | null
16443 readonly "container_id": string
16444 readonly "id": string
16445 readonly "outputs":
16446 | ReadonlyArray<
16447 { readonly "type": "image"; readonly "url": string } | { readonly "logs": string; readonly "type": "logs" }
16448 >
16449 | null
16450 readonly "status": "in_progress" | "completed" | "incomplete"
16451 readonly "type": never
16452 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16453 readonly "phase"?: "commentary" | "final_answer" | null
16454 readonly "role": "assistant"
16455 } | {
16456 readonly "action"?: Schema.Json
16457 readonly "call_id": string
16458 readonly "id": string
16459 readonly "pending_safety_checks": ReadonlyArray<
16460 { readonly "code": string; readonly "id": string; readonly "message": string }
16461 >
16462 readonly "status": "completed" | "incomplete" | "in_progress"
16463 readonly "type": never
16464 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16465 readonly "phase"?: "commentary" | "final_answer" | null
16466 readonly "role": "assistant"
16467 } | {
16468 readonly "datetime": string
16469 readonly "id": string
16470 readonly "status": "in_progress" | "completed" | "incomplete"
16471 readonly "timezone": string
16472 readonly "type": never
16473 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16474 readonly "phase"?: "commentary" | "final_answer" | null
16475 readonly "role": "assistant"
16476 } | {
16477 readonly "action"?: {
16478 readonly "query": string
16479 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
16480 readonly "type": "search"
16481 }
16482 readonly "id": string
16483 readonly "status": "in_progress" | "completed" | "incomplete"
16484 readonly "type": never
16485 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16486 readonly "phase"?: "commentary" | "final_answer" | null
16487 readonly "role": "assistant"
16488 } | {
16489 readonly "code"?: string
16490 readonly "exitCode"?: number
16491 readonly "id": string
16492 readonly "language"?: string
16493 readonly "status": "in_progress" | "completed" | "incomplete"
16494 readonly "stderr"?: string
16495 readonly "stdout"?: string
16496 readonly "type": never
16497 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16498 readonly "phase"?: "commentary" | "final_answer" | null
16499 readonly "role": "assistant"
16500 } | {
16501 readonly "id": string
16502 readonly "queries"?: ReadonlyArray<string>
16503 readonly "status": "in_progress" | "completed" | "incomplete"
16504 readonly "type": never
16505 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16506 readonly "phase"?: "commentary" | "final_answer" | null
16507 readonly "role": "assistant"
16508 } | {
16509 readonly "id": string
16510 readonly "imageB64"?: string
16511 readonly "imageUrl"?: string
16512 readonly "prompt"?: string
16513 readonly "result"?: string | null
16514 readonly "revisedPrompt"?: string
16515 readonly "status": "in_progress" | "completed" | "incomplete"
16516 readonly "type": never
16517 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16518 readonly "phase"?: "commentary" | "final_answer" | null
16519 readonly "role": "assistant"
16520 } | {
16521 readonly "action"?: string
16522 readonly "id": string
16523 readonly "screenshotB64"?: string
16524 readonly "status": "in_progress" | "completed" | "incomplete"
16525 readonly "type": never
16526 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16527 readonly "phase"?: "commentary" | "final_answer" | null
16528 readonly "role": "assistant"
16529 } | {
16530 readonly "arguments"?: string
16531 readonly "call_id"?: string
16532 readonly "command"?: string
16533 readonly "exitCode"?: number
16534 readonly "id": string
16535 readonly "status": "in_progress" | "completed" | "incomplete"
16536 readonly "stderr"?: string
16537 readonly "stdout"?: string
16538 readonly "type": never
16539 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16540 readonly "phase"?: "commentary" | "final_answer" | null
16541 readonly "role": "assistant"
16542 } | {
16543 readonly "command"?: "view" | "create" | "str_replace" | "insert"
16544 readonly "filePath"?: string
16545 readonly "id": string
16546 readonly "status": "in_progress" | "completed" | "incomplete"
16547 readonly "type": never
16548 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16549 readonly "phase"?: "commentary" | "final_answer" | null
16550 readonly "role": "assistant"
16551 } | {
16552 readonly "call_id"?: string
16553 readonly "id": string
16554 readonly "operation"?: ApplyPatchCallOperation
16555 readonly "status": "in_progress" | "completed" | "incomplete"
16556 readonly "type": never
16557 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16558 readonly "phase"?: "commentary" | "final_answer" | null
16559 readonly "role": "assistant"
16560 } | {
16561 readonly "call_id": string
16562 readonly "id": string
16563 readonly "operation": ApplyPatchCallOperation
16564 readonly "status": "in_progress" | "completed"
16565 readonly "type": never
16566 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16567 readonly "phase"?: "commentary" | "final_answer" | null
16568 readonly "role": "assistant"
16569 } | {
16570 readonly "action"?: {
16571 readonly "commands": ReadonlyArray<string>
16572 readonly "max_output_length": number | null
16573 readonly "timeout_ms": number | null
16574 }
16575 readonly "call_id": string
16576 readonly "id": string
16577 readonly "status": "in_progress" | "completed" | "incomplete"
16578 readonly "type": never
16579 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16580 readonly "phase"?: "commentary" | "final_answer" | null
16581 readonly "role": "assistant"
16582 } | {
16583 readonly "call_id": string
16584 readonly "id": string
16585 readonly "max_output_length"?: number | null
16586 readonly "output": ReadonlyArray<
16587 {
16588 readonly "outcome": { readonly "exit_code": number; readonly "type": "exit" } | { readonly "type": "timeout" }
16589 readonly "stderr": string
16590 readonly "stdout": string
16591 }
16592 >
16593 readonly "status": "in_progress" | "completed" | "incomplete"
16594 readonly "type": never
16595 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16596 readonly "phase"?: "commentary" | "final_answer" | null
16597 readonly "role": "assistant"
16598 } | {
16599 readonly "content": never
16600 readonly "error"?: string
16601 readonly "httpStatus"?: number
16602 readonly "id": string
16603 readonly "status": "in_progress" | "completed" | "incomplete"
16604 readonly "title"?: string
16605 readonly "type": never
16606 readonly "url"?: string
16607 readonly "phase"?: "commentary" | "final_answer" | null
16608 readonly "role": "assistant"
16609 } | {
16610 readonly "id": string
16611 readonly "query"?: string
16612 readonly "status": "in_progress" | "completed" | "incomplete"
16613 readonly "type": never
16614 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16615 readonly "phase"?: "commentary" | "final_answer" | null
16616 readonly "role": "assistant"
16617 } | {
16618 readonly "action"?: "read" | "write" | "delete"
16619 readonly "id": string
16620 readonly "key"?: string
16621 readonly "status": "in_progress" | "completed" | "incomplete"
16622 readonly "type": never
16623 readonly "value"?: Schema.Json
16624 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16625 readonly "phase"?: "commentary" | "final_answer" | null
16626 readonly "role": "assistant"
16627 } | {
16628 readonly "id": string
16629 readonly "serverLabel"?: string
16630 readonly "status": "in_progress" | "completed" | "incomplete"
16631 readonly "toolName"?: string
16632 readonly "type": never
16633 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16634 readonly "phase"?: "commentary" | "final_answer" | null
16635 readonly "role": "assistant"
16636 } | {
16637 readonly "arguments"?: string
16638 readonly "id": string
16639 readonly "query"?: string
16640 readonly "status": "in_progress" | "completed" | "incomplete"
16641 readonly "type": never
16642 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16643 readonly "phase"?: "commentary" | "final_answer" | null
16644 readonly "role": "assistant"
16645 } | {
16646 readonly "analysis"?: FusionAnalysisResult
16647 readonly "error"?: string
16648 readonly "failed_models"?: ReadonlyArray<
16649 { readonly "error": string; readonly "model": string; readonly "status_code"?: number }
16650 >
16651 readonly "failure_reason"?: string
16652 readonly "id": string
16653 readonly "responses"?: ReadonlyArray<{ readonly "content"?: string; readonly "model": string }>
16654 readonly "sources"?: ReadonlyArray<FusionSource>
16655 readonly "status": "in_progress" | "completed" | "incomplete"
16656 readonly "type": never
16657 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16658 readonly "phase"?: "commentary" | "final_answer" | null
16659 readonly "role": "assistant"
16660 } | {
16661 readonly "advice"?: string
16662 readonly "error"?: string
16663 readonly "id": string
16664 readonly "instance_name"?: string
16665 readonly "model"?: string
16666 readonly "prompt"?: string
16667 readonly "status": "in_progress" | "completed" | "incomplete"
16668 readonly "type": never
16669 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16670 readonly "phase"?: "commentary" | "final_answer" | null
16671 readonly "role": "assistant"
16672 } | {
16673 readonly "error"?: string
16674 readonly "id": string
16675 readonly "instance_name"?: string
16676 readonly "model"?: string
16677 readonly "name"?: string
16678 readonly "outcome"?: string
16679 readonly "status": "in_progress" | "completed" | "incomplete"
16680 readonly "task_description"?: string
16681 readonly "task_name"?: string
16682 readonly "type": never
16683 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16684 readonly "phase"?: "commentary" | "final_answer" | null
16685 readonly "role": "assistant"
16686 } | {
16687 readonly "error"?: string
16688 readonly "file_id"?: string
16689 readonly "filename"?: string
16690 readonly "id": string
16691 readonly "operation"?: string
16692 readonly "result"?: string
16693 readonly "status": "in_progress" | "completed" | "incomplete"
16694 readonly "type": never
16695 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16696 readonly "phase"?: "commentary" | "final_answer" | null
16697 readonly "role": "assistant"
16698 } | {
16699 readonly "call_id": string
16700 readonly "id": string
16701 readonly "input": string
16702 readonly "name": string
16703 readonly "namespace"?: string
16704 readonly "type": never
16705 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
16706 readonly "phase"?: "commentary" | "final_answer" | null
16707 readonly "role": "assistant"
16708 readonly "status"?: "completed" | "incomplete" | "in_progress"
16709 } | {
16710 readonly "content": ReadonlyArray<
16711 {
16712 readonly "annotations"?: ReadonlyArray<OpenAIResponsesAnnotation>
16713 readonly "logprobs"?: ReadonlyArray<
16714 {
16715 readonly "bytes": ReadonlyArray<number>
16716 readonly "logprob": number
16717 readonly "token": string
16718 readonly "top_logprobs": ReadonlyArray<
16719 { readonly "bytes": ReadonlyArray<number>; readonly "logprob": number; readonly "token": string }
16720 >
16721 }
16722 >
16723 readonly "text": string
16724 readonly "type": never
16725 } | { readonly "refusal": string; readonly "type": never; readonly "text": string }
16726 >
16727 readonly "id": string
16728 readonly "phase"?: "commentary" | "final_answer" | null
16729 readonly "role": "assistant"
16730 readonly "status"?: "completed" | "incomplete" | "in_progress"
16731 readonly "type": never
16732 readonly "encrypted_content"?: string | null
16733 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16734 } | {
16735 readonly "content"?: ReadonlyArray<{ readonly "text": string; readonly "type": "reasoning_text" }>
16736 readonly "encrypted_content"?: string | null
16737 readonly "id": string
16738 readonly "status"?: "completed" | "incomplete" | "in_progress"
16739 readonly "summary": ReadonlyArray<{ readonly "text": string; readonly "type": "summary_text" }>
16740 readonly "type": "reasoning"
16741 readonly "format"?: ReasoningFormat
16742 readonly "signature"?: string | null
16743 } | {
16744 readonly "arguments": string
16745 readonly "call_id": string
16746 readonly "id": string
16747 readonly "name": string
16748 readonly "namespace"?: string
16749 readonly "status"?: "completed" | "incomplete" | "in_progress"
16750 readonly "type": never
16751 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16752 readonly "encrypted_content"?: string | null
16753 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16754 } | {
16755 readonly "action"?:
16756 | {
16757 readonly "queries"?: ReadonlyArray<string>
16758 readonly "query": string
16759 readonly "sources"?: ReadonlyArray<WebSearchSource>
16760 readonly "type": "search"
16761 }
16762 | { readonly "type": "open_page"; readonly "url"?: string | null }
16763 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
16764 readonly "id": string
16765 readonly "status": "completed" | "in_progress"
16766 readonly "type": never
16767 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16768 readonly "encrypted_content"?: string | null
16769 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16770 } | {
16771 readonly "id": string
16772 readonly "queries": ReadonlyArray<string>
16773 readonly "status": "completed" | "in_progress"
16774 readonly "type": never
16775 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16776 readonly "encrypted_content"?: string | null
16777 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16778 } | {
16779 readonly "id": string
16780 readonly "result"?: string | null
16781 readonly "status": "in_progress" | "completed"
16782 readonly "type": never
16783 readonly "prompt"?: string
16784 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16785 readonly "encrypted_content"?: string | null
16786 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16787 } | {
16788 readonly "code": string | null
16789 readonly "container_id": string
16790 readonly "id": string
16791 readonly "outputs":
16792 | ReadonlyArray<
16793 { readonly "type": "image"; readonly "url": string } | { readonly "logs": string; readonly "type": "logs" }
16794 >
16795 | null
16796 readonly "status": "in_progress" | "completed" | "incomplete"
16797 readonly "type": never
16798 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16799 readonly "encrypted_content"?: string | null
16800 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16801 } | {
16802 readonly "action"?: Schema.Json
16803 readonly "call_id": string
16804 readonly "id": string
16805 readonly "pending_safety_checks": ReadonlyArray<
16806 { readonly "code": string; readonly "id": string; readonly "message": string }
16807 >
16808 readonly "status": "completed" | "incomplete" | "in_progress"
16809 readonly "type": never
16810 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16811 readonly "encrypted_content"?: string | null
16812 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16813 } | {
16814 readonly "datetime": string
16815 readonly "id": string
16816 readonly "status": "in_progress" | "completed" | "incomplete"
16817 readonly "timezone": string
16818 readonly "type": never
16819 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16820 readonly "encrypted_content"?: string | null
16821 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16822 } | {
16823 readonly "action"?: {
16824 readonly "query": string
16825 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
16826 readonly "type": "search"
16827 }
16828 readonly "id": string
16829 readonly "status": "in_progress" | "completed" | "incomplete"
16830 readonly "type": never
16831 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16832 readonly "encrypted_content"?: string | null
16833 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16834 } | {
16835 readonly "code"?: string
16836 readonly "exitCode"?: number
16837 readonly "id": string
16838 readonly "language"?: string
16839 readonly "status": "in_progress" | "completed" | "incomplete"
16840 readonly "stderr"?: string
16841 readonly "stdout"?: string
16842 readonly "type": never
16843 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16844 readonly "encrypted_content"?: string | null
16845 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16846 } | {
16847 readonly "id": string
16848 readonly "queries"?: ReadonlyArray<string>
16849 readonly "status": "in_progress" | "completed" | "incomplete"
16850 readonly "type": never
16851 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16852 readonly "encrypted_content"?: string | null
16853 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16854 } | {
16855 readonly "id": string
16856 readonly "imageB64"?: string
16857 readonly "imageUrl"?: string
16858 readonly "prompt"?: string
16859 readonly "result"?: string | null
16860 readonly "revisedPrompt"?: string
16861 readonly "status": "in_progress" | "completed" | "incomplete"
16862 readonly "type": never
16863 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16864 readonly "encrypted_content"?: string | null
16865 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16866 } | {
16867 readonly "action"?: string
16868 readonly "id": string
16869 readonly "screenshotB64"?: string
16870 readonly "status": "in_progress" | "completed" | "incomplete"
16871 readonly "type": never
16872 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16873 readonly "encrypted_content"?: string | null
16874 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16875 } | {
16876 readonly "arguments"?: string
16877 readonly "call_id"?: string
16878 readonly "command"?: string
16879 readonly "exitCode"?: number
16880 readonly "id": string
16881 readonly "status": "in_progress" | "completed" | "incomplete"
16882 readonly "stderr"?: string
16883 readonly "stdout"?: string
16884 readonly "type": never
16885 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16886 readonly "encrypted_content"?: string | null
16887 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16888 } | {
16889 readonly "command"?: "view" | "create" | "str_replace" | "insert"
16890 readonly "filePath"?: string
16891 readonly "id": string
16892 readonly "status": "in_progress" | "completed" | "incomplete"
16893 readonly "type": never
16894 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16895 readonly "encrypted_content"?: string | null
16896 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16897 } | {
16898 readonly "call_id"?: string
16899 readonly "id": string
16900 readonly "operation"?: ApplyPatchCallOperation
16901 readonly "status": "in_progress" | "completed" | "incomplete"
16902 readonly "type": never
16903 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16904 readonly "encrypted_content"?: string | null
16905 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16906 } | {
16907 readonly "call_id": string
16908 readonly "id": string
16909 readonly "operation": ApplyPatchCallOperation
16910 readonly "status": "in_progress" | "completed"
16911 readonly "type": never
16912 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16913 readonly "encrypted_content"?: string | null
16914 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16915 } | {
16916 readonly "action"?: {
16917 readonly "commands": ReadonlyArray<string>
16918 readonly "max_output_length": number | null
16919 readonly "timeout_ms": number | null
16920 }
16921 readonly "call_id": string
16922 readonly "id": string
16923 readonly "status": "in_progress" | "completed" | "incomplete"
16924 readonly "type": never
16925 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16926 readonly "encrypted_content"?: string | null
16927 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16928 } | {
16929 readonly "call_id": string
16930 readonly "id": string
16931 readonly "max_output_length"?: number | null
16932 readonly "output": ReadonlyArray<
16933 {
16934 readonly "outcome": { readonly "exit_code": number; readonly "type": "exit" } | { readonly "type": "timeout" }
16935 readonly "stderr": string
16936 readonly "stdout": string
16937 }
16938 >
16939 readonly "status": "in_progress" | "completed" | "incomplete"
16940 readonly "type": never
16941 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16942 readonly "encrypted_content"?: string | null
16943 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16944 } | {
16945 readonly "content"?: never
16946 readonly "error"?: string
16947 readonly "httpStatus"?: number
16948 readonly "id": string
16949 readonly "status": "in_progress" | "completed" | "incomplete"
16950 readonly "title"?: string
16951 readonly "type": never
16952 readonly "url"?: string
16953 readonly "encrypted_content"?: string | null
16954 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16955 } | {
16956 readonly "id": string
16957 readonly "query"?: string
16958 readonly "status": "in_progress" | "completed" | "incomplete"
16959 readonly "type": never
16960 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16961 readonly "encrypted_content"?: string | null
16962 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16963 } | {
16964 readonly "action"?: "read" | "write" | "delete"
16965 readonly "id": string
16966 readonly "key"?: string
16967 readonly "status": "in_progress" | "completed" | "incomplete"
16968 readonly "type": never
16969 readonly "value"?: Schema.Json
16970 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16971 readonly "encrypted_content"?: string | null
16972 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16973 } | {
16974 readonly "id": string
16975 readonly "serverLabel"?: string
16976 readonly "status": "in_progress" | "completed" | "incomplete"
16977 readonly "toolName"?: string
16978 readonly "type": never
16979 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16980 readonly "encrypted_content"?: string | null
16981 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16982 } | {
16983 readonly "arguments"?: string
16984 readonly "id": string
16985 readonly "query"?: string
16986 readonly "status": "in_progress" | "completed" | "incomplete"
16987 readonly "type": never
16988 readonly "content"?: ReadonlyArray<ReasoningTextContent>
16989 readonly "encrypted_content"?: string | null
16990 readonly "summary": ReadonlyArray<ReasoningSummaryText>
16991 } | {
16992 readonly "analysis"?: FusionAnalysisResult
16993 readonly "error"?: string
16994 readonly "failed_models"?: ReadonlyArray<
16995 { readonly "error": string; readonly "model": string; readonly "status_code"?: number }
16996 >
16997 readonly "failure_reason"?: string
16998 readonly "id": string
16999 readonly "responses"?: ReadonlyArray<{ readonly "content"?: string; readonly "model": string }>
17000 readonly "sources"?: ReadonlyArray<FusionSource>
17001 readonly "status": "in_progress" | "completed" | "incomplete"
17002 readonly "type": never
17003 readonly "content"?: ReadonlyArray<ReasoningTextContent>
17004 readonly "encrypted_content"?: string | null
17005 readonly "summary": ReadonlyArray<ReasoningSummaryText>
17006 } | {
17007 readonly "advice"?: string
17008 readonly "error"?: string
17009 readonly "id": string
17010 readonly "instance_name"?: string
17011 readonly "model"?: string
17012 readonly "prompt"?: string
17013 readonly "status": "in_progress" | "completed" | "incomplete"
17014 readonly "type": never
17015 readonly "content"?: ReadonlyArray<ReasoningTextContent>
17016 readonly "encrypted_content"?: string | null
17017 readonly "summary": ReadonlyArray<ReasoningSummaryText>
17018 } | {
17019 readonly "error"?: string
17020 readonly "id": string
17021 readonly "instance_name"?: string
17022 readonly "model"?: string
17023 readonly "name"?: string
17024 readonly "outcome"?: string
17025 readonly "status": "in_progress" | "completed" | "incomplete"
17026 readonly "task_description"?: string
17027 readonly "task_name"?: string
17028 readonly "type": never
17029 readonly "content"?: ReadonlyArray<ReasoningTextContent>
17030 readonly "encrypted_content"?: string | null
17031 readonly "summary": ReadonlyArray<ReasoningSummaryText>
17032 } | {
17033 readonly "error"?: string
17034 readonly "file_id"?: string
17035 readonly "filename"?: string
17036 readonly "id": string
17037 readonly "operation"?: string
17038 readonly "result"?: string
17039 readonly "status": "in_progress" | "completed" | "incomplete"
17040 readonly "type": never
17041 readonly "content"?: ReadonlyArray<ReasoningTextContent>
17042 readonly "encrypted_content"?: string | null
17043 readonly "summary": ReadonlyArray<ReasoningSummaryText>
17044 } | {
17045 readonly "call_id": string
17046 readonly "id": string
17047 readonly "input": string
17048 readonly "name": string
17049 readonly "namespace"?: string
17050 readonly "type": never
17051 readonly "content"?: ReadonlyArray<ReasoningTextContent>
17052 readonly "encrypted_content"?: string | null
17053 readonly "status"?: "completed" | "incomplete" | "in_progress"
17054 readonly "summary": ReadonlyArray<ReasoningSummaryText>
17055 } | {
17056 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
17057 readonly "id": string
17058 readonly "phase"?: "commentary" | "final_answer" | null
17059 readonly "role": "assistant"
17060 readonly "status"?: "completed" | "incomplete" | "in_progress"
17061 readonly "type": never
17062 readonly "arguments": string
17063 readonly "call_id": string
17064 readonly "name": string
17065 readonly "namespace"?: string
17066 } | {
17067 readonly "content"?: ReadonlyArray<{ readonly "text": string; readonly "type": "reasoning_text" }>
17068 readonly "encrypted_content"?: string | null
17069 readonly "id": string
17070 readonly "status"?: "completed" | "incomplete" | "in_progress"
17071 readonly "summary": ReadonlyArray<ReasoningSummaryText>
17072 readonly "type": never
17073 readonly "format"?: ReasoningFormat
17074 readonly "signature"?: string | null
17075 readonly "arguments": string
17076 readonly "call_id": string
17077 readonly "name": string
17078 readonly "namespace"?: string
17079 } | {
17080 readonly "arguments": string
17081 readonly "call_id": string
17082 readonly "id"?: string
17083 readonly "name": string
17084 readonly "namespace"?: string
17085 readonly "status"?: "completed" | "incomplete" | "in_progress"
17086 readonly "type": "function_call"
17087 } | {
17088 readonly "action"?:
17089 | {
17090 readonly "queries"?: ReadonlyArray<string>
17091 readonly "query": string
17092 readonly "sources"?: ReadonlyArray<WebSearchSource>
17093 readonly "type": "search"
17094 }
17095 | { readonly "type": "open_page"; readonly "url"?: string | null }
17096 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17097 readonly "id": string
17098 readonly "status": "completed" | "in_progress"
17099 readonly "type": never
17100 readonly "arguments": string
17101 readonly "call_id": string
17102 readonly "name": string
17103 readonly "namespace"?: string
17104 } | {
17105 readonly "id": string
17106 readonly "queries": ReadonlyArray<string>
17107 readonly "status": "completed" | "in_progress"
17108 readonly "type": never
17109 readonly "arguments": string
17110 readonly "call_id": string
17111 readonly "name": string
17112 readonly "namespace"?: string
17113 } | {
17114 readonly "id": string
17115 readonly "result"?: string | null
17116 readonly "status": "in_progress" | "completed"
17117 readonly "type": never
17118 readonly "prompt"?: string
17119 readonly "arguments": string
17120 readonly "call_id": string
17121 readonly "name": string
17122 readonly "namespace"?: string
17123 } | {
17124 readonly "code": string | null
17125 readonly "container_id": string
17126 readonly "id": string
17127 readonly "outputs":
17128 | ReadonlyArray<
17129 { readonly "type": "image"; readonly "url": string } | { readonly "logs": string; readonly "type": "logs" }
17130 >
17131 | null
17132 readonly "status": "in_progress" | "completed" | "incomplete"
17133 readonly "type": never
17134 readonly "arguments": string
17135 readonly "call_id": string
17136 readonly "name": string
17137 readonly "namespace"?: string
17138 } | {
17139 readonly "action"?: Schema.Json
17140 readonly "call_id": string
17141 readonly "id"?: string
17142 readonly "pending_safety_checks": ReadonlyArray<
17143 { readonly "code": string; readonly "id": string; readonly "message": string }
17144 >
17145 readonly "status": "completed" | "incomplete" | "in_progress"
17146 readonly "type": never
17147 readonly "arguments": string
17148 readonly "name": string
17149 readonly "namespace"?: string
17150 } | {
17151 readonly "datetime": string
17152 readonly "id"?: string
17153 readonly "status": "in_progress" | "completed" | "incomplete"
17154 readonly "timezone": string
17155 readonly "type": never
17156 readonly "arguments": string
17157 readonly "call_id": string
17158 readonly "name": string
17159 readonly "namespace"?: string
17160 } | {
17161 readonly "action"?: {
17162 readonly "query": string
17163 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
17164 readonly "type": "search"
17165 }
17166 readonly "id"?: string
17167 readonly "status": "in_progress" | "completed" | "incomplete"
17168 readonly "type": never
17169 readonly "arguments": string
17170 readonly "call_id": string
17171 readonly "name": string
17172 readonly "namespace"?: string
17173 } | {
17174 readonly "code"?: string
17175 readonly "exitCode"?: number
17176 readonly "id"?: string
17177 readonly "language"?: string
17178 readonly "status": "in_progress" | "completed" | "incomplete"
17179 readonly "stderr"?: string
17180 readonly "stdout"?: string
17181 readonly "type": never
17182 readonly "arguments": string
17183 readonly "call_id": string
17184 readonly "name": string
17185 readonly "namespace"?: string
17186 } | {
17187 readonly "id"?: string
17188 readonly "queries"?: ReadonlyArray<string>
17189 readonly "status": "in_progress" | "completed" | "incomplete"
17190 readonly "type": never
17191 readonly "arguments": string
17192 readonly "call_id": string
17193 readonly "name": string
17194 readonly "namespace"?: string
17195 } | {
17196 readonly "id"?: string
17197 readonly "imageB64"?: string
17198 readonly "imageUrl"?: string
17199 readonly "prompt"?: string
17200 readonly "result"?: string | null
17201 readonly "revisedPrompt"?: string
17202 readonly "status": "in_progress" | "completed" | "incomplete"
17203 readonly "type": never
17204 readonly "arguments": string
17205 readonly "call_id": string
17206 readonly "name": string
17207 readonly "namespace"?: string
17208 } | {
17209 readonly "action"?: string
17210 readonly "id"?: string
17211 readonly "screenshotB64"?: string
17212 readonly "status": "in_progress" | "completed" | "incomplete"
17213 readonly "type": never
17214 readonly "arguments": string
17215 readonly "call_id": string
17216 readonly "name": string
17217 readonly "namespace"?: string
17218 } | {
17219 readonly "arguments": string
17220 readonly "call_id": string
17221 readonly "command"?: string
17222 readonly "exitCode"?: number
17223 readonly "id"?: string
17224 readonly "status": "in_progress" | "completed" | "incomplete"
17225 readonly "stderr"?: string
17226 readonly "stdout"?: string
17227 readonly "type": never
17228 readonly "name": string
17229 readonly "namespace"?: string
17230 } | {
17231 readonly "command"?: "view" | "create" | "str_replace" | "insert"
17232 readonly "filePath"?: string
17233 readonly "id"?: string
17234 readonly "status": "in_progress" | "completed" | "incomplete"
17235 readonly "type": never
17236 readonly "arguments": string
17237 readonly "call_id": string
17238 readonly "name": string
17239 readonly "namespace"?: string
17240 } | {
17241 readonly "call_id": string
17242 readonly "id"?: string
17243 readonly "operation"?: ApplyPatchCallOperation
17244 readonly "status": "in_progress" | "completed" | "incomplete"
17245 readonly "type": never
17246 readonly "arguments": string
17247 readonly "name": string
17248 readonly "namespace"?: string
17249 } | {
17250 readonly "call_id": string
17251 readonly "id": string
17252 readonly "operation": ApplyPatchCallOperation
17253 readonly "status": "in_progress" | "completed"
17254 readonly "type": never
17255 readonly "arguments": string
17256 readonly "name": string
17257 readonly "namespace"?: string
17258 } | {
17259 readonly "action"?: {
17260 readonly "commands": ReadonlyArray<string>
17261 readonly "max_output_length": number | null
17262 readonly "timeout_ms": number | null
17263 }
17264 readonly "call_id": string
17265 readonly "id": string
17266 readonly "status": "in_progress" | "completed" | "incomplete"
17267 readonly "type": never
17268 readonly "arguments": string
17269 readonly "name": string
17270 readonly "namespace"?: string
17271 } | {
17272 readonly "call_id": string
17273 readonly "id": string
17274 readonly "max_output_length"?: number | null
17275 readonly "output": ReadonlyArray<
17276 {
17277 readonly "outcome": { readonly "exit_code": number; readonly "type": "exit" } | { readonly "type": "timeout" }
17278 readonly "stderr": string
17279 readonly "stdout": string
17280 }
17281 >
17282 readonly "status": "in_progress" | "completed" | "incomplete"
17283 readonly "type": never
17284 readonly "arguments": string
17285 readonly "name": string
17286 readonly "namespace"?: string
17287 } | {
17288 readonly "content"?: string
17289 readonly "error"?: string
17290 readonly "httpStatus"?: number
17291 readonly "id"?: string
17292 readonly "status": "in_progress" | "completed" | "incomplete"
17293 readonly "title"?: string
17294 readonly "type": never
17295 readonly "url"?: string
17296 readonly "arguments": string
17297 readonly "call_id": string
17298 readonly "name": string
17299 readonly "namespace"?: string
17300 } | {
17301 readonly "id"?: string
17302 readonly "query"?: string
17303 readonly "status": "in_progress" | "completed" | "incomplete"
17304 readonly "type": never
17305 readonly "arguments": string
17306 readonly "call_id": string
17307 readonly "name": string
17308 readonly "namespace"?: string
17309 } | {
17310 readonly "action"?: "read" | "write" | "delete"
17311 readonly "id"?: string
17312 readonly "key"?: string
17313 readonly "status": "in_progress" | "completed" | "incomplete"
17314 readonly "type": never
17315 readonly "value"?: Schema.Json
17316 readonly "arguments": string
17317 readonly "call_id": string
17318 readonly "name": string
17319 readonly "namespace"?: string
17320 } | {
17321 readonly "id"?: string
17322 readonly "serverLabel"?: string
17323 readonly "status": "in_progress" | "completed" | "incomplete"
17324 readonly "toolName"?: string
17325 readonly "type": never
17326 readonly "arguments": string
17327 readonly "call_id": string
17328 readonly "name": string
17329 readonly "namespace"?: string
17330 } | {
17331 readonly "arguments": string
17332 readonly "id"?: string
17333 readonly "query"?: string
17334 readonly "status": "in_progress" | "completed" | "incomplete"
17335 readonly "type": never
17336 readonly "call_id": string
17337 readonly "name": string
17338 readonly "namespace"?: string
17339 } | {
17340 readonly "analysis"?: FusionAnalysisResult
17341 readonly "error"?: string
17342 readonly "failed_models"?: ReadonlyArray<
17343 { readonly "error": string; readonly "model": string; readonly "status_code"?: number }
17344 >
17345 readonly "failure_reason"?: string
17346 readonly "id"?: string
17347 readonly "responses"?: ReadonlyArray<{ readonly "content"?: string; readonly "model": string }>
17348 readonly "sources"?: ReadonlyArray<FusionSource>
17349 readonly "status": "in_progress" | "completed" | "incomplete"
17350 readonly "type": never
17351 readonly "arguments": string
17352 readonly "call_id": string
17353 readonly "name": string
17354 readonly "namespace"?: string
17355 } | {
17356 readonly "advice"?: string
17357 readonly "error"?: string
17358 readonly "id"?: string
17359 readonly "instance_name"?: string
17360 readonly "model"?: string
17361 readonly "prompt"?: string
17362 readonly "status": "in_progress" | "completed" | "incomplete"
17363 readonly "type": never
17364 readonly "arguments": string
17365 readonly "call_id": string
17366 readonly "name": string
17367 readonly "namespace"?: string
17368 } | {
17369 readonly "error"?: string
17370 readonly "id"?: string
17371 readonly "instance_name"?: string
17372 readonly "model"?: string
17373 readonly "name": string
17374 readonly "outcome"?: string
17375 readonly "status": "in_progress" | "completed" | "incomplete"
17376 readonly "task_description"?: string
17377 readonly "task_name"?: string
17378 readonly "type": never
17379 readonly "arguments": string
17380 readonly "call_id": string
17381 readonly "namespace"?: string
17382 } | {
17383 readonly "error"?: string
17384 readonly "file_id"?: string
17385 readonly "filename"?: string
17386 readonly "id"?: string
17387 readonly "operation"?: string
17388 readonly "result"?: string
17389 readonly "status": "in_progress" | "completed" | "incomplete"
17390 readonly "type": never
17391 readonly "arguments": string
17392 readonly "call_id": string
17393 readonly "name": string
17394 readonly "namespace"?: string
17395 } | {
17396 readonly "call_id": string
17397 readonly "id"?: string
17398 readonly "input": string
17399 readonly "name": string
17400 readonly "namespace"?: string
17401 readonly "type": never
17402 readonly "arguments": string
17403 readonly "status"?: "completed" | "incomplete" | "in_progress"
17404 } | {
17405 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
17406 readonly "id": string
17407 readonly "phase"?: "commentary" | "final_answer" | null
17408 readonly "role": "assistant"
17409 readonly "status"?: "completed" | "incomplete" | "in_progress"
17410 readonly "type": never
17411 readonly "call_id": string
17412 readonly "input": string
17413 readonly "name": string
17414 readonly "namespace"?: string
17415 } | {
17416 readonly "content"?: ReadonlyArray<{ readonly "text": string; readonly "type": "reasoning_text" }>
17417 readonly "encrypted_content"?: string | null
17418 readonly "id": string
17419 readonly "status"?: "completed" | "incomplete" | "in_progress"
17420 readonly "summary": ReadonlyArray<ReasoningSummaryText>
17421 readonly "type": never
17422 readonly "format"?: ReasoningFormat
17423 readonly "signature"?: string | null
17424 readonly "call_id": string
17425 readonly "input": string
17426 readonly "name": string
17427 readonly "namespace"?: string
17428 } | {
17429 readonly "arguments": string
17430 readonly "call_id": string
17431 readonly "id"?: string
17432 readonly "name": string
17433 readonly "namespace"?: string
17434 readonly "status"?: "completed" | "incomplete" | "in_progress"
17435 readonly "type": never
17436 readonly "input": string
17437 } | {
17438 readonly "action"?:
17439 | {
17440 readonly "queries"?: ReadonlyArray<string>
17441 readonly "query": string
17442 readonly "sources"?: ReadonlyArray<WebSearchSource>
17443 readonly "type": "search"
17444 }
17445 | { readonly "type": "open_page"; readonly "url"?: string | null }
17446 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17447 readonly "id": string
17448 readonly "status": WebSearchStatus
17449 readonly "type": never
17450 readonly "call_id": string
17451 readonly "input": string
17452 readonly "name": string
17453 readonly "namespace"?: string
17454 } | {
17455 readonly "id": string
17456 readonly "queries": ReadonlyArray<string>
17457 readonly "status": WebSearchStatus
17458 readonly "type": never
17459 readonly "call_id": string
17460 readonly "input": string
17461 readonly "name": string
17462 readonly "namespace"?: string
17463 } | {
17464 readonly "id": string
17465 readonly "result"?: string | null
17466 readonly "status": ImageGenerationStatus
17467 readonly "type": never
17468 readonly "prompt"?: string
17469 readonly "call_id": string
17470 readonly "input": string
17471 readonly "name": string
17472 readonly "namespace"?: string
17473 } | {
17474 readonly "code": string | null
17475 readonly "container_id": string
17476 readonly "id": string
17477 readonly "outputs":
17478 | ReadonlyArray<
17479 { readonly "type": "image"; readonly "url": string } | { readonly "logs": string; readonly "type": "logs" }
17480 >
17481 | null
17482 readonly "status": ToolCallStatus
17483 readonly "type": never
17484 readonly "call_id": string
17485 readonly "input": string
17486 readonly "name": string
17487 readonly "namespace"?: string
17488 } | {
17489 readonly "action"?: Schema.Json
17490 readonly "call_id": string
17491 readonly "id"?: string
17492 readonly "pending_safety_checks": ReadonlyArray<
17493 { readonly "code": string; readonly "id": string; readonly "message": string }
17494 >
17495 readonly "status": "completed" | "incomplete" | "in_progress"
17496 readonly "type": never
17497 readonly "input": string
17498 readonly "name": string
17499 readonly "namespace"?: string
17500 } | {
17501 readonly "datetime": string
17502 readonly "id"?: string
17503 readonly "status": ToolCallStatus
17504 readonly "timezone": string
17505 readonly "type": never
17506 readonly "call_id": string
17507 readonly "input": string
17508 readonly "name": string
17509 readonly "namespace"?: string
17510 } | {
17511 readonly "action"?: {
17512 readonly "query": string
17513 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
17514 readonly "type": "search"
17515 }
17516 readonly "id"?: string
17517 readonly "status": ToolCallStatus
17518 readonly "type": never
17519 readonly "call_id": string
17520 readonly "input": string
17521 readonly "name": string
17522 readonly "namespace"?: string
17523 } | {
17524 readonly "code"?: string
17525 readonly "exitCode"?: number
17526 readonly "id"?: string
17527 readonly "language"?: string
17528 readonly "status": ToolCallStatus
17529 readonly "stderr"?: string
17530 readonly "stdout"?: string
17531 readonly "type": never
17532 readonly "call_id": string
17533 readonly "input": string
17534 readonly "name": string
17535 readonly "namespace"?: string
17536 } | {
17537 readonly "id"?: string
17538 readonly "queries"?: ReadonlyArray<string>
17539 readonly "status": ToolCallStatus
17540 readonly "type": never
17541 readonly "call_id": string
17542 readonly "input": string
17543 readonly "name": string
17544 readonly "namespace"?: string
17545 } | {
17546 readonly "id"?: string
17547 readonly "imageB64"?: string
17548 readonly "imageUrl"?: string
17549 readonly "prompt"?: string
17550 readonly "result"?: string | null
17551 readonly "revisedPrompt"?: string
17552 readonly "status": ToolCallStatus
17553 readonly "type": never
17554 readonly "call_id": string
17555 readonly "input": string
17556 readonly "name": string
17557 readonly "namespace"?: string
17558 } | {
17559 readonly "action"?: string
17560 readonly "id"?: string
17561 readonly "screenshotB64"?: string
17562 readonly "status": ToolCallStatus
17563 readonly "type": never
17564 readonly "call_id": string
17565 readonly "input": string
17566 readonly "name": string
17567 readonly "namespace"?: string
17568 } | {
17569 readonly "arguments"?: string
17570 readonly "call_id": string
17571 readonly "command"?: string
17572 readonly "exitCode"?: number
17573 readonly "id"?: string
17574 readonly "status": ToolCallStatus
17575 readonly "stderr"?: string
17576 readonly "stdout"?: string
17577 readonly "type": never
17578 readonly "input": string
17579 readonly "name": string
17580 readonly "namespace"?: string
17581 } | {
17582 readonly "command"?: "view" | "create" | "str_replace" | "insert"
17583 readonly "filePath"?: string
17584 readonly "id"?: string
17585 readonly "status": ToolCallStatus
17586 readonly "type": never
17587 readonly "call_id": string
17588 readonly "input": string
17589 readonly "name": string
17590 readonly "namespace"?: string
17591 } | {
17592 readonly "call_id": string
17593 readonly "id"?: string
17594 readonly "operation"?: ApplyPatchCallOperation
17595 readonly "status": ToolCallStatus
17596 readonly "type": never
17597 readonly "input": string
17598 readonly "name": string
17599 readonly "namespace"?: string
17600 } | {
17601 readonly "call_id": string
17602 readonly "id": string
17603 readonly "operation": ApplyPatchCallOperation
17604 readonly "status": ApplyPatchCallStatus
17605 readonly "type": never
17606 readonly "input": string
17607 readonly "name": string
17608 readonly "namespace"?: string
17609 } | {
17610 readonly "action"?: {
17611 readonly "commands": ReadonlyArray<string>
17612 readonly "max_output_length": number | null
17613 readonly "timeout_ms": number | null
17614 }
17615 readonly "call_id": string
17616 readonly "id": string
17617 readonly "status": ShellCallStatus
17618 readonly "type": never
17619 readonly "input": string
17620 readonly "name": string
17621 readonly "namespace"?: string
17622 } | {
17623 readonly "call_id": string
17624 readonly "id": string
17625 readonly "max_output_length"?: number | null
17626 readonly "output": ReadonlyArray<
17627 {
17628 readonly "outcome": { readonly "exit_code": number; readonly "type": "exit" } | { readonly "type": "timeout" }
17629 readonly "stderr": string
17630 readonly "stdout": string
17631 }
17632 >
17633 readonly "status": ShellCallStatus
17634 readonly "type": never
17635 readonly "input": string
17636 readonly "name": string
17637 readonly "namespace"?: string
17638 } | {
17639 readonly "content"?: string
17640 readonly "error"?: string
17641 readonly "httpStatus"?: number
17642 readonly "id"?: string
17643 readonly "status": ToolCallStatus
17644 readonly "title"?: string
17645 readonly "type": never
17646 readonly "url"?: string
17647 readonly "call_id": string
17648 readonly "input": string
17649 readonly "name": string
17650 readonly "namespace"?: string
17651 } | {
17652 readonly "id"?: string
17653 readonly "query"?: string
17654 readonly "status": ToolCallStatus
17655 readonly "type": never
17656 readonly "call_id": string
17657 readonly "input": string
17658 readonly "name": string
17659 readonly "namespace"?: string
17660 } | {
17661 readonly "action"?: "read" | "write" | "delete"
17662 readonly "id"?: string
17663 readonly "key"?: string
17664 readonly "status": ToolCallStatus
17665 readonly "type": never
17666 readonly "value"?: Schema.Json
17667 readonly "call_id": string
17668 readonly "input": string
17669 readonly "name": string
17670 readonly "namespace"?: string
17671 } | {
17672 readonly "id"?: string
17673 readonly "serverLabel"?: string
17674 readonly "status": ToolCallStatus
17675 readonly "toolName"?: string
17676 readonly "type": never
17677 readonly "call_id": string
17678 readonly "input": string
17679 readonly "name": string
17680 readonly "namespace"?: string
17681 } | {
17682 readonly "arguments"?: string
17683 readonly "id"?: string
17684 readonly "query"?: string
17685 readonly "status": ToolCallStatus
17686 readonly "type": never
17687 readonly "call_id": string
17688 readonly "input": string
17689 readonly "name": string
17690 readonly "namespace"?: string
17691 } | {
17692 readonly "analysis"?: FusionAnalysisResult
17693 readonly "error"?: string
17694 readonly "failed_models"?: ReadonlyArray<
17695 { readonly "error": string; readonly "model": string; readonly "status_code"?: number }
17696 >
17697 readonly "failure_reason"?: string
17698 readonly "id"?: string
17699 readonly "responses"?: ReadonlyArray<{ readonly "content"?: string; readonly "model": string }>
17700 readonly "sources"?: ReadonlyArray<FusionSource>
17701 readonly "status": ToolCallStatus
17702 readonly "type": never
17703 readonly "call_id": string
17704 readonly "input": string
17705 readonly "name": string
17706 readonly "namespace"?: string
17707 } | {
17708 readonly "advice"?: string
17709 readonly "error"?: string
17710 readonly "id"?: string
17711 readonly "instance_name"?: string
17712 readonly "model"?: string
17713 readonly "prompt"?: string
17714 readonly "status": ToolCallStatus
17715 readonly "type": never
17716 readonly "call_id": string
17717 readonly "input": string
17718 readonly "name": string
17719 readonly "namespace"?: string
17720 } | {
17721 readonly "error"?: string
17722 readonly "id"?: string
17723 readonly "instance_name"?: string
17724 readonly "model"?: string
17725 readonly "name": string
17726 readonly "outcome"?: string
17727 readonly "status": ToolCallStatus
17728 readonly "task_description"?: string
17729 readonly "task_name"?: string
17730 readonly "type": never
17731 readonly "call_id": string
17732 readonly "input": string
17733 readonly "namespace"?: string
17734 } | {
17735 readonly "error"?: string
17736 readonly "file_id"?: string
17737 readonly "filename"?: string
17738 readonly "id"?: string
17739 readonly "operation"?: string
17740 readonly "result"?: string
17741 readonly "status": ToolCallStatus
17742 readonly "type": never
17743 readonly "call_id": string
17744 readonly "input": string
17745 readonly "name": string
17746 readonly "namespace"?: string
17747 } | {
17748 readonly "call_id": string
17749 readonly "id"?: string
17750 readonly "input": string
17751 readonly "name": string
17752 readonly "namespace"?: string
17753 readonly "type": "custom_tool_call"
17754 } | {
17755 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
17756 readonly "id": string
17757 readonly "phase"?: "commentary" | "final_answer" | null
17758 readonly "role": "assistant"
17759 readonly "status": "completed" | "in_progress"
17760 readonly "type": never
17761 readonly "action"?:
17762 | {
17763 readonly "queries"?: ReadonlyArray<string>
17764 readonly "query": string
17765 readonly "sources"?: ReadonlyArray<WebSearchSource>
17766 readonly "type": "search"
17767 }
17768 | { readonly "type": "open_page"; readonly "url"?: string | null }
17769 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17770 } | {
17771 readonly "content"?: ReadonlyArray<{ readonly "text": string; readonly "type": "reasoning_text" }>
17772 readonly "encrypted_content"?: string | null
17773 readonly "id": string
17774 readonly "status": "completed" | "in_progress"
17775 readonly "summary": ReadonlyArray<ReasoningSummaryText>
17776 readonly "type": never
17777 readonly "format"?: ReasoningFormat
17778 readonly "signature"?: string | null
17779 readonly "action"?:
17780 | {
17781 readonly "queries"?: ReadonlyArray<string>
17782 readonly "query": string
17783 readonly "sources"?: ReadonlyArray<WebSearchSource>
17784 readonly "type": "search"
17785 }
17786 | { readonly "type": "open_page"; readonly "url"?: string | null }
17787 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17788 } | {
17789 readonly "arguments": string
17790 readonly "call_id": string
17791 readonly "id": string
17792 readonly "name": string
17793 readonly "namespace"?: string
17794 readonly "status": "completed" | "in_progress"
17795 readonly "type": never
17796 readonly "action"?:
17797 | {
17798 readonly "queries"?: ReadonlyArray<string>
17799 readonly "query": string
17800 readonly "sources"?: ReadonlyArray<WebSearchSource>
17801 readonly "type": "search"
17802 }
17803 | { readonly "type": "open_page"; readonly "url"?: string | null }
17804 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17805 } | {
17806 readonly "action"?:
17807 | {
17808 readonly "queries"?: ReadonlyArray<string>
17809 readonly "query": string
17810 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
17811 readonly "type": "search"
17812 }
17813 | {
17814 readonly "type": never
17815 readonly "url"?: string | null
17816 readonly "queries"?: ReadonlyArray<string>
17817 readonly "query": string
17818 readonly "sources"?: ReadonlyArray<WebSearchSource>
17819 }
17820 | {
17821 readonly "pattern": string
17822 readonly "type": never
17823 readonly "url": string
17824 readonly "queries"?: ReadonlyArray<string>
17825 readonly "query": string
17826 readonly "sources"?: ReadonlyArray<WebSearchSource>
17827 }
17828 | {
17829 readonly "queries"?: ReadonlyArray<string>
17830 readonly "query": string
17831 readonly "sources"?: ReadonlyArray<WebSearchSource>
17832 readonly "type": never
17833 readonly "url"?: string | null
17834 }
17835 | { readonly "type": "open_page"; readonly "url"?: string | null }
17836 | { readonly "pattern": string; readonly "type": never; readonly "url": string }
17837 | {
17838 readonly "queries"?: ReadonlyArray<string>
17839 readonly "query": string
17840 readonly "sources"?: ReadonlyArray<WebSearchSource>
17841 readonly "type": never
17842 readonly "pattern": string
17843 readonly "url": string
17844 }
17845 | { readonly "type": never; readonly "url": string; readonly "pattern": string }
17846 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17847 readonly "id": string
17848 readonly "status": "completed" | "searching" | "in_progress" | "failed"
17849 readonly "type": "web_search_call"
17850 } | {
17851 readonly "id": string
17852 readonly "queries": ReadonlyArray<string>
17853 readonly "status": "completed" | "searching" | "in_progress" | "failed"
17854 readonly "type": never
17855 readonly "action"?:
17856 | {
17857 readonly "queries"?: ReadonlyArray<string>
17858 readonly "query": string
17859 readonly "sources"?: ReadonlyArray<WebSearchSource>
17860 readonly "type": "search"
17861 }
17862 | { readonly "type": "open_page"; readonly "url"?: string | null }
17863 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17864 } | {
17865 readonly "id": string
17866 readonly "result"?: string | null
17867 readonly "status": "in_progress" | "completed" | "failed"
17868 readonly "type": never
17869 readonly "prompt"?: string
17870 readonly "action"?:
17871 | {
17872 readonly "queries"?: ReadonlyArray<string>
17873 readonly "query": string
17874 readonly "sources"?: ReadonlyArray<WebSearchSource>
17875 readonly "type": "search"
17876 }
17877 | { readonly "type": "open_page"; readonly "url"?: string | null }
17878 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17879 } | {
17880 readonly "code": string | null
17881 readonly "container_id": string
17882 readonly "id": string
17883 readonly "outputs":
17884 | ReadonlyArray<
17885 { readonly "type": "image"; readonly "url": string } | { readonly "logs": string; readonly "type": "logs" }
17886 >
17887 | null
17888 readonly "status": "in_progress" | "completed"
17889 readonly "type": never
17890 readonly "action"?:
17891 | {
17892 readonly "queries"?: ReadonlyArray<string>
17893 readonly "query": string
17894 readonly "sources"?: ReadonlyArray<WebSearchSource>
17895 readonly "type": "search"
17896 }
17897 | { readonly "type": "open_page"; readonly "url"?: string | null }
17898 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17899 } | {
17900 readonly "action"?:
17901 | {
17902 readonly "queries"?: ReadonlyArray<string>
17903 readonly "query": string
17904 readonly "sources"?: ReadonlyArray<WebSearchSource>
17905 readonly "type": "search"
17906 }
17907 | { readonly "type": "open_page"; readonly "url"?: string | null }
17908 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17909 readonly "call_id": string
17910 readonly "id": string
17911 readonly "pending_safety_checks": ReadonlyArray<
17912 { readonly "code": string; readonly "id": string; readonly "message": string }
17913 >
17914 readonly "status": "completed" | "in_progress"
17915 readonly "type": never
17916 } | {
17917 readonly "datetime": string
17918 readonly "id": string
17919 readonly "status": "in_progress" | "completed"
17920 readonly "timezone": string
17921 readonly "type": never
17922 readonly "action"?:
17923 | {
17924 readonly "queries"?: ReadonlyArray<string>
17925 readonly "query": string
17926 readonly "sources"?: ReadonlyArray<WebSearchSource>
17927 readonly "type": "search"
17928 }
17929 | { readonly "type": "open_page"; readonly "url"?: string | null }
17930 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17931 } | {
17932 readonly "action"?: {
17933 readonly "queries"?: ReadonlyArray<string>
17934 readonly "query": string
17935 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
17936 readonly "type": "search"
17937 } | {
17938 readonly "type": never
17939 readonly "url"?: string | null
17940 readonly "query": string
17941 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
17942 } | {
17943 readonly "pattern": string
17944 readonly "type": never
17945 readonly "url": string
17946 readonly "query": string
17947 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
17948 }
17949 readonly "id": string
17950 readonly "status": "in_progress" | "completed"
17951 readonly "type": never
17952 } | {
17953 readonly "code"?: string
17954 readonly "exitCode"?: number
17955 readonly "id": string
17956 readonly "language"?: string
17957 readonly "status": "in_progress" | "completed"
17958 readonly "stderr"?: string
17959 readonly "stdout"?: string
17960 readonly "type": never
17961 readonly "action"?:
17962 | {
17963 readonly "queries"?: ReadonlyArray<string>
17964 readonly "query": string
17965 readonly "sources"?: ReadonlyArray<WebSearchSource>
17966 readonly "type": "search"
17967 }
17968 | { readonly "type": "open_page"; readonly "url"?: string | null }
17969 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17970 } | {
17971 readonly "id": string
17972 readonly "queries"?: ReadonlyArray<string>
17973 readonly "status": "in_progress" | "completed"
17974 readonly "type": never
17975 readonly "action"?:
17976 | {
17977 readonly "queries"?: ReadonlyArray<string>
17978 readonly "query": string
17979 readonly "sources"?: ReadonlyArray<WebSearchSource>
17980 readonly "type": "search"
17981 }
17982 | { readonly "type": "open_page"; readonly "url"?: string | null }
17983 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
17984 } | {
17985 readonly "id": string
17986 readonly "imageB64"?: string
17987 readonly "imageUrl"?: string
17988 readonly "prompt"?: string
17989 readonly "result"?: string | null
17990 readonly "revisedPrompt"?: string
17991 readonly "status": "in_progress" | "completed"
17992 readonly "type": never
17993 readonly "action"?:
17994 | {
17995 readonly "queries"?: ReadonlyArray<string>
17996 readonly "query": string
17997 readonly "sources"?: ReadonlyArray<WebSearchSource>
17998 readonly "type": "search"
17999 }
18000 | { readonly "type": "open_page"; readonly "url"?: string | null }
18001 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18002 } | {
18003 readonly "action"?: never
18004 readonly "id": string
18005 readonly "screenshotB64"?: string
18006 readonly "status": "in_progress" | "completed"
18007 readonly "type": never
18008 } | {
18009 readonly "arguments"?: string
18010 readonly "call_id"?: string
18011 readonly "command"?: string
18012 readonly "exitCode"?: number
18013 readonly "id": string
18014 readonly "status": "in_progress" | "completed"
18015 readonly "stderr"?: string
18016 readonly "stdout"?: string
18017 readonly "type": never
18018 readonly "action"?:
18019 | {
18020 readonly "queries"?: ReadonlyArray<string>
18021 readonly "query": string
18022 readonly "sources"?: ReadonlyArray<WebSearchSource>
18023 readonly "type": "search"
18024 }
18025 | { readonly "type": "open_page"; readonly "url"?: string | null }
18026 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18027 } | {
18028 readonly "command"?: "view" | "create" | "str_replace" | "insert"
18029 readonly "filePath"?: string
18030 readonly "id": string
18031 readonly "status": "in_progress" | "completed"
18032 readonly "type": never
18033 readonly "action"?:
18034 | {
18035 readonly "queries"?: ReadonlyArray<string>
18036 readonly "query": string
18037 readonly "sources"?: ReadonlyArray<WebSearchSource>
18038 readonly "type": "search"
18039 }
18040 | { readonly "type": "open_page"; readonly "url"?: string | null }
18041 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18042 } | {
18043 readonly "call_id"?: string
18044 readonly "id": string
18045 readonly "operation"?: ApplyPatchCallOperation
18046 readonly "status": "in_progress" | "completed"
18047 readonly "type": never
18048 readonly "action"?:
18049 | {
18050 readonly "queries"?: ReadonlyArray<string>
18051 readonly "query": string
18052 readonly "sources"?: ReadonlyArray<WebSearchSource>
18053 readonly "type": "search"
18054 }
18055 | { readonly "type": "open_page"; readonly "url"?: string | null }
18056 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18057 } | {
18058 readonly "call_id": string
18059 readonly "id": string
18060 readonly "operation": ApplyPatchCallOperation
18061 readonly "status": "in_progress" | "completed"
18062 readonly "type": never
18063 readonly "action"?:
18064 | {
18065 readonly "queries"?: ReadonlyArray<string>
18066 readonly "query": string
18067 readonly "sources"?: ReadonlyArray<WebSearchSource>
18068 readonly "type": "search"
18069 }
18070 | { readonly "type": "open_page"; readonly "url"?: string | null }
18071 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18072 } | {
18073 readonly "action"?: {
18074 readonly "queries"?: ReadonlyArray<string>
18075 readonly "query": string
18076 readonly "sources"?: ReadonlyArray<WebSearchSource>
18077 readonly "type": "search"
18078 readonly "commands": ReadonlyArray<string>
18079 readonly "max_output_length": number | null
18080 readonly "timeout_ms": number | null
18081 } | {
18082 readonly "type": "open_page"
18083 readonly "url"?: string | null
18084 readonly "commands": ReadonlyArray<string>
18085 readonly "max_output_length": number | null
18086 readonly "timeout_ms": number | null
18087 } | {
18088 readonly "pattern": string
18089 readonly "type": "find_in_page"
18090 readonly "url": string
18091 readonly "commands": ReadonlyArray<string>
18092 readonly "max_output_length": number | null
18093 readonly "timeout_ms": number | null
18094 }
18095 readonly "call_id": string
18096 readonly "id": string
18097 readonly "status": "in_progress" | "completed"
18098 readonly "type": never
18099 } | {
18100 readonly "call_id": string
18101 readonly "id": string
18102 readonly "max_output_length"?: number | null
18103 readonly "output": ReadonlyArray<
18104 {
18105 readonly "outcome": { readonly "exit_code": number; readonly "type": "exit" } | { readonly "type": "timeout" }
18106 readonly "stderr": string
18107 readonly "stdout": string
18108 }
18109 >
18110 readonly "status": "in_progress" | "completed"
18111 readonly "type": never
18112 readonly "action"?:
18113 | {
18114 readonly "queries"?: ReadonlyArray<string>
18115 readonly "query": string
18116 readonly "sources"?: ReadonlyArray<WebSearchSource>
18117 readonly "type": "search"
18118 }
18119 | { readonly "type": "open_page"; readonly "url"?: string | null }
18120 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18121 } | {
18122 readonly "content"?: string
18123 readonly "error"?: string
18124 readonly "httpStatus"?: number
18125 readonly "id": string
18126 readonly "status": "in_progress" | "completed"
18127 readonly "title"?: string
18128 readonly "type": never
18129 readonly "url"?: string
18130 readonly "action"?:
18131 | {
18132 readonly "queries"?: ReadonlyArray<string>
18133 readonly "query": string
18134 readonly "sources"?: ReadonlyArray<WebSearchSource>
18135 readonly "type": "search"
18136 }
18137 | { readonly "type": "open_page"; readonly "url"?: string | null }
18138 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18139 } | {
18140 readonly "id": string
18141 readonly "query"?: string
18142 readonly "status": "in_progress" | "completed"
18143 readonly "type": never
18144 readonly "action"?:
18145 | {
18146 readonly "queries"?: ReadonlyArray<string>
18147 readonly "query": string
18148 readonly "sources"?: ReadonlyArray<WebSearchSource>
18149 readonly "type": "search"
18150 }
18151 | { readonly "type": "open_page"; readonly "url"?: string | null }
18152 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18153 } | {
18154 readonly "action"?: never
18155 readonly "id": string
18156 readonly "key"?: string
18157 readonly "status": "in_progress" | "completed"
18158 readonly "type": never
18159 readonly "value"?: Schema.Json
18160 } | {
18161 readonly "id": string
18162 readonly "serverLabel"?: string
18163 readonly "status": "in_progress" | "completed"
18164 readonly "toolName"?: string
18165 readonly "type": never
18166 readonly "action"?:
18167 | {
18168 readonly "queries"?: ReadonlyArray<string>
18169 readonly "query": string
18170 readonly "sources"?: ReadonlyArray<WebSearchSource>
18171 readonly "type": "search"
18172 }
18173 | { readonly "type": "open_page"; readonly "url"?: string | null }
18174 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18175 } | {
18176 readonly "arguments"?: string
18177 readonly "id": string
18178 readonly "query"?: string
18179 readonly "status": "in_progress" | "completed"
18180 readonly "type": never
18181 readonly "action"?:
18182 | {
18183 readonly "queries"?: ReadonlyArray<string>
18184 readonly "query": string
18185 readonly "sources"?: ReadonlyArray<WebSearchSource>
18186 readonly "type": "search"
18187 }
18188 | { readonly "type": "open_page"; readonly "url"?: string | null }
18189 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18190 } | {
18191 readonly "analysis"?: FusionAnalysisResult
18192 readonly "error"?: string
18193 readonly "failed_models"?: ReadonlyArray<
18194 { readonly "error": string; readonly "model": string; readonly "status_code"?: number }
18195 >
18196 readonly "failure_reason"?: string
18197 readonly "id": string
18198 readonly "responses"?: ReadonlyArray<{ readonly "content"?: string; readonly "model": string }>
18199 readonly "sources"?: ReadonlyArray<FusionSource>
18200 readonly "status": "in_progress" | "completed"
18201 readonly "type": never
18202 readonly "action"?:
18203 | {
18204 readonly "queries"?: ReadonlyArray<string>
18205 readonly "query": string
18206 readonly "sources"?: ReadonlyArray<WebSearchSource>
18207 readonly "type": "search"
18208 }
18209 | { readonly "type": "open_page"; readonly "url"?: string | null }
18210 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18211 } | {
18212 readonly "advice"?: string
18213 readonly "error"?: string
18214 readonly "id": string
18215 readonly "instance_name"?: string
18216 readonly "model"?: string
18217 readonly "prompt"?: string
18218 readonly "status": "in_progress" | "completed"
18219 readonly "type": never
18220 readonly "action"?:
18221 | {
18222 readonly "queries"?: ReadonlyArray<string>
18223 readonly "query": string
18224 readonly "sources"?: ReadonlyArray<WebSearchSource>
18225 readonly "type": "search"
18226 }
18227 | { readonly "type": "open_page"; readonly "url"?: string | null }
18228 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18229 } | {
18230 readonly "error"?: string
18231 readonly "id": string
18232 readonly "instance_name"?: string
18233 readonly "model"?: string
18234 readonly "name"?: string
18235 readonly "outcome"?: string
18236 readonly "status": "in_progress" | "completed"
18237 readonly "task_description"?: string
18238 readonly "task_name"?: string
18239 readonly "type": never
18240 readonly "action"?:
18241 | {
18242 readonly "queries"?: ReadonlyArray<string>
18243 readonly "query": string
18244 readonly "sources"?: ReadonlyArray<WebSearchSource>
18245 readonly "type": "search"
18246 }
18247 | { readonly "type": "open_page"; readonly "url"?: string | null }
18248 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18249 } | {
18250 readonly "error"?: string
18251 readonly "file_id"?: string
18252 readonly "filename"?: string
18253 readonly "id": string
18254 readonly "operation"?: string
18255 readonly "result"?: string
18256 readonly "status": "in_progress" | "completed"
18257 readonly "type": never
18258 readonly "action"?:
18259 | {
18260 readonly "queries"?: ReadonlyArray<string>
18261 readonly "query": string
18262 readonly "sources"?: ReadonlyArray<WebSearchSource>
18263 readonly "type": "search"
18264 }
18265 | { readonly "type": "open_page"; readonly "url"?: string | null }
18266 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18267 } | {
18268 readonly "call_id": string
18269 readonly "id": string
18270 readonly "input": string
18271 readonly "name": string
18272 readonly "namespace"?: string
18273 readonly "type": never
18274 readonly "action"?:
18275 | {
18276 readonly "queries"?: ReadonlyArray<string>
18277 readonly "query": string
18278 readonly "sources"?: ReadonlyArray<WebSearchSource>
18279 readonly "type": "search"
18280 }
18281 | { readonly "type": "open_page"; readonly "url"?: string | null }
18282 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18283 readonly "status": WebSearchStatus
18284 } | {
18285 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
18286 readonly "id": string
18287 readonly "phase"?: "commentary" | "final_answer" | null
18288 readonly "role": "assistant"
18289 readonly "status": "completed" | "in_progress"
18290 readonly "type": never
18291 readonly "queries": ReadonlyArray<string>
18292 } | {
18293 readonly "content"?: ReadonlyArray<{ readonly "text": string; readonly "type": "reasoning_text" }>
18294 readonly "encrypted_content"?: string | null
18295 readonly "id": string
18296 readonly "status": "completed" | "in_progress"
18297 readonly "summary": ReadonlyArray<ReasoningSummaryText>
18298 readonly "type": never
18299 readonly "format"?: ReasoningFormat
18300 readonly "signature"?: string | null
18301 readonly "queries": ReadonlyArray<string>
18302 } | {
18303 readonly "arguments": string
18304 readonly "call_id": string
18305 readonly "id": string
18306 readonly "name": string
18307 readonly "namespace"?: string
18308 readonly "status": "completed" | "in_progress"
18309 readonly "type": never
18310 readonly "queries": ReadonlyArray<string>
18311 } | {
18312 readonly "action"?:
18313 | {
18314 readonly "queries"?: ReadonlyArray<string>
18315 readonly "query": string
18316 readonly "sources"?: ReadonlyArray<WebSearchSource>
18317 readonly "type": "search"
18318 }
18319 | { readonly "type": "open_page"; readonly "url"?: string | null }
18320 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18321 readonly "id": string
18322 readonly "status": "completed" | "searching" | "in_progress" | "failed"
18323 readonly "type": never
18324 readonly "queries": ReadonlyArray<string>
18325 } | {
18326 readonly "id": string
18327 readonly "queries": ReadonlyArray<string>
18328 readonly "status": "completed" | "searching" | "in_progress" | "failed"
18329 readonly "type": "file_search_call"
18330 } | {
18331 readonly "id": string
18332 readonly "result"?: string | null
18333 readonly "status": "in_progress" | "completed" | "failed"
18334 readonly "type": never
18335 readonly "prompt"?: string
18336 readonly "queries": ReadonlyArray<string>
18337 } | {
18338 readonly "code": string | null
18339 readonly "container_id": string
18340 readonly "id": string
18341 readonly "outputs":
18342 | ReadonlyArray<
18343 { readonly "type": "image"; readonly "url": string } | { readonly "logs": string; readonly "type": "logs" }
18344 >
18345 | null
18346 readonly "status": "in_progress" | "completed"
18347 readonly "type": never
18348 readonly "queries": ReadonlyArray<string>
18349 } | {
18350 readonly "action"?: Schema.Json
18351 readonly "call_id": string
18352 readonly "id": string
18353 readonly "pending_safety_checks": ReadonlyArray<
18354 { readonly "code": string; readonly "id": string; readonly "message": string }
18355 >
18356 readonly "status": "completed" | "in_progress"
18357 readonly "type": never
18358 readonly "queries": ReadonlyArray<string>
18359 } | {
18360 readonly "datetime": string
18361 readonly "id": string
18362 readonly "status": "in_progress" | "completed"
18363 readonly "timezone": string
18364 readonly "type": never
18365 readonly "queries": ReadonlyArray<string>
18366 } | {
18367 readonly "action"?: {
18368 readonly "query": string
18369 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
18370 readonly "type": "search"
18371 }
18372 readonly "id": string
18373 readonly "status": "in_progress" | "completed"
18374 readonly "type": never
18375 readonly "queries": ReadonlyArray<string>
18376 } | {
18377 readonly "code"?: string
18378 readonly "exitCode"?: number
18379 readonly "id": string
18380 readonly "language"?: string
18381 readonly "status": "in_progress" | "completed"
18382 readonly "stderr"?: string
18383 readonly "stdout"?: string
18384 readonly "type": never
18385 readonly "queries": ReadonlyArray<string>
18386 } | {
18387 readonly "id": string
18388 readonly "queries": ReadonlyArray<string>
18389 readonly "status": "in_progress" | "completed"
18390 readonly "type": never
18391 } | {
18392 readonly "id": string
18393 readonly "imageB64"?: string
18394 readonly "imageUrl"?: string
18395 readonly "prompt"?: string
18396 readonly "result"?: string | null
18397 readonly "revisedPrompt"?: string
18398 readonly "status": "in_progress" | "completed"
18399 readonly "type": never
18400 readonly "queries": ReadonlyArray<string>
18401 } | {
18402 readonly "action"?: string
18403 readonly "id": string
18404 readonly "screenshotB64"?: string
18405 readonly "status": "in_progress" | "completed"
18406 readonly "type": never
18407 readonly "queries": ReadonlyArray<string>
18408 } | {
18409 readonly "arguments"?: string
18410 readonly "call_id"?: string
18411 readonly "command"?: string
18412 readonly "exitCode"?: number
18413 readonly "id": string
18414 readonly "status": "in_progress" | "completed"
18415 readonly "stderr"?: string
18416 readonly "stdout"?: string
18417 readonly "type": never
18418 readonly "queries": ReadonlyArray<string>
18419 } | {
18420 readonly "command"?: "view" | "create" | "str_replace" | "insert"
18421 readonly "filePath"?: string
18422 readonly "id": string
18423 readonly "status": "in_progress" | "completed"
18424 readonly "type": never
18425 readonly "queries": ReadonlyArray<string>
18426 } | {
18427 readonly "call_id"?: string
18428 readonly "id": string
18429 readonly "operation"?: ApplyPatchCallOperation
18430 readonly "status": "in_progress" | "completed"
18431 readonly "type": never
18432 readonly "queries": ReadonlyArray<string>
18433 } | {
18434 readonly "call_id": string
18435 readonly "id": string
18436 readonly "operation": ApplyPatchCallOperation
18437 readonly "status": "in_progress" | "completed"
18438 readonly "type": never
18439 readonly "queries": ReadonlyArray<string>
18440 } | {
18441 readonly "action"?: {
18442 readonly "commands": ReadonlyArray<string>
18443 readonly "max_output_length": number | null
18444 readonly "timeout_ms": number | null
18445 }
18446 readonly "call_id": string
18447 readonly "id": string
18448 readonly "status": "in_progress" | "completed"
18449 readonly "type": never
18450 readonly "queries": ReadonlyArray<string>
18451 } | {
18452 readonly "call_id": string
18453 readonly "id": string
18454 readonly "max_output_length"?: number | null
18455 readonly "output": ReadonlyArray<
18456 {
18457 readonly "outcome": { readonly "exit_code": number; readonly "type": "exit" } | { readonly "type": "timeout" }
18458 readonly "stderr": string
18459 readonly "stdout": string
18460 }
18461 >
18462 readonly "status": "in_progress" | "completed"
18463 readonly "type": never
18464 readonly "queries": ReadonlyArray<string>
18465 } | {
18466 readonly "content"?: string
18467 readonly "error"?: string
18468 readonly "httpStatus"?: number
18469 readonly "id": string
18470 readonly "status": "in_progress" | "completed"
18471 readonly "title"?: string
18472 readonly "type": never
18473 readonly "url"?: string
18474 readonly "queries": ReadonlyArray<string>
18475 } | {
18476 readonly "id": string
18477 readonly "query"?: string
18478 readonly "status": "in_progress" | "completed"
18479 readonly "type": never
18480 readonly "queries": ReadonlyArray<string>
18481 } | {
18482 readonly "action"?: "read" | "write" | "delete"
18483 readonly "id": string
18484 readonly "key"?: string
18485 readonly "status": "in_progress" | "completed"
18486 readonly "type": never
18487 readonly "value"?: Schema.Json
18488 readonly "queries": ReadonlyArray<string>
18489 } | {
18490 readonly "id": string
18491 readonly "serverLabel"?: string
18492 readonly "status": "in_progress" | "completed"
18493 readonly "toolName"?: string
18494 readonly "type": never
18495 readonly "queries": ReadonlyArray<string>
18496 } | {
18497 readonly "arguments"?: string
18498 readonly "id": string
18499 readonly "query"?: string
18500 readonly "status": "in_progress" | "completed"
18501 readonly "type": never
18502 readonly "queries": ReadonlyArray<string>
18503 } | {
18504 readonly "analysis"?: FusionAnalysisResult
18505 readonly "error"?: string
18506 readonly "failed_models"?: ReadonlyArray<
18507 { readonly "error": string; readonly "model": string; readonly "status_code"?: number }
18508 >
18509 readonly "failure_reason"?: string
18510 readonly "id": string
18511 readonly "responses"?: ReadonlyArray<{ readonly "content"?: string; readonly "model": string }>
18512 readonly "sources"?: ReadonlyArray<FusionSource>
18513 readonly "status": "in_progress" | "completed"
18514 readonly "type": never
18515 readonly "queries": ReadonlyArray<string>
18516 } | {
18517 readonly "advice"?: string
18518 readonly "error"?: string
18519 readonly "id": string
18520 readonly "instance_name"?: string
18521 readonly "model"?: string
18522 readonly "prompt"?: string
18523 readonly "status": "in_progress" | "completed"
18524 readonly "type": never
18525 readonly "queries": ReadonlyArray<string>
18526 } | {
18527 readonly "error"?: string
18528 readonly "id": string
18529 readonly "instance_name"?: string
18530 readonly "model"?: string
18531 readonly "name"?: string
18532 readonly "outcome"?: string
18533 readonly "status": "in_progress" | "completed"
18534 readonly "task_description"?: string
18535 readonly "task_name"?: string
18536 readonly "type": never
18537 readonly "queries": ReadonlyArray<string>
18538 } | {
18539 readonly "error"?: string
18540 readonly "file_id"?: string
18541 readonly "filename"?: string
18542 readonly "id": string
18543 readonly "operation"?: string
18544 readonly "result"?: string
18545 readonly "status": "in_progress" | "completed"
18546 readonly "type": never
18547 readonly "queries": ReadonlyArray<string>
18548 } | {
18549 readonly "call_id": string
18550 readonly "id": string
18551 readonly "input": string
18552 readonly "name": string
18553 readonly "namespace"?: string
18554 readonly "type": never
18555 readonly "queries": ReadonlyArray<string>
18556 readonly "status": WebSearchStatus
18557 } | {
18558 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
18559 readonly "id": string
18560 readonly "phase"?: "commentary" | "final_answer" | null
18561 readonly "role": "assistant"
18562 readonly "status": "completed" | "in_progress"
18563 readonly "type": never
18564 readonly "result"?: string | null
18565 } | {
18566 readonly "content"?: ReadonlyArray<{ readonly "text": string; readonly "type": "reasoning_text" }>
18567 readonly "encrypted_content"?: string | null
18568 readonly "id": string
18569 readonly "status": "completed" | "in_progress"
18570 readonly "summary": ReadonlyArray<ReasoningSummaryText>
18571 readonly "type": never
18572 readonly "format"?: ReasoningFormat
18573 readonly "signature"?: string | null
18574 readonly "result"?: string | null
18575 } | {
18576 readonly "arguments": string
18577 readonly "call_id": string
18578 readonly "id": string
18579 readonly "name": string
18580 readonly "namespace"?: string
18581 readonly "status": "completed" | "in_progress"
18582 readonly "type": never
18583 readonly "result"?: string | null
18584 } | {
18585 readonly "action"?:
18586 | {
18587 readonly "queries"?: ReadonlyArray<string>
18588 readonly "query": string
18589 readonly "sources"?: ReadonlyArray<WebSearchSource>
18590 readonly "type": "search"
18591 }
18592 | { readonly "type": "open_page"; readonly "url"?: string | null }
18593 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18594 readonly "id": string
18595 readonly "status": "completed" | "in_progress" | "failed"
18596 readonly "type": never
18597 readonly "result"?: string | null
18598 } | {
18599 readonly "id": string
18600 readonly "queries": ReadonlyArray<string>
18601 readonly "status": "completed" | "in_progress" | "failed"
18602 readonly "type": never
18603 readonly "result"?: string | null
18604 } | {
18605 readonly "id": string
18606 readonly "result"?: string | null
18607 readonly "status": "in_progress" | "completed" | "generating" | "failed"
18608 readonly "type": "image_generation_call"
18609 readonly "prompt"?: string
18610 } | {
18611 readonly "code": string | null
18612 readonly "container_id": string
18613 readonly "id": string
18614 readonly "outputs":
18615 | ReadonlyArray<
18616 { readonly "type": "image"; readonly "url": string } | { readonly "logs": string; readonly "type": "logs" }
18617 >
18618 | null
18619 readonly "status": "in_progress" | "completed"
18620 readonly "type": never
18621 readonly "result"?: string | null
18622 } | {
18623 readonly "action"?: Schema.Json
18624 readonly "call_id": string
18625 readonly "id": string
18626 readonly "pending_safety_checks": ReadonlyArray<
18627 { readonly "code": string; readonly "id": string; readonly "message": string }
18628 >
18629 readonly "status": "completed" | "in_progress"
18630 readonly "type": never
18631 readonly "result"?: string | null
18632 } | {
18633 readonly "datetime": string
18634 readonly "id": string
18635 readonly "status": "in_progress" | "completed"
18636 readonly "timezone": string
18637 readonly "type": never
18638 readonly "result"?: string | null
18639 } | {
18640 readonly "action"?: {
18641 readonly "query": string
18642 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
18643 readonly "type": "search"
18644 }
18645 readonly "id": string
18646 readonly "status": "in_progress" | "completed"
18647 readonly "type": never
18648 readonly "result"?: string | null
18649 } | {
18650 readonly "code"?: string
18651 readonly "exitCode"?: number
18652 readonly "id": string
18653 readonly "language"?: string
18654 readonly "status": "in_progress" | "completed"
18655 readonly "stderr"?: string
18656 readonly "stdout"?: string
18657 readonly "type": never
18658 readonly "result"?: string | null
18659 } | {
18660 readonly "id": string
18661 readonly "queries"?: ReadonlyArray<string>
18662 readonly "status": "in_progress" | "completed"
18663 readonly "type": never
18664 readonly "result"?: string | null
18665 } | {
18666 readonly "id": string
18667 readonly "imageB64"?: string
18668 readonly "imageUrl"?: string
18669 readonly "prompt"?: string
18670 readonly "result"?: string | null
18671 readonly "revisedPrompt"?: string
18672 readonly "status": "in_progress" | "completed"
18673 readonly "type": never
18674 } | {
18675 readonly "action"?: string
18676 readonly "id": string
18677 readonly "screenshotB64"?: string
18678 readonly "status": "in_progress" | "completed"
18679 readonly "type": never
18680 readonly "result"?: string | null
18681 } | {
18682 readonly "arguments"?: string
18683 readonly "call_id"?: string
18684 readonly "command"?: string
18685 readonly "exitCode"?: number
18686 readonly "id": string
18687 readonly "status": "in_progress" | "completed"
18688 readonly "stderr"?: string
18689 readonly "stdout"?: string
18690 readonly "type": never
18691 readonly "result"?: string | null
18692 } | {
18693 readonly "command"?: "view" | "create" | "str_replace" | "insert"
18694 readonly "filePath"?: string
18695 readonly "id": string
18696 readonly "status": "in_progress" | "completed"
18697 readonly "type": never
18698 readonly "result"?: string | null
18699 } | {
18700 readonly "call_id"?: string
18701 readonly "id": string
18702 readonly "operation"?: ApplyPatchCallOperation
18703 readonly "status": "in_progress" | "completed"
18704 readonly "type": never
18705 readonly "result"?: string | null
18706 } | {
18707 readonly "call_id": string
18708 readonly "id": string
18709 readonly "operation": ApplyPatchCallOperation
18710 readonly "status": "in_progress" | "completed"
18711 readonly "type": never
18712 readonly "result"?: string | null
18713 } | {
18714 readonly "action"?: {
18715 readonly "commands": ReadonlyArray<string>
18716 readonly "max_output_length": number | null
18717 readonly "timeout_ms": number | null
18718 }
18719 readonly "call_id": string
18720 readonly "id": string
18721 readonly "status": "in_progress" | "completed"
18722 readonly "type": never
18723 readonly "result"?: string | null
18724 } | {
18725 readonly "call_id": string
18726 readonly "id": string
18727 readonly "max_output_length"?: number | null
18728 readonly "output": ReadonlyArray<
18729 {
18730 readonly "outcome": { readonly "exit_code": number; readonly "type": "exit" } | { readonly "type": "timeout" }
18731 readonly "stderr": string
18732 readonly "stdout": string
18733 }
18734 >
18735 readonly "status": "in_progress" | "completed"
18736 readonly "type": never
18737 readonly "result"?: string | null
18738 } | {
18739 readonly "content"?: string
18740 readonly "error"?: string
18741 readonly "httpStatus"?: number
18742 readonly "id": string
18743 readonly "status": "in_progress" | "completed"
18744 readonly "title"?: string
18745 readonly "type": never
18746 readonly "url"?: string
18747 readonly "result"?: string | null
18748 } | {
18749 readonly "id": string
18750 readonly "query"?: string
18751 readonly "status": "in_progress" | "completed"
18752 readonly "type": never
18753 readonly "result"?: string | null
18754 } | {
18755 readonly "action"?: "read" | "write" | "delete"
18756 readonly "id": string
18757 readonly "key"?: string
18758 readonly "status": "in_progress" | "completed"
18759 readonly "type": never
18760 readonly "value"?: Schema.Json
18761 readonly "result"?: string | null
18762 } | {
18763 readonly "id": string
18764 readonly "serverLabel"?: string
18765 readonly "status": "in_progress" | "completed"
18766 readonly "toolName"?: string
18767 readonly "type": never
18768 readonly "result"?: string | null
18769 } | {
18770 readonly "arguments"?: string
18771 readonly "id": string
18772 readonly "query"?: string
18773 readonly "status": "in_progress" | "completed"
18774 readonly "type": never
18775 readonly "result"?: string | null
18776 } | {
18777 readonly "analysis"?: FusionAnalysisResult
18778 readonly "error"?: string
18779 readonly "failed_models"?: ReadonlyArray<
18780 { readonly "error": string; readonly "model": string; readonly "status_code"?: number }
18781 >
18782 readonly "failure_reason"?: string
18783 readonly "id": string
18784 readonly "responses"?: ReadonlyArray<{ readonly "content"?: string; readonly "model": string }>
18785 readonly "sources"?: ReadonlyArray<FusionSource>
18786 readonly "status": "in_progress" | "completed"
18787 readonly "type": never
18788 readonly "result"?: string | null
18789 } | {
18790 readonly "advice"?: string
18791 readonly "error"?: string
18792 readonly "id": string
18793 readonly "instance_name"?: string
18794 readonly "model"?: string
18795 readonly "prompt"?: string
18796 readonly "status": "in_progress" | "completed"
18797 readonly "type": never
18798 readonly "result"?: string | null
18799 } | {
18800 readonly "error"?: string
18801 readonly "id": string
18802 readonly "instance_name"?: string
18803 readonly "model"?: string
18804 readonly "name"?: string
18805 readonly "outcome"?: string
18806 readonly "status": "in_progress" | "completed"
18807 readonly "task_description"?: string
18808 readonly "task_name"?: string
18809 readonly "type": never
18810 readonly "result"?: string | null
18811 } | {
18812 readonly "error"?: string
18813 readonly "file_id"?: string
18814 readonly "filename"?: string
18815 readonly "id": string
18816 readonly "operation"?: string
18817 readonly "result"?: string
18818 readonly "status": "in_progress" | "completed"
18819 readonly "type": never
18820 } | {
18821 readonly "call_id": string
18822 readonly "id": string
18823 readonly "input": string
18824 readonly "name": string
18825 readonly "namespace"?: string
18826 readonly "type": never
18827 readonly "result"?: string | null
18828 readonly "status": ImageGenerationStatus
18829 } | {
18830 readonly "content": ReadonlyArray<ResponseOutputText | OpenAIResponsesRefusalContent>
18831 readonly "id": string
18832 readonly "phase"?: "commentary" | "final_answer" | null
18833 readonly "role": "assistant"
18834 readonly "status": "completed" | "in_progress"
18835 readonly "type": never
18836 readonly "call_id": string
18837 readonly "created_by"?: string
18838 readonly "operation":
18839 | ApplyPatchCreateFileOperation
18840 | ApplyPatchUpdateFileOperation
18841 | ApplyPatchDeleteFileOperation
18842 } | {
18843 readonly "content"?: ReadonlyArray<{ readonly "text": string; readonly "type": "reasoning_text" }>
18844 readonly "encrypted_content"?: string | null
18845 readonly "id": string
18846 readonly "status": "completed" | "in_progress"
18847 readonly "summary": ReadonlyArray<ReasoningSummaryText>
18848 readonly "type": never
18849 readonly "format"?: ReasoningFormat
18850 readonly "signature"?: string | null
18851 readonly "call_id": string
18852 readonly "created_by"?: string
18853 readonly "operation":
18854 | ApplyPatchCreateFileOperation
18855 | ApplyPatchUpdateFileOperation
18856 | ApplyPatchDeleteFileOperation
18857 } | {
18858 readonly "arguments": string
18859 readonly "call_id": string
18860 readonly "id": string
18861 readonly "name": string
18862 readonly "namespace"?: string
18863 readonly "status": "completed" | "in_progress"
18864 readonly "type": never
18865 readonly "created_by"?: string
18866 readonly "operation":
18867 | ApplyPatchCreateFileOperation
18868 | ApplyPatchUpdateFileOperation
18869 | ApplyPatchDeleteFileOperation
18870 } | {
18871 readonly "action"?:
18872 | {
18873 readonly "queries"?: ReadonlyArray<string>
18874 readonly "query": string
18875 readonly "sources"?: ReadonlyArray<WebSearchSource>
18876 readonly "type": "search"
18877 }
18878 | { readonly "type": "open_page"; readonly "url"?: string | null }
18879 | { readonly "pattern": string; readonly "type": "find_in_page"; readonly "url": string }
18880 readonly "id": string
18881 readonly "status": "completed" | "in_progress"
18882 readonly "type": never
18883 readonly "call_id": string
18884 readonly "created_by"?: string
18885 readonly "operation":
18886 | ApplyPatchCreateFileOperation
18887 | ApplyPatchUpdateFileOperation
18888 | ApplyPatchDeleteFileOperation
18889 } | {
18890 readonly "id": string
18891 readonly "queries": ReadonlyArray<string>
18892 readonly "status": "completed" | "in_progress"
18893 readonly "type": never
18894 readonly "call_id": string
18895 readonly "created_by"?: string
18896 readonly "operation":
18897 | ApplyPatchCreateFileOperation
18898 | ApplyPatchUpdateFileOperation
18899 | ApplyPatchDeleteFileOperation
18900 } | {
18901 readonly "id": string
18902 readonly "result"?: string | null
18903 readonly "status": "in_progress" | "completed"
18904 readonly "type": never
18905 readonly "prompt"?: string
18906 readonly "call_id": string
18907 readonly "created_by"?: string
18908 readonly "operation":
18909 | ApplyPatchCreateFileOperation
18910 | ApplyPatchUpdateFileOperation
18911 | ApplyPatchDeleteFileOperation
18912 } | {
18913 readonly "code": string | null
18914 readonly "container_id": string
18915 readonly "id": string
18916 readonly "outputs":
18917 | ReadonlyArray<
18918 { readonly "type": "image"; readonly "url": string } | { readonly "logs": string; readonly "type": "logs" }
18919 >
18920 | null
18921 readonly "status": "in_progress" | "completed"
18922 readonly "type": never
18923 readonly "call_id": string
18924 readonly "created_by"?: string
18925 readonly "operation":
18926 | ApplyPatchCreateFileOperation
18927 | ApplyPatchUpdateFileOperation
18928 | ApplyPatchDeleteFileOperation
18929 } | {
18930 readonly "action"?: Schema.Json
18931 readonly "call_id": string
18932 readonly "id": string
18933 readonly "pending_safety_checks": ReadonlyArray<
18934 { readonly "code": string; readonly "id": string; readonly "message": string }
18935 >
18936 readonly "status": "completed" | "in_progress"
18937 readonly "type": never
18938 readonly "created_by"?: string
18939 readonly "operation":
18940 | ApplyPatchCreateFileOperation
18941 | ApplyPatchUpdateFileOperation
18942 | ApplyPatchDeleteFileOperation
18943 } | {
18944 readonly "datetime": string
18945 readonly "id": string
18946 readonly "status": "in_progress" | "completed"
18947 readonly "timezone": string
18948 readonly "type": never
18949 readonly "call_id": string
18950 readonly "created_by"?: string
18951 readonly "operation":
18952 | ApplyPatchCreateFileOperation
18953 | ApplyPatchUpdateFileOperation
18954 | ApplyPatchDeleteFileOperation
18955 } | {
18956 readonly "action"?: {
18957 readonly "query": string
18958 readonly "sources"?: ReadonlyArray<{ readonly "type": "url"; readonly "url": string }>
18959 readonly "type": "search"
18960 }
18961 readonly "id": string
18962 readonly "status": "in_progress" | "completed"
18963 readonly "type": never
18964 readonly "call_id": string
18965 readonly "created_by"?: string
18966 readonly "operation":
18967 | ApplyPatchCreateFileOperation
18968 | ApplyPatchUpdateFileOperation
18969 | ApplyPatchDeleteFileOperation
18970 } | {
18971 readonly "code"?: string
18972 readonly "exitCode"?: number
18973 readonly "id": string
18974 readonly "language"?: string
18975 readonly "status": "in_progress" | "completed"
18976 readonly "stderr"?: string
18977 readonly "stdout"?: string
18978 readonly "type": never
18979 readonly "call_id": string
18980 readonly "created_by"?: string
18981 readonly "operation":
18982 | ApplyPatchCreateFileOperation
18983 | ApplyPatchUpdateFileOperation
18984 | ApplyPatchDeleteFileOperation
18985 } | {
18986 readonly "id": string
18987 readonly "queries"?: ReadonlyArray<string>
18988 readonly "status": "in_progress" | "completed"
18989 readonly "type": never
18990 readonly "call_id": string
18991 readonly "created_by"?: string
18992 readonly "operation":
18993 | ApplyPatchCreateFileOperation
18994 | ApplyPatchUpdateFileOperation
18995 | ApplyPatchDeleteFileOperation
18996 } | {
18997 readonly "id": string
18998 readonly "imageB64"?: string
18999 readonly "imageUrl"?: string
19000 readonly "prompt"?: string
19001 readonly "result"?: string | null
19002 readonly "revisedPrompt"?: string
19003 readonly "status": "in_progress" | "completed"
19004 readonly "type": never
19005 readonly "call_id": string
19006 readonly "created_by"?: string
19007 readonly "operation":
19008 | ApplyPatchCreateFileOperation
19009 | ApplyPatchUpdateFileOperation
19010 | ApplyPatchDeleteFileOperation
19011 } | {
19012 readonly "action"?: string
19013 readonly "id": string
19014 readonly "screenshotB64"?: string
19015 readonly "status": "in_progress" | "completed"
19016 readonly "type": never
19017 readonly "call_id": string
19018 readonly "created_by"?: string
19019 readonly "operation":
19020 | ApplyPatchCreateFileOperation
19021 | ApplyPatchUpdateFileOperation
19022 | ApplyPatchDeleteFileOperation
19023 } | {
19024 readonly "arguments"?: string
19025 readonly "call_id": string
19026 readonly "command"?: string
19027 readonly "exitCode"?: number
19028 readonly "id": string
19029 readonly "status": "in_progress" | "completed"
19030 readonly "stderr"?: string
19031 readonly "stdout"?: string
19032 readonly "type": never
19033 readonly "created_by"?: string
19034 readonly "operation":
19035 | ApplyPatchCreateFileOperation
19036 | ApplyPatchUpdateFileOperation
19037 | ApplyPatchDeleteFileOperation
19038 } | {
19039 readonly "command"?: "view" | "create" | "str_replace" | "insert"
19040 readonly "filePath"?: string
19041 readonly "id": string
19042 readonly "status": "in_progress" | "completed"
19043 readonly "type": never
19044 readonly "call_id": string
19045 readonly "created_by"?: string
19046 readonly "operation":
19047 | ApplyPatchCreateFileOperation
19048 | ApplyPatchUpdateFileOperation
19049 | ApplyPatchDeleteFileOperation
19050 } | {
19051 readonly "call_id": string
19052 readonly "id": string
19053 readonly "operation":
19054 | { readonly "diff": string; readonly "path": string; readonly "type": "create_file" }
19055 | { readonly "diff": string; readonly "path": string; readonly "type": never }
19056 | { readonly "path": string; readonly "type": never; readonly "diff": string }
19057 | { readonly "diff": string; readonly "path": string; readonly "type": never }
19058 | { readonly "diff": string; readonly "path": string; readonly "type": "update_file" }
19059 | { readonly "path": string; readonly "type": never; readonly "diff": string }
19060 | { readonly "diff": string; readonly "path": string; readonly "type": never }
19061 | { readonly "diff": string; readonly "path": string; readonly "type": never }
19062 | { readonly "path": string; readonly "type": "delete_file" }
19063 readonly "status": "in_progress" | "completed"
19064 readonly "type": never
19065 readonly "created_by"?: string
19066 } | {
19067 readonly "call_id": string
19068 readonly "id": string
19069 readonly "operation":
19070 | { readonly "diff": string; readonly "path": string; readonly "type": "create_file" }
19071 | { readonly "diff": string; readonly "path": string; readonly "type": never }
19072 | { readonly "path": string; readonly "type": never; readonly "diff": string }
19073 | { readonly "diff": string; readonly "path": string; readonly "type": never }
19074 | { readonly "diff": string; readonly "path": string; readonly "type": "update_file" }
19075 | { readonly "path": string; readonly "type": never; readonly "diff": string }
19076 | { readonly "diff": string; readonly "path": string; readonly "type": never }
19077 | { readonly "diff": string; readonly "path": string; readonly "type": never }
19078 | { readonly "path": string; readonly "type": "delete_file" }
19079 readonly "status": "in_progress" | "completed"
19080 readonly "type": "apply_patch_call"
19081 readonly "created_by"?: string
19082 } | {
19083 readonly "action"?: {
19084 readonly "commands": ReadonlyArray<string>
19085 readonly "max_output_length": number | null
19086 readonly "timeout_ms": number | null
19087 }
19088 readonly "call_id": string
19089 readonly "id": string
19090 readonly "status": "in_progress" | "completed"
19091 readonly "type": never
19092 readonly "created_by"?: string
19093 readonly "operation":
19094 | ApplyPatchCreateFileOperation
19095 | ApplyPatchUpdateFileOperation
19096 | ApplyPatchDeleteFileOperation
19097 } | {
19098 readonly "call_id": string
19099 readonly "id": string
19100 readonly "max_output_length"?: number | null
19101 readonly "output": ReadonlyArray<
19102 {
19103 readonly "outcome": { readonly "exit_code": number; readonly "type": "exit" } | { readonly "type": "timeout" }
19104 readonly "stderr": string
19105 readonly "stdout": string
19106 }
19107 >
19108 readonly "status": "in_progress" | "completed"
19109 readonly "type": never
19110 readonly "created_by"?: string
19111 readonly "operation":
19112 | ApplyPatchCreateFileOperation
19113 | ApplyPatchUpdateFileOperation
19114 | ApplyPatchDeleteFileOperation
19115 } | {
19116 readonly "content"?: string
19117 readonly "error"?: string
19118 readonly "httpStatus"?: number
19119 readonly "id": string
19120 readonly "status": "in_progress" | "completed"
19121 readonly "title"?: string
19122 readonly "type": never
19123 readonly "url"?: string
19124 readonly "call_id": string
19125 readonly "created_by"?: string
19126 readonly "operation":
19127 | ApplyPatchCreateFileOperation
19128 | ApplyPatchUpdateFileOperation
19129 | ApplyPatchDeleteFileOperation
19130 } | {
19131 readonly "id": string
19132 readonly "query"?: string
19133 readonly "status": "in_progress" | "completed"
19134 readonly "type": never
19135 readonly "call_id": string
19136 readonly "created_by"?: string
19137 readonly "operation":
19138 | ApplyPatchCreateFileOperation
19139 | ApplyPatchUpdateFileOperation
19140 | ApplyPatchDeleteFileOperation
19141 } | {
19142 readonly "action"?: "read" | "write" | "delete"
19143 readonly "id": string
19144 readonly "key"?: string
19145 readonly "status": "in_progress" | "completed"
19146 readonly "type": never
19147 readonly "value"?: Schema.Json
19148 readonly "call_id": string
19149 readonly "created_by"?: string
19150 readonly "operation":
19151 | ApplyPatchCreateFileOperation
19152 | ApplyPatchUpdateFileOperation
19153 | ApplyPatchDeleteFileOperation
19154 } | {
19155 readonly "id": string
19156 readonly "serverLabel"?: string
19157 readonly "status": "in_progress" | "completed"
19158 readonly "toolName"?: string
19159 readonly "type": never
19160 readonly "call_id": string
19161 readonly "created_by"?: string
19162 readonly "operation":
19163 | ApplyPatchCreateFileOperation
19164 | ApplyPatchUpdateFileOperation
19165 | ApplyPatchDeleteFileOperation
19166 } | {
19167 readonly "arguments"?: string
19168 readonly "id": string
19169 readonly "query"?: string
19170 readonly "status": "in_progress" | "completed"
19171 readonly "type": never
19172 readonly "call_id": string
19173 readonly "created_by"?: string
19174 readonly "operation":
19175 | ApplyPatchCreateFileOperation
19176 | ApplyPatchUpdateFileOperation
19177 | ApplyPatchDeleteFileOperation
19178 } | {
19179 readonly "analysis"?: FusionAnalysisResult
19180 readonly "error"?: string
19181 readonly "failed_models"?: ReadonlyArray<
19182 { readonly "error": string; readonly "model": string; readonly "status_code"?: number }
19183 >
19184 readonly "failure_reason"?: string
19185 readonly "id": string
19186 readonly "responses"?: ReadonlyArray<{ readonly "content"?: string; readonly "model": string }>
19187 readonly "sources"?: ReadonlyArray<FusionSource>
19188 readonly "status": "in_progress" | "completed"
19189 readonly "type": never
19190 readonly "call_id": string
19191 readonly "created_by"?: string
19192 readonly "operation":
19193 | ApplyPatchCreateFileOperation
19194 | ApplyPatchUpdateFileOperation
19195 | ApplyPatchDeleteFileOperation
19196 } | {
19197 readonly "advice"?: string
19198 readonly "error"?: string
19199 readonly "id": string
19200 readonly "instance_name"?: string
19201 readonly "model"?: string
19202 readonly "prompt"?: string
19203 readonly "status": "in_progress" | "completed"
19204 readonly "type": never
19205 readonly "call_id": string
19206 readonly "created_by"?: string
19207 readonly "operation":
19208 | ApplyPatchCreateFileOperation
19209 | ApplyPatchUpdateFileOperation
19210 | ApplyPatchDeleteFileOperation
19211 } | {
19212 readonly "error"?: string
19213 readonly "id": string
19214 readonly "instance_name"?: string
19215 readonly "model"?: string
19216 readonly "name"?: string
19217 readonly "outcome"?: string
19218 readonly "status": "in_progress" | "completed"
19219 readonly "task_description"?: string
19220 readonly "task_name"?: string
19221 readonly "type": never
19222 readonly "call_id": string
19223 readonly "created_by"?: string
19224 readonly "operation":
19225 | ApplyPatchCreateFileOperation
19226 | ApplyPatchUpdateFileOperation
19227 | ApplyPatchDeleteFileOperation
19228 } | {
19229 readonly "error"?: string
19230 readonly "file_id"?: string
19231 readonly "filename"?: string
19232 readonly "id": string
19233 readonly "operation": never
19234 readonly "result"?: string
19235 readonly "status": "in_progress" | "completed"
19236 readonly "type": never
19237 readonly "call_id": string
19238 readonly "created_by"?: string
19239 } | {
19240 readonly "call_id": string
19241 readonly "id": string
19242 readonly "input": string
19243 readonly "name": string
19244 readonly "namespace"?: string
19245 readonly "type": never
19246 readonly "created_by"?: string
19247 readonly "operation":
19248 | ApplyPatchCreateFileOperation
19249 | ApplyPatchUpdateFileOperation
19250 | ApplyPatchDeleteFileOperation
19251 readonly "status": "in_progress" | "completed"
19252 }
19253 >
19254 readonly "output_text"?: string
19255 readonly "parallel_tool_calls": boolean
19256 readonly "presence_penalty": number | null
19257 readonly "previous_response_id"?: string | null
19258 readonly "prompt"?: StoredPromptTemplate
19259 readonly "prompt_cache_key"?: string | null
19260 readonly "prompt_cache_options"?: PromptCacheOptions
19261 readonly "reasoning"?: BaseReasoningConfig
19262 readonly "safety_identifier"?: string | null
19263 readonly "service_tier"?: "auto" | "default" | "flex" | "priority" | "scale" | null
19264 readonly "status": OpenAIResponsesResponseStatus
19265 readonly "store"?: boolean
19266 readonly "temperature": number | null
19267 readonly "text"?: {
19268 readonly "format"?:
19269 | { readonly "type": "text" }
19270 | { readonly "type": never }
19271 | {
19272 readonly "description"?: string
19273 readonly "name": string
19274 readonly "schema": {}
19275 readonly "strict"?: boolean | null
19276 readonly "type": never
19277 }
19278 | { readonly "type": never }
19279 | { readonly "type": "json_object" }
19280 | {
19281 readonly "description"?: string
19282 readonly "name": string
19283 readonly "schema": {}
19284 readonly "strict"?: boolean | null
19285 readonly "type": never
19286 }
19287 | {
19288 readonly "type": never
19289 readonly "description"?: string
19290 readonly "name": string
19291 readonly "schema": {}
19292 readonly "strict"?: boolean | null
19293 }
19294 | {
19295 readonly "type": never
19296 readonly "description"?: string
19297 readonly "name": string
19298 readonly "schema": {}
19299 readonly "strict"?: boolean | null
19300 }
19301 | {
19302 readonly "description"?: string
19303 readonly "name": string
19304 readonly "schema": {}
19305 readonly "strict"?: boolean | null
19306 readonly "type": "json_schema"
19307 }
19308 readonly "verbosity"?: "high" | "low" | "medium" | null
19309 }
19310 readonly "tool_choice": OpenAIResponsesToolChoice
19311 readonly "tools": ReadonlyArray<
19312 | {
19313 readonly "description"?: string | null
19314 readonly "name": string
19315 readonly "parameters": { readonly [x: string]: Schema.Json } | null
19316 readonly "strict"?: boolean | null
19317 readonly "type": "function"
19318 }
19319 | Preview_WebSearchServerTool
19320 | Preview_20250311_WebSearchServerTool
19321 | Legacy_WebSearchServerTool
19322 | WebSearchServerTool
19323 | FileSearchServerTool
19324 | ComputerUseServerTool
19325 | CodeInterpreterServerTool
19326 | McpServerTool
19327 | ImageGenerationServerTool
19328 | CodexLocalShellTool
19329 | ShellServerTool
19330 | ApplyPatchServerTool
19331 | CustomTool
19332 | NamespaceTool
19333 >
19334 readonly "top_logprobs"?: number
19335 readonly "top_p": number | null
19336 readonly "truncation"?: Truncation
19337 readonly "usage"?: {
19338 readonly "input_tokens": number
19339 readonly "input_tokens_details": { readonly "cache_write_tokens"?: number | null; readonly "cached_tokens": number }
19340 readonly "output_tokens": number
19341 readonly "output_tokens_details": { readonly "reasoning_tokens": number }
19342 readonly "total_tokens": number
19343 readonly "cost"?: number | null
19344 readonly "cost_details"?: {
19345 readonly "upstream_inference_cost"?: number | null
19346 readonly "upstream_inference_input_cost": number
19347 readonly "upstream_inference_output_cost": number
19348 }
19349 readonly "is_byok"?: boolean
19350 readonly "server_tool_use_details"?: ServerToolUseDetails
19351 }
19352 readonly "user"?: string | null
19353 readonly "error_type"?: ApiErrorType
19354 readonly "openrouter_metadata"?: OpenRouterMetadata
19355}
19356export const OpenResponsesResult = Schema.Struct({
19357 "background": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
19358 "completed_at": Schema.Union([
19359 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19360 Schema.Null
19361 ]),
19362 "created_at": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19363 "error": ResponsesErrorField,
19364 "frequency_penalty": Schema.Union([
19365 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
19366 Schema.Null
19367 ]).annotate({ "format": "double" }),
19368 "id": Schema.String,
19369 "incomplete_details": IncompleteDetails,
19370 "instructions": BaseInputs,
19371 "max_output_tokens": Schema.optionalKey(
19372 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
19373 ),
19374 "max_tool_calls": Schema.optionalKey(
19375 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
19376 ),
19377 "metadata": RequestMetadata,
19378 "model": Schema.String,
19379 "object": Schema.Literal("response"),
19380 "output": Schema.Array(Schema.Union([
19381 Schema.Union([
19382 Schema.Struct({
19383 "content": Schema.Array(Schema.Union([
19384 Schema.Union([
19385 Schema.Struct({
19386 "annotations": Schema.optionalKey(
19387 Schema.Array(
19388 Schema.Union([
19389 Schema.Union([
19390 Schema.Struct({
19391 "file_id": Schema.String,
19392 "filename": Schema.String,
19393 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19394 "type": Schema.Literal("file_citation")
19395 }),
19396 Schema.Struct({
19397 "content": Schema.optionalKey(Schema.String),
19398 "end_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19399 "start_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19400 "title": Schema.String,
19401 "type": Schema.Never,
19402 "url": Schema.String,
19403 "file_id": Schema.String,
19404 "filename": Schema.String,
19405 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
19406 }),
19407 Schema.Struct({
19408 "file_id": Schema.String,
19409 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19410 "type": Schema.Never,
19411 "filename": Schema.String
19412 })
19413 ]),
19414 Schema.Union([
19415 Schema.Struct({
19416 "file_id": Schema.String,
19417 "filename": Schema.String,
19418 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19419 "type": Schema.Never,
19420 "content": Schema.optionalKey(Schema.String),
19421 "end_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19422 "start_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19423 "title": Schema.String,
19424 "url": Schema.String
19425 }),
19426 Schema.Struct({
19427 "content": Schema.optionalKey(Schema.String),
19428 "end_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19429 "start_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19430 "title": Schema.String,
19431 "type": Schema.Literal("url_citation"),
19432 "url": Schema.String
19433 }),
19434 Schema.Struct({
19435 "file_id": Schema.String,
19436 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19437 "type": Schema.Never,
19438 "content": Schema.optionalKey(Schema.String),
19439 "end_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19440 "start_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19441 "title": Schema.String,
19442 "url": Schema.String
19443 })
19444 ]),
19445 Schema.Union([
19446 Schema.Struct({
19447 "file_id": Schema.String,
19448 "filename": Schema.String,
19449 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19450 "type": Schema.Never
19451 }),
19452 Schema.Struct({
19453 "content": Schema.optionalKey(Schema.String),
19454 "end_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19455 "start_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19456 "title": Schema.String,
19457 "type": Schema.Never,
19458 "url": Schema.String,
19459 "file_id": Schema.String,
19460 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
19461 }),
19462 Schema.Struct({
19463 "file_id": Schema.String,
19464 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19465 "type": Schema.Literal("file_path")
19466 })
19467 ])
19468 ])
19469 )
19470 ),
19471 "logprobs": Schema.optionalKey(Schema.Array(Schema.Struct({
19472 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
19473 "logprob": Schema.Number.annotate({ "format": "double" }).check(
19474 Schema.isFinite().annotate({ "expected": "a finite number" })
19475 ),
19476 "token": Schema.String,
19477 "top_logprobs": Schema.Array(
19478 Schema.Struct({
19479 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
19480 "logprob": Schema.Number.annotate({ "format": "double" }).check(
19481 Schema.isFinite().annotate({ "expected": "a finite number" })
19482 ),
19483 "token": Schema.String
19484 })
19485 )
19486 }))),
19487 "text": Schema.String,
19488 "type": Schema.Literal("output_text")
19489 }),
19490 Schema.Struct({
19491 "refusal": Schema.String,
19492 "type": Schema.Never,
19493 "annotations": Schema.optionalKey(Schema.Array(OpenAIResponsesAnnotation)),
19494 "logprobs": Schema.optionalKey(Schema.Array(Schema.Struct({
19495 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
19496 "logprob": Schema.Number.annotate({ "format": "double" }).check(
19497 Schema.isFinite().annotate({ "expected": "a finite number" })
19498 ),
19499 "token": Schema.String,
19500 "top_logprobs": Schema.Array(
19501 Schema.Struct({
19502 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
19503 "logprob": Schema.Number.annotate({ "format": "double" }).check(
19504 Schema.isFinite().annotate({ "expected": "a finite number" })
19505 ),
19506 "token": Schema.String
19507 })
19508 )
19509 }))),
19510 "text": Schema.String
19511 })
19512 ]),
19513 Schema.Union([
19514 Schema.Struct({
19515 "annotations": Schema.optionalKey(Schema.Array(OpenAIResponsesAnnotation)),
19516 "logprobs": Schema.optionalKey(Schema.Array(Schema.Struct({
19517 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
19518 "logprob": Schema.Number.annotate({ "format": "double" }).check(
19519 Schema.isFinite().annotate({ "expected": "a finite number" })
19520 ),
19521 "token": Schema.String,
19522 "top_logprobs": Schema.Array(
19523 Schema.Struct({
19524 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
19525 "logprob": Schema.Number.annotate({ "format": "double" }).check(
19526 Schema.isFinite().annotate({ "expected": "a finite number" })
19527 ),
19528 "token": Schema.String
19529 })
19530 )
19531 }))),
19532 "text": Schema.String,
19533 "type": Schema.Never,
19534 "refusal": Schema.String
19535 }),
19536 Schema.Struct({ "refusal": Schema.String, "type": Schema.Literal("refusal") })
19537 ])
19538 ])),
19539 "id": Schema.String,
19540 "phase": Schema.optionalKey(
19541 Schema.Union([
19542 Schema.Literal("commentary").annotate({
19543 "description":
19544 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19545 }),
19546 Schema.Literal("final_answer").annotate({
19547 "description":
19548 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19549 }),
19550 Schema.Union([Schema.Null]).annotate({
19551 "description":
19552 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19553 })
19554 ]).annotate({
19555 "description":
19556 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19557 })
19558 ),
19559 "role": Schema.Literal("assistant"),
19560 "status": Schema.optionalKey(
19561 Schema.Union([Schema.Literal("completed"), Schema.Literal("incomplete"), Schema.Literal("in_progress")])
19562 ),
19563 "type": Schema.Literal("message")
19564 }).annotate({ "description": "An output message item" }),
19565 Schema.Struct({
19566 "content": Schema.Union([Schema.Array(Schema.Union([
19567 Schema.Struct({
19568 "annotations": Schema.optionalKey(Schema.Array(OpenAIResponsesAnnotation)),
19569 "logprobs": Schema.optionalKey(Schema.Array(Schema.Struct({
19570 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
19571 "logprob": Schema.Number.annotate({ "format": "double" }).check(
19572 Schema.isFinite().annotate({ "expected": "a finite number" })
19573 ),
19574 "token": Schema.String,
19575 "top_logprobs": Schema.Array(
19576 Schema.Struct({
19577 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
19578 "logprob": Schema.Number.annotate({ "format": "double" }).check(
19579 Schema.isFinite().annotate({ "expected": "a finite number" })
19580 ),
19581 "token": Schema.String
19582 })
19583 )
19584 }))),
19585 "text": Schema.String,
19586 "type": Schema.Never
19587 }),
19588 Schema.Struct({ "refusal": Schema.String, "type": Schema.Never, "text": Schema.String })
19589 ]))]),
19590 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
19591 "id": Schema.String,
19592 "status": Schema.optionalKey(
19593 Schema.Union([Schema.Literal("completed"), Schema.Literal("incomplete"), Schema.Literal("in_progress")])
19594 ),
19595 "summary": Schema.Array(ReasoningSummaryText),
19596 "type": Schema.Never,
19597 "format": Schema.optionalKey(ReasoningFormat),
19598 "signature": Schema.optionalKey(
19599 Schema.Union([Schema.String, Schema.Null]).annotate({
19600 "description": "A signature for the reasoning content, used for verification"
19601 })
19602 ),
19603 "phase": Schema.optionalKey(
19604 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19605 "description":
19606 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19607 })
19608 ),
19609 "role": Schema.Literal("assistant")
19610 }).annotate({ "description": "An output item containing reasoning" }),
19611 Schema.Struct({
19612 "arguments": Schema.String,
19613 "call_id": Schema.String,
19614 "id": Schema.String,
19615 "name": Schema.String,
19616 "namespace": Schema.optionalKey(
19617 Schema.String.annotate({
19618 "description":
19619 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
19620 })
19621 ),
19622 "status": Schema.optionalKey(
19623 Schema.Union([Schema.Literal("completed"), Schema.Literal("incomplete"), Schema.Literal("in_progress")])
19624 ),
19625 "type": Schema.Never,
19626 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19627 "phase": Schema.optionalKey(
19628 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19629 "description":
19630 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19631 })
19632 ),
19633 "role": Schema.Literal("assistant")
19634 }),
19635 Schema.Struct({
19636 "action": Schema.optionalKey(
19637 Schema.Union([
19638 Schema.Struct({
19639 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
19640 "query": Schema.String,
19641 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
19642 "type": Schema.Literal("search")
19643 }),
19644 Schema.Struct({
19645 "type": Schema.Literal("open_page"),
19646 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
19647 }),
19648 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
19649 ], { mode: "oneOf" })
19650 ),
19651 "id": Schema.String,
19652 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
19653 "type": Schema.Never,
19654 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19655 "phase": Schema.optionalKey(
19656 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19657 "description":
19658 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19659 })
19660 ),
19661 "role": Schema.Literal("assistant")
19662 }),
19663 Schema.Struct({
19664 "id": Schema.String,
19665 "queries": Schema.Array(Schema.String),
19666 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
19667 "type": Schema.Never,
19668 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19669 "phase": Schema.optionalKey(
19670 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19671 "description":
19672 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19673 })
19674 ),
19675 "role": Schema.Literal("assistant")
19676 }),
19677 Schema.Struct({
19678 "id": Schema.String,
19679 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
19680 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
19681 "type": Schema.Never,
19682 "prompt": Schema.optionalKey(
19683 Schema.String.annotate({
19684 "description": "The prompt (possibly rewritten) that the image was generated from."
19685 })
19686 ),
19687 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19688 "phase": Schema.optionalKey(
19689 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19690 "description":
19691 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19692 })
19693 ),
19694 "role": Schema.Literal("assistant")
19695 }),
19696 Schema.Struct({
19697 "code": Schema.Union([Schema.String, Schema.Null]),
19698 "container_id": Schema.String,
19699 "id": Schema.String,
19700 "outputs": Schema.Union([
19701 Schema.Array(
19702 Schema.Union([
19703 Schema.Struct({ "type": Schema.Literal("image"), "url": Schema.String }),
19704 Schema.Struct({ "logs": Schema.String, "type": Schema.Literal("logs") })
19705 ])
19706 ),
19707 Schema.Null
19708 ]),
19709 "status": Schema.Union([
19710 Schema.Literal("in_progress"),
19711 Schema.Literal("completed"),
19712 Schema.Literal("incomplete")
19713 ]),
19714 "type": Schema.Never,
19715 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19716 "phase": Schema.optionalKey(
19717 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19718 "description":
19719 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19720 })
19721 ),
19722 "role": Schema.Literal("assistant")
19723 }).annotate({ "description": "A code interpreter execution call with outputs" }),
19724 Schema.Struct({
19725 "action": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
19726 "call_id": Schema.String,
19727 "id": Schema.String,
19728 "pending_safety_checks": Schema.Array(
19729 Schema.Struct({ "code": Schema.String, "id": Schema.String, "message": Schema.String })
19730 ),
19731 "status": Schema.Union([
19732 Schema.Literal("completed"),
19733 Schema.Literal("incomplete"),
19734 Schema.Literal("in_progress")
19735 ]),
19736 "type": Schema.Never,
19737 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19738 "phase": Schema.optionalKey(
19739 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19740 "description":
19741 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19742 })
19743 ),
19744 "role": Schema.Literal("assistant")
19745 }),
19746 Schema.Struct({
19747 "datetime": Schema.String.annotate({ "description": "ISO 8601 datetime string" }),
19748 "id": Schema.String,
19749 "status": Schema.Union([
19750 Schema.Literal("in_progress"),
19751 Schema.Literal("completed"),
19752 Schema.Literal("incomplete")
19753 ]),
19754 "timezone": Schema.String.annotate({ "description": "IANA timezone name" }),
19755 "type": Schema.Never,
19756 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19757 "phase": Schema.optionalKey(
19758 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19759 "description":
19760 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19761 })
19762 ),
19763 "role": Schema.Literal("assistant")
19764 }).annotate({ "description": "An openrouter:datetime server tool output item" }),
19765 Schema.Struct({
19766 "action": Schema.optionalKey(
19767 Schema.Struct({
19768 "query": Schema.String,
19769 "sources": Schema.optionalKey(
19770 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
19771 ),
19772 "type": Schema.Literal("search")
19773 }).annotate({
19774 "description":
19775 "The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider."
19776 })
19777 ),
19778 "id": Schema.String,
19779 "status": Schema.Union([
19780 Schema.Literal("in_progress"),
19781 Schema.Literal("completed"),
19782 Schema.Literal("incomplete")
19783 ]),
19784 "type": Schema.Never,
19785 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19786 "phase": Schema.optionalKey(
19787 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19788 "description":
19789 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19790 })
19791 ),
19792 "role": Schema.Literal("assistant")
19793 }).annotate({ "description": "An openrouter:web_search server tool output item" }),
19794 Schema.Struct({
19795 "code": Schema.optionalKey(Schema.String),
19796 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
19797 "id": Schema.String,
19798 "language": Schema.optionalKey(Schema.String),
19799 "status": Schema.Union([
19800 Schema.Literal("in_progress"),
19801 Schema.Literal("completed"),
19802 Schema.Literal("incomplete")
19803 ]),
19804 "stderr": Schema.optionalKey(Schema.String),
19805 "stdout": Schema.optionalKey(Schema.String),
19806 "type": Schema.Never,
19807 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19808 "phase": Schema.optionalKey(
19809 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19810 "description":
19811 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19812 })
19813 ),
19814 "role": Schema.Literal("assistant")
19815 }).annotate({ "description": "An openrouter:code_interpreter server tool output item" }),
19816 Schema.Struct({
19817 "id": Schema.String,
19818 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
19819 "status": Schema.Union([
19820 Schema.Literal("in_progress"),
19821 Schema.Literal("completed"),
19822 Schema.Literal("incomplete")
19823 ]),
19824 "type": Schema.Never,
19825 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19826 "phase": Schema.optionalKey(
19827 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19828 "description":
19829 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19830 })
19831 ),
19832 "role": Schema.Literal("assistant")
19833 }).annotate({ "description": "An openrouter:file_search server tool output item" }),
19834 Schema.Struct({
19835 "id": Schema.String,
19836 "imageB64": Schema.optionalKey(Schema.String),
19837 "imageUrl": Schema.optionalKey(Schema.String),
19838 "prompt": Schema.optionalKey(
19839 Schema.String.annotate({
19840 "description": "The prompt (possibly rewritten) that the image was generated from."
19841 })
19842 ),
19843 "result": Schema.optionalKey(
19844 Schema.Union([Schema.String, Schema.Null]).annotate({
19845 "description":
19846 "The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format"
19847 })
19848 ),
19849 "revisedPrompt": Schema.optionalKey(Schema.String),
19850 "status": Schema.Union([
19851 Schema.Literal("in_progress"),
19852 Schema.Literal("completed"),
19853 Schema.Literal("incomplete")
19854 ]),
19855 "type": Schema.Never,
19856 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19857 "phase": Schema.optionalKey(
19858 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19859 "description":
19860 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19861 })
19862 ),
19863 "role": Schema.Literal("assistant")
19864 }).annotate({ "description": "An openrouter:image_generation server tool output item" }),
19865 Schema.Struct({
19866 "action": Schema.optionalKey(Schema.String),
19867 "id": Schema.String,
19868 "screenshotB64": Schema.optionalKey(Schema.String),
19869 "status": Schema.Union([
19870 Schema.Literal("in_progress"),
19871 Schema.Literal("completed"),
19872 Schema.Literal("incomplete")
19873 ]),
19874 "type": Schema.Never,
19875 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19876 "phase": Schema.optionalKey(
19877 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19878 "description":
19879 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19880 })
19881 ),
19882 "role": Schema.Literal("assistant")
19883 }).annotate({ "description": "An openrouter:browser_use server tool output item" }),
19884 Schema.Struct({
19885 "arguments": Schema.optionalKey(
19886 Schema.String.annotate({ "description": "The raw tool-call arguments string as emitted by the model." })
19887 ),
19888 "call_id": Schema.optionalKey(
19889 Schema.String.annotate({ "description": "The model-generated tool call id from the originating turn." })
19890 ),
19891 "command": Schema.optionalKey(Schema.String),
19892 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
19893 "id": Schema.String,
19894 "status": Schema.Union([
19895 Schema.Literal("in_progress"),
19896 Schema.Literal("completed"),
19897 Schema.Literal("incomplete")
19898 ]),
19899 "stderr": Schema.optionalKey(Schema.String),
19900 "stdout": Schema.optionalKey(Schema.String),
19901 "type": Schema.Never,
19902 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19903 "phase": Schema.optionalKey(
19904 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19905 "description":
19906 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19907 })
19908 ),
19909 "role": Schema.Literal("assistant")
19910 }).annotate({ "description": "An openrouter:bash server tool output item" }),
19911 Schema.Struct({
19912 "command": Schema.optionalKey(Schema.Literals(["view", "create", "str_replace", "insert"])),
19913 "filePath": Schema.optionalKey(Schema.String),
19914 "id": Schema.String,
19915 "status": Schema.Union([
19916 Schema.Literal("in_progress"),
19917 Schema.Literal("completed"),
19918 Schema.Literal("incomplete")
19919 ]),
19920 "type": Schema.Never,
19921 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19922 "phase": Schema.optionalKey(
19923 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19924 "description":
19925 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19926 })
19927 ),
19928 "role": Schema.Literal("assistant")
19929 }).annotate({ "description": "An openrouter:text_editor server tool output item" }),
19930 Schema.Struct({
19931 "call_id": Schema.optionalKey(Schema.String),
19932 "id": Schema.String,
19933 "operation": Schema.optionalKey(ApplyPatchCallOperation),
19934 "status": Schema.Union([
19935 Schema.Literal("in_progress"),
19936 Schema.Literal("completed"),
19937 Schema.Literal("incomplete")
19938 ]),
19939 "type": Schema.Never,
19940 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19941 "phase": Schema.optionalKey(
19942 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19943 "description":
19944 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19945 })
19946 ),
19947 "role": Schema.Literal("assistant")
19948 }).annotate({
19949 "description":
19950 "An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn."
19951 }),
19952 Schema.Struct({
19953 "call_id": Schema.String,
19954 "id": Schema.String,
19955 "operation": ApplyPatchCallOperation,
19956 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
19957 "description": "Lifecycle state of an `apply_patch_call` output item."
19958 }),
19959 "type": Schema.Never,
19960 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19961 "phase": Schema.optionalKey(
19962 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19963 "description":
19964 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19965 })
19966 ),
19967 "role": Schema.Literal("assistant")
19968 }).annotate({
19969 "description":
19970 "A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand."
19971 }),
19972 Schema.Struct({
19973 "action": Schema.optionalKey(Schema.Struct({
19974 "commands": Schema.Array(Schema.String),
19975 "max_output_length": Schema.Union([
19976 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19977 Schema.Null
19978 ]),
19979 "timeout_ms": Schema.Union([
19980 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
19981 Schema.Null
19982 ])
19983 })),
19984 "call_id": Schema.String,
19985 "id": Schema.String,
19986 "status": Schema.Union([
19987 Schema.Literal("in_progress"),
19988 Schema.Literal("completed"),
19989 Schema.Literal("incomplete")
19990 ]).annotate({ "description": "Status of a shell call or its output." }),
19991 "type": Schema.Never,
19992 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
19993 "phase": Schema.optionalKey(
19994 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
19995 "description":
19996 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
19997 })
19998 ),
19999 "role": Schema.Literal("assistant")
20000 }).annotate({
20001 "description":
20002 "A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool."
20003 }),
20004 Schema.Struct({
20005 "call_id": Schema.String,
20006 "id": Schema.String,
20007 "max_output_length": Schema.optionalKey(
20008 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
20009 ),
20010 "output": Schema.Array(Schema.Struct({
20011 "outcome": Schema.Union([
20012 Schema.Struct({
20013 "exit_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
20014 "type": Schema.Literal("exit")
20015 }),
20016 Schema.Struct({ "type": Schema.Literal("timeout") })
20017 ], { mode: "oneOf" }),
20018 "stderr": Schema.String,
20019 "stdout": Schema.String
20020 })),
20021 "status": Schema.Union([
20022 Schema.Literal("in_progress"),
20023 Schema.Literal("completed"),
20024 Schema.Literal("incomplete")
20025 ]).annotate({ "description": "Status of a shell call or its output." }),
20026 "type": Schema.Never,
20027 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
20028 "phase": Schema.optionalKey(
20029 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20030 "description":
20031 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20032 })
20033 ),
20034 "role": Schema.Literal("assistant")
20035 }).annotate({
20036 "description":
20037 "A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome."
20038 }),
20039 Schema.Struct({
20040 "content": Schema.Never,
20041 "error": Schema.optionalKey(
20042 Schema.String.annotate({ "description": "The error message if the fetch failed." })
20043 ),
20044 "httpStatus": Schema.optionalKey(
20045 Schema.Number.annotate({ "description": "The HTTP status code returned by the upstream URL fetch." }).check(
20046 Schema.isInt().annotate({ "expected": "an integer" })
20047 )
20048 ),
20049 "id": Schema.String,
20050 "status": Schema.Union([
20051 Schema.Literal("in_progress"),
20052 Schema.Literal("completed"),
20053 Schema.Literal("incomplete")
20054 ]),
20055 "title": Schema.optionalKey(Schema.String),
20056 "type": Schema.Never,
20057 "url": Schema.optionalKey(Schema.String),
20058 "phase": Schema.optionalKey(
20059 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20060 "description":
20061 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20062 })
20063 ),
20064 "role": Schema.Literal("assistant")
20065 }).annotate({ "description": "An openrouter:web_fetch server tool output item" }),
20066 Schema.Struct({
20067 "id": Schema.String,
20068 "query": Schema.optionalKey(Schema.String),
20069 "status": Schema.Union([
20070 Schema.Literal("in_progress"),
20071 Schema.Literal("completed"),
20072 Schema.Literal("incomplete")
20073 ]),
20074 "type": Schema.Never,
20075 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
20076 "phase": Schema.optionalKey(
20077 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20078 "description":
20079 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20080 })
20081 ),
20082 "role": Schema.Literal("assistant")
20083 }).annotate({ "description": "An openrouter:tool_search server tool output item" }),
20084 Schema.Struct({
20085 "action": Schema.optionalKey(Schema.Literals(["read", "write", "delete"])),
20086 "id": Schema.String,
20087 "key": Schema.optionalKey(Schema.String),
20088 "status": Schema.Union([
20089 Schema.Literal("in_progress"),
20090 Schema.Literal("completed"),
20091 Schema.Literal("incomplete")
20092 ]),
20093 "type": Schema.Never,
20094 "value": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
20095 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
20096 "phase": Schema.optionalKey(
20097 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20098 "description":
20099 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20100 })
20101 ),
20102 "role": Schema.Literal("assistant")
20103 }).annotate({ "description": "An openrouter:memory server tool output item" }),
20104 Schema.Struct({
20105 "id": Schema.String,
20106 "serverLabel": Schema.optionalKey(Schema.String),
20107 "status": Schema.Union([
20108 Schema.Literal("in_progress"),
20109 Schema.Literal("completed"),
20110 Schema.Literal("incomplete")
20111 ]),
20112 "toolName": Schema.optionalKey(Schema.String),
20113 "type": Schema.Never,
20114 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
20115 "phase": Schema.optionalKey(
20116 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20117 "description":
20118 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20119 })
20120 ),
20121 "role": Schema.Literal("assistant")
20122 }).annotate({ "description": "An openrouter:mcp server tool output item" }),
20123 Schema.Struct({
20124 "arguments": Schema.optionalKey(
20125 Schema.String.annotate({
20126 "description": "The JSON arguments submitted to the search tool (e.g. {\"query\":\"Claude\"})"
20127 })
20128 ),
20129 "id": Schema.String,
20130 "query": Schema.optionalKey(Schema.String),
20131 "status": Schema.Union([
20132 Schema.Literal("in_progress"),
20133 Schema.Literal("completed"),
20134 Schema.Literal("incomplete")
20135 ]),
20136 "type": Schema.Never,
20137 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
20138 "phase": Schema.optionalKey(
20139 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20140 "description":
20141 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20142 })
20143 ),
20144 "role": Schema.Literal("assistant")
20145 }).annotate({ "description": "An openrouter:experimental__search_models server tool output item" }),
20146 Schema.Struct({
20147 "analysis": Schema.optionalKey(FusionAnalysisResult),
20148 "error": Schema.optionalKey(
20149 Schema.String.annotate({
20150 "description": "Error message when the fusion run did not produce an analysis result."
20151 })
20152 ),
20153 "failed_models": Schema.optionalKey(
20154 Schema.Array(Schema.Struct({
20155 "error": Schema.String.annotate({ "description": "Error message describing why the model failed." }),
20156 "model": Schema.String.annotate({ "description": "Slug of the analysis model that failed." }),
20157 "status_code": Schema.optionalKey(
20158 Schema.Number.annotate({
20159 "description": "HTTP status code from the upstream response, when available (e.g. 402, 429)."
20160 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
20161 )
20162 })).annotate({
20163 "description":
20164 "Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel."
20165 })
20166 ),
20167 "failure_reason": Schema.optionalKey(
20168 Schema.String.annotate({
20169 "description":
20170 "Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion."
20171 })
20172 ),
20173 "id": Schema.String,
20174 "responses": Schema.optionalKey(
20175 Schema.Array(Schema.Struct({ "content": Schema.optionalKey(Schema.String), "model": Schema.String }))
20176 .annotate({
20177 "description":
20178 "Analysis models that produced a response in this fusion run, with each model's full panel content."
20179 })
20180 ),
20181 "sources": Schema.optionalKey(
20182 Schema.Array(FusionSource).annotate({
20183 "description":
20184 "Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source."
20185 })
20186 ),
20187 "status": Schema.Union([
20188 Schema.Literal("in_progress"),
20189 Schema.Literal("completed"),
20190 Schema.Literal("incomplete")
20191 ]),
20192 "type": Schema.Never,
20193 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
20194 "phase": Schema.optionalKey(
20195 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20196 "description":
20197 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20198 })
20199 ),
20200 "role": Schema.Literal("assistant")
20201 }).annotate({ "description": "An openrouter:fusion server tool output item" }),
20202 Schema.Struct({
20203 "advice": Schema.optionalKey(
20204 Schema.String.annotate({
20205 "description": "The advisor model's response (the advice text returned to the executor)."
20206 })
20207 ),
20208 "error": Schema.optionalKey(
20209 Schema.String.annotate({ "description": "Error message when the advisor call did not produce advice." })
20210 ),
20211 "id": Schema.String,
20212 "instance_name": Schema.optionalKey(Schema.String.annotate({
20213 "description":
20214 "Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance."
20215 })),
20216 "model": Schema.optionalKey(
20217 Schema.String.annotate({ "description": "Slug of the advisor model that was consulted." })
20218 ),
20219 "prompt": Schema.optionalKey(
20220 Schema.String.annotate({ "description": "The prompt the executor sent to the advisor." })
20221 ),
20222 "status": Schema.Union([
20223 Schema.Literal("in_progress"),
20224 Schema.Literal("completed"),
20225 Schema.Literal("incomplete")
20226 ]),
20227 "type": Schema.Never,
20228 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
20229 "phase": Schema.optionalKey(
20230 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20231 "description":
20232 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20233 })
20234 ),
20235 "role": Schema.Literal("assistant")
20236 }).annotate({ "description": "An openrouter:advisor server tool output item" }),
20237 Schema.Struct({
20238 "error": Schema.optionalKey(
20239 Schema.String.annotate({ "description": "Error message when the subagent task did not produce an outcome." })
20240 ),
20241 "id": Schema.String,
20242 "instance_name": Schema.optionalKey(Schema.String.annotate({
20243 "description":
20244 "Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation."
20245 })),
20246 "model": Schema.optionalKey(
20247 Schema.String.annotate({ "description": "Slug of the worker model that executed the task." })
20248 ),
20249 "name": Schema.optionalKey(
20250 Schema.String.annotate({
20251 "description":
20252 "Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent."
20253 })
20254 ),
20255 "outcome": Schema.optionalKey(
20256 Schema.String.annotate({
20257 "description": "The worker model's result (the outcome text returned to the delegating model)."
20258 })
20259 ),
20260 "status": Schema.Union([
20261 Schema.Literal("in_progress"),
20262 Schema.Literal("completed"),
20263 Schema.Literal("incomplete")
20264 ]),
20265 "task_description": Schema.optionalKey(
20266 Schema.String.annotate({ "description": "The task description the delegating model sent to the worker." })
20267 ),
20268 "task_name": Schema.optionalKey(
20269 Schema.String.annotate({ "description": "The short task identifier the delegating model supplied." })
20270 ),
20271 "type": Schema.Never,
20272 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
20273 "phase": Schema.optionalKey(
20274 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20275 "description":
20276 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20277 })
20278 ),
20279 "role": Schema.Literal("assistant")
20280 }).annotate({ "description": "An openrouter:subagent server tool output item" }),
20281 Schema.Struct({
20282 "error": Schema.optionalKey(
20283 Schema.String.annotate({ "description": "Error message when the file operation failed." })
20284 ),
20285 "file_id": Schema.optionalKey(
20286 Schema.String.annotate({ "description": "The target file id supplied in the tool-call arguments." })
20287 ),
20288 "filename": Schema.optionalKey(
20289 Schema.String.annotate({ "description": "The target filename supplied in the tool-call arguments." })
20290 ),
20291 "id": Schema.String,
20292 "operation": Schema.optionalKey(
20293 Schema.String.annotate({ "description": "The file operation performed (list, read, write, or edit)." })
20294 ),
20295 "result": Schema.optionalKey(
20296 Schema.String.annotate({ "description": "JSON-serialized result of the file operation." })
20297 ),
20298 "status": Schema.Union([
20299 Schema.Literal("in_progress"),
20300 Schema.Literal("completed"),
20301 Schema.Literal("incomplete")
20302 ]),
20303 "type": Schema.Never,
20304 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
20305 "phase": Schema.optionalKey(
20306 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20307 "description":
20308 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20309 })
20310 ),
20311 "role": Schema.Literal("assistant")
20312 }).annotate({ "description": "An openrouter:files server tool output item" }),
20313 Schema.Struct({
20314 "call_id": Schema.String,
20315 "id": Schema.String,
20316 "input": Schema.String,
20317 "name": Schema.String,
20318 "namespace": Schema.optionalKey(
20319 Schema.String.annotate({
20320 "description":
20321 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
20322 })
20323 ),
20324 "type": Schema.Never,
20325 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
20326 "phase": Schema.optionalKey(
20327 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20328 "description":
20329 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20330 })
20331 ),
20332 "role": Schema.Literal("assistant"),
20333 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"]))
20334 }).annotate({
20335 "description":
20336 "A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments."
20337 })
20338 ], { mode: "oneOf" }).annotate({ "description": "An output item from the response" }),
20339 Schema.Union([
20340 Schema.Struct({
20341 "content": Schema.Array(Schema.Union([
20342 Schema.Struct({
20343 "annotations": Schema.optionalKey(Schema.Array(OpenAIResponsesAnnotation)),
20344 "logprobs": Schema.optionalKey(Schema.Array(Schema.Struct({
20345 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
20346 "logprob": Schema.Number.annotate({ "format": "double" }).check(
20347 Schema.isFinite().annotate({ "expected": "a finite number" })
20348 ),
20349 "token": Schema.String,
20350 "top_logprobs": Schema.Array(
20351 Schema.Struct({
20352 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
20353 "logprob": Schema.Number.annotate({ "format": "double" }).check(
20354 Schema.isFinite().annotate({ "expected": "a finite number" })
20355 ),
20356 "token": Schema.String
20357 })
20358 )
20359 }))),
20360 "text": Schema.String,
20361 "type": Schema.Never
20362 }),
20363 Schema.Struct({ "refusal": Schema.String, "type": Schema.Never, "text": Schema.String })
20364 ])),
20365 "id": Schema.String,
20366 "phase": Schema.optionalKey(
20367 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20368 "description":
20369 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20370 })
20371 ),
20372 "role": Schema.Literal("assistant"),
20373 "status": Schema.optionalKey(
20374 Schema.Union([Schema.Literal("completed"), Schema.Literal("incomplete"), Schema.Literal("in_progress")])
20375 ),
20376 "type": Schema.Never,
20377 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20378 "summary": Schema.Array(ReasoningSummaryText)
20379 }).annotate({ "description": "An output message item" }),
20380 Schema.Struct({
20381 "content": Schema.optionalKey(
20382 Schema.Union([
20383 Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("reasoning_text") }))
20384 ])
20385 ),
20386 "encrypted_content": Schema.optionalKey(
20387 Schema.Union([Schema.Union([Schema.String]), Schema.Union([Schema.Null])])
20388 ),
20389 "id": Schema.String,
20390 "status": Schema.optionalKey(
20391 Schema.Union([Schema.Literal("completed"), Schema.Literal("incomplete"), Schema.Literal("in_progress")])
20392 ),
20393 "summary": Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("summary_text") })),
20394 "type": Schema.Literal("reasoning"),
20395 "format": Schema.optionalKey(ReasoningFormat),
20396 "signature": Schema.optionalKey(
20397 Schema.Union([Schema.String, Schema.Null]).annotate({
20398 "description": "A signature for the reasoning content, used for verification"
20399 })
20400 )
20401 }).annotate({ "description": "An output item containing reasoning" }),
20402 Schema.Struct({
20403 "arguments": Schema.String,
20404 "call_id": Schema.String,
20405 "id": Schema.String,
20406 "name": Schema.String,
20407 "namespace": Schema.optionalKey(
20408 Schema.String.annotate({
20409 "description":
20410 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
20411 })
20412 ),
20413 "status": Schema.optionalKey(
20414 Schema.Union([Schema.Literal("completed"), Schema.Literal("incomplete"), Schema.Literal("in_progress")])
20415 ),
20416 "type": Schema.Never,
20417 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20418 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20419 "summary": Schema.Array(ReasoningSummaryText)
20420 }),
20421 Schema.Struct({
20422 "action": Schema.optionalKey(
20423 Schema.Union([
20424 Schema.Struct({
20425 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
20426 "query": Schema.String,
20427 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
20428 "type": Schema.Literal("search")
20429 }),
20430 Schema.Struct({
20431 "type": Schema.Literal("open_page"),
20432 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
20433 }),
20434 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
20435 ], { mode: "oneOf" })
20436 ),
20437 "id": Schema.String,
20438 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
20439 "type": Schema.Never,
20440 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20441 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20442 "summary": Schema.Array(ReasoningSummaryText)
20443 }),
20444 Schema.Struct({
20445 "id": Schema.String,
20446 "queries": Schema.Array(Schema.String),
20447 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
20448 "type": Schema.Never,
20449 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20450 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20451 "summary": Schema.Array(ReasoningSummaryText)
20452 }),
20453 Schema.Struct({
20454 "id": Schema.String,
20455 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20456 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
20457 "type": Schema.Never,
20458 "prompt": Schema.optionalKey(
20459 Schema.String.annotate({
20460 "description": "The prompt (possibly rewritten) that the image was generated from."
20461 })
20462 ),
20463 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20464 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20465 "summary": Schema.Array(ReasoningSummaryText)
20466 }),
20467 Schema.Struct({
20468 "code": Schema.Union([Schema.String, Schema.Null]),
20469 "container_id": Schema.String,
20470 "id": Schema.String,
20471 "outputs": Schema.Union([
20472 Schema.Array(
20473 Schema.Union([
20474 Schema.Struct({ "type": Schema.Literal("image"), "url": Schema.String }),
20475 Schema.Struct({ "logs": Schema.String, "type": Schema.Literal("logs") })
20476 ])
20477 ),
20478 Schema.Null
20479 ]),
20480 "status": Schema.Union([
20481 Schema.Literal("in_progress"),
20482 Schema.Literal("completed"),
20483 Schema.Literal("incomplete")
20484 ]),
20485 "type": Schema.Never,
20486 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20487 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20488 "summary": Schema.Array(ReasoningSummaryText)
20489 }).annotate({ "description": "A code interpreter execution call with outputs" }),
20490 Schema.Struct({
20491 "action": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
20492 "call_id": Schema.String,
20493 "id": Schema.String,
20494 "pending_safety_checks": Schema.Array(
20495 Schema.Struct({ "code": Schema.String, "id": Schema.String, "message": Schema.String })
20496 ),
20497 "status": Schema.Union([
20498 Schema.Literal("completed"),
20499 Schema.Literal("incomplete"),
20500 Schema.Literal("in_progress")
20501 ]),
20502 "type": Schema.Never,
20503 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20504 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20505 "summary": Schema.Array(ReasoningSummaryText)
20506 }),
20507 Schema.Struct({
20508 "datetime": Schema.String.annotate({ "description": "ISO 8601 datetime string" }),
20509 "id": Schema.String,
20510 "status": Schema.Union([
20511 Schema.Literal("in_progress"),
20512 Schema.Literal("completed"),
20513 Schema.Literal("incomplete")
20514 ]),
20515 "timezone": Schema.String.annotate({ "description": "IANA timezone name" }),
20516 "type": Schema.Never,
20517 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20518 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20519 "summary": Schema.Array(ReasoningSummaryText)
20520 }).annotate({ "description": "An openrouter:datetime server tool output item" }),
20521 Schema.Struct({
20522 "action": Schema.optionalKey(
20523 Schema.Struct({
20524 "query": Schema.String,
20525 "sources": Schema.optionalKey(
20526 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
20527 ),
20528 "type": Schema.Literal("search")
20529 }).annotate({
20530 "description":
20531 "The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider."
20532 })
20533 ),
20534 "id": Schema.String,
20535 "status": Schema.Union([
20536 Schema.Literal("in_progress"),
20537 Schema.Literal("completed"),
20538 Schema.Literal("incomplete")
20539 ]),
20540 "type": Schema.Never,
20541 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20542 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20543 "summary": Schema.Array(ReasoningSummaryText)
20544 }).annotate({ "description": "An openrouter:web_search server tool output item" }),
20545 Schema.Struct({
20546 "code": Schema.optionalKey(Schema.String),
20547 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
20548 "id": Schema.String,
20549 "language": Schema.optionalKey(Schema.String),
20550 "status": Schema.Union([
20551 Schema.Literal("in_progress"),
20552 Schema.Literal("completed"),
20553 Schema.Literal("incomplete")
20554 ]),
20555 "stderr": Schema.optionalKey(Schema.String),
20556 "stdout": Schema.optionalKey(Schema.String),
20557 "type": Schema.Never,
20558 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20559 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20560 "summary": Schema.Array(ReasoningSummaryText)
20561 }).annotate({ "description": "An openrouter:code_interpreter server tool output item" }),
20562 Schema.Struct({
20563 "id": Schema.String,
20564 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
20565 "status": Schema.Union([
20566 Schema.Literal("in_progress"),
20567 Schema.Literal("completed"),
20568 Schema.Literal("incomplete")
20569 ]),
20570 "type": Schema.Never,
20571 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20572 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20573 "summary": Schema.Array(ReasoningSummaryText)
20574 }).annotate({ "description": "An openrouter:file_search server tool output item" }),
20575 Schema.Struct({
20576 "id": Schema.String,
20577 "imageB64": Schema.optionalKey(Schema.String),
20578 "imageUrl": Schema.optionalKey(Schema.String),
20579 "prompt": Schema.optionalKey(
20580 Schema.String.annotate({
20581 "description": "The prompt (possibly rewritten) that the image was generated from."
20582 })
20583 ),
20584 "result": Schema.optionalKey(
20585 Schema.Union([Schema.String, Schema.Null]).annotate({
20586 "description":
20587 "The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format"
20588 })
20589 ),
20590 "revisedPrompt": Schema.optionalKey(Schema.String),
20591 "status": Schema.Union([
20592 Schema.Literal("in_progress"),
20593 Schema.Literal("completed"),
20594 Schema.Literal("incomplete")
20595 ]),
20596 "type": Schema.Never,
20597 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20598 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20599 "summary": Schema.Array(ReasoningSummaryText)
20600 }).annotate({ "description": "An openrouter:image_generation server tool output item" }),
20601 Schema.Struct({
20602 "action": Schema.optionalKey(Schema.String),
20603 "id": Schema.String,
20604 "screenshotB64": Schema.optionalKey(Schema.String),
20605 "status": Schema.Union([
20606 Schema.Literal("in_progress"),
20607 Schema.Literal("completed"),
20608 Schema.Literal("incomplete")
20609 ]),
20610 "type": Schema.Never,
20611 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20612 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20613 "summary": Schema.Array(ReasoningSummaryText)
20614 }).annotate({ "description": "An openrouter:browser_use server tool output item" }),
20615 Schema.Struct({
20616 "arguments": Schema.optionalKey(
20617 Schema.String.annotate({ "description": "The raw tool-call arguments string as emitted by the model." })
20618 ),
20619 "call_id": Schema.optionalKey(
20620 Schema.String.annotate({ "description": "The model-generated tool call id from the originating turn." })
20621 ),
20622 "command": Schema.optionalKey(Schema.String),
20623 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
20624 "id": Schema.String,
20625 "status": Schema.Union([
20626 Schema.Literal("in_progress"),
20627 Schema.Literal("completed"),
20628 Schema.Literal("incomplete")
20629 ]),
20630 "stderr": Schema.optionalKey(Schema.String),
20631 "stdout": Schema.optionalKey(Schema.String),
20632 "type": Schema.Never,
20633 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20634 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20635 "summary": Schema.Array(ReasoningSummaryText)
20636 }).annotate({ "description": "An openrouter:bash server tool output item" }),
20637 Schema.Struct({
20638 "command": Schema.optionalKey(Schema.Literals(["view", "create", "str_replace", "insert"])),
20639 "filePath": Schema.optionalKey(Schema.String),
20640 "id": Schema.String,
20641 "status": Schema.Union([
20642 Schema.Literal("in_progress"),
20643 Schema.Literal("completed"),
20644 Schema.Literal("incomplete")
20645 ]),
20646 "type": Schema.Never,
20647 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20648 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20649 "summary": Schema.Array(ReasoningSummaryText)
20650 }).annotate({ "description": "An openrouter:text_editor server tool output item" }),
20651 Schema.Struct({
20652 "call_id": Schema.optionalKey(Schema.String),
20653 "id": Schema.String,
20654 "operation": Schema.optionalKey(ApplyPatchCallOperation),
20655 "status": Schema.Union([
20656 Schema.Literal("in_progress"),
20657 Schema.Literal("completed"),
20658 Schema.Literal("incomplete")
20659 ]),
20660 "type": Schema.Never,
20661 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20662 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20663 "summary": Schema.Array(ReasoningSummaryText)
20664 }).annotate({
20665 "description":
20666 "An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn."
20667 }),
20668 Schema.Struct({
20669 "call_id": Schema.String,
20670 "id": Schema.String,
20671 "operation": ApplyPatchCallOperation,
20672 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
20673 "description": "Lifecycle state of an `apply_patch_call` output item."
20674 }),
20675 "type": Schema.Never,
20676 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20677 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20678 "summary": Schema.Array(ReasoningSummaryText)
20679 }).annotate({
20680 "description":
20681 "A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand."
20682 }),
20683 Schema.Struct({
20684 "action": Schema.optionalKey(Schema.Struct({
20685 "commands": Schema.Array(Schema.String),
20686 "max_output_length": Schema.Union([
20687 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
20688 Schema.Null
20689 ]),
20690 "timeout_ms": Schema.Union([
20691 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
20692 Schema.Null
20693 ])
20694 })),
20695 "call_id": Schema.String,
20696 "id": Schema.String,
20697 "status": Schema.Union([
20698 Schema.Literal("in_progress"),
20699 Schema.Literal("completed"),
20700 Schema.Literal("incomplete")
20701 ]).annotate({ "description": "Status of a shell call or its output." }),
20702 "type": Schema.Never,
20703 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20704 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20705 "summary": Schema.Array(ReasoningSummaryText)
20706 }).annotate({
20707 "description":
20708 "A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool."
20709 }),
20710 Schema.Struct({
20711 "call_id": Schema.String,
20712 "id": Schema.String,
20713 "max_output_length": Schema.optionalKey(
20714 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
20715 ),
20716 "output": Schema.Array(Schema.Struct({
20717 "outcome": Schema.Union([
20718 Schema.Struct({
20719 "exit_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
20720 "type": Schema.Literal("exit")
20721 }),
20722 Schema.Struct({ "type": Schema.Literal("timeout") })
20723 ], { mode: "oneOf" }),
20724 "stderr": Schema.String,
20725 "stdout": Schema.String
20726 })),
20727 "status": Schema.Union([
20728 Schema.Literal("in_progress"),
20729 Schema.Literal("completed"),
20730 Schema.Literal("incomplete")
20731 ]).annotate({ "description": "Status of a shell call or its output." }),
20732 "type": Schema.Never,
20733 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20734 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20735 "summary": Schema.Array(ReasoningSummaryText)
20736 }).annotate({
20737 "description":
20738 "A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome."
20739 }),
20740 Schema.Struct({
20741 "content": Schema.optionalKey(Schema.Never),
20742 "error": Schema.optionalKey(
20743 Schema.String.annotate({ "description": "The error message if the fetch failed." })
20744 ),
20745 "httpStatus": Schema.optionalKey(
20746 Schema.Number.annotate({ "description": "The HTTP status code returned by the upstream URL fetch." }).check(
20747 Schema.isInt().annotate({ "expected": "an integer" })
20748 )
20749 ),
20750 "id": Schema.String,
20751 "status": Schema.Union([
20752 Schema.Literal("in_progress"),
20753 Schema.Literal("completed"),
20754 Schema.Literal("incomplete")
20755 ]),
20756 "title": Schema.optionalKey(Schema.String),
20757 "type": Schema.Never,
20758 "url": Schema.optionalKey(Schema.String),
20759 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20760 "summary": Schema.Array(ReasoningSummaryText)
20761 }).annotate({ "description": "An openrouter:web_fetch server tool output item" }),
20762 Schema.Struct({
20763 "id": Schema.String,
20764 "query": Schema.optionalKey(Schema.String),
20765 "status": Schema.Union([
20766 Schema.Literal("in_progress"),
20767 Schema.Literal("completed"),
20768 Schema.Literal("incomplete")
20769 ]),
20770 "type": Schema.Never,
20771 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20772 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20773 "summary": Schema.Array(ReasoningSummaryText)
20774 }).annotate({ "description": "An openrouter:tool_search server tool output item" }),
20775 Schema.Struct({
20776 "action": Schema.optionalKey(Schema.Literals(["read", "write", "delete"])),
20777 "id": Schema.String,
20778 "key": Schema.optionalKey(Schema.String),
20779 "status": Schema.Union([
20780 Schema.Literal("in_progress"),
20781 Schema.Literal("completed"),
20782 Schema.Literal("incomplete")
20783 ]),
20784 "type": Schema.Never,
20785 "value": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
20786 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20787 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20788 "summary": Schema.Array(ReasoningSummaryText)
20789 }).annotate({ "description": "An openrouter:memory server tool output item" }),
20790 Schema.Struct({
20791 "id": Schema.String,
20792 "serverLabel": Schema.optionalKey(Schema.String),
20793 "status": Schema.Union([
20794 Schema.Literal("in_progress"),
20795 Schema.Literal("completed"),
20796 Schema.Literal("incomplete")
20797 ]),
20798 "toolName": Schema.optionalKey(Schema.String),
20799 "type": Schema.Never,
20800 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20801 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20802 "summary": Schema.Array(ReasoningSummaryText)
20803 }).annotate({ "description": "An openrouter:mcp server tool output item" }),
20804 Schema.Struct({
20805 "arguments": Schema.optionalKey(
20806 Schema.String.annotate({
20807 "description": "The JSON arguments submitted to the search tool (e.g. {\"query\":\"Claude\"})"
20808 })
20809 ),
20810 "id": Schema.String,
20811 "query": Schema.optionalKey(Schema.String),
20812 "status": Schema.Union([
20813 Schema.Literal("in_progress"),
20814 Schema.Literal("completed"),
20815 Schema.Literal("incomplete")
20816 ]),
20817 "type": Schema.Never,
20818 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20819 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20820 "summary": Schema.Array(ReasoningSummaryText)
20821 }).annotate({ "description": "An openrouter:experimental__search_models server tool output item" }),
20822 Schema.Struct({
20823 "analysis": Schema.optionalKey(FusionAnalysisResult),
20824 "error": Schema.optionalKey(
20825 Schema.String.annotate({
20826 "description": "Error message when the fusion run did not produce an analysis result."
20827 })
20828 ),
20829 "failed_models": Schema.optionalKey(
20830 Schema.Array(Schema.Struct({
20831 "error": Schema.String.annotate({ "description": "Error message describing why the model failed." }),
20832 "model": Schema.String.annotate({ "description": "Slug of the analysis model that failed." }),
20833 "status_code": Schema.optionalKey(
20834 Schema.Number.annotate({
20835 "description": "HTTP status code from the upstream response, when available (e.g. 402, 429)."
20836 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
20837 )
20838 })).annotate({
20839 "description":
20840 "Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel."
20841 })
20842 ),
20843 "failure_reason": Schema.optionalKey(
20844 Schema.String.annotate({
20845 "description":
20846 "Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion."
20847 })
20848 ),
20849 "id": Schema.String,
20850 "responses": Schema.optionalKey(
20851 Schema.Array(Schema.Struct({ "content": Schema.optionalKey(Schema.String), "model": Schema.String }))
20852 .annotate({
20853 "description":
20854 "Analysis models that produced a response in this fusion run, with each model's full panel content."
20855 })
20856 ),
20857 "sources": Schema.optionalKey(
20858 Schema.Array(FusionSource).annotate({
20859 "description":
20860 "Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source."
20861 })
20862 ),
20863 "status": Schema.Union([
20864 Schema.Literal("in_progress"),
20865 Schema.Literal("completed"),
20866 Schema.Literal("incomplete")
20867 ]),
20868 "type": Schema.Never,
20869 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20870 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20871 "summary": Schema.Array(ReasoningSummaryText)
20872 }).annotate({ "description": "An openrouter:fusion server tool output item" }),
20873 Schema.Struct({
20874 "advice": Schema.optionalKey(
20875 Schema.String.annotate({
20876 "description": "The advisor model's response (the advice text returned to the executor)."
20877 })
20878 ),
20879 "error": Schema.optionalKey(
20880 Schema.String.annotate({ "description": "Error message when the advisor call did not produce advice." })
20881 ),
20882 "id": Schema.String,
20883 "instance_name": Schema.optionalKey(Schema.String.annotate({
20884 "description":
20885 "Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance."
20886 })),
20887 "model": Schema.optionalKey(
20888 Schema.String.annotate({ "description": "Slug of the advisor model that was consulted." })
20889 ),
20890 "prompt": Schema.optionalKey(
20891 Schema.String.annotate({ "description": "The prompt the executor sent to the advisor." })
20892 ),
20893 "status": Schema.Union([
20894 Schema.Literal("in_progress"),
20895 Schema.Literal("completed"),
20896 Schema.Literal("incomplete")
20897 ]),
20898 "type": Schema.Never,
20899 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20900 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20901 "summary": Schema.Array(ReasoningSummaryText)
20902 }).annotate({ "description": "An openrouter:advisor server tool output item" }),
20903 Schema.Struct({
20904 "error": Schema.optionalKey(
20905 Schema.String.annotate({ "description": "Error message when the subagent task did not produce an outcome." })
20906 ),
20907 "id": Schema.String,
20908 "instance_name": Schema.optionalKey(Schema.String.annotate({
20909 "description":
20910 "Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation."
20911 })),
20912 "model": Schema.optionalKey(
20913 Schema.String.annotate({ "description": "Slug of the worker model that executed the task." })
20914 ),
20915 "name": Schema.optionalKey(
20916 Schema.String.annotate({
20917 "description":
20918 "Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent."
20919 })
20920 ),
20921 "outcome": Schema.optionalKey(
20922 Schema.String.annotate({
20923 "description": "The worker model's result (the outcome text returned to the delegating model)."
20924 })
20925 ),
20926 "status": Schema.Union([
20927 Schema.Literal("in_progress"),
20928 Schema.Literal("completed"),
20929 Schema.Literal("incomplete")
20930 ]),
20931 "task_description": Schema.optionalKey(
20932 Schema.String.annotate({ "description": "The task description the delegating model sent to the worker." })
20933 ),
20934 "task_name": Schema.optionalKey(
20935 Schema.String.annotate({ "description": "The short task identifier the delegating model supplied." })
20936 ),
20937 "type": Schema.Never,
20938 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20939 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20940 "summary": Schema.Array(ReasoningSummaryText)
20941 }).annotate({ "description": "An openrouter:subagent server tool output item" }),
20942 Schema.Struct({
20943 "error": Schema.optionalKey(
20944 Schema.String.annotate({ "description": "Error message when the file operation failed." })
20945 ),
20946 "file_id": Schema.optionalKey(
20947 Schema.String.annotate({ "description": "The target file id supplied in the tool-call arguments." })
20948 ),
20949 "filename": Schema.optionalKey(
20950 Schema.String.annotate({ "description": "The target filename supplied in the tool-call arguments." })
20951 ),
20952 "id": Schema.String,
20953 "operation": Schema.optionalKey(
20954 Schema.String.annotate({ "description": "The file operation performed (list, read, write, or edit)." })
20955 ),
20956 "result": Schema.optionalKey(
20957 Schema.String.annotate({ "description": "JSON-serialized result of the file operation." })
20958 ),
20959 "status": Schema.Union([
20960 Schema.Literal("in_progress"),
20961 Schema.Literal("completed"),
20962 Schema.Literal("incomplete")
20963 ]),
20964 "type": Schema.Never,
20965 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20966 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20967 "summary": Schema.Array(ReasoningSummaryText)
20968 }).annotate({ "description": "An openrouter:files server tool output item" }),
20969 Schema.Struct({
20970 "call_id": Schema.String,
20971 "id": Schema.String,
20972 "input": Schema.String,
20973 "name": Schema.String,
20974 "namespace": Schema.optionalKey(
20975 Schema.String.annotate({
20976 "description":
20977 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
20978 })
20979 ),
20980 "type": Schema.Never,
20981 "content": Schema.optionalKey(Schema.Array(ReasoningTextContent)),
20982 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
20983 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
20984 "summary": Schema.Array(ReasoningSummaryText)
20985 }).annotate({
20986 "description":
20987 "A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments."
20988 })
20989 ], { mode: "oneOf" }).annotate({ "description": "An output item from the response" }),
20990 Schema.Union([
20991 Schema.Struct({
20992 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
20993 "id": Schema.String,
20994 "phase": Schema.optionalKey(
20995 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
20996 "description":
20997 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
20998 })
20999 ),
21000 "role": Schema.Literal("assistant"),
21001 "status": Schema.optionalKey(
21002 Schema.Union([Schema.Literal("completed"), Schema.Literal("incomplete"), Schema.Literal("in_progress")])
21003 ),
21004 "type": Schema.Never,
21005 "arguments": Schema.String,
21006 "call_id": Schema.String,
21007 "name": Schema.String,
21008 "namespace": Schema.optionalKey(
21009 Schema.String.annotate({
21010 "description":
21011 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21012 })
21013 )
21014 }).annotate({ "description": "An output message item" }),
21015 Schema.Struct({
21016 "content": Schema.optionalKey(
21017 Schema.Union([
21018 Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("reasoning_text") }))
21019 ])
21020 ),
21021 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
21022 "id": Schema.String,
21023 "status": Schema.optionalKey(
21024 Schema.Union([Schema.Literal("completed"), Schema.Literal("incomplete"), Schema.Literal("in_progress")])
21025 ),
21026 "summary": Schema.Array(ReasoningSummaryText),
21027 "type": Schema.Never,
21028 "format": Schema.optionalKey(ReasoningFormat),
21029 "signature": Schema.optionalKey(
21030 Schema.Union([Schema.String, Schema.Null]).annotate({
21031 "description": "A signature for the reasoning content, used for verification"
21032 })
21033 ),
21034 "arguments": Schema.String,
21035 "call_id": Schema.String,
21036 "name": Schema.String,
21037 "namespace": Schema.optionalKey(
21038 Schema.String.annotate({
21039 "description":
21040 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21041 })
21042 )
21043 }).annotate({ "description": "An output item containing reasoning" }),
21044 Schema.Struct({
21045 "arguments": Schema.String,
21046 "call_id": Schema.String,
21047 "id": Schema.optionalKey(Schema.String),
21048 "name": Schema.String,
21049 "namespace": Schema.optionalKey(
21050 Schema.String.annotate({
21051 "description":
21052 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21053 })
21054 ),
21055 "status": Schema.optionalKey(
21056 Schema.Union([Schema.Literal("completed"), Schema.Literal("incomplete"), Schema.Literal("in_progress")])
21057 ),
21058 "type": Schema.Literal("function_call")
21059 }),
21060 Schema.Struct({
21061 "action": Schema.optionalKey(
21062 Schema.Union([
21063 Schema.Struct({
21064 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
21065 "query": Schema.String,
21066 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
21067 "type": Schema.Literal("search")
21068 }),
21069 Schema.Struct({
21070 "type": Schema.Literal("open_page"),
21071 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
21072 }),
21073 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
21074 ], { mode: "oneOf" })
21075 ),
21076 "id": Schema.String,
21077 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
21078 "type": Schema.Never,
21079 "arguments": Schema.String,
21080 "call_id": Schema.String,
21081 "name": Schema.String,
21082 "namespace": Schema.optionalKey(
21083 Schema.String.annotate({
21084 "description":
21085 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21086 })
21087 )
21088 }),
21089 Schema.Struct({
21090 "id": Schema.String,
21091 "queries": Schema.Array(Schema.String),
21092 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
21093 "type": Schema.Never,
21094 "arguments": Schema.String,
21095 "call_id": Schema.String,
21096 "name": Schema.String,
21097 "namespace": Schema.optionalKey(
21098 Schema.String.annotate({
21099 "description":
21100 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21101 })
21102 )
21103 }),
21104 Schema.Struct({
21105 "id": Schema.String,
21106 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
21107 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
21108 "type": Schema.Never,
21109 "prompt": Schema.optionalKey(
21110 Schema.String.annotate({
21111 "description": "The prompt (possibly rewritten) that the image was generated from."
21112 })
21113 ),
21114 "arguments": Schema.String,
21115 "call_id": Schema.String,
21116 "name": Schema.String,
21117 "namespace": Schema.optionalKey(
21118 Schema.String.annotate({
21119 "description":
21120 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21121 })
21122 )
21123 }),
21124 Schema.Struct({
21125 "code": Schema.Union([Schema.String, Schema.Null]),
21126 "container_id": Schema.String,
21127 "id": Schema.String,
21128 "outputs": Schema.Union([
21129 Schema.Array(
21130 Schema.Union([
21131 Schema.Struct({ "type": Schema.Literal("image"), "url": Schema.String }),
21132 Schema.Struct({ "logs": Schema.String, "type": Schema.Literal("logs") })
21133 ])
21134 ),
21135 Schema.Null
21136 ]),
21137 "status": Schema.Union([
21138 Schema.Literal("in_progress"),
21139 Schema.Literal("completed"),
21140 Schema.Literal("incomplete")
21141 ]),
21142 "type": Schema.Never,
21143 "arguments": Schema.String,
21144 "call_id": Schema.String,
21145 "name": Schema.String,
21146 "namespace": Schema.optionalKey(
21147 Schema.String.annotate({
21148 "description":
21149 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21150 })
21151 )
21152 }).annotate({ "description": "A code interpreter execution call with outputs" }),
21153 Schema.Struct({
21154 "action": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
21155 "call_id": Schema.String,
21156 "id": Schema.optionalKey(Schema.String),
21157 "pending_safety_checks": Schema.Array(
21158 Schema.Struct({ "code": Schema.String, "id": Schema.String, "message": Schema.String })
21159 ),
21160 "status": Schema.Union([
21161 Schema.Literal("completed"),
21162 Schema.Literal("incomplete"),
21163 Schema.Literal("in_progress")
21164 ]),
21165 "type": Schema.Never,
21166 "arguments": Schema.String,
21167 "name": Schema.String,
21168 "namespace": Schema.optionalKey(
21169 Schema.String.annotate({
21170 "description":
21171 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21172 })
21173 )
21174 }),
21175 Schema.Struct({
21176 "datetime": Schema.String.annotate({ "description": "ISO 8601 datetime string" }),
21177 "id": Schema.optionalKey(Schema.String),
21178 "status": Schema.Union([
21179 Schema.Literal("in_progress"),
21180 Schema.Literal("completed"),
21181 Schema.Literal("incomplete")
21182 ]),
21183 "timezone": Schema.String.annotate({ "description": "IANA timezone name" }),
21184 "type": Schema.Never,
21185 "arguments": Schema.String,
21186 "call_id": Schema.String,
21187 "name": Schema.String,
21188 "namespace": Schema.optionalKey(
21189 Schema.String.annotate({
21190 "description":
21191 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21192 })
21193 )
21194 }).annotate({ "description": "An openrouter:datetime server tool output item" }),
21195 Schema.Struct({
21196 "action": Schema.optionalKey(
21197 Schema.Struct({
21198 "query": Schema.String,
21199 "sources": Schema.optionalKey(
21200 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
21201 ),
21202 "type": Schema.Literal("search")
21203 }).annotate({
21204 "description":
21205 "The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider."
21206 })
21207 ),
21208 "id": Schema.optionalKey(Schema.String),
21209 "status": Schema.Union([
21210 Schema.Literal("in_progress"),
21211 Schema.Literal("completed"),
21212 Schema.Literal("incomplete")
21213 ]),
21214 "type": Schema.Never,
21215 "arguments": Schema.String,
21216 "call_id": Schema.String,
21217 "name": Schema.String,
21218 "namespace": Schema.optionalKey(
21219 Schema.String.annotate({
21220 "description":
21221 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21222 })
21223 )
21224 }).annotate({ "description": "An openrouter:web_search server tool output item" }),
21225 Schema.Struct({
21226 "code": Schema.optionalKey(Schema.String),
21227 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
21228 "id": Schema.optionalKey(Schema.String),
21229 "language": Schema.optionalKey(Schema.String),
21230 "status": Schema.Union([
21231 Schema.Literal("in_progress"),
21232 Schema.Literal("completed"),
21233 Schema.Literal("incomplete")
21234 ]),
21235 "stderr": Schema.optionalKey(Schema.String),
21236 "stdout": Schema.optionalKey(Schema.String),
21237 "type": Schema.Never,
21238 "arguments": Schema.String,
21239 "call_id": Schema.String,
21240 "name": Schema.String,
21241 "namespace": Schema.optionalKey(
21242 Schema.String.annotate({
21243 "description":
21244 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21245 })
21246 )
21247 }).annotate({ "description": "An openrouter:code_interpreter server tool output item" }),
21248 Schema.Struct({
21249 "id": Schema.optionalKey(Schema.String),
21250 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
21251 "status": Schema.Union([
21252 Schema.Literal("in_progress"),
21253 Schema.Literal("completed"),
21254 Schema.Literal("incomplete")
21255 ]),
21256 "type": Schema.Never,
21257 "arguments": Schema.String,
21258 "call_id": Schema.String,
21259 "name": Schema.String,
21260 "namespace": Schema.optionalKey(
21261 Schema.String.annotate({
21262 "description":
21263 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21264 })
21265 )
21266 }).annotate({ "description": "An openrouter:file_search server tool output item" }),
21267 Schema.Struct({
21268 "id": Schema.optionalKey(Schema.String),
21269 "imageB64": Schema.optionalKey(Schema.String),
21270 "imageUrl": Schema.optionalKey(Schema.String),
21271 "prompt": Schema.optionalKey(
21272 Schema.String.annotate({
21273 "description": "The prompt (possibly rewritten) that the image was generated from."
21274 })
21275 ),
21276 "result": Schema.optionalKey(
21277 Schema.Union([Schema.String, Schema.Null]).annotate({
21278 "description":
21279 "The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format"
21280 })
21281 ),
21282 "revisedPrompt": Schema.optionalKey(Schema.String),
21283 "status": Schema.Union([
21284 Schema.Literal("in_progress"),
21285 Schema.Literal("completed"),
21286 Schema.Literal("incomplete")
21287 ]),
21288 "type": Schema.Never,
21289 "arguments": Schema.String,
21290 "call_id": Schema.String,
21291 "name": Schema.String,
21292 "namespace": Schema.optionalKey(
21293 Schema.String.annotate({
21294 "description":
21295 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21296 })
21297 )
21298 }).annotate({ "description": "An openrouter:image_generation server tool output item" }),
21299 Schema.Struct({
21300 "action": Schema.optionalKey(Schema.String),
21301 "id": Schema.optionalKey(Schema.String),
21302 "screenshotB64": Schema.optionalKey(Schema.String),
21303 "status": Schema.Union([
21304 Schema.Literal("in_progress"),
21305 Schema.Literal("completed"),
21306 Schema.Literal("incomplete")
21307 ]),
21308 "type": Schema.Never,
21309 "arguments": Schema.String,
21310 "call_id": Schema.String,
21311 "name": Schema.String,
21312 "namespace": Schema.optionalKey(
21313 Schema.String.annotate({
21314 "description":
21315 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21316 })
21317 )
21318 }).annotate({ "description": "An openrouter:browser_use server tool output item" }),
21319 Schema.Struct({
21320 "arguments": Schema.String.annotate({
21321 "description": "The raw tool-call arguments string as emitted by the model."
21322 }),
21323 "call_id": Schema.String.annotate({
21324 "description": "The model-generated tool call id from the originating turn."
21325 }),
21326 "command": Schema.optionalKey(Schema.String),
21327 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
21328 "id": Schema.optionalKey(Schema.String),
21329 "status": Schema.Union([
21330 Schema.Literal("in_progress"),
21331 Schema.Literal("completed"),
21332 Schema.Literal("incomplete")
21333 ]),
21334 "stderr": Schema.optionalKey(Schema.String),
21335 "stdout": Schema.optionalKey(Schema.String),
21336 "type": Schema.Never,
21337 "name": Schema.String,
21338 "namespace": Schema.optionalKey(
21339 Schema.String.annotate({
21340 "description":
21341 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21342 })
21343 )
21344 }).annotate({ "description": "An openrouter:bash server tool output item" }),
21345 Schema.Struct({
21346 "command": Schema.optionalKey(Schema.Literals(["view", "create", "str_replace", "insert"])),
21347 "filePath": Schema.optionalKey(Schema.String),
21348 "id": Schema.optionalKey(Schema.String),
21349 "status": Schema.Union([
21350 Schema.Literal("in_progress"),
21351 Schema.Literal("completed"),
21352 Schema.Literal("incomplete")
21353 ]),
21354 "type": Schema.Never,
21355 "arguments": Schema.String,
21356 "call_id": Schema.String,
21357 "name": Schema.String,
21358 "namespace": Schema.optionalKey(
21359 Schema.String.annotate({
21360 "description":
21361 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21362 })
21363 )
21364 }).annotate({ "description": "An openrouter:text_editor server tool output item" }),
21365 Schema.Struct({
21366 "call_id": Schema.String,
21367 "id": Schema.optionalKey(Schema.String),
21368 "operation": Schema.optionalKey(ApplyPatchCallOperation),
21369 "status": Schema.Union([
21370 Schema.Literal("in_progress"),
21371 Schema.Literal("completed"),
21372 Schema.Literal("incomplete")
21373 ]),
21374 "type": Schema.Never,
21375 "arguments": Schema.String,
21376 "name": Schema.String,
21377 "namespace": Schema.optionalKey(
21378 Schema.String.annotate({
21379 "description":
21380 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21381 })
21382 )
21383 }).annotate({
21384 "description":
21385 "An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn."
21386 }),
21387 Schema.Struct({
21388 "call_id": Schema.String,
21389 "id": Schema.String,
21390 "operation": ApplyPatchCallOperation,
21391 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
21392 "description": "Lifecycle state of an `apply_patch_call` output item."
21393 }),
21394 "type": Schema.Never,
21395 "arguments": Schema.String,
21396 "name": Schema.String,
21397 "namespace": Schema.optionalKey(
21398 Schema.String.annotate({
21399 "description":
21400 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21401 })
21402 )
21403 }).annotate({
21404 "description":
21405 "A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand."
21406 }),
21407 Schema.Struct({
21408 "action": Schema.optionalKey(Schema.Struct({
21409 "commands": Schema.Array(Schema.String),
21410 "max_output_length": Schema.Union([
21411 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
21412 Schema.Null
21413 ]),
21414 "timeout_ms": Schema.Union([
21415 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
21416 Schema.Null
21417 ])
21418 })),
21419 "call_id": Schema.String,
21420 "id": Schema.String,
21421 "status": Schema.Union([
21422 Schema.Literal("in_progress"),
21423 Schema.Literal("completed"),
21424 Schema.Literal("incomplete")
21425 ]).annotate({ "description": "Status of a shell call or its output." }),
21426 "type": Schema.Never,
21427 "arguments": Schema.String,
21428 "name": Schema.String,
21429 "namespace": Schema.optionalKey(
21430 Schema.String.annotate({
21431 "description":
21432 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21433 })
21434 )
21435 }).annotate({
21436 "description":
21437 "A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool."
21438 }),
21439 Schema.Struct({
21440 "call_id": Schema.String,
21441 "id": Schema.String,
21442 "max_output_length": Schema.optionalKey(
21443 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
21444 ),
21445 "output": Schema.Array(Schema.Struct({
21446 "outcome": Schema.Union([
21447 Schema.Struct({
21448 "exit_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
21449 "type": Schema.Literal("exit")
21450 }),
21451 Schema.Struct({ "type": Schema.Literal("timeout") })
21452 ], { mode: "oneOf" }),
21453 "stderr": Schema.String,
21454 "stdout": Schema.String
21455 })),
21456 "status": Schema.Union([
21457 Schema.Literal("in_progress"),
21458 Schema.Literal("completed"),
21459 Schema.Literal("incomplete")
21460 ]).annotate({ "description": "Status of a shell call or its output." }),
21461 "type": Schema.Never,
21462 "arguments": Schema.String,
21463 "name": Schema.String,
21464 "namespace": Schema.optionalKey(
21465 Schema.String.annotate({
21466 "description":
21467 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21468 })
21469 )
21470 }).annotate({
21471 "description":
21472 "A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome."
21473 }),
21474 Schema.Struct({
21475 "content": Schema.optionalKey(Schema.String),
21476 "error": Schema.optionalKey(
21477 Schema.String.annotate({ "description": "The error message if the fetch failed." })
21478 ),
21479 "httpStatus": Schema.optionalKey(
21480 Schema.Number.annotate({ "description": "The HTTP status code returned by the upstream URL fetch." }).check(
21481 Schema.isInt().annotate({ "expected": "an integer" })
21482 )
21483 ),
21484 "id": Schema.optionalKey(Schema.String),
21485 "status": Schema.Union([
21486 Schema.Literal("in_progress"),
21487 Schema.Literal("completed"),
21488 Schema.Literal("incomplete")
21489 ]),
21490 "title": Schema.optionalKey(Schema.String),
21491 "type": Schema.Never,
21492 "url": Schema.optionalKey(Schema.String),
21493 "arguments": Schema.String,
21494 "call_id": Schema.String,
21495 "name": Schema.String,
21496 "namespace": Schema.optionalKey(
21497 Schema.String.annotate({
21498 "description":
21499 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21500 })
21501 )
21502 }).annotate({ "description": "An openrouter:web_fetch server tool output item" }),
21503 Schema.Struct({
21504 "id": Schema.optionalKey(Schema.String),
21505 "query": Schema.optionalKey(Schema.String),
21506 "status": Schema.Union([
21507 Schema.Literal("in_progress"),
21508 Schema.Literal("completed"),
21509 Schema.Literal("incomplete")
21510 ]),
21511 "type": Schema.Never,
21512 "arguments": Schema.String,
21513 "call_id": Schema.String,
21514 "name": Schema.String,
21515 "namespace": Schema.optionalKey(
21516 Schema.String.annotate({
21517 "description":
21518 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21519 })
21520 )
21521 }).annotate({ "description": "An openrouter:tool_search server tool output item" }),
21522 Schema.Struct({
21523 "action": Schema.optionalKey(Schema.Literals(["read", "write", "delete"])),
21524 "id": Schema.optionalKey(Schema.String),
21525 "key": Schema.optionalKey(Schema.String),
21526 "status": Schema.Union([
21527 Schema.Literal("in_progress"),
21528 Schema.Literal("completed"),
21529 Schema.Literal("incomplete")
21530 ]),
21531 "type": Schema.Never,
21532 "value": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
21533 "arguments": Schema.String,
21534 "call_id": Schema.String,
21535 "name": Schema.String,
21536 "namespace": Schema.optionalKey(
21537 Schema.String.annotate({
21538 "description":
21539 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21540 })
21541 )
21542 }).annotate({ "description": "An openrouter:memory server tool output item" }),
21543 Schema.Struct({
21544 "id": Schema.optionalKey(Schema.String),
21545 "serverLabel": Schema.optionalKey(Schema.String),
21546 "status": Schema.Union([
21547 Schema.Literal("in_progress"),
21548 Schema.Literal("completed"),
21549 Schema.Literal("incomplete")
21550 ]),
21551 "toolName": Schema.optionalKey(Schema.String),
21552 "type": Schema.Never,
21553 "arguments": Schema.String,
21554 "call_id": Schema.String,
21555 "name": Schema.String,
21556 "namespace": Schema.optionalKey(
21557 Schema.String.annotate({
21558 "description":
21559 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21560 })
21561 )
21562 }).annotate({ "description": "An openrouter:mcp server tool output item" }),
21563 Schema.Struct({
21564 "arguments": Schema.String.annotate({
21565 "description": "The JSON arguments submitted to the search tool (e.g. {\"query\":\"Claude\"})"
21566 }),
21567 "id": Schema.optionalKey(Schema.String),
21568 "query": Schema.optionalKey(Schema.String),
21569 "status": Schema.Union([
21570 Schema.Literal("in_progress"),
21571 Schema.Literal("completed"),
21572 Schema.Literal("incomplete")
21573 ]),
21574 "type": Schema.Never,
21575 "call_id": Schema.String,
21576 "name": Schema.String,
21577 "namespace": Schema.optionalKey(
21578 Schema.String.annotate({
21579 "description":
21580 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21581 })
21582 )
21583 }).annotate({ "description": "An openrouter:experimental__search_models server tool output item" }),
21584 Schema.Struct({
21585 "analysis": Schema.optionalKey(FusionAnalysisResult),
21586 "error": Schema.optionalKey(
21587 Schema.String.annotate({
21588 "description": "Error message when the fusion run did not produce an analysis result."
21589 })
21590 ),
21591 "failed_models": Schema.optionalKey(
21592 Schema.Array(Schema.Struct({
21593 "error": Schema.String.annotate({ "description": "Error message describing why the model failed." }),
21594 "model": Schema.String.annotate({ "description": "Slug of the analysis model that failed." }),
21595 "status_code": Schema.optionalKey(
21596 Schema.Number.annotate({
21597 "description": "HTTP status code from the upstream response, when available (e.g. 402, 429)."
21598 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
21599 )
21600 })).annotate({
21601 "description":
21602 "Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel."
21603 })
21604 ),
21605 "failure_reason": Schema.optionalKey(
21606 Schema.String.annotate({
21607 "description":
21608 "Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion."
21609 })
21610 ),
21611 "id": Schema.optionalKey(Schema.String),
21612 "responses": Schema.optionalKey(
21613 Schema.Array(Schema.Struct({ "content": Schema.optionalKey(Schema.String), "model": Schema.String }))
21614 .annotate({
21615 "description":
21616 "Analysis models that produced a response in this fusion run, with each model's full panel content."
21617 })
21618 ),
21619 "sources": Schema.optionalKey(
21620 Schema.Array(FusionSource).annotate({
21621 "description":
21622 "Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source."
21623 })
21624 ),
21625 "status": Schema.Union([
21626 Schema.Literal("in_progress"),
21627 Schema.Literal("completed"),
21628 Schema.Literal("incomplete")
21629 ]),
21630 "type": Schema.Never,
21631 "arguments": Schema.String,
21632 "call_id": Schema.String,
21633 "name": Schema.String,
21634 "namespace": Schema.optionalKey(
21635 Schema.String.annotate({
21636 "description":
21637 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21638 })
21639 )
21640 }).annotate({ "description": "An openrouter:fusion server tool output item" }),
21641 Schema.Struct({
21642 "advice": Schema.optionalKey(
21643 Schema.String.annotate({
21644 "description": "The advisor model's response (the advice text returned to the executor)."
21645 })
21646 ),
21647 "error": Schema.optionalKey(
21648 Schema.String.annotate({ "description": "Error message when the advisor call did not produce advice." })
21649 ),
21650 "id": Schema.optionalKey(Schema.String),
21651 "instance_name": Schema.optionalKey(Schema.String.annotate({
21652 "description":
21653 "Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance."
21654 })),
21655 "model": Schema.optionalKey(
21656 Schema.String.annotate({ "description": "Slug of the advisor model that was consulted." })
21657 ),
21658 "prompt": Schema.optionalKey(
21659 Schema.String.annotate({ "description": "The prompt the executor sent to the advisor." })
21660 ),
21661 "status": Schema.Union([
21662 Schema.Literal("in_progress"),
21663 Schema.Literal("completed"),
21664 Schema.Literal("incomplete")
21665 ]),
21666 "type": Schema.Never,
21667 "arguments": Schema.String,
21668 "call_id": Schema.String,
21669 "name": Schema.String,
21670 "namespace": Schema.optionalKey(
21671 Schema.String.annotate({
21672 "description":
21673 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21674 })
21675 )
21676 }).annotate({ "description": "An openrouter:advisor server tool output item" }),
21677 Schema.Struct({
21678 "error": Schema.optionalKey(
21679 Schema.String.annotate({ "description": "Error message when the subagent task did not produce an outcome." })
21680 ),
21681 "id": Schema.optionalKey(Schema.String),
21682 "instance_name": Schema.optionalKey(Schema.String.annotate({
21683 "description":
21684 "Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation."
21685 })),
21686 "model": Schema.optionalKey(
21687 Schema.String.annotate({ "description": "Slug of the worker model that executed the task." })
21688 ),
21689 "name": Schema.String.annotate({
21690 "description":
21691 "Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent."
21692 }),
21693 "outcome": Schema.optionalKey(
21694 Schema.String.annotate({
21695 "description": "The worker model's result (the outcome text returned to the delegating model)."
21696 })
21697 ),
21698 "status": Schema.Union([
21699 Schema.Literal("in_progress"),
21700 Schema.Literal("completed"),
21701 Schema.Literal("incomplete")
21702 ]),
21703 "task_description": Schema.optionalKey(
21704 Schema.String.annotate({ "description": "The task description the delegating model sent to the worker." })
21705 ),
21706 "task_name": Schema.optionalKey(
21707 Schema.String.annotate({ "description": "The short task identifier the delegating model supplied." })
21708 ),
21709 "type": Schema.Never,
21710 "arguments": Schema.String,
21711 "call_id": Schema.String,
21712 "namespace": Schema.optionalKey(
21713 Schema.String.annotate({
21714 "description":
21715 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21716 })
21717 )
21718 }).annotate({ "description": "An openrouter:subagent server tool output item" }),
21719 Schema.Struct({
21720 "error": Schema.optionalKey(
21721 Schema.String.annotate({ "description": "Error message when the file operation failed." })
21722 ),
21723 "file_id": Schema.optionalKey(
21724 Schema.String.annotate({ "description": "The target file id supplied in the tool-call arguments." })
21725 ),
21726 "filename": Schema.optionalKey(
21727 Schema.String.annotate({ "description": "The target filename supplied in the tool-call arguments." })
21728 ),
21729 "id": Schema.optionalKey(Schema.String),
21730 "operation": Schema.optionalKey(
21731 Schema.String.annotate({ "description": "The file operation performed (list, read, write, or edit)." })
21732 ),
21733 "result": Schema.optionalKey(
21734 Schema.String.annotate({ "description": "JSON-serialized result of the file operation." })
21735 ),
21736 "status": Schema.Union([
21737 Schema.Literal("in_progress"),
21738 Schema.Literal("completed"),
21739 Schema.Literal("incomplete")
21740 ]),
21741 "type": Schema.Never,
21742 "arguments": Schema.String,
21743 "call_id": Schema.String,
21744 "name": Schema.String,
21745 "namespace": Schema.optionalKey(
21746 Schema.String.annotate({
21747 "description":
21748 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21749 })
21750 )
21751 }).annotate({ "description": "An openrouter:files server tool output item" }),
21752 Schema.Struct({
21753 "call_id": Schema.String,
21754 "id": Schema.optionalKey(Schema.String),
21755 "input": Schema.String,
21756 "name": Schema.String,
21757 "namespace": Schema.optionalKey(
21758 Schema.String.annotate({
21759 "description":
21760 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21761 })
21762 ),
21763 "type": Schema.Never,
21764 "arguments": Schema.String,
21765 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"]))
21766 }).annotate({
21767 "description":
21768 "A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments."
21769 })
21770 ], { mode: "oneOf" }).annotate({ "description": "An output item from the response" }),
21771 Schema.Union([
21772 Schema.Struct({
21773 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
21774 "id": Schema.String,
21775 "phase": Schema.optionalKey(
21776 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
21777 "description":
21778 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
21779 })
21780 ),
21781 "role": Schema.Literal("assistant"),
21782 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
21783 "type": Schema.Never,
21784 "call_id": Schema.String,
21785 "input": Schema.String,
21786 "name": Schema.String,
21787 "namespace": Schema.optionalKey(
21788 Schema.String.annotate({
21789 "description":
21790 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21791 })
21792 )
21793 }).annotate({ "description": "An output message item" }),
21794 Schema.Struct({
21795 "content": Schema.optionalKey(
21796 Schema.Union([
21797 Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("reasoning_text") }))
21798 ])
21799 ),
21800 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
21801 "id": Schema.String,
21802 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
21803 "summary": Schema.Array(ReasoningSummaryText),
21804 "type": Schema.Never,
21805 "format": Schema.optionalKey(ReasoningFormat),
21806 "signature": Schema.optionalKey(
21807 Schema.Union([Schema.String, Schema.Null]).annotate({
21808 "description": "A signature for the reasoning content, used for verification"
21809 })
21810 ),
21811 "call_id": Schema.String,
21812 "input": Schema.String,
21813 "name": Schema.String,
21814 "namespace": Schema.optionalKey(
21815 Schema.String.annotate({
21816 "description":
21817 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21818 })
21819 )
21820 }).annotate({ "description": "An output item containing reasoning" }),
21821 Schema.Struct({
21822 "arguments": Schema.String,
21823 "call_id": Schema.String,
21824 "id": Schema.optionalKey(Schema.String),
21825 "name": Schema.String,
21826 "namespace": Schema.optionalKey(
21827 Schema.String.annotate({
21828 "description":
21829 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21830 })
21831 ),
21832 "status": Schema.optionalKey(Schema.Literals(["completed", "incomplete", "in_progress"])),
21833 "type": Schema.Never,
21834 "input": Schema.String
21835 }),
21836 Schema.Struct({
21837 "action": Schema.optionalKey(
21838 Schema.Union([
21839 Schema.Struct({
21840 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
21841 "query": Schema.String,
21842 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
21843 "type": Schema.Literal("search")
21844 }),
21845 Schema.Struct({
21846 "type": Schema.Literal("open_page"),
21847 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
21848 }),
21849 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
21850 ], { mode: "oneOf" })
21851 ),
21852 "id": Schema.String,
21853 "status": WebSearchStatus,
21854 "type": Schema.Never,
21855 "call_id": Schema.String,
21856 "input": Schema.String,
21857 "name": Schema.String,
21858 "namespace": Schema.optionalKey(
21859 Schema.String.annotate({
21860 "description":
21861 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21862 })
21863 )
21864 }),
21865 Schema.Struct({
21866 "id": Schema.String,
21867 "queries": Schema.Array(Schema.String),
21868 "status": WebSearchStatus,
21869 "type": Schema.Never,
21870 "call_id": Schema.String,
21871 "input": Schema.String,
21872 "name": Schema.String,
21873 "namespace": Schema.optionalKey(
21874 Schema.String.annotate({
21875 "description":
21876 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21877 })
21878 )
21879 }),
21880 Schema.Struct({
21881 "id": Schema.String,
21882 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
21883 "status": ImageGenerationStatus,
21884 "type": Schema.Never,
21885 "prompt": Schema.optionalKey(
21886 Schema.String.annotate({
21887 "description": "The prompt (possibly rewritten) that the image was generated from."
21888 })
21889 ),
21890 "call_id": Schema.String,
21891 "input": Schema.String,
21892 "name": Schema.String,
21893 "namespace": Schema.optionalKey(
21894 Schema.String.annotate({
21895 "description":
21896 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21897 })
21898 )
21899 }),
21900 Schema.Struct({
21901 "code": Schema.Union([Schema.String, Schema.Null]),
21902 "container_id": Schema.String,
21903 "id": Schema.String,
21904 "outputs": Schema.Union([
21905 Schema.Array(
21906 Schema.Union([
21907 Schema.Struct({ "type": Schema.Literal("image"), "url": Schema.String }),
21908 Schema.Struct({ "logs": Schema.String, "type": Schema.Literal("logs") })
21909 ])
21910 ),
21911 Schema.Null
21912 ]),
21913 "status": ToolCallStatus,
21914 "type": Schema.Never,
21915 "call_id": Schema.String,
21916 "input": Schema.String,
21917 "name": Schema.String,
21918 "namespace": Schema.optionalKey(
21919 Schema.String.annotate({
21920 "description":
21921 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21922 })
21923 )
21924 }).annotate({ "description": "A code interpreter execution call with outputs" }),
21925 Schema.Struct({
21926 "action": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
21927 "call_id": Schema.String,
21928 "id": Schema.optionalKey(Schema.String),
21929 "pending_safety_checks": Schema.Array(
21930 Schema.Struct({ "code": Schema.String, "id": Schema.String, "message": Schema.String })
21931 ),
21932 "status": Schema.Literals(["completed", "incomplete", "in_progress"]),
21933 "type": Schema.Never,
21934 "input": Schema.String,
21935 "name": Schema.String,
21936 "namespace": Schema.optionalKey(
21937 Schema.String.annotate({
21938 "description":
21939 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21940 })
21941 )
21942 }),
21943 Schema.Struct({
21944 "datetime": Schema.String.annotate({ "description": "ISO 8601 datetime string" }),
21945 "id": Schema.optionalKey(Schema.String),
21946 "status": ToolCallStatus,
21947 "timezone": Schema.String.annotate({ "description": "IANA timezone name" }),
21948 "type": Schema.Never,
21949 "call_id": Schema.String,
21950 "input": Schema.String,
21951 "name": Schema.String,
21952 "namespace": Schema.optionalKey(
21953 Schema.String.annotate({
21954 "description":
21955 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21956 })
21957 )
21958 }).annotate({ "description": "An openrouter:datetime server tool output item" }),
21959 Schema.Struct({
21960 "action": Schema.optionalKey(
21961 Schema.Struct({
21962 "query": Schema.String,
21963 "sources": Schema.optionalKey(
21964 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
21965 ),
21966 "type": Schema.Literal("search")
21967 }).annotate({
21968 "description":
21969 "The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider."
21970 })
21971 ),
21972 "id": Schema.optionalKey(Schema.String),
21973 "status": ToolCallStatus,
21974 "type": Schema.Never,
21975 "call_id": Schema.String,
21976 "input": Schema.String,
21977 "name": Schema.String,
21978 "namespace": Schema.optionalKey(
21979 Schema.String.annotate({
21980 "description":
21981 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
21982 })
21983 )
21984 }).annotate({ "description": "An openrouter:web_search server tool output item" }),
21985 Schema.Struct({
21986 "code": Schema.optionalKey(Schema.String),
21987 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
21988 "id": Schema.optionalKey(Schema.String),
21989 "language": Schema.optionalKey(Schema.String),
21990 "status": ToolCallStatus,
21991 "stderr": Schema.optionalKey(Schema.String),
21992 "stdout": Schema.optionalKey(Schema.String),
21993 "type": Schema.Never,
21994 "call_id": Schema.String,
21995 "input": Schema.String,
21996 "name": Schema.String,
21997 "namespace": Schema.optionalKey(
21998 Schema.String.annotate({
21999 "description":
22000 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22001 })
22002 )
22003 }).annotate({ "description": "An openrouter:code_interpreter server tool output item" }),
22004 Schema.Struct({
22005 "id": Schema.optionalKey(Schema.String),
22006 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22007 "status": ToolCallStatus,
22008 "type": Schema.Never,
22009 "call_id": Schema.String,
22010 "input": Schema.String,
22011 "name": Schema.String,
22012 "namespace": Schema.optionalKey(
22013 Schema.String.annotate({
22014 "description":
22015 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22016 })
22017 )
22018 }).annotate({ "description": "An openrouter:file_search server tool output item" }),
22019 Schema.Struct({
22020 "id": Schema.optionalKey(Schema.String),
22021 "imageB64": Schema.optionalKey(Schema.String),
22022 "imageUrl": Schema.optionalKey(Schema.String),
22023 "prompt": Schema.optionalKey(
22024 Schema.String.annotate({
22025 "description": "The prompt (possibly rewritten) that the image was generated from."
22026 })
22027 ),
22028 "result": Schema.optionalKey(
22029 Schema.Union([Schema.String, Schema.Null]).annotate({
22030 "description":
22031 "The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format"
22032 })
22033 ),
22034 "revisedPrompt": Schema.optionalKey(Schema.String),
22035 "status": ToolCallStatus,
22036 "type": Schema.Never,
22037 "call_id": Schema.String,
22038 "input": Schema.String,
22039 "name": Schema.String,
22040 "namespace": Schema.optionalKey(
22041 Schema.String.annotate({
22042 "description":
22043 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22044 })
22045 )
22046 }).annotate({ "description": "An openrouter:image_generation server tool output item" }),
22047 Schema.Struct({
22048 "action": Schema.optionalKey(Schema.String),
22049 "id": Schema.optionalKey(Schema.String),
22050 "screenshotB64": Schema.optionalKey(Schema.String),
22051 "status": ToolCallStatus,
22052 "type": Schema.Never,
22053 "call_id": Schema.String,
22054 "input": Schema.String,
22055 "name": Schema.String,
22056 "namespace": Schema.optionalKey(
22057 Schema.String.annotate({
22058 "description":
22059 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22060 })
22061 )
22062 }).annotate({ "description": "An openrouter:browser_use server tool output item" }),
22063 Schema.Struct({
22064 "arguments": Schema.optionalKey(
22065 Schema.String.annotate({ "description": "The raw tool-call arguments string as emitted by the model." })
22066 ),
22067 "call_id": Schema.String.annotate({
22068 "description": "The model-generated tool call id from the originating turn."
22069 }),
22070 "command": Schema.optionalKey(Schema.String),
22071 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
22072 "id": Schema.optionalKey(Schema.String),
22073 "status": ToolCallStatus,
22074 "stderr": Schema.optionalKey(Schema.String),
22075 "stdout": Schema.optionalKey(Schema.String),
22076 "type": Schema.Never,
22077 "input": Schema.String,
22078 "name": Schema.String,
22079 "namespace": Schema.optionalKey(
22080 Schema.String.annotate({
22081 "description":
22082 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22083 })
22084 )
22085 }).annotate({ "description": "An openrouter:bash server tool output item" }),
22086 Schema.Struct({
22087 "command": Schema.optionalKey(Schema.Literals(["view", "create", "str_replace", "insert"])),
22088 "filePath": Schema.optionalKey(Schema.String),
22089 "id": Schema.optionalKey(Schema.String),
22090 "status": ToolCallStatus,
22091 "type": Schema.Never,
22092 "call_id": Schema.String,
22093 "input": Schema.String,
22094 "name": Schema.String,
22095 "namespace": Schema.optionalKey(
22096 Schema.String.annotate({
22097 "description":
22098 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22099 })
22100 )
22101 }).annotate({ "description": "An openrouter:text_editor server tool output item" }),
22102 Schema.Struct({
22103 "call_id": Schema.String,
22104 "id": Schema.optionalKey(Schema.String),
22105 "operation": Schema.optionalKey(ApplyPatchCallOperation),
22106 "status": ToolCallStatus,
22107 "type": Schema.Never,
22108 "input": Schema.String,
22109 "name": Schema.String,
22110 "namespace": Schema.optionalKey(
22111 Schema.String.annotate({
22112 "description":
22113 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22114 })
22115 )
22116 }).annotate({
22117 "description":
22118 "An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn."
22119 }),
22120 Schema.Struct({
22121 "call_id": Schema.String,
22122 "id": Schema.String,
22123 "operation": ApplyPatchCallOperation,
22124 "status": ApplyPatchCallStatus,
22125 "type": Schema.Never,
22126 "input": Schema.String,
22127 "name": Schema.String,
22128 "namespace": Schema.optionalKey(
22129 Schema.String.annotate({
22130 "description":
22131 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22132 })
22133 )
22134 }).annotate({
22135 "description":
22136 "A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand."
22137 }),
22138 Schema.Struct({
22139 "action": Schema.optionalKey(Schema.Struct({
22140 "commands": Schema.Array(Schema.String),
22141 "max_output_length": Schema.Union([
22142 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
22143 Schema.Null
22144 ]),
22145 "timeout_ms": Schema.Union([
22146 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
22147 Schema.Null
22148 ])
22149 })),
22150 "call_id": Schema.String,
22151 "id": Schema.String,
22152 "status": ShellCallStatus,
22153 "type": Schema.Never,
22154 "input": Schema.String,
22155 "name": Schema.String,
22156 "namespace": Schema.optionalKey(
22157 Schema.String.annotate({
22158 "description":
22159 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22160 })
22161 )
22162 }).annotate({
22163 "description":
22164 "A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool."
22165 }),
22166 Schema.Struct({
22167 "call_id": Schema.String,
22168 "id": Schema.String,
22169 "max_output_length": Schema.optionalKey(
22170 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
22171 ),
22172 "output": Schema.Array(Schema.Struct({
22173 "outcome": Schema.Union([
22174 Schema.Struct({
22175 "exit_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
22176 "type": Schema.Literal("exit")
22177 }),
22178 Schema.Struct({ "type": Schema.Literal("timeout") })
22179 ], { mode: "oneOf" }),
22180 "stderr": Schema.String,
22181 "stdout": Schema.String
22182 })),
22183 "status": ShellCallStatus,
22184 "type": Schema.Never,
22185 "input": Schema.String,
22186 "name": Schema.String,
22187 "namespace": Schema.optionalKey(
22188 Schema.String.annotate({
22189 "description":
22190 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22191 })
22192 )
22193 }).annotate({
22194 "description":
22195 "A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome."
22196 }),
22197 Schema.Struct({
22198 "content": Schema.optionalKey(Schema.String),
22199 "error": Schema.optionalKey(
22200 Schema.String.annotate({ "description": "The error message if the fetch failed." })
22201 ),
22202 "httpStatus": Schema.optionalKey(
22203 Schema.Number.annotate({ "description": "The HTTP status code returned by the upstream URL fetch." }).check(
22204 Schema.isInt().annotate({ "expected": "an integer" })
22205 )
22206 ),
22207 "id": Schema.optionalKey(Schema.String),
22208 "status": ToolCallStatus,
22209 "title": Schema.optionalKey(Schema.String),
22210 "type": Schema.Never,
22211 "url": Schema.optionalKey(Schema.String),
22212 "call_id": Schema.String,
22213 "input": Schema.String,
22214 "name": Schema.String,
22215 "namespace": Schema.optionalKey(
22216 Schema.String.annotate({
22217 "description":
22218 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22219 })
22220 )
22221 }).annotate({ "description": "An openrouter:web_fetch server tool output item" }),
22222 Schema.Struct({
22223 "id": Schema.optionalKey(Schema.String),
22224 "query": Schema.optionalKey(Schema.String),
22225 "status": ToolCallStatus,
22226 "type": Schema.Never,
22227 "call_id": Schema.String,
22228 "input": Schema.String,
22229 "name": Schema.String,
22230 "namespace": Schema.optionalKey(
22231 Schema.String.annotate({
22232 "description":
22233 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22234 })
22235 )
22236 }).annotate({ "description": "An openrouter:tool_search server tool output item" }),
22237 Schema.Struct({
22238 "action": Schema.optionalKey(Schema.Literals(["read", "write", "delete"])),
22239 "id": Schema.optionalKey(Schema.String),
22240 "key": Schema.optionalKey(Schema.String),
22241 "status": ToolCallStatus,
22242 "type": Schema.Never,
22243 "value": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
22244 "call_id": Schema.String,
22245 "input": Schema.String,
22246 "name": Schema.String,
22247 "namespace": Schema.optionalKey(
22248 Schema.String.annotate({
22249 "description":
22250 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22251 })
22252 )
22253 }).annotate({ "description": "An openrouter:memory server tool output item" }),
22254 Schema.Struct({
22255 "id": Schema.optionalKey(Schema.String),
22256 "serverLabel": Schema.optionalKey(Schema.String),
22257 "status": ToolCallStatus,
22258 "toolName": Schema.optionalKey(Schema.String),
22259 "type": Schema.Never,
22260 "call_id": Schema.String,
22261 "input": Schema.String,
22262 "name": Schema.String,
22263 "namespace": Schema.optionalKey(
22264 Schema.String.annotate({
22265 "description":
22266 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22267 })
22268 )
22269 }).annotate({ "description": "An openrouter:mcp server tool output item" }),
22270 Schema.Struct({
22271 "arguments": Schema.optionalKey(
22272 Schema.String.annotate({
22273 "description": "The JSON arguments submitted to the search tool (e.g. {\"query\":\"Claude\"})"
22274 })
22275 ),
22276 "id": Schema.optionalKey(Schema.String),
22277 "query": Schema.optionalKey(Schema.String),
22278 "status": ToolCallStatus,
22279 "type": Schema.Never,
22280 "call_id": Schema.String,
22281 "input": Schema.String,
22282 "name": Schema.String,
22283 "namespace": Schema.optionalKey(
22284 Schema.String.annotate({
22285 "description":
22286 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22287 })
22288 )
22289 }).annotate({ "description": "An openrouter:experimental__search_models server tool output item" }),
22290 Schema.Struct({
22291 "analysis": Schema.optionalKey(FusionAnalysisResult),
22292 "error": Schema.optionalKey(
22293 Schema.String.annotate({
22294 "description": "Error message when the fusion run did not produce an analysis result."
22295 })
22296 ),
22297 "failed_models": Schema.optionalKey(
22298 Schema.Array(Schema.Struct({
22299 "error": Schema.String.annotate({ "description": "Error message describing why the model failed." }),
22300 "model": Schema.String.annotate({ "description": "Slug of the analysis model that failed." }),
22301 "status_code": Schema.optionalKey(
22302 Schema.Number.annotate({
22303 "description": "HTTP status code from the upstream response, when available (e.g. 402, 429)."
22304 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
22305 )
22306 })).annotate({
22307 "description":
22308 "Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel."
22309 })
22310 ),
22311 "failure_reason": Schema.optionalKey(
22312 Schema.String.annotate({
22313 "description":
22314 "Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion."
22315 })
22316 ),
22317 "id": Schema.optionalKey(Schema.String),
22318 "responses": Schema.optionalKey(
22319 Schema.Array(Schema.Struct({ "content": Schema.optionalKey(Schema.String), "model": Schema.String }))
22320 .annotate({
22321 "description":
22322 "Analysis models that produced a response in this fusion run, with each model's full panel content."
22323 })
22324 ),
22325 "sources": Schema.optionalKey(
22326 Schema.Array(FusionSource).annotate({
22327 "description":
22328 "Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source."
22329 })
22330 ),
22331 "status": ToolCallStatus,
22332 "type": Schema.Never,
22333 "call_id": Schema.String,
22334 "input": Schema.String,
22335 "name": Schema.String,
22336 "namespace": Schema.optionalKey(
22337 Schema.String.annotate({
22338 "description":
22339 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22340 })
22341 )
22342 }).annotate({ "description": "An openrouter:fusion server tool output item" }),
22343 Schema.Struct({
22344 "advice": Schema.optionalKey(
22345 Schema.String.annotate({
22346 "description": "The advisor model's response (the advice text returned to the executor)."
22347 })
22348 ),
22349 "error": Schema.optionalKey(
22350 Schema.String.annotate({ "description": "Error message when the advisor call did not produce advice." })
22351 ),
22352 "id": Schema.optionalKey(Schema.String),
22353 "instance_name": Schema.optionalKey(Schema.String.annotate({
22354 "description":
22355 "Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance."
22356 })),
22357 "model": Schema.optionalKey(
22358 Schema.String.annotate({ "description": "Slug of the advisor model that was consulted." })
22359 ),
22360 "prompt": Schema.optionalKey(
22361 Schema.String.annotate({ "description": "The prompt the executor sent to the advisor." })
22362 ),
22363 "status": ToolCallStatus,
22364 "type": Schema.Never,
22365 "call_id": Schema.String,
22366 "input": Schema.String,
22367 "name": Schema.String,
22368 "namespace": Schema.optionalKey(
22369 Schema.String.annotate({
22370 "description":
22371 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22372 })
22373 )
22374 }).annotate({ "description": "An openrouter:advisor server tool output item" }),
22375 Schema.Struct({
22376 "error": Schema.optionalKey(
22377 Schema.String.annotate({ "description": "Error message when the subagent task did not produce an outcome." })
22378 ),
22379 "id": Schema.optionalKey(Schema.String),
22380 "instance_name": Schema.optionalKey(Schema.String.annotate({
22381 "description":
22382 "Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation."
22383 })),
22384 "model": Schema.optionalKey(
22385 Schema.String.annotate({ "description": "Slug of the worker model that executed the task." })
22386 ),
22387 "name": Schema.String.annotate({
22388 "description":
22389 "Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent."
22390 }),
22391 "outcome": Schema.optionalKey(
22392 Schema.String.annotate({
22393 "description": "The worker model's result (the outcome text returned to the delegating model)."
22394 })
22395 ),
22396 "status": ToolCallStatus,
22397 "task_description": Schema.optionalKey(
22398 Schema.String.annotate({ "description": "The task description the delegating model sent to the worker." })
22399 ),
22400 "task_name": Schema.optionalKey(
22401 Schema.String.annotate({ "description": "The short task identifier the delegating model supplied." })
22402 ),
22403 "type": Schema.Never,
22404 "call_id": Schema.String,
22405 "input": Schema.String,
22406 "namespace": Schema.optionalKey(
22407 Schema.String.annotate({
22408 "description":
22409 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22410 })
22411 )
22412 }).annotate({ "description": "An openrouter:subagent server tool output item" }),
22413 Schema.Struct({
22414 "error": Schema.optionalKey(
22415 Schema.String.annotate({ "description": "Error message when the file operation failed." })
22416 ),
22417 "file_id": Schema.optionalKey(
22418 Schema.String.annotate({ "description": "The target file id supplied in the tool-call arguments." })
22419 ),
22420 "filename": Schema.optionalKey(
22421 Schema.String.annotate({ "description": "The target filename supplied in the tool-call arguments." })
22422 ),
22423 "id": Schema.optionalKey(Schema.String),
22424 "operation": Schema.optionalKey(
22425 Schema.String.annotate({ "description": "The file operation performed (list, read, write, or edit)." })
22426 ),
22427 "result": Schema.optionalKey(
22428 Schema.String.annotate({ "description": "JSON-serialized result of the file operation." })
22429 ),
22430 "status": ToolCallStatus,
22431 "type": Schema.Never,
22432 "call_id": Schema.String,
22433 "input": Schema.String,
22434 "name": Schema.String,
22435 "namespace": Schema.optionalKey(
22436 Schema.String.annotate({
22437 "description":
22438 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22439 })
22440 )
22441 }).annotate({ "description": "An openrouter:files server tool output item" }),
22442 Schema.Struct({
22443 "call_id": Schema.String,
22444 "id": Schema.optionalKey(Schema.String),
22445 "input": Schema.String,
22446 "name": Schema.String,
22447 "namespace": Schema.optionalKey(
22448 Schema.String.annotate({
22449 "description":
22450 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22451 })
22452 ),
22453 "type": Schema.Literal("custom_tool_call")
22454 }).annotate({
22455 "description":
22456 "A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments."
22457 })
22458 ], { mode: "oneOf" }).annotate({ "description": "An output item from the response" }),
22459 Schema.Union([
22460 Schema.Struct({
22461 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
22462 "id": Schema.String,
22463 "phase": Schema.optionalKey(
22464 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
22465 "description":
22466 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
22467 })
22468 ),
22469 "role": Schema.Literal("assistant"),
22470 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
22471 "type": Schema.Never,
22472 "action": Schema.optionalKey(
22473 Schema.Union([
22474 Schema.Struct({
22475 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22476 "query": Schema.String,
22477 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22478 "type": Schema.Literal("search")
22479 }),
22480 Schema.Struct({
22481 "type": Schema.Literal("open_page"),
22482 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22483 }),
22484 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22485 ], { mode: "oneOf" })
22486 )
22487 }).annotate({ "description": "An output message item" }),
22488 Schema.Struct({
22489 "content": Schema.optionalKey(
22490 Schema.Union([
22491 Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("reasoning_text") }))
22492 ])
22493 ),
22494 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
22495 "id": Schema.String,
22496 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
22497 "summary": Schema.Array(ReasoningSummaryText),
22498 "type": Schema.Never,
22499 "format": Schema.optionalKey(ReasoningFormat),
22500 "signature": Schema.optionalKey(
22501 Schema.Union([Schema.String, Schema.Null]).annotate({
22502 "description": "A signature for the reasoning content, used for verification"
22503 })
22504 ),
22505 "action": Schema.optionalKey(
22506 Schema.Union([
22507 Schema.Struct({
22508 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22509 "query": Schema.String,
22510 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22511 "type": Schema.Literal("search")
22512 }),
22513 Schema.Struct({
22514 "type": Schema.Literal("open_page"),
22515 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22516 }),
22517 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22518 ], { mode: "oneOf" })
22519 )
22520 }).annotate({ "description": "An output item containing reasoning" }),
22521 Schema.Struct({
22522 "arguments": Schema.String,
22523 "call_id": Schema.String,
22524 "id": Schema.String,
22525 "name": Schema.String,
22526 "namespace": Schema.optionalKey(
22527 Schema.String.annotate({
22528 "description":
22529 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
22530 })
22531 ),
22532 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
22533 "type": Schema.Never,
22534 "action": Schema.optionalKey(
22535 Schema.Union([
22536 Schema.Struct({
22537 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22538 "query": Schema.String,
22539 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22540 "type": Schema.Literal("search")
22541 }),
22542 Schema.Struct({
22543 "type": Schema.Literal("open_page"),
22544 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22545 }),
22546 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22547 ], { mode: "oneOf" })
22548 )
22549 }),
22550 Schema.Struct({
22551 "action": Schema.optionalKey(
22552 Schema.Union([
22553 Schema.Union([
22554 Schema.Struct({
22555 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22556 "query": Schema.String,
22557 "sources": Schema.optionalKey(
22558 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
22559 ),
22560 "type": Schema.Literal("search")
22561 }),
22562 Schema.Struct({
22563 "type": Schema.Never,
22564 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
22565 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22566 "query": Schema.String,
22567 "sources": Schema.optionalKey(Schema.Array(WebSearchSource))
22568 }),
22569 Schema.Struct({
22570 "pattern": Schema.String,
22571 "type": Schema.Never,
22572 "url": Schema.String,
22573 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22574 "query": Schema.String,
22575 "sources": Schema.optionalKey(Schema.Array(WebSearchSource))
22576 })
22577 ], { mode: "oneOf" }),
22578 Schema.Union([
22579 Schema.Struct({
22580 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22581 "query": Schema.String,
22582 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22583 "type": Schema.Never,
22584 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22585 }),
22586 Schema.Struct({
22587 "type": Schema.Literal("open_page"),
22588 "url": Schema.optionalKey(Schema.Union([Schema.Union([Schema.String]), Schema.Union([Schema.Null])]))
22589 }),
22590 Schema.Struct({ "pattern": Schema.String, "type": Schema.Never, "url": Schema.Union([Schema.String]) })
22591 ], { mode: "oneOf" }),
22592 Schema.Union([
22593 Schema.Struct({
22594 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22595 "query": Schema.String,
22596 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22597 "type": Schema.Never,
22598 "pattern": Schema.String,
22599 "url": Schema.String
22600 }),
22601 Schema.Struct({ "type": Schema.Never, "url": Schema.Union([Schema.String]), "pattern": Schema.String }),
22602 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22603 ], { mode: "oneOf" })
22604 ], { mode: "oneOf" })
22605 ),
22606 "id": Schema.String,
22607 "status": Schema.Union([
22608 Schema.Literal("completed"),
22609 Schema.Literal("searching"),
22610 Schema.Literal("in_progress"),
22611 Schema.Literal("failed")
22612 ]),
22613 "type": Schema.Literal("web_search_call")
22614 }),
22615 Schema.Struct({
22616 "id": Schema.String,
22617 "queries": Schema.Array(Schema.String),
22618 "status": Schema.Union([
22619 Schema.Literal("completed"),
22620 Schema.Literal("searching"),
22621 Schema.Literal("in_progress"),
22622 Schema.Literal("failed")
22623 ]),
22624 "type": Schema.Never,
22625 "action": Schema.optionalKey(
22626 Schema.Union([
22627 Schema.Struct({
22628 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22629 "query": Schema.String,
22630 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22631 "type": Schema.Literal("search")
22632 }),
22633 Schema.Struct({
22634 "type": Schema.Literal("open_page"),
22635 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22636 }),
22637 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22638 ], { mode: "oneOf" })
22639 )
22640 }),
22641 Schema.Struct({
22642 "id": Schema.String,
22643 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
22644 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed"), Schema.Literal("failed")]),
22645 "type": Schema.Never,
22646 "prompt": Schema.optionalKey(
22647 Schema.String.annotate({
22648 "description": "The prompt (possibly rewritten) that the image was generated from."
22649 })
22650 ),
22651 "action": Schema.optionalKey(
22652 Schema.Union([
22653 Schema.Struct({
22654 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22655 "query": Schema.String,
22656 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22657 "type": Schema.Literal("search")
22658 }),
22659 Schema.Struct({
22660 "type": Schema.Literal("open_page"),
22661 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22662 }),
22663 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22664 ], { mode: "oneOf" })
22665 )
22666 }),
22667 Schema.Struct({
22668 "code": Schema.Union([Schema.String, Schema.Null]),
22669 "container_id": Schema.String,
22670 "id": Schema.String,
22671 "outputs": Schema.Union([
22672 Schema.Array(
22673 Schema.Union([
22674 Schema.Struct({ "type": Schema.Literal("image"), "url": Schema.String }),
22675 Schema.Struct({ "logs": Schema.String, "type": Schema.Literal("logs") })
22676 ])
22677 ),
22678 Schema.Null
22679 ]),
22680 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
22681 "type": Schema.Never,
22682 "action": Schema.optionalKey(
22683 Schema.Union([
22684 Schema.Struct({
22685 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22686 "query": Schema.String,
22687 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22688 "type": Schema.Literal("search")
22689 }),
22690 Schema.Struct({
22691 "type": Schema.Literal("open_page"),
22692 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22693 }),
22694 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22695 ], { mode: "oneOf" })
22696 )
22697 }).annotate({ "description": "A code interpreter execution call with outputs" }),
22698 Schema.Struct({
22699 "action": Schema.optionalKey(
22700 Schema.Union([
22701 Schema.Struct({
22702 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22703 "query": Schema.String,
22704 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22705 "type": Schema.Literal("search")
22706 }),
22707 Schema.Struct({
22708 "type": Schema.Literal("open_page"),
22709 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22710 }),
22711 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22712 ], { mode: "oneOf" })
22713 ),
22714 "call_id": Schema.String,
22715 "id": Schema.String,
22716 "pending_safety_checks": Schema.Array(
22717 Schema.Struct({ "code": Schema.String, "id": Schema.String, "message": Schema.String })
22718 ),
22719 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
22720 "type": Schema.Never
22721 }),
22722 Schema.Struct({
22723 "datetime": Schema.String.annotate({ "description": "ISO 8601 datetime string" }),
22724 "id": Schema.String,
22725 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
22726 "timezone": Schema.String.annotate({ "description": "IANA timezone name" }),
22727 "type": Schema.Never,
22728 "action": Schema.optionalKey(
22729 Schema.Union([
22730 Schema.Struct({
22731 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22732 "query": Schema.String,
22733 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22734 "type": Schema.Literal("search")
22735 }),
22736 Schema.Struct({
22737 "type": Schema.Literal("open_page"),
22738 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22739 }),
22740 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22741 ], { mode: "oneOf" })
22742 )
22743 }).annotate({ "description": "An openrouter:datetime server tool output item" }),
22744 Schema.Struct({
22745 "action": Schema.optionalKey(
22746 Schema.Union([
22747 Schema.Struct({
22748 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22749 "query": Schema.String,
22750 "sources": Schema.optionalKey(
22751 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
22752 ),
22753 "type": Schema.Literal("search")
22754 }).annotate({
22755 "description":
22756 "The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider."
22757 }),
22758 Schema.Struct({
22759 "type": Schema.Never,
22760 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
22761 "query": Schema.String,
22762 "sources": Schema.optionalKey(
22763 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
22764 )
22765 }).annotate({
22766 "description":
22767 "The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider."
22768 }),
22769 Schema.Struct({
22770 "pattern": Schema.String,
22771 "type": Schema.Never,
22772 "url": Schema.String,
22773 "query": Schema.String,
22774 "sources": Schema.optionalKey(
22775 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
22776 )
22777 }).annotate({
22778 "description":
22779 "The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider."
22780 })
22781 ], { mode: "oneOf" })
22782 ),
22783 "id": Schema.String,
22784 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
22785 "type": Schema.Never
22786 }).annotate({ "description": "An openrouter:web_search server tool output item" }),
22787 Schema.Struct({
22788 "code": Schema.optionalKey(Schema.String),
22789 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
22790 "id": Schema.String,
22791 "language": Schema.optionalKey(Schema.String),
22792 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
22793 "stderr": Schema.optionalKey(Schema.String),
22794 "stdout": Schema.optionalKey(Schema.String),
22795 "type": Schema.Never,
22796 "action": Schema.optionalKey(
22797 Schema.Union([
22798 Schema.Struct({
22799 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22800 "query": Schema.String,
22801 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22802 "type": Schema.Literal("search")
22803 }),
22804 Schema.Struct({
22805 "type": Schema.Literal("open_page"),
22806 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22807 }),
22808 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22809 ], { mode: "oneOf" })
22810 )
22811 }).annotate({ "description": "An openrouter:code_interpreter server tool output item" }),
22812 Schema.Struct({
22813 "id": Schema.String,
22814 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22815 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
22816 "type": Schema.Never,
22817 "action": Schema.optionalKey(
22818 Schema.Union([
22819 Schema.Struct({
22820 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22821 "query": Schema.String,
22822 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22823 "type": Schema.Literal("search")
22824 }),
22825 Schema.Struct({
22826 "type": Schema.Literal("open_page"),
22827 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22828 }),
22829 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22830 ], { mode: "oneOf" })
22831 )
22832 }).annotate({ "description": "An openrouter:file_search server tool output item" }),
22833 Schema.Struct({
22834 "id": Schema.String,
22835 "imageB64": Schema.optionalKey(Schema.String),
22836 "imageUrl": Schema.optionalKey(Schema.String),
22837 "prompt": Schema.optionalKey(
22838 Schema.String.annotate({
22839 "description": "The prompt (possibly rewritten) that the image was generated from."
22840 })
22841 ),
22842 "result": Schema.optionalKey(
22843 Schema.Union([Schema.String, Schema.Null]).annotate({
22844 "description":
22845 "The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format"
22846 })
22847 ),
22848 "revisedPrompt": Schema.optionalKey(Schema.String),
22849 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
22850 "type": Schema.Never,
22851 "action": Schema.optionalKey(
22852 Schema.Union([
22853 Schema.Struct({
22854 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22855 "query": Schema.String,
22856 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22857 "type": Schema.Literal("search")
22858 }),
22859 Schema.Struct({
22860 "type": Schema.Literal("open_page"),
22861 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22862 }),
22863 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22864 ], { mode: "oneOf" })
22865 )
22866 }).annotate({ "description": "An openrouter:image_generation server tool output item" }),
22867 Schema.Struct({
22868 "action": Schema.optionalKey(Schema.Never),
22869 "id": Schema.String,
22870 "screenshotB64": Schema.optionalKey(Schema.String),
22871 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
22872 "type": Schema.Never
22873 }).annotate({ "description": "An openrouter:browser_use server tool output item" }),
22874 Schema.Struct({
22875 "arguments": Schema.optionalKey(
22876 Schema.String.annotate({ "description": "The raw tool-call arguments string as emitted by the model." })
22877 ),
22878 "call_id": Schema.optionalKey(
22879 Schema.String.annotate({ "description": "The model-generated tool call id from the originating turn." })
22880 ),
22881 "command": Schema.optionalKey(Schema.String),
22882 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
22883 "id": Schema.String,
22884 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
22885 "stderr": Schema.optionalKey(Schema.String),
22886 "stdout": Schema.optionalKey(Schema.String),
22887 "type": Schema.Never,
22888 "action": Schema.optionalKey(
22889 Schema.Union([
22890 Schema.Struct({
22891 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22892 "query": Schema.String,
22893 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22894 "type": Schema.Literal("search")
22895 }),
22896 Schema.Struct({
22897 "type": Schema.Literal("open_page"),
22898 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22899 }),
22900 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22901 ], { mode: "oneOf" })
22902 )
22903 }).annotate({ "description": "An openrouter:bash server tool output item" }),
22904 Schema.Struct({
22905 "command": Schema.optionalKey(Schema.Literals(["view", "create", "str_replace", "insert"])),
22906 "filePath": Schema.optionalKey(Schema.String),
22907 "id": Schema.String,
22908 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
22909 "type": Schema.Never,
22910 "action": Schema.optionalKey(
22911 Schema.Union([
22912 Schema.Struct({
22913 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22914 "query": Schema.String,
22915 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22916 "type": Schema.Literal("search")
22917 }),
22918 Schema.Struct({
22919 "type": Schema.Literal("open_page"),
22920 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22921 }),
22922 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22923 ], { mode: "oneOf" })
22924 )
22925 }).annotate({ "description": "An openrouter:text_editor server tool output item" }),
22926 Schema.Struct({
22927 "call_id": Schema.optionalKey(Schema.String),
22928 "id": Schema.String,
22929 "operation": Schema.optionalKey(ApplyPatchCallOperation),
22930 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
22931 "type": Schema.Never,
22932 "action": Schema.optionalKey(
22933 Schema.Union([
22934 Schema.Struct({
22935 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22936 "query": Schema.String,
22937 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22938 "type": Schema.Literal("search")
22939 }),
22940 Schema.Struct({
22941 "type": Schema.Literal("open_page"),
22942 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22943 }),
22944 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22945 ], { mode: "oneOf" })
22946 )
22947 }).annotate({
22948 "description":
22949 "An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn."
22950 }),
22951 Schema.Struct({
22952 "call_id": Schema.String,
22953 "id": Schema.String,
22954 "operation": ApplyPatchCallOperation,
22955 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
22956 "description": "Lifecycle state of an `apply_patch_call` output item."
22957 }),
22958 "type": Schema.Never,
22959 "action": Schema.optionalKey(
22960 Schema.Union([
22961 Schema.Struct({
22962 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22963 "query": Schema.String,
22964 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22965 "type": Schema.Literal("search")
22966 }),
22967 Schema.Struct({
22968 "type": Schema.Literal("open_page"),
22969 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
22970 }),
22971 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
22972 ], { mode: "oneOf" })
22973 )
22974 }).annotate({
22975 "description":
22976 "A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand."
22977 }),
22978 Schema.Struct({
22979 "action": Schema.optionalKey(Schema.Union([
22980 Schema.Struct({
22981 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
22982 "query": Schema.String,
22983 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
22984 "type": Schema.Literal("search"),
22985 "commands": Schema.Array(Schema.String),
22986 "max_output_length": Schema.Union([
22987 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
22988 Schema.Null
22989 ]),
22990 "timeout_ms": Schema.Union([
22991 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
22992 Schema.Null
22993 ])
22994 }),
22995 Schema.Struct({
22996 "type": Schema.Literal("open_page"),
22997 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
22998 "commands": Schema.Array(Schema.String),
22999 "max_output_length": Schema.Union([
23000 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
23001 Schema.Null
23002 ]),
23003 "timeout_ms": Schema.Union([
23004 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
23005 Schema.Null
23006 ])
23007 }),
23008 Schema.Struct({
23009 "pattern": Schema.String,
23010 "type": Schema.Literal("find_in_page"),
23011 "url": Schema.String,
23012 "commands": Schema.Array(Schema.String),
23013 "max_output_length": Schema.Union([
23014 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
23015 Schema.Null
23016 ]),
23017 "timeout_ms": Schema.Union([
23018 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
23019 Schema.Null
23020 ])
23021 })
23022 ], { mode: "oneOf" })),
23023 "call_id": Schema.String,
23024 "id": Schema.String,
23025 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
23026 "description": "Status of a shell call or its output."
23027 }),
23028 "type": Schema.Never
23029 }).annotate({
23030 "description":
23031 "A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool."
23032 }),
23033 Schema.Struct({
23034 "call_id": Schema.String,
23035 "id": Schema.String,
23036 "max_output_length": Schema.optionalKey(
23037 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
23038 ),
23039 "output": Schema.Array(Schema.Struct({
23040 "outcome": Schema.Union([
23041 Schema.Struct({
23042 "exit_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
23043 "type": Schema.Literal("exit")
23044 }),
23045 Schema.Struct({ "type": Schema.Literal("timeout") })
23046 ], { mode: "oneOf" }),
23047 "stderr": Schema.String,
23048 "stdout": Schema.String
23049 })),
23050 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
23051 "description": "Status of a shell call or its output."
23052 }),
23053 "type": Schema.Never,
23054 "action": Schema.optionalKey(
23055 Schema.Union([
23056 Schema.Struct({
23057 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23058 "query": Schema.String,
23059 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23060 "type": Schema.Literal("search")
23061 }),
23062 Schema.Struct({
23063 "type": Schema.Literal("open_page"),
23064 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23065 }),
23066 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23067 ], { mode: "oneOf" })
23068 )
23069 }).annotate({
23070 "description":
23071 "A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome."
23072 }),
23073 Schema.Struct({
23074 "content": Schema.optionalKey(Schema.String),
23075 "error": Schema.optionalKey(
23076 Schema.String.annotate({ "description": "The error message if the fetch failed." })
23077 ),
23078 "httpStatus": Schema.optionalKey(
23079 Schema.Number.annotate({ "description": "The HTTP status code returned by the upstream URL fetch." }).check(
23080 Schema.isInt().annotate({ "expected": "an integer" })
23081 )
23082 ),
23083 "id": Schema.String,
23084 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23085 "title": Schema.optionalKey(Schema.String),
23086 "type": Schema.Never,
23087 "url": Schema.optionalKey(Schema.String),
23088 "action": Schema.optionalKey(
23089 Schema.Union([
23090 Schema.Struct({
23091 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23092 "query": Schema.String,
23093 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23094 "type": Schema.Literal("search")
23095 }),
23096 Schema.Struct({
23097 "type": Schema.Literal("open_page"),
23098 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23099 }),
23100 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23101 ], { mode: "oneOf" })
23102 )
23103 }).annotate({ "description": "An openrouter:web_fetch server tool output item" }),
23104 Schema.Struct({
23105 "id": Schema.String,
23106 "query": Schema.optionalKey(Schema.String),
23107 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23108 "type": Schema.Never,
23109 "action": Schema.optionalKey(
23110 Schema.Union([
23111 Schema.Struct({
23112 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23113 "query": Schema.String,
23114 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23115 "type": Schema.Literal("search")
23116 }),
23117 Schema.Struct({
23118 "type": Schema.Literal("open_page"),
23119 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23120 }),
23121 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23122 ], { mode: "oneOf" })
23123 )
23124 }).annotate({ "description": "An openrouter:tool_search server tool output item" }),
23125 Schema.Struct({
23126 "action": Schema.optionalKey(Schema.Never),
23127 "id": Schema.String,
23128 "key": Schema.optionalKey(Schema.String),
23129 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23130 "type": Schema.Never,
23131 "value": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" }))
23132 }).annotate({ "description": "An openrouter:memory server tool output item" }),
23133 Schema.Struct({
23134 "id": Schema.String,
23135 "serverLabel": Schema.optionalKey(Schema.String),
23136 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23137 "toolName": Schema.optionalKey(Schema.String),
23138 "type": Schema.Never,
23139 "action": Schema.optionalKey(
23140 Schema.Union([
23141 Schema.Struct({
23142 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23143 "query": Schema.String,
23144 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23145 "type": Schema.Literal("search")
23146 }),
23147 Schema.Struct({
23148 "type": Schema.Literal("open_page"),
23149 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23150 }),
23151 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23152 ], { mode: "oneOf" })
23153 )
23154 }).annotate({ "description": "An openrouter:mcp server tool output item" }),
23155 Schema.Struct({
23156 "arguments": Schema.optionalKey(
23157 Schema.String.annotate({
23158 "description": "The JSON arguments submitted to the search tool (e.g. {\"query\":\"Claude\"})"
23159 })
23160 ),
23161 "id": Schema.String,
23162 "query": Schema.optionalKey(Schema.String),
23163 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23164 "type": Schema.Never,
23165 "action": Schema.optionalKey(
23166 Schema.Union([
23167 Schema.Struct({
23168 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23169 "query": Schema.String,
23170 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23171 "type": Schema.Literal("search")
23172 }),
23173 Schema.Struct({
23174 "type": Schema.Literal("open_page"),
23175 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23176 }),
23177 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23178 ], { mode: "oneOf" })
23179 )
23180 }).annotate({ "description": "An openrouter:experimental__search_models server tool output item" }),
23181 Schema.Struct({
23182 "analysis": Schema.optionalKey(FusionAnalysisResult),
23183 "error": Schema.optionalKey(
23184 Schema.String.annotate({
23185 "description": "Error message when the fusion run did not produce an analysis result."
23186 })
23187 ),
23188 "failed_models": Schema.optionalKey(
23189 Schema.Array(Schema.Struct({
23190 "error": Schema.String.annotate({ "description": "Error message describing why the model failed." }),
23191 "model": Schema.String.annotate({ "description": "Slug of the analysis model that failed." }),
23192 "status_code": Schema.optionalKey(
23193 Schema.Number.annotate({
23194 "description": "HTTP status code from the upstream response, when available (e.g. 402, 429)."
23195 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
23196 )
23197 })).annotate({
23198 "description":
23199 "Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel."
23200 })
23201 ),
23202 "failure_reason": Schema.optionalKey(
23203 Schema.String.annotate({
23204 "description":
23205 "Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion."
23206 })
23207 ),
23208 "id": Schema.String,
23209 "responses": Schema.optionalKey(
23210 Schema.Array(Schema.Struct({ "content": Schema.optionalKey(Schema.String), "model": Schema.String }))
23211 .annotate({
23212 "description":
23213 "Analysis models that produced a response in this fusion run, with each model's full panel content."
23214 })
23215 ),
23216 "sources": Schema.optionalKey(
23217 Schema.Array(FusionSource).annotate({
23218 "description":
23219 "Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source."
23220 })
23221 ),
23222 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23223 "type": Schema.Never,
23224 "action": Schema.optionalKey(
23225 Schema.Union([
23226 Schema.Struct({
23227 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23228 "query": Schema.String,
23229 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23230 "type": Schema.Literal("search")
23231 }),
23232 Schema.Struct({
23233 "type": Schema.Literal("open_page"),
23234 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23235 }),
23236 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23237 ], { mode: "oneOf" })
23238 )
23239 }).annotate({ "description": "An openrouter:fusion server tool output item" }),
23240 Schema.Struct({
23241 "advice": Schema.optionalKey(
23242 Schema.String.annotate({
23243 "description": "The advisor model's response (the advice text returned to the executor)."
23244 })
23245 ),
23246 "error": Schema.optionalKey(
23247 Schema.String.annotate({ "description": "Error message when the advisor call did not produce advice." })
23248 ),
23249 "id": Schema.String,
23250 "instance_name": Schema.optionalKey(Schema.String.annotate({
23251 "description":
23252 "Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance."
23253 })),
23254 "model": Schema.optionalKey(
23255 Schema.String.annotate({ "description": "Slug of the advisor model that was consulted." })
23256 ),
23257 "prompt": Schema.optionalKey(
23258 Schema.String.annotate({ "description": "The prompt the executor sent to the advisor." })
23259 ),
23260 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23261 "type": Schema.Never,
23262 "action": Schema.optionalKey(
23263 Schema.Union([
23264 Schema.Struct({
23265 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23266 "query": Schema.String,
23267 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23268 "type": Schema.Literal("search")
23269 }),
23270 Schema.Struct({
23271 "type": Schema.Literal("open_page"),
23272 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23273 }),
23274 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23275 ], { mode: "oneOf" })
23276 )
23277 }).annotate({ "description": "An openrouter:advisor server tool output item" }),
23278 Schema.Struct({
23279 "error": Schema.optionalKey(
23280 Schema.String.annotate({ "description": "Error message when the subagent task did not produce an outcome." })
23281 ),
23282 "id": Schema.String,
23283 "instance_name": Schema.optionalKey(Schema.String.annotate({
23284 "description":
23285 "Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation."
23286 })),
23287 "model": Schema.optionalKey(
23288 Schema.String.annotate({ "description": "Slug of the worker model that executed the task." })
23289 ),
23290 "name": Schema.optionalKey(
23291 Schema.String.annotate({
23292 "description":
23293 "Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent."
23294 })
23295 ),
23296 "outcome": Schema.optionalKey(
23297 Schema.String.annotate({
23298 "description": "The worker model's result (the outcome text returned to the delegating model)."
23299 })
23300 ),
23301 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23302 "task_description": Schema.optionalKey(
23303 Schema.String.annotate({ "description": "The task description the delegating model sent to the worker." })
23304 ),
23305 "task_name": Schema.optionalKey(
23306 Schema.String.annotate({ "description": "The short task identifier the delegating model supplied." })
23307 ),
23308 "type": Schema.Never,
23309 "action": Schema.optionalKey(
23310 Schema.Union([
23311 Schema.Struct({
23312 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23313 "query": Schema.String,
23314 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23315 "type": Schema.Literal("search")
23316 }),
23317 Schema.Struct({
23318 "type": Schema.Literal("open_page"),
23319 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23320 }),
23321 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23322 ], { mode: "oneOf" })
23323 )
23324 }).annotate({ "description": "An openrouter:subagent server tool output item" }),
23325 Schema.Struct({
23326 "error": Schema.optionalKey(
23327 Schema.String.annotate({ "description": "Error message when the file operation failed." })
23328 ),
23329 "file_id": Schema.optionalKey(
23330 Schema.String.annotate({ "description": "The target file id supplied in the tool-call arguments." })
23331 ),
23332 "filename": Schema.optionalKey(
23333 Schema.String.annotate({ "description": "The target filename supplied in the tool-call arguments." })
23334 ),
23335 "id": Schema.String,
23336 "operation": Schema.optionalKey(
23337 Schema.String.annotate({ "description": "The file operation performed (list, read, write, or edit)." })
23338 ),
23339 "result": Schema.optionalKey(
23340 Schema.String.annotate({ "description": "JSON-serialized result of the file operation." })
23341 ),
23342 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23343 "type": Schema.Never,
23344 "action": Schema.optionalKey(
23345 Schema.Union([
23346 Schema.Struct({
23347 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23348 "query": Schema.String,
23349 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23350 "type": Schema.Literal("search")
23351 }),
23352 Schema.Struct({
23353 "type": Schema.Literal("open_page"),
23354 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23355 }),
23356 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23357 ], { mode: "oneOf" })
23358 )
23359 }).annotate({ "description": "An openrouter:files server tool output item" }),
23360 Schema.Struct({
23361 "call_id": Schema.String,
23362 "id": Schema.String,
23363 "input": Schema.String,
23364 "name": Schema.String,
23365 "namespace": Schema.optionalKey(
23366 Schema.String.annotate({
23367 "description":
23368 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
23369 })
23370 ),
23371 "type": Schema.Never,
23372 "action": Schema.optionalKey(
23373 Schema.Union([
23374 Schema.Struct({
23375 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23376 "query": Schema.String,
23377 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23378 "type": Schema.Literal("search")
23379 }),
23380 Schema.Struct({
23381 "type": Schema.Literal("open_page"),
23382 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23383 }),
23384 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23385 ], { mode: "oneOf" })
23386 ),
23387 "status": WebSearchStatus
23388 }).annotate({
23389 "description":
23390 "A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments."
23391 })
23392 ], { mode: "oneOf" }).annotate({ "description": "An output item from the response" }),
23393 Schema.Union([
23394 Schema.Struct({
23395 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
23396 "id": Schema.String,
23397 "phase": Schema.optionalKey(
23398 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
23399 "description":
23400 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
23401 })
23402 ),
23403 "role": Schema.Literal("assistant"),
23404 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
23405 "type": Schema.Never,
23406 "queries": Schema.Array(Schema.String)
23407 }).annotate({ "description": "An output message item" }),
23408 Schema.Struct({
23409 "content": Schema.optionalKey(
23410 Schema.Union([
23411 Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("reasoning_text") }))
23412 ])
23413 ),
23414 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
23415 "id": Schema.String,
23416 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
23417 "summary": Schema.Array(ReasoningSummaryText),
23418 "type": Schema.Never,
23419 "format": Schema.optionalKey(ReasoningFormat),
23420 "signature": Schema.optionalKey(
23421 Schema.Union([Schema.String, Schema.Null]).annotate({
23422 "description": "A signature for the reasoning content, used for verification"
23423 })
23424 ),
23425 "queries": Schema.Array(Schema.String)
23426 }).annotate({ "description": "An output item containing reasoning" }),
23427 Schema.Struct({
23428 "arguments": Schema.String,
23429 "call_id": Schema.String,
23430 "id": Schema.String,
23431 "name": Schema.String,
23432 "namespace": Schema.optionalKey(
23433 Schema.String.annotate({
23434 "description":
23435 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
23436 })
23437 ),
23438 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
23439 "type": Schema.Never,
23440 "queries": Schema.Array(Schema.String)
23441 }),
23442 Schema.Struct({
23443 "action": Schema.optionalKey(
23444 Schema.Union([
23445 Schema.Struct({
23446 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23447 "query": Schema.String,
23448 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23449 "type": Schema.Literal("search")
23450 }),
23451 Schema.Struct({
23452 "type": Schema.Literal("open_page"),
23453 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23454 }),
23455 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23456 ], { mode: "oneOf" })
23457 ),
23458 "id": Schema.String,
23459 "status": Schema.Union([
23460 Schema.Literal("completed"),
23461 Schema.Literal("searching"),
23462 Schema.Literal("in_progress"),
23463 Schema.Literal("failed")
23464 ]),
23465 "type": Schema.Never,
23466 "queries": Schema.Array(Schema.String)
23467 }),
23468 Schema.Struct({
23469 "id": Schema.String,
23470 "queries": Schema.Array(Schema.String),
23471 "status": Schema.Union([
23472 Schema.Literal("completed"),
23473 Schema.Literal("searching"),
23474 Schema.Literal("in_progress"),
23475 Schema.Literal("failed")
23476 ]),
23477 "type": Schema.Literal("file_search_call")
23478 }),
23479 Schema.Struct({
23480 "id": Schema.String,
23481 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
23482 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed"), Schema.Literal("failed")]),
23483 "type": Schema.Never,
23484 "prompt": Schema.optionalKey(
23485 Schema.String.annotate({
23486 "description": "The prompt (possibly rewritten) that the image was generated from."
23487 })
23488 ),
23489 "queries": Schema.Array(Schema.String)
23490 }),
23491 Schema.Struct({
23492 "code": Schema.Union([Schema.String, Schema.Null]),
23493 "container_id": Schema.String,
23494 "id": Schema.String,
23495 "outputs": Schema.Union([
23496 Schema.Array(
23497 Schema.Union([
23498 Schema.Struct({ "type": Schema.Literal("image"), "url": Schema.String }),
23499 Schema.Struct({ "logs": Schema.String, "type": Schema.Literal("logs") })
23500 ])
23501 ),
23502 Schema.Null
23503 ]),
23504 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23505 "type": Schema.Never,
23506 "queries": Schema.Array(Schema.String)
23507 }).annotate({ "description": "A code interpreter execution call with outputs" }),
23508 Schema.Struct({
23509 "action": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
23510 "call_id": Schema.String,
23511 "id": Schema.String,
23512 "pending_safety_checks": Schema.Array(
23513 Schema.Struct({ "code": Schema.String, "id": Schema.String, "message": Schema.String })
23514 ),
23515 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
23516 "type": Schema.Never,
23517 "queries": Schema.Array(Schema.String)
23518 }),
23519 Schema.Struct({
23520 "datetime": Schema.String.annotate({ "description": "ISO 8601 datetime string" }),
23521 "id": Schema.String,
23522 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23523 "timezone": Schema.String.annotate({ "description": "IANA timezone name" }),
23524 "type": Schema.Never,
23525 "queries": Schema.Array(Schema.String)
23526 }).annotate({ "description": "An openrouter:datetime server tool output item" }),
23527 Schema.Struct({
23528 "action": Schema.optionalKey(
23529 Schema.Struct({
23530 "query": Schema.String,
23531 "sources": Schema.optionalKey(
23532 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
23533 ),
23534 "type": Schema.Literal("search")
23535 }).annotate({
23536 "description":
23537 "The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider."
23538 })
23539 ),
23540 "id": Schema.String,
23541 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23542 "type": Schema.Never,
23543 "queries": Schema.Array(Schema.String)
23544 }).annotate({ "description": "An openrouter:web_search server tool output item" }),
23545 Schema.Struct({
23546 "code": Schema.optionalKey(Schema.String),
23547 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
23548 "id": Schema.String,
23549 "language": Schema.optionalKey(Schema.String),
23550 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23551 "stderr": Schema.optionalKey(Schema.String),
23552 "stdout": Schema.optionalKey(Schema.String),
23553 "type": Schema.Never,
23554 "queries": Schema.Array(Schema.String)
23555 }).annotate({ "description": "An openrouter:code_interpreter server tool output item" }),
23556 Schema.Struct({
23557 "id": Schema.String,
23558 "queries": Schema.Array(Schema.String),
23559 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23560 "type": Schema.Never
23561 }).annotate({ "description": "An openrouter:file_search server tool output item" }),
23562 Schema.Struct({
23563 "id": Schema.String,
23564 "imageB64": Schema.optionalKey(Schema.String),
23565 "imageUrl": Schema.optionalKey(Schema.String),
23566 "prompt": Schema.optionalKey(
23567 Schema.String.annotate({
23568 "description": "The prompt (possibly rewritten) that the image was generated from."
23569 })
23570 ),
23571 "result": Schema.optionalKey(
23572 Schema.Union([Schema.String, Schema.Null]).annotate({
23573 "description":
23574 "The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format"
23575 })
23576 ),
23577 "revisedPrompt": Schema.optionalKey(Schema.String),
23578 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23579 "type": Schema.Never,
23580 "queries": Schema.Array(Schema.String)
23581 }).annotate({ "description": "An openrouter:image_generation server tool output item" }),
23582 Schema.Struct({
23583 "action": Schema.optionalKey(Schema.String),
23584 "id": Schema.String,
23585 "screenshotB64": Schema.optionalKey(Schema.String),
23586 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23587 "type": Schema.Never,
23588 "queries": Schema.Array(Schema.String)
23589 }).annotate({ "description": "An openrouter:browser_use server tool output item" }),
23590 Schema.Struct({
23591 "arguments": Schema.optionalKey(
23592 Schema.String.annotate({ "description": "The raw tool-call arguments string as emitted by the model." })
23593 ),
23594 "call_id": Schema.optionalKey(
23595 Schema.String.annotate({ "description": "The model-generated tool call id from the originating turn." })
23596 ),
23597 "command": Schema.optionalKey(Schema.String),
23598 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
23599 "id": Schema.String,
23600 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23601 "stderr": Schema.optionalKey(Schema.String),
23602 "stdout": Schema.optionalKey(Schema.String),
23603 "type": Schema.Never,
23604 "queries": Schema.Array(Schema.String)
23605 }).annotate({ "description": "An openrouter:bash server tool output item" }),
23606 Schema.Struct({
23607 "command": Schema.optionalKey(Schema.Literals(["view", "create", "str_replace", "insert"])),
23608 "filePath": Schema.optionalKey(Schema.String),
23609 "id": Schema.String,
23610 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23611 "type": Schema.Never,
23612 "queries": Schema.Array(Schema.String)
23613 }).annotate({ "description": "An openrouter:text_editor server tool output item" }),
23614 Schema.Struct({
23615 "call_id": Schema.optionalKey(Schema.String),
23616 "id": Schema.String,
23617 "operation": Schema.optionalKey(ApplyPatchCallOperation),
23618 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23619 "type": Schema.Never,
23620 "queries": Schema.Array(Schema.String)
23621 }).annotate({
23622 "description":
23623 "An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn."
23624 }),
23625 Schema.Struct({
23626 "call_id": Schema.String,
23627 "id": Schema.String,
23628 "operation": ApplyPatchCallOperation,
23629 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
23630 "description": "Lifecycle state of an `apply_patch_call` output item."
23631 }),
23632 "type": Schema.Never,
23633 "queries": Schema.Array(Schema.String)
23634 }).annotate({
23635 "description":
23636 "A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand."
23637 }),
23638 Schema.Struct({
23639 "action": Schema.optionalKey(Schema.Struct({
23640 "commands": Schema.Array(Schema.String),
23641 "max_output_length": Schema.Union([
23642 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
23643 Schema.Null
23644 ]),
23645 "timeout_ms": Schema.Union([
23646 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
23647 Schema.Null
23648 ])
23649 })),
23650 "call_id": Schema.String,
23651 "id": Schema.String,
23652 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
23653 "description": "Status of a shell call or its output."
23654 }),
23655 "type": Schema.Never,
23656 "queries": Schema.Array(Schema.String)
23657 }).annotate({
23658 "description":
23659 "A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool."
23660 }),
23661 Schema.Struct({
23662 "call_id": Schema.String,
23663 "id": Schema.String,
23664 "max_output_length": Schema.optionalKey(
23665 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
23666 ),
23667 "output": Schema.Array(Schema.Struct({
23668 "outcome": Schema.Union([
23669 Schema.Struct({
23670 "exit_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
23671 "type": Schema.Literal("exit")
23672 }),
23673 Schema.Struct({ "type": Schema.Literal("timeout") })
23674 ], { mode: "oneOf" }),
23675 "stderr": Schema.String,
23676 "stdout": Schema.String
23677 })),
23678 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
23679 "description": "Status of a shell call or its output."
23680 }),
23681 "type": Schema.Never,
23682 "queries": Schema.Array(Schema.String)
23683 }).annotate({
23684 "description":
23685 "A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome."
23686 }),
23687 Schema.Struct({
23688 "content": Schema.optionalKey(Schema.String),
23689 "error": Schema.optionalKey(
23690 Schema.String.annotate({ "description": "The error message if the fetch failed." })
23691 ),
23692 "httpStatus": Schema.optionalKey(
23693 Schema.Number.annotate({ "description": "The HTTP status code returned by the upstream URL fetch." }).check(
23694 Schema.isInt().annotate({ "expected": "an integer" })
23695 )
23696 ),
23697 "id": Schema.String,
23698 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23699 "title": Schema.optionalKey(Schema.String),
23700 "type": Schema.Never,
23701 "url": Schema.optionalKey(Schema.String),
23702 "queries": Schema.Array(Schema.String)
23703 }).annotate({ "description": "An openrouter:web_fetch server tool output item" }),
23704 Schema.Struct({
23705 "id": Schema.String,
23706 "query": Schema.optionalKey(Schema.String),
23707 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23708 "type": Schema.Never,
23709 "queries": Schema.Array(Schema.String)
23710 }).annotate({ "description": "An openrouter:tool_search server tool output item" }),
23711 Schema.Struct({
23712 "action": Schema.optionalKey(Schema.Literals(["read", "write", "delete"])),
23713 "id": Schema.String,
23714 "key": Schema.optionalKey(Schema.String),
23715 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23716 "type": Schema.Never,
23717 "value": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
23718 "queries": Schema.Array(Schema.String)
23719 }).annotate({ "description": "An openrouter:memory server tool output item" }),
23720 Schema.Struct({
23721 "id": Schema.String,
23722 "serverLabel": Schema.optionalKey(Schema.String),
23723 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23724 "toolName": Schema.optionalKey(Schema.String),
23725 "type": Schema.Never,
23726 "queries": Schema.Array(Schema.String)
23727 }).annotate({ "description": "An openrouter:mcp server tool output item" }),
23728 Schema.Struct({
23729 "arguments": Schema.optionalKey(
23730 Schema.String.annotate({
23731 "description": "The JSON arguments submitted to the search tool (e.g. {\"query\":\"Claude\"})"
23732 })
23733 ),
23734 "id": Schema.String,
23735 "query": Schema.optionalKey(Schema.String),
23736 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23737 "type": Schema.Never,
23738 "queries": Schema.Array(Schema.String)
23739 }).annotate({ "description": "An openrouter:experimental__search_models server tool output item" }),
23740 Schema.Struct({
23741 "analysis": Schema.optionalKey(FusionAnalysisResult),
23742 "error": Schema.optionalKey(
23743 Schema.String.annotate({
23744 "description": "Error message when the fusion run did not produce an analysis result."
23745 })
23746 ),
23747 "failed_models": Schema.optionalKey(
23748 Schema.Array(Schema.Struct({
23749 "error": Schema.String.annotate({ "description": "Error message describing why the model failed." }),
23750 "model": Schema.String.annotate({ "description": "Slug of the analysis model that failed." }),
23751 "status_code": Schema.optionalKey(
23752 Schema.Number.annotate({
23753 "description": "HTTP status code from the upstream response, when available (e.g. 402, 429)."
23754 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
23755 )
23756 })).annotate({
23757 "description":
23758 "Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel."
23759 })
23760 ),
23761 "failure_reason": Schema.optionalKey(
23762 Schema.String.annotate({
23763 "description":
23764 "Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion."
23765 })
23766 ),
23767 "id": Schema.String,
23768 "responses": Schema.optionalKey(
23769 Schema.Array(Schema.Struct({ "content": Schema.optionalKey(Schema.String), "model": Schema.String }))
23770 .annotate({
23771 "description":
23772 "Analysis models that produced a response in this fusion run, with each model's full panel content."
23773 })
23774 ),
23775 "sources": Schema.optionalKey(
23776 Schema.Array(FusionSource).annotate({
23777 "description":
23778 "Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source."
23779 })
23780 ),
23781 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23782 "type": Schema.Never,
23783 "queries": Schema.Array(Schema.String)
23784 }).annotate({ "description": "An openrouter:fusion server tool output item" }),
23785 Schema.Struct({
23786 "advice": Schema.optionalKey(
23787 Schema.String.annotate({
23788 "description": "The advisor model's response (the advice text returned to the executor)."
23789 })
23790 ),
23791 "error": Schema.optionalKey(
23792 Schema.String.annotate({ "description": "Error message when the advisor call did not produce advice." })
23793 ),
23794 "id": Schema.String,
23795 "instance_name": Schema.optionalKey(Schema.String.annotate({
23796 "description":
23797 "Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance."
23798 })),
23799 "model": Schema.optionalKey(
23800 Schema.String.annotate({ "description": "Slug of the advisor model that was consulted." })
23801 ),
23802 "prompt": Schema.optionalKey(
23803 Schema.String.annotate({ "description": "The prompt the executor sent to the advisor." })
23804 ),
23805 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23806 "type": Schema.Never,
23807 "queries": Schema.Array(Schema.String)
23808 }).annotate({ "description": "An openrouter:advisor server tool output item" }),
23809 Schema.Struct({
23810 "error": Schema.optionalKey(
23811 Schema.String.annotate({ "description": "Error message when the subagent task did not produce an outcome." })
23812 ),
23813 "id": Schema.String,
23814 "instance_name": Schema.optionalKey(Schema.String.annotate({
23815 "description":
23816 "Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation."
23817 })),
23818 "model": Schema.optionalKey(
23819 Schema.String.annotate({ "description": "Slug of the worker model that executed the task." })
23820 ),
23821 "name": Schema.optionalKey(
23822 Schema.String.annotate({
23823 "description":
23824 "Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent."
23825 })
23826 ),
23827 "outcome": Schema.optionalKey(
23828 Schema.String.annotate({
23829 "description": "The worker model's result (the outcome text returned to the delegating model)."
23830 })
23831 ),
23832 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23833 "task_description": Schema.optionalKey(
23834 Schema.String.annotate({ "description": "The task description the delegating model sent to the worker." })
23835 ),
23836 "task_name": Schema.optionalKey(
23837 Schema.String.annotate({ "description": "The short task identifier the delegating model supplied." })
23838 ),
23839 "type": Schema.Never,
23840 "queries": Schema.Array(Schema.String)
23841 }).annotate({ "description": "An openrouter:subagent server tool output item" }),
23842 Schema.Struct({
23843 "error": Schema.optionalKey(
23844 Schema.String.annotate({ "description": "Error message when the file operation failed." })
23845 ),
23846 "file_id": Schema.optionalKey(
23847 Schema.String.annotate({ "description": "The target file id supplied in the tool-call arguments." })
23848 ),
23849 "filename": Schema.optionalKey(
23850 Schema.String.annotate({ "description": "The target filename supplied in the tool-call arguments." })
23851 ),
23852 "id": Schema.String,
23853 "operation": Schema.optionalKey(
23854 Schema.String.annotate({ "description": "The file operation performed (list, read, write, or edit)." })
23855 ),
23856 "result": Schema.optionalKey(
23857 Schema.String.annotate({ "description": "JSON-serialized result of the file operation." })
23858 ),
23859 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23860 "type": Schema.Never,
23861 "queries": Schema.Array(Schema.String)
23862 }).annotate({ "description": "An openrouter:files server tool output item" }),
23863 Schema.Struct({
23864 "call_id": Schema.String,
23865 "id": Schema.String,
23866 "input": Schema.String,
23867 "name": Schema.String,
23868 "namespace": Schema.optionalKey(
23869 Schema.String.annotate({
23870 "description":
23871 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
23872 })
23873 ),
23874 "type": Schema.Never,
23875 "queries": Schema.Array(Schema.String),
23876 "status": WebSearchStatus
23877 }).annotate({
23878 "description":
23879 "A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments."
23880 })
23881 ], { mode: "oneOf" }).annotate({ "description": "An output item from the response" }),
23882 Schema.Union([
23883 Schema.Struct({
23884 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
23885 "id": Schema.String,
23886 "phase": Schema.optionalKey(
23887 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
23888 "description":
23889 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
23890 })
23891 ),
23892 "role": Schema.Literal("assistant"),
23893 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
23894 "type": Schema.Never,
23895 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23896 }).annotate({ "description": "An output message item" }),
23897 Schema.Struct({
23898 "content": Schema.optionalKey(
23899 Schema.Union([
23900 Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("reasoning_text") }))
23901 ])
23902 ),
23903 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
23904 "id": Schema.String,
23905 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
23906 "summary": Schema.Array(ReasoningSummaryText),
23907 "type": Schema.Never,
23908 "format": Schema.optionalKey(ReasoningFormat),
23909 "signature": Schema.optionalKey(
23910 Schema.Union([Schema.String, Schema.Null]).annotate({
23911 "description": "A signature for the reasoning content, used for verification"
23912 })
23913 ),
23914 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23915 }).annotate({ "description": "An output item containing reasoning" }),
23916 Schema.Struct({
23917 "arguments": Schema.String,
23918 "call_id": Schema.String,
23919 "id": Schema.String,
23920 "name": Schema.String,
23921 "namespace": Schema.optionalKey(
23922 Schema.String.annotate({
23923 "description":
23924 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
23925 })
23926 ),
23927 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
23928 "type": Schema.Never,
23929 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23930 }),
23931 Schema.Struct({
23932 "action": Schema.optionalKey(
23933 Schema.Union([
23934 Schema.Struct({
23935 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
23936 "query": Schema.String,
23937 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
23938 "type": Schema.Literal("search")
23939 }),
23940 Schema.Struct({
23941 "type": Schema.Literal("open_page"),
23942 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23943 }),
23944 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
23945 ], { mode: "oneOf" })
23946 ),
23947 "id": Schema.String,
23948 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress"), Schema.Literal("failed")]),
23949 "type": Schema.Never,
23950 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23951 }),
23952 Schema.Struct({
23953 "id": Schema.String,
23954 "queries": Schema.Array(Schema.String),
23955 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress"), Schema.Literal("failed")]),
23956 "type": Schema.Never,
23957 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23958 }),
23959 Schema.Struct({
23960 "id": Schema.String,
23961 "result": Schema.optionalKey(Schema.Union([Schema.Union([Schema.String]), Schema.Union([Schema.Null])])),
23962 "status": Schema.Union([
23963 Schema.Literal("in_progress"),
23964 Schema.Literal("completed"),
23965 Schema.Literal("generating"),
23966 Schema.Literal("failed")
23967 ]),
23968 "type": Schema.Literal("image_generation_call"),
23969 "prompt": Schema.optionalKey(
23970 Schema.String.annotate({
23971 "description": "The prompt (possibly rewritten) that the image was generated from."
23972 })
23973 )
23974 }),
23975 Schema.Struct({
23976 "code": Schema.Union([Schema.String, Schema.Null]),
23977 "container_id": Schema.String,
23978 "id": Schema.String,
23979 "outputs": Schema.Union([
23980 Schema.Array(
23981 Schema.Union([
23982 Schema.Struct({ "type": Schema.Literal("image"), "url": Schema.String }),
23983 Schema.Struct({ "logs": Schema.String, "type": Schema.Literal("logs") })
23984 ])
23985 ),
23986 Schema.Null
23987 ]),
23988 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
23989 "type": Schema.Never,
23990 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
23991 }).annotate({ "description": "A code interpreter execution call with outputs" }),
23992 Schema.Struct({
23993 "action": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
23994 "call_id": Schema.String,
23995 "id": Schema.String,
23996 "pending_safety_checks": Schema.Array(
23997 Schema.Struct({ "code": Schema.String, "id": Schema.String, "message": Schema.String })
23998 ),
23999 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
24000 "type": Schema.Never,
24001 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24002 }),
24003 Schema.Struct({
24004 "datetime": Schema.String.annotate({ "description": "ISO 8601 datetime string" }),
24005 "id": Schema.String,
24006 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24007 "timezone": Schema.String.annotate({ "description": "IANA timezone name" }),
24008 "type": Schema.Never,
24009 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24010 }).annotate({ "description": "An openrouter:datetime server tool output item" }),
24011 Schema.Struct({
24012 "action": Schema.optionalKey(
24013 Schema.Struct({
24014 "query": Schema.String,
24015 "sources": Schema.optionalKey(
24016 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
24017 ),
24018 "type": Schema.Literal("search")
24019 }).annotate({
24020 "description":
24021 "The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider."
24022 })
24023 ),
24024 "id": Schema.String,
24025 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24026 "type": Schema.Never,
24027 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24028 }).annotate({ "description": "An openrouter:web_search server tool output item" }),
24029 Schema.Struct({
24030 "code": Schema.optionalKey(Schema.String),
24031 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
24032 "id": Schema.String,
24033 "language": Schema.optionalKey(Schema.String),
24034 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24035 "stderr": Schema.optionalKey(Schema.String),
24036 "stdout": Schema.optionalKey(Schema.String),
24037 "type": Schema.Never,
24038 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24039 }).annotate({ "description": "An openrouter:code_interpreter server tool output item" }),
24040 Schema.Struct({
24041 "id": Schema.String,
24042 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
24043 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24044 "type": Schema.Never,
24045 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24046 }).annotate({ "description": "An openrouter:file_search server tool output item" }),
24047 Schema.Struct({
24048 "id": Schema.String,
24049 "imageB64": Schema.optionalKey(Schema.String),
24050 "imageUrl": Schema.optionalKey(Schema.String),
24051 "prompt": Schema.optionalKey(
24052 Schema.String.annotate({
24053 "description": "The prompt (possibly rewritten) that the image was generated from."
24054 })
24055 ),
24056 "result": Schema.optionalKey(
24057 Schema.Union([Schema.Union([Schema.String]), Schema.Union([Schema.Null])]).annotate({
24058 "description":
24059 "The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format"
24060 })
24061 ),
24062 "revisedPrompt": Schema.optionalKey(Schema.String),
24063 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24064 "type": Schema.Never
24065 }).annotate({ "description": "An openrouter:image_generation server tool output item" }),
24066 Schema.Struct({
24067 "action": Schema.optionalKey(Schema.String),
24068 "id": Schema.String,
24069 "screenshotB64": Schema.optionalKey(Schema.String),
24070 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24071 "type": Schema.Never,
24072 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24073 }).annotate({ "description": "An openrouter:browser_use server tool output item" }),
24074 Schema.Struct({
24075 "arguments": Schema.optionalKey(
24076 Schema.String.annotate({ "description": "The raw tool-call arguments string as emitted by the model." })
24077 ),
24078 "call_id": Schema.optionalKey(
24079 Schema.String.annotate({ "description": "The model-generated tool call id from the originating turn." })
24080 ),
24081 "command": Schema.optionalKey(Schema.String),
24082 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
24083 "id": Schema.String,
24084 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24085 "stderr": Schema.optionalKey(Schema.String),
24086 "stdout": Schema.optionalKey(Schema.String),
24087 "type": Schema.Never,
24088 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24089 }).annotate({ "description": "An openrouter:bash server tool output item" }),
24090 Schema.Struct({
24091 "command": Schema.optionalKey(Schema.Literals(["view", "create", "str_replace", "insert"])),
24092 "filePath": Schema.optionalKey(Schema.String),
24093 "id": Schema.String,
24094 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24095 "type": Schema.Never,
24096 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24097 }).annotate({ "description": "An openrouter:text_editor server tool output item" }),
24098 Schema.Struct({
24099 "call_id": Schema.optionalKey(Schema.String),
24100 "id": Schema.String,
24101 "operation": Schema.optionalKey(ApplyPatchCallOperation),
24102 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24103 "type": Schema.Never,
24104 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24105 }).annotate({
24106 "description":
24107 "An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn."
24108 }),
24109 Schema.Struct({
24110 "call_id": Schema.String,
24111 "id": Schema.String,
24112 "operation": ApplyPatchCallOperation,
24113 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
24114 "description": "Lifecycle state of an `apply_patch_call` output item."
24115 }),
24116 "type": Schema.Never,
24117 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24118 }).annotate({
24119 "description":
24120 "A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand."
24121 }),
24122 Schema.Struct({
24123 "action": Schema.optionalKey(Schema.Struct({
24124 "commands": Schema.Array(Schema.String),
24125 "max_output_length": Schema.Union([
24126 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
24127 Schema.Null
24128 ]),
24129 "timeout_ms": Schema.Union([
24130 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
24131 Schema.Null
24132 ])
24133 })),
24134 "call_id": Schema.String,
24135 "id": Schema.String,
24136 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
24137 "description": "Status of a shell call or its output."
24138 }),
24139 "type": Schema.Never,
24140 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24141 }).annotate({
24142 "description":
24143 "A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool."
24144 }),
24145 Schema.Struct({
24146 "call_id": Schema.String,
24147 "id": Schema.String,
24148 "max_output_length": Schema.optionalKey(
24149 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
24150 ),
24151 "output": Schema.Array(Schema.Struct({
24152 "outcome": Schema.Union([
24153 Schema.Struct({
24154 "exit_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
24155 "type": Schema.Literal("exit")
24156 }),
24157 Schema.Struct({ "type": Schema.Literal("timeout") })
24158 ], { mode: "oneOf" }),
24159 "stderr": Schema.String,
24160 "stdout": Schema.String
24161 })),
24162 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
24163 "description": "Status of a shell call or its output."
24164 }),
24165 "type": Schema.Never,
24166 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24167 }).annotate({
24168 "description":
24169 "A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome."
24170 }),
24171 Schema.Struct({
24172 "content": Schema.optionalKey(Schema.String),
24173 "error": Schema.optionalKey(
24174 Schema.String.annotate({ "description": "The error message if the fetch failed." })
24175 ),
24176 "httpStatus": Schema.optionalKey(
24177 Schema.Number.annotate({ "description": "The HTTP status code returned by the upstream URL fetch." }).check(
24178 Schema.isInt().annotate({ "expected": "an integer" })
24179 )
24180 ),
24181 "id": Schema.String,
24182 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24183 "title": Schema.optionalKey(Schema.String),
24184 "type": Schema.Never,
24185 "url": Schema.optionalKey(Schema.String),
24186 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24187 }).annotate({ "description": "An openrouter:web_fetch server tool output item" }),
24188 Schema.Struct({
24189 "id": Schema.String,
24190 "query": Schema.optionalKey(Schema.String),
24191 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24192 "type": Schema.Never,
24193 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24194 }).annotate({ "description": "An openrouter:tool_search server tool output item" }),
24195 Schema.Struct({
24196 "action": Schema.optionalKey(Schema.Literals(["read", "write", "delete"])),
24197 "id": Schema.String,
24198 "key": Schema.optionalKey(Schema.String),
24199 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24200 "type": Schema.Never,
24201 "value": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
24202 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24203 }).annotate({ "description": "An openrouter:memory server tool output item" }),
24204 Schema.Struct({
24205 "id": Schema.String,
24206 "serverLabel": Schema.optionalKey(Schema.String),
24207 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24208 "toolName": Schema.optionalKey(Schema.String),
24209 "type": Schema.Never,
24210 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24211 }).annotate({ "description": "An openrouter:mcp server tool output item" }),
24212 Schema.Struct({
24213 "arguments": Schema.optionalKey(
24214 Schema.String.annotate({
24215 "description": "The JSON arguments submitted to the search tool (e.g. {\"query\":\"Claude\"})"
24216 })
24217 ),
24218 "id": Schema.String,
24219 "query": Schema.optionalKey(Schema.String),
24220 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24221 "type": Schema.Never,
24222 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24223 }).annotate({ "description": "An openrouter:experimental__search_models server tool output item" }),
24224 Schema.Struct({
24225 "analysis": Schema.optionalKey(FusionAnalysisResult),
24226 "error": Schema.optionalKey(
24227 Schema.String.annotate({
24228 "description": "Error message when the fusion run did not produce an analysis result."
24229 })
24230 ),
24231 "failed_models": Schema.optionalKey(
24232 Schema.Array(Schema.Struct({
24233 "error": Schema.String.annotate({ "description": "Error message describing why the model failed." }),
24234 "model": Schema.String.annotate({ "description": "Slug of the analysis model that failed." }),
24235 "status_code": Schema.optionalKey(
24236 Schema.Number.annotate({
24237 "description": "HTTP status code from the upstream response, when available (e.g. 402, 429)."
24238 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
24239 )
24240 })).annotate({
24241 "description":
24242 "Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel."
24243 })
24244 ),
24245 "failure_reason": Schema.optionalKey(
24246 Schema.String.annotate({
24247 "description":
24248 "Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion."
24249 })
24250 ),
24251 "id": Schema.String,
24252 "responses": Schema.optionalKey(
24253 Schema.Array(Schema.Struct({ "content": Schema.optionalKey(Schema.String), "model": Schema.String }))
24254 .annotate({
24255 "description":
24256 "Analysis models that produced a response in this fusion run, with each model's full panel content."
24257 })
24258 ),
24259 "sources": Schema.optionalKey(
24260 Schema.Array(FusionSource).annotate({
24261 "description":
24262 "Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source."
24263 })
24264 ),
24265 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24266 "type": Schema.Never,
24267 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24268 }).annotate({ "description": "An openrouter:fusion server tool output item" }),
24269 Schema.Struct({
24270 "advice": Schema.optionalKey(
24271 Schema.String.annotate({
24272 "description": "The advisor model's response (the advice text returned to the executor)."
24273 })
24274 ),
24275 "error": Schema.optionalKey(
24276 Schema.String.annotate({ "description": "Error message when the advisor call did not produce advice." })
24277 ),
24278 "id": Schema.String,
24279 "instance_name": Schema.optionalKey(Schema.String.annotate({
24280 "description":
24281 "Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance."
24282 })),
24283 "model": Schema.optionalKey(
24284 Schema.String.annotate({ "description": "Slug of the advisor model that was consulted." })
24285 ),
24286 "prompt": Schema.optionalKey(
24287 Schema.String.annotate({ "description": "The prompt the executor sent to the advisor." })
24288 ),
24289 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24290 "type": Schema.Never,
24291 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24292 }).annotate({ "description": "An openrouter:advisor server tool output item" }),
24293 Schema.Struct({
24294 "error": Schema.optionalKey(
24295 Schema.String.annotate({ "description": "Error message when the subagent task did not produce an outcome." })
24296 ),
24297 "id": Schema.String,
24298 "instance_name": Schema.optionalKey(Schema.String.annotate({
24299 "description":
24300 "Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation."
24301 })),
24302 "model": Schema.optionalKey(
24303 Schema.String.annotate({ "description": "Slug of the worker model that executed the task." })
24304 ),
24305 "name": Schema.optionalKey(
24306 Schema.String.annotate({
24307 "description":
24308 "Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent."
24309 })
24310 ),
24311 "outcome": Schema.optionalKey(
24312 Schema.String.annotate({
24313 "description": "The worker model's result (the outcome text returned to the delegating model)."
24314 })
24315 ),
24316 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24317 "task_description": Schema.optionalKey(
24318 Schema.String.annotate({ "description": "The task description the delegating model sent to the worker." })
24319 ),
24320 "task_name": Schema.optionalKey(
24321 Schema.String.annotate({ "description": "The short task identifier the delegating model supplied." })
24322 ),
24323 "type": Schema.Never,
24324 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24325 }).annotate({ "description": "An openrouter:subagent server tool output item" }),
24326 Schema.Struct({
24327 "error": Schema.optionalKey(
24328 Schema.String.annotate({ "description": "Error message when the file operation failed." })
24329 ),
24330 "file_id": Schema.optionalKey(
24331 Schema.String.annotate({ "description": "The target file id supplied in the tool-call arguments." })
24332 ),
24333 "filename": Schema.optionalKey(
24334 Schema.String.annotate({ "description": "The target filename supplied in the tool-call arguments." })
24335 ),
24336 "id": Schema.String,
24337 "operation": Schema.optionalKey(
24338 Schema.String.annotate({ "description": "The file operation performed (list, read, write, or edit)." })
24339 ),
24340 "result": Schema.optionalKey(
24341 Schema.Union([Schema.String.annotate({ "description": "JSON-serialized result of the file operation." })])
24342 ),
24343 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24344 "type": Schema.Never
24345 }).annotate({ "description": "An openrouter:files server tool output item" }),
24346 Schema.Struct({
24347 "call_id": Schema.String,
24348 "id": Schema.String,
24349 "input": Schema.String,
24350 "name": Schema.String,
24351 "namespace": Schema.optionalKey(
24352 Schema.String.annotate({
24353 "description":
24354 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
24355 })
24356 ),
24357 "type": Schema.Never,
24358 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
24359 "status": ImageGenerationStatus
24360 }).annotate({
24361 "description":
24362 "A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments."
24363 })
24364 ], { mode: "oneOf" }).annotate({ "description": "An output item from the response" }),
24365 Schema.Union([
24366 Schema.Struct({
24367 "content": Schema.Array(Schema.Union([ResponseOutputText, OpenAIResponsesRefusalContent])),
24368 "id": Schema.String,
24369 "phase": Schema.optionalKey(
24370 Schema.Union([Schema.Literal("commentary"), Schema.Literal("final_answer"), Schema.Null]).annotate({
24371 "description":
24372 "The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."
24373 })
24374 ),
24375 "role": Schema.Literal("assistant"),
24376 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
24377 "type": Schema.Never,
24378 "call_id": Schema.String,
24379 "created_by": Schema.optionalKey(Schema.String),
24380 "operation": Schema.Union([
24381 ApplyPatchCreateFileOperation,
24382 ApplyPatchUpdateFileOperation,
24383 ApplyPatchDeleteFileOperation
24384 ], { mode: "oneOf" })
24385 }).annotate({ "description": "An output message item" }),
24386 Schema.Struct({
24387 "content": Schema.optionalKey(
24388 Schema.Union([
24389 Schema.Array(Schema.Struct({ "text": Schema.String, "type": Schema.Literal("reasoning_text") }))
24390 ])
24391 ),
24392 "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
24393 "id": Schema.String,
24394 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
24395 "summary": Schema.Array(ReasoningSummaryText),
24396 "type": Schema.Never,
24397 "format": Schema.optionalKey(ReasoningFormat),
24398 "signature": Schema.optionalKey(
24399 Schema.Union([Schema.String, Schema.Null]).annotate({
24400 "description": "A signature for the reasoning content, used for verification"
24401 })
24402 ),
24403 "call_id": Schema.String,
24404 "created_by": Schema.optionalKey(Schema.String),
24405 "operation": Schema.Union([
24406 ApplyPatchCreateFileOperation,
24407 ApplyPatchUpdateFileOperation,
24408 ApplyPatchDeleteFileOperation
24409 ], { mode: "oneOf" })
24410 }).annotate({ "description": "An output item containing reasoning" }),
24411 Schema.Struct({
24412 "arguments": Schema.String,
24413 "call_id": Schema.String,
24414 "id": Schema.String,
24415 "name": Schema.String,
24416 "namespace": Schema.optionalKey(
24417 Schema.String.annotate({
24418 "description":
24419 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
24420 })
24421 ),
24422 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
24423 "type": Schema.Never,
24424 "created_by": Schema.optionalKey(Schema.String),
24425 "operation": Schema.Union([
24426 ApplyPatchCreateFileOperation,
24427 ApplyPatchUpdateFileOperation,
24428 ApplyPatchDeleteFileOperation
24429 ], { mode: "oneOf" })
24430 }),
24431 Schema.Struct({
24432 "action": Schema.optionalKey(
24433 Schema.Union([
24434 Schema.Struct({
24435 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
24436 "query": Schema.String,
24437 "sources": Schema.optionalKey(Schema.Array(WebSearchSource)),
24438 "type": Schema.Literal("search")
24439 }),
24440 Schema.Struct({
24441 "type": Schema.Literal("open_page"),
24442 "url": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
24443 }),
24444 Schema.Struct({ "pattern": Schema.String, "type": Schema.Literal("find_in_page"), "url": Schema.String })
24445 ], { mode: "oneOf" })
24446 ),
24447 "id": Schema.String,
24448 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
24449 "type": Schema.Never,
24450 "call_id": Schema.String,
24451 "created_by": Schema.optionalKey(Schema.String),
24452 "operation": Schema.Union([
24453 ApplyPatchCreateFileOperation,
24454 ApplyPatchUpdateFileOperation,
24455 ApplyPatchDeleteFileOperation
24456 ], { mode: "oneOf" })
24457 }),
24458 Schema.Struct({
24459 "id": Schema.String,
24460 "queries": Schema.Array(Schema.String),
24461 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
24462 "type": Schema.Never,
24463 "call_id": Schema.String,
24464 "created_by": Schema.optionalKey(Schema.String),
24465 "operation": Schema.Union([
24466 ApplyPatchCreateFileOperation,
24467 ApplyPatchUpdateFileOperation,
24468 ApplyPatchDeleteFileOperation
24469 ], { mode: "oneOf" })
24470 }),
24471 Schema.Struct({
24472 "id": Schema.String,
24473 "result": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
24474 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24475 "type": Schema.Never,
24476 "prompt": Schema.optionalKey(
24477 Schema.String.annotate({
24478 "description": "The prompt (possibly rewritten) that the image was generated from."
24479 })
24480 ),
24481 "call_id": Schema.String,
24482 "created_by": Schema.optionalKey(Schema.String),
24483 "operation": Schema.Union([
24484 ApplyPatchCreateFileOperation,
24485 ApplyPatchUpdateFileOperation,
24486 ApplyPatchDeleteFileOperation
24487 ], { mode: "oneOf" })
24488 }),
24489 Schema.Struct({
24490 "code": Schema.Union([Schema.String, Schema.Null]),
24491 "container_id": Schema.String,
24492 "id": Schema.String,
24493 "outputs": Schema.Union([
24494 Schema.Array(
24495 Schema.Union([
24496 Schema.Struct({ "type": Schema.Literal("image"), "url": Schema.String }),
24497 Schema.Struct({ "logs": Schema.String, "type": Schema.Literal("logs") })
24498 ])
24499 ),
24500 Schema.Null
24501 ]),
24502 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24503 "type": Schema.Never,
24504 "call_id": Schema.String,
24505 "created_by": Schema.optionalKey(Schema.String),
24506 "operation": Schema.Union([
24507 ApplyPatchCreateFileOperation,
24508 ApplyPatchUpdateFileOperation,
24509 ApplyPatchDeleteFileOperation
24510 ], { mode: "oneOf" })
24511 }).annotate({ "description": "A code interpreter execution call with outputs" }),
24512 Schema.Struct({
24513 "action": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
24514 "call_id": Schema.String,
24515 "id": Schema.String,
24516 "pending_safety_checks": Schema.Array(
24517 Schema.Struct({ "code": Schema.String, "id": Schema.String, "message": Schema.String })
24518 ),
24519 "status": Schema.Union([Schema.Literal("completed"), Schema.Literal("in_progress")]),
24520 "type": Schema.Never,
24521 "created_by": Schema.optionalKey(Schema.String),
24522 "operation": Schema.Union([
24523 ApplyPatchCreateFileOperation,
24524 ApplyPatchUpdateFileOperation,
24525 ApplyPatchDeleteFileOperation
24526 ], { mode: "oneOf" })
24527 }),
24528 Schema.Struct({
24529 "datetime": Schema.String.annotate({ "description": "ISO 8601 datetime string" }),
24530 "id": Schema.String,
24531 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24532 "timezone": Schema.String.annotate({ "description": "IANA timezone name" }),
24533 "type": Schema.Never,
24534 "call_id": Schema.String,
24535 "created_by": Schema.optionalKey(Schema.String),
24536 "operation": Schema.Union([
24537 ApplyPatchCreateFileOperation,
24538 ApplyPatchUpdateFileOperation,
24539 ApplyPatchDeleteFileOperation
24540 ], { mode: "oneOf" })
24541 }).annotate({ "description": "An openrouter:datetime server tool output item" }),
24542 Schema.Struct({
24543 "action": Schema.optionalKey(
24544 Schema.Struct({
24545 "query": Schema.String,
24546 "sources": Schema.optionalKey(
24547 Schema.Array(Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }))
24548 ),
24549 "type": Schema.Literal("search")
24550 }).annotate({
24551 "description":
24552 "The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider."
24553 })
24554 ),
24555 "id": Schema.String,
24556 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24557 "type": Schema.Never,
24558 "call_id": Schema.String,
24559 "created_by": Schema.optionalKey(Schema.String),
24560 "operation": Schema.Union([
24561 ApplyPatchCreateFileOperation,
24562 ApplyPatchUpdateFileOperation,
24563 ApplyPatchDeleteFileOperation
24564 ], { mode: "oneOf" })
24565 }).annotate({ "description": "An openrouter:web_search server tool output item" }),
24566 Schema.Struct({
24567 "code": Schema.optionalKey(Schema.String),
24568 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
24569 "id": Schema.String,
24570 "language": Schema.optionalKey(Schema.String),
24571 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24572 "stderr": Schema.optionalKey(Schema.String),
24573 "stdout": Schema.optionalKey(Schema.String),
24574 "type": Schema.Never,
24575 "call_id": Schema.String,
24576 "created_by": Schema.optionalKey(Schema.String),
24577 "operation": Schema.Union([
24578 ApplyPatchCreateFileOperation,
24579 ApplyPatchUpdateFileOperation,
24580 ApplyPatchDeleteFileOperation
24581 ], { mode: "oneOf" })
24582 }).annotate({ "description": "An openrouter:code_interpreter server tool output item" }),
24583 Schema.Struct({
24584 "id": Schema.String,
24585 "queries": Schema.optionalKey(Schema.Array(Schema.String)),
24586 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24587 "type": Schema.Never,
24588 "call_id": Schema.String,
24589 "created_by": Schema.optionalKey(Schema.String),
24590 "operation": Schema.Union([
24591 ApplyPatchCreateFileOperation,
24592 ApplyPatchUpdateFileOperation,
24593 ApplyPatchDeleteFileOperation
24594 ], { mode: "oneOf" })
24595 }).annotate({ "description": "An openrouter:file_search server tool output item" }),
24596 Schema.Struct({
24597 "id": Schema.String,
24598 "imageB64": Schema.optionalKey(Schema.String),
24599 "imageUrl": Schema.optionalKey(Schema.String),
24600 "prompt": Schema.optionalKey(
24601 Schema.String.annotate({
24602 "description": "The prompt (possibly rewritten) that the image was generated from."
24603 })
24604 ),
24605 "result": Schema.optionalKey(
24606 Schema.Union([Schema.String, Schema.Null]).annotate({
24607 "description":
24608 "The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format"
24609 })
24610 ),
24611 "revisedPrompt": Schema.optionalKey(Schema.String),
24612 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24613 "type": Schema.Never,
24614 "call_id": Schema.String,
24615 "created_by": Schema.optionalKey(Schema.String),
24616 "operation": Schema.Union([
24617 ApplyPatchCreateFileOperation,
24618 ApplyPatchUpdateFileOperation,
24619 ApplyPatchDeleteFileOperation
24620 ], { mode: "oneOf" })
24621 }).annotate({ "description": "An openrouter:image_generation server tool output item" }),
24622 Schema.Struct({
24623 "action": Schema.optionalKey(Schema.String),
24624 "id": Schema.String,
24625 "screenshotB64": Schema.optionalKey(Schema.String),
24626 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24627 "type": Schema.Never,
24628 "call_id": Schema.String,
24629 "created_by": Schema.optionalKey(Schema.String),
24630 "operation": Schema.Union([
24631 ApplyPatchCreateFileOperation,
24632 ApplyPatchUpdateFileOperation,
24633 ApplyPatchDeleteFileOperation
24634 ], { mode: "oneOf" })
24635 }).annotate({ "description": "An openrouter:browser_use server tool output item" }),
24636 Schema.Struct({
24637 "arguments": Schema.optionalKey(
24638 Schema.String.annotate({ "description": "The raw tool-call arguments string as emitted by the model." })
24639 ),
24640 "call_id": Schema.String.annotate({
24641 "description": "The model-generated tool call id from the originating turn."
24642 }),
24643 "command": Schema.optionalKey(Schema.String),
24644 "exitCode": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
24645 "id": Schema.String,
24646 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24647 "stderr": Schema.optionalKey(Schema.String),
24648 "stdout": Schema.optionalKey(Schema.String),
24649 "type": Schema.Never,
24650 "created_by": Schema.optionalKey(Schema.String),
24651 "operation": Schema.Union([
24652 ApplyPatchCreateFileOperation,
24653 ApplyPatchUpdateFileOperation,
24654 ApplyPatchDeleteFileOperation
24655 ], { mode: "oneOf" })
24656 }).annotate({ "description": "An openrouter:bash server tool output item" }),
24657 Schema.Struct({
24658 "command": Schema.optionalKey(Schema.Literals(["view", "create", "str_replace", "insert"])),
24659 "filePath": Schema.optionalKey(Schema.String),
24660 "id": Schema.String,
24661 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24662 "type": Schema.Never,
24663 "call_id": Schema.String,
24664 "created_by": Schema.optionalKey(Schema.String),
24665 "operation": Schema.Union([
24666 ApplyPatchCreateFileOperation,
24667 ApplyPatchUpdateFileOperation,
24668 ApplyPatchDeleteFileOperation
24669 ], { mode: "oneOf" })
24670 }).annotate({ "description": "An openrouter:text_editor server tool output item" }),
24671 Schema.Struct({
24672 "call_id": Schema.String,
24673 "id": Schema.String,
24674 "operation": Schema.Union([
24675 Schema.Union([
24676 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Literal("create_file") })
24677 .annotate({
24678 "description":
24679 "The `create_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing the new file contents."
24680 }),
24681 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Never }).annotate({
24682 "description":
24683 "The `create_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing the new file contents."
24684 }),
24685 Schema.Struct({ "path": Schema.String, "type": Schema.Never, "diff": Schema.String }).annotate({
24686 "description":
24687 "The `create_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing the new file contents."
24688 })
24689 ], { mode: "oneOf" }),
24690 Schema.Union([
24691 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Never }).annotate({
24692 "description":
24693 "The `update_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing edits to an existing file."
24694 }),
24695 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Literal("update_file") })
24696 .annotate({
24697 "description":
24698 "The `update_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing edits to an existing file."
24699 }),
24700 Schema.Struct({ "path": Schema.String, "type": Schema.Never, "diff": Schema.String }).annotate({
24701 "description":
24702 "The `update_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing edits to an existing file."
24703 })
24704 ], { mode: "oneOf" }),
24705 Schema.Union([
24706 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Never }).annotate({
24707 "description":
24708 "The `delete_file` variant of an `apply_patch_call.operation`. Identifies the file to remove; no diff is required."
24709 }),
24710 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Never }).annotate({
24711 "description":
24712 "The `delete_file` variant of an `apply_patch_call.operation`. Identifies the file to remove; no diff is required."
24713 }),
24714 Schema.Struct({ "path": Schema.String, "type": Schema.Literal("delete_file") }).annotate({
24715 "description":
24716 "The `delete_file` variant of an `apply_patch_call.operation`. Identifies the file to remove; no diff is required."
24717 })
24718 ], { mode: "oneOf" })
24719 ], { mode: "oneOf" }).annotate({
24720 "description":
24721 "The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it."
24722 }),
24723 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24724 "type": Schema.Never,
24725 "created_by": Schema.optionalKey(Schema.String)
24726 }).annotate({
24727 "description":
24728 "An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn."
24729 }),
24730 Schema.Struct({
24731 "call_id": Schema.String,
24732 "id": Schema.String,
24733 "operation": Schema.Union([
24734 Schema.Union([
24735 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Literal("create_file") })
24736 .annotate({
24737 "description":
24738 "The `create_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing the new file contents."
24739 }),
24740 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Never }).annotate({
24741 "description":
24742 "The `create_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing the new file contents."
24743 }),
24744 Schema.Struct({ "path": Schema.String, "type": Schema.Never, "diff": Schema.String }).annotate({
24745 "description":
24746 "The `create_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing the new file contents."
24747 })
24748 ], { mode: "oneOf" }),
24749 Schema.Union([
24750 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Never }).annotate({
24751 "description":
24752 "The `update_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing edits to an existing file."
24753 }),
24754 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Literal("update_file") })
24755 .annotate({
24756 "description":
24757 "The `update_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing edits to an existing file."
24758 }),
24759 Schema.Struct({ "path": Schema.String, "type": Schema.Never, "diff": Schema.String }).annotate({
24760 "description":
24761 "The `update_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing edits to an existing file."
24762 })
24763 ], { mode: "oneOf" }),
24764 Schema.Union([
24765 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Never }).annotate({
24766 "description":
24767 "The `delete_file` variant of an `apply_patch_call.operation`. Identifies the file to remove; no diff is required."
24768 }),
24769 Schema.Struct({ "diff": Schema.String, "path": Schema.String, "type": Schema.Never }).annotate({
24770 "description":
24771 "The `delete_file` variant of an `apply_patch_call.operation`. Identifies the file to remove; no diff is required."
24772 }),
24773 Schema.Struct({ "path": Schema.String, "type": Schema.Literal("delete_file") }).annotate({
24774 "description":
24775 "The `delete_file` variant of an `apply_patch_call.operation`. Identifies the file to remove; no diff is required."
24776 })
24777 ], { mode: "oneOf" })
24778 ], { mode: "oneOf" }).annotate({
24779 "description":
24780 "The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it."
24781 }),
24782 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
24783 "description": "Lifecycle state of an `apply_patch_call` output item."
24784 }),
24785 "type": Schema.Literal("apply_patch_call"),
24786 "created_by": Schema.optionalKey(Schema.String)
24787 }).annotate({
24788 "description":
24789 "A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand."
24790 }),
24791 Schema.Struct({
24792 "action": Schema.optionalKey(Schema.Struct({
24793 "commands": Schema.Array(Schema.String),
24794 "max_output_length": Schema.Union([
24795 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
24796 Schema.Null
24797 ]),
24798 "timeout_ms": Schema.Union([
24799 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
24800 Schema.Null
24801 ])
24802 })),
24803 "call_id": Schema.String,
24804 "id": Schema.String,
24805 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
24806 "description": "Status of a shell call or its output."
24807 }),
24808 "type": Schema.Never,
24809 "created_by": Schema.optionalKey(Schema.String),
24810 "operation": Schema.Union([
24811 ApplyPatchCreateFileOperation,
24812 ApplyPatchUpdateFileOperation,
24813 ApplyPatchDeleteFileOperation
24814 ], { mode: "oneOf" })
24815 }).annotate({
24816 "description":
24817 "A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool."
24818 }),
24819 Schema.Struct({
24820 "call_id": Schema.String,
24821 "id": Schema.String,
24822 "max_output_length": Schema.optionalKey(
24823 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
24824 ),
24825 "output": Schema.Array(Schema.Struct({
24826 "outcome": Schema.Union([
24827 Schema.Struct({
24828 "exit_code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
24829 "type": Schema.Literal("exit")
24830 }),
24831 Schema.Struct({ "type": Schema.Literal("timeout") })
24832 ], { mode: "oneOf" }),
24833 "stderr": Schema.String,
24834 "stdout": Schema.String
24835 })),
24836 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]).annotate({
24837 "description": "Status of a shell call or its output."
24838 }),
24839 "type": Schema.Never,
24840 "created_by": Schema.optionalKey(Schema.String),
24841 "operation": Schema.Union([
24842 ApplyPatchCreateFileOperation,
24843 ApplyPatchUpdateFileOperation,
24844 ApplyPatchDeleteFileOperation
24845 ], { mode: "oneOf" })
24846 }).annotate({
24847 "description":
24848 "A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome."
24849 }),
24850 Schema.Struct({
24851 "content": Schema.optionalKey(Schema.String),
24852 "error": Schema.optionalKey(
24853 Schema.String.annotate({ "description": "The error message if the fetch failed." })
24854 ),
24855 "httpStatus": Schema.optionalKey(
24856 Schema.Number.annotate({ "description": "The HTTP status code returned by the upstream URL fetch." }).check(
24857 Schema.isInt().annotate({ "expected": "an integer" })
24858 )
24859 ),
24860 "id": Schema.String,
24861 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24862 "title": Schema.optionalKey(Schema.String),
24863 "type": Schema.Never,
24864 "url": Schema.optionalKey(Schema.String),
24865 "call_id": Schema.String,
24866 "created_by": Schema.optionalKey(Schema.String),
24867 "operation": Schema.Union([
24868 ApplyPatchCreateFileOperation,
24869 ApplyPatchUpdateFileOperation,
24870 ApplyPatchDeleteFileOperation
24871 ], { mode: "oneOf" })
24872 }).annotate({ "description": "An openrouter:web_fetch server tool output item" }),
24873 Schema.Struct({
24874 "id": Schema.String,
24875 "query": Schema.optionalKey(Schema.String),
24876 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24877 "type": Schema.Never,
24878 "call_id": Schema.String,
24879 "created_by": Schema.optionalKey(Schema.String),
24880 "operation": Schema.Union([
24881 ApplyPatchCreateFileOperation,
24882 ApplyPatchUpdateFileOperation,
24883 ApplyPatchDeleteFileOperation
24884 ], { mode: "oneOf" })
24885 }).annotate({ "description": "An openrouter:tool_search server tool output item" }),
24886 Schema.Struct({
24887 "action": Schema.optionalKey(Schema.Literals(["read", "write", "delete"])),
24888 "id": Schema.String,
24889 "key": Schema.optionalKey(Schema.String),
24890 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24891 "type": Schema.Never,
24892 "value": Schema.optionalKey(Schema.Json.annotate({ "expected": "JSON value" })),
24893 "call_id": Schema.String,
24894 "created_by": Schema.optionalKey(Schema.String),
24895 "operation": Schema.Union([
24896 ApplyPatchCreateFileOperation,
24897 ApplyPatchUpdateFileOperation,
24898 ApplyPatchDeleteFileOperation
24899 ], { mode: "oneOf" })
24900 }).annotate({ "description": "An openrouter:memory server tool output item" }),
24901 Schema.Struct({
24902 "id": Schema.String,
24903 "serverLabel": Schema.optionalKey(Schema.String),
24904 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24905 "toolName": Schema.optionalKey(Schema.String),
24906 "type": Schema.Never,
24907 "call_id": Schema.String,
24908 "created_by": Schema.optionalKey(Schema.String),
24909 "operation": Schema.Union([
24910 ApplyPatchCreateFileOperation,
24911 ApplyPatchUpdateFileOperation,
24912 ApplyPatchDeleteFileOperation
24913 ], { mode: "oneOf" })
24914 }).annotate({ "description": "An openrouter:mcp server tool output item" }),
24915 Schema.Struct({
24916 "arguments": Schema.optionalKey(
24917 Schema.String.annotate({
24918 "description": "The JSON arguments submitted to the search tool (e.g. {\"query\":\"Claude\"})"
24919 })
24920 ),
24921 "id": Schema.String,
24922 "query": Schema.optionalKey(Schema.String),
24923 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24924 "type": Schema.Never,
24925 "call_id": Schema.String,
24926 "created_by": Schema.optionalKey(Schema.String),
24927 "operation": Schema.Union([
24928 ApplyPatchCreateFileOperation,
24929 ApplyPatchUpdateFileOperation,
24930 ApplyPatchDeleteFileOperation
24931 ], { mode: "oneOf" })
24932 }).annotate({ "description": "An openrouter:experimental__search_models server tool output item" }),
24933 Schema.Struct({
24934 "analysis": Schema.optionalKey(FusionAnalysisResult),
24935 "error": Schema.optionalKey(
24936 Schema.String.annotate({
24937 "description": "Error message when the fusion run did not produce an analysis result."
24938 })
24939 ),
24940 "failed_models": Schema.optionalKey(
24941 Schema.Array(Schema.Struct({
24942 "error": Schema.String.annotate({ "description": "Error message describing why the model failed." }),
24943 "model": Schema.String.annotate({ "description": "Slug of the analysis model that failed." }),
24944 "status_code": Schema.optionalKey(
24945 Schema.Number.annotate({
24946 "description": "HTTP status code from the upstream response, when available (e.g. 402, 429)."
24947 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
24948 )
24949 })).annotate({
24950 "description":
24951 "Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel."
24952 })
24953 ),
24954 "failure_reason": Schema.optionalKey(
24955 Schema.String.annotate({
24956 "description":
24957 "Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion."
24958 })
24959 ),
24960 "id": Schema.String,
24961 "responses": Schema.optionalKey(
24962 Schema.Array(Schema.Struct({ "content": Schema.optionalKey(Schema.String), "model": Schema.String }))
24963 .annotate({
24964 "description":
24965 "Analysis models that produced a response in this fusion run, with each model's full panel content."
24966 })
24967 ),
24968 "sources": Schema.optionalKey(
24969 Schema.Array(FusionSource).annotate({
24970 "description":
24971 "Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source."
24972 })
24973 ),
24974 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
24975 "type": Schema.Never,
24976 "call_id": Schema.String,
24977 "created_by": Schema.optionalKey(Schema.String),
24978 "operation": Schema.Union([
24979 ApplyPatchCreateFileOperation,
24980 ApplyPatchUpdateFileOperation,
24981 ApplyPatchDeleteFileOperation
24982 ], { mode: "oneOf" })
24983 }).annotate({ "description": "An openrouter:fusion server tool output item" }),
24984 Schema.Struct({
24985 "advice": Schema.optionalKey(
24986 Schema.String.annotate({
24987 "description": "The advisor model's response (the advice text returned to the executor)."
24988 })
24989 ),
24990 "error": Schema.optionalKey(
24991 Schema.String.annotate({ "description": "Error message when the advisor call did not produce advice." })
24992 ),
24993 "id": Schema.String,
24994 "instance_name": Schema.optionalKey(Schema.String.annotate({
24995 "description":
24996 "Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance."
24997 })),
24998 "model": Schema.optionalKey(
24999 Schema.String.annotate({ "description": "Slug of the advisor model that was consulted." })
25000 ),
25001 "prompt": Schema.optionalKey(
25002 Schema.String.annotate({ "description": "The prompt the executor sent to the advisor." })
25003 ),
25004 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
25005 "type": Schema.Never,
25006 "call_id": Schema.String,
25007 "created_by": Schema.optionalKey(Schema.String),
25008 "operation": Schema.Union([
25009 ApplyPatchCreateFileOperation,
25010 ApplyPatchUpdateFileOperation,
25011 ApplyPatchDeleteFileOperation
25012 ], { mode: "oneOf" })
25013 }).annotate({ "description": "An openrouter:advisor server tool output item" }),
25014 Schema.Struct({
25015 "error": Schema.optionalKey(
25016 Schema.String.annotate({ "description": "Error message when the subagent task did not produce an outcome." })
25017 ),
25018 "id": Schema.String,
25019 "instance_name": Schema.optionalKey(Schema.String.annotate({
25020 "description":
25021 "Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation."
25022 })),
25023 "model": Schema.optionalKey(
25024 Schema.String.annotate({ "description": "Slug of the worker model that executed the task." })
25025 ),
25026 "name": Schema.optionalKey(
25027 Schema.String.annotate({
25028 "description":
25029 "Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent."
25030 })
25031 ),
25032 "outcome": Schema.optionalKey(
25033 Schema.String.annotate({
25034 "description": "The worker model's result (the outcome text returned to the delegating model)."
25035 })
25036 ),
25037 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
25038 "task_description": Schema.optionalKey(
25039 Schema.String.annotate({ "description": "The task description the delegating model sent to the worker." })
25040 ),
25041 "task_name": Schema.optionalKey(
25042 Schema.String.annotate({ "description": "The short task identifier the delegating model supplied." })
25043 ),
25044 "type": Schema.Never,
25045 "call_id": Schema.String,
25046 "created_by": Schema.optionalKey(Schema.String),
25047 "operation": Schema.Union([
25048 ApplyPatchCreateFileOperation,
25049 ApplyPatchUpdateFileOperation,
25050 ApplyPatchDeleteFileOperation
25051 ], { mode: "oneOf" })
25052 }).annotate({ "description": "An openrouter:subagent server tool output item" }),
25053 Schema.Struct({
25054 "error": Schema.optionalKey(
25055 Schema.String.annotate({ "description": "Error message when the file operation failed." })
25056 ),
25057 "file_id": Schema.optionalKey(
25058 Schema.String.annotate({ "description": "The target file id supplied in the tool-call arguments." })
25059 ),
25060 "filename": Schema.optionalKey(
25061 Schema.String.annotate({ "description": "The target filename supplied in the tool-call arguments." })
25062 ),
25063 "id": Schema.String,
25064 "operation": Schema.Never,
25065 "result": Schema.optionalKey(
25066 Schema.String.annotate({ "description": "JSON-serialized result of the file operation." })
25067 ),
25068 "status": Schema.Union([Schema.Literal("in_progress"), Schema.Literal("completed")]),
25069 "type": Schema.Never,
25070 "call_id": Schema.String,
25071 "created_by": Schema.optionalKey(Schema.String)
25072 }).annotate({ "description": "An openrouter:files server tool output item" }),
25073 Schema.Struct({
25074 "call_id": Schema.String,
25075 "id": Schema.String,
25076 "input": Schema.String,
25077 "name": Schema.String,
25078 "namespace": Schema.optionalKey(
25079 Schema.String.annotate({
25080 "description":
25081 "Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"
25082 })
25083 ),
25084 "type": Schema.Never,
25085 "created_by": Schema.optionalKey(Schema.String),
25086 "operation": Schema.Union([
25087 ApplyPatchCreateFileOperation,
25088 ApplyPatchUpdateFileOperation,
25089 ApplyPatchDeleteFileOperation
25090 ], { mode: "oneOf" }),
25091 "status": Schema.Literals(["in_progress", "completed"])
25092 }).annotate({
25093 "description":
25094 "A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments."
25095 })
25096 ], { mode: "oneOf" }).annotate({ "description": "An output item from the response" })
25097 ], { mode: "oneOf" })),
25098 "output_text": Schema.optionalKey(Schema.String),
25099 "parallel_tool_calls": Schema.Boolean,
25100 "presence_penalty": Schema.Union([
25101 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
25102 Schema.Null
25103 ]).annotate({ "format": "double" }),
25104 "previous_response_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
25105 "prompt": Schema.optionalKey(StoredPromptTemplate),
25106 "prompt_cache_key": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
25107 "prompt_cache_options": Schema.optionalKey(PromptCacheOptions),
25108 "reasoning": Schema.optionalKey(BaseReasoningConfig),
25109 "safety_identifier": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
25110 "service_tier": Schema.optionalKey(
25111 Schema.Union([
25112 Schema.Literal("auto"),
25113 Schema.Literal("default"),
25114 Schema.Literal("flex"),
25115 Schema.Literal("priority"),
25116 Schema.Literal("scale"),
25117 Schema.Union([Schema.Null])
25118 ])
25119 ),
25120 "status": OpenAIResponsesResponseStatus,
25121 "store": Schema.optionalKey(Schema.Boolean),
25122 "temperature": Schema.Union([
25123 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
25124 Schema.Null
25125 ]).annotate({ "format": "double" }),
25126 "text": Schema.optionalKey(
25127 Schema.Struct({
25128 "format": Schema.optionalKey(
25129 Schema.Union([
25130 Schema.Union([
25131 Schema.Struct({ "type": Schema.Literal("text") }).annotate({ "description": "Plain text response format" }),
25132 Schema.Struct({ "type": Schema.Never }).annotate({ "description": "Plain text response format" }),
25133 Schema.Struct({
25134 "description": Schema.optionalKey(Schema.String),
25135 "name": Schema.String,
25136 "schema": Schema.Struct({}),
25137 "strict": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
25138 "type": Schema.Never
25139 }).annotate({ "description": "Plain text response format" })
25140 ]).annotate({ "description": "Text response format configuration" }),
25141 Schema.Union([
25142 Schema.Struct({ "type": Schema.Never }).annotate({ "description": "JSON object response format" }),
25143 Schema.Struct({ "type": Schema.Literal("json_object") }).annotate({
25144 "description": "JSON object response format"
25145 }),
25146 Schema.Struct({
25147 "description": Schema.optionalKey(Schema.String),
25148 "name": Schema.String,
25149 "schema": Schema.Struct({}),
25150 "strict": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
25151 "type": Schema.Never
25152 }).annotate({ "description": "JSON object response format" })
25153 ]).annotate({ "description": "Text response format configuration" }),
25154 Schema.Union([
25155 Schema.Struct({
25156 "type": Schema.Never,
25157 "description": Schema.optionalKey(Schema.String),
25158 "name": Schema.String,
25159 "schema": Schema.Struct({}),
25160 "strict": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]))
25161 }).annotate({ "description": "JSON schema constrained response format" }),
25162 Schema.Struct({
25163 "type": Schema.Never,
25164 "description": Schema.optionalKey(Schema.String),
25165 "name": Schema.String,
25166 "schema": Schema.Struct({}),
25167 "strict": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]))
25168 }).annotate({ "description": "JSON schema constrained response format" }),
25169 Schema.Struct({
25170 "description": Schema.optionalKey(Schema.String),
25171 "name": Schema.String,
25172 "schema": Schema.Struct({}),
25173 "strict": Schema.optionalKey(Schema.Union([Schema.Union([Schema.Boolean]), Schema.Union([Schema.Null])])),
25174 "type": Schema.Literal("json_schema")
25175 }).annotate({ "description": "JSON schema constrained response format" })
25176 ]).annotate({ "description": "Text response format configuration" })
25177 ]).annotate({ "description": "Text response format configuration" })
25178 ),
25179 "verbosity": Schema.optionalKey(
25180 Schema.Union([
25181 Schema.Union([Schema.Literal("high")]),
25182 Schema.Union([Schema.Literal("low")]),
25183 Schema.Union([Schema.Literal("medium")]),
25184 Schema.Union([Schema.Union([Schema.Null])])
25185 ])
25186 )
25187 }).annotate({ "description": "Text output configuration including format and verbosity" })
25188 ),
25189 "tool_choice": OpenAIResponsesToolChoice,
25190 "tools": Schema.Array(Schema.Union([
25191 Schema.Struct({
25192 "description": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
25193 "name": Schema.String,
25194 "parameters": Schema.Union([
25195 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })),
25196 Schema.Null
25197 ]),
25198 "strict": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
25199 "type": Schema.Literal("function")
25200 }).annotate({ "description": "Function tool definition" }),
25201 Preview_WebSearchServerTool,
25202 Preview_20250311_WebSearchServerTool,
25203 Legacy_WebSearchServerTool,
25204 WebSearchServerTool,
25205 FileSearchServerTool,
25206 ComputerUseServerTool,
25207 CodeInterpreterServerTool,
25208 McpServerTool,
25209 ImageGenerationServerTool,
25210 CodexLocalShellTool,
25211 ShellServerTool,
25212 ApplyPatchServerTool,
25213 CustomTool,
25214 NamespaceTool
25215 ], { mode: "oneOf" })),
25216 "top_logprobs": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
25217 "top_p": Schema.Union([
25218 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
25219 Schema.Null
25220 ]).annotate({ "format": "double" }),
25221 "truncation": Schema.optionalKey(Truncation),
25222 "usage": Schema.optionalKey(
25223 Schema.Union([Schema.Struct({
25224 "input_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25225 "input_tokens_details": Schema.Struct({
25226 "cache_write_tokens": Schema.optionalKey(
25227 Schema.Union([
25228 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))]),
25229 Schema.Union([Schema.Null])
25230 ])
25231 ),
25232 "cached_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
25233 }),
25234 "output_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25235 "output_tokens_details": Schema.Struct({
25236 "reasoning_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
25237 }),
25238 "total_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25239 "cost": Schema.optionalKey(
25240 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
25241 .annotate({ "description": "Cost of the completion", "format": "double" })
25242 ),
25243 "cost_details": Schema.optionalKey(Schema.Struct({
25244 "upstream_inference_cost": Schema.optionalKey(
25245 Schema.Union([
25246 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
25247 Schema.Null
25248 ]).annotate({ "format": "double" })
25249 ),
25250 "upstream_inference_input_cost": Schema.Number.annotate({ "format": "double" }).check(
25251 Schema.isFinite().annotate({ "expected": "a finite number" })
25252 ),
25253 "upstream_inference_output_cost": Schema.Number.annotate({ "format": "double" }).check(
25254 Schema.isFinite().annotate({ "expected": "a finite number" })
25255 )
25256 })),
25257 "is_byok": Schema.optionalKey(
25258 Schema.Boolean.annotate({
25259 "description": "Whether a request was made using a Bring Your Own Key configuration"
25260 })
25261 ),
25262 "server_tool_use_details": Schema.optionalKey(ServerToolUseDetails)
25263 })]).annotate({ "description": "Token usage information for the response" })
25264 ),
25265 "user": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
25266 "error_type": Schema.optionalKey(ApiErrorType),
25267 "openrouter_metadata": Schema.optionalKey(OpenRouterMetadata)
25268}).annotate({
25269 "description": "Complete non-streaming response from the Responses API",
25270 "identifier": "OpenResponsesResult"
25271})
25272export type StreamEventsResponseOutputItemAdded = {
25273 readonly "item": OutputItems
25274 readonly "output_index": number
25275 readonly "sequence_number": number
25276 readonly "type": "response.output_item.added"
25277}
25278export const StreamEventsResponseOutputItemAdded = Schema.Struct({
25279 "item": OutputItems,
25280 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25281 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25282 "type": Schema.Literal("response.output_item.added")
25283}).annotate({
25284 "description": "Event emitted when a new output item is added to the response",
25285 "identifier": "StreamEventsResponseOutputItemAdded"
25286})
25287export type StreamEventsResponseOutputItemDone = {
25288 readonly "item": OutputItems
25289 readonly "output_index": number
25290 readonly "sequence_number": number
25291 readonly "type": "response.output_item.done"
25292}
25293export const StreamEventsResponseOutputItemDone = Schema.Struct({
25294 "item": OutputItems,
25295 "output_index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25296 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25297 "type": Schema.Literal("response.output_item.done")
25298}).annotate({
25299 "description": "Event emitted when an output item is complete",
25300 "identifier": "StreamEventsResponseOutputItemDone"
25301})
25302export type MessagesContentBlockStartEvent = {
25303 readonly "content_block":
25304 | AnthropicTextBlock
25305 | AnthropicToolUseBlock
25306 | AnthropicThinkingBlock
25307 | AnthropicRedactedThinkingBlock
25308 | ORAnthropicServerToolUseBlock
25309 | AnthropicWebSearchToolResult
25310 | AnthropicWebFetchToolResult
25311 | AnthropicCodeExecutionToolResult
25312 | AnthropicBashCodeExecutionToolResult
25313 | AnthropicTextEditorCodeExecutionToolResult
25314 | AnthropicToolSearchToolResult
25315 | AnthropicContainerUpload
25316 | AnthropicCompactionBlock
25317 | AnthropicAdvisorToolResult
25318 | { readonly "content": string | null; readonly "type": "compaction" }
25319 readonly "index": number
25320 readonly "type": "content_block_start"
25321}
25322export const MessagesContentBlockStartEvent = Schema.Struct({
25323 "content_block": Schema.Union([
25324 AnthropicTextBlock,
25325 AnthropicToolUseBlock,
25326 AnthropicThinkingBlock,
25327 AnthropicRedactedThinkingBlock,
25328 ORAnthropicServerToolUseBlock,
25329 AnthropicWebSearchToolResult,
25330 AnthropicWebFetchToolResult,
25331 AnthropicCodeExecutionToolResult,
25332 AnthropicBashCodeExecutionToolResult,
25333 AnthropicTextEditorCodeExecutionToolResult,
25334 AnthropicToolSearchToolResult,
25335 AnthropicContainerUpload,
25336 AnthropicCompactionBlock,
25337 AnthropicAdvisorToolResult,
25338 Schema.Struct({ "content": Schema.Union([Schema.String, Schema.Null]), "type": Schema.Literal("compaction") })
25339 ]),
25340 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25341 "type": Schema.Literal("content_block_start")
25342}).annotate({
25343 "description": "Event sent when a new content block starts",
25344 "identifier": "MessagesContentBlockStartEvent"
25345})
25346export type ORAnthropicContentBlock =
25347 | AnthropicTextBlock
25348 | AnthropicToolUseBlock
25349 | AnthropicThinkingBlock
25350 | AnthropicRedactedThinkingBlock
25351 | ORAnthropicServerToolUseBlock
25352 | AnthropicWebSearchToolResult
25353 | AnthropicWebFetchToolResult
25354 | AnthropicCodeExecutionToolResult
25355 | AnthropicBashCodeExecutionToolResult
25356 | AnthropicTextEditorCodeExecutionToolResult
25357 | AnthropicToolSearchToolResult
25358 | AnthropicContainerUpload
25359 | AnthropicCompactionBlock
25360 | AnthropicAdvisorToolResult
25361export const ORAnthropicContentBlock = Schema.Union([
25362 AnthropicTextBlock,
25363 AnthropicToolUseBlock,
25364 AnthropicThinkingBlock,
25365 AnthropicRedactedThinkingBlock,
25366 ORAnthropicServerToolUseBlock,
25367 AnthropicWebSearchToolResult,
25368 AnthropicWebFetchToolResult,
25369 AnthropicCodeExecutionToolResult,
25370 AnthropicBashCodeExecutionToolResult,
25371 AnthropicTextEditorCodeExecutionToolResult,
25372 AnthropicToolSearchToolResult,
25373 AnthropicContainerUpload,
25374 AnthropicCompactionBlock,
25375 AnthropicAdvisorToolResult
25376], { mode: "oneOf" }).annotate({ "identifier": "ORAnthropicContentBlock" })
25377export type ImageGenCompletedEvent = {
25378 readonly "b64_json": string
25379 readonly "created": number
25380 readonly "media_type"?: string
25381 readonly "type": "image_generation.completed"
25382 readonly "usage"?: ImageGenerationUsage
25383}
25384export const ImageGenCompletedEvent = Schema.Struct({
25385 "b64_json": Schema.String.annotate({ "description": "Base64-encoded final image data" }),
25386 "created": Schema.Number.annotate({ "description": "Unix timestamp (seconds) when the image was generated" }).check(
25387 Schema.isInt().annotate({ "expected": "an integer" })
25388 ),
25389 "media_type": Schema.optionalKey(
25390 Schema.String.annotate({
25391 "description":
25392 "Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined."
25393 })
25394 ),
25395 "type": Schema.Literal("image_generation.completed").annotate({ "description": "The event type" }),
25396 "usage": Schema.optionalKey(ImageGenerationUsage)
25397}).annotate({
25398 "description": "Emitted when generation completes and the final image is available",
25399 "identifier": "ImageGenCompletedEvent"
25400})
25401export type ImageGenerationResponse = {
25402 readonly "created": number
25403 readonly "data": ReadonlyArray<{ readonly "b64_json": string; readonly "media_type"?: string }>
25404 readonly "usage"?: ImageGenerationUsage
25405}
25406export const ImageGenerationResponse = Schema.Struct({
25407 "created": Schema.Number.annotate({ "description": "Unix timestamp (seconds) when the image was generated" }).check(
25408 Schema.isInt().annotate({ "expected": "an integer" })
25409 ),
25410 "data": Schema.Array(Schema.Struct({
25411 "b64_json": Schema.String.annotate({ "description": "Base64-encoded image bytes" }),
25412 "media_type": Schema.optionalKey(
25413 Schema.String.annotate({
25414 "description":
25415 "Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined."
25416 })
25417 )
25418 })).annotate({ "description": "Generated images" }),
25419 "usage": Schema.optionalKey(ImageGenerationUsage)
25420}).annotate({ "description": "Image generation response", "identifier": "ImageGenerationResponse" })
25421export type ChatResult = {
25422 readonly "choices": ReadonlyArray<ChatChoice>
25423 readonly "created": number
25424 readonly "id": string
25425 readonly "model": string
25426 readonly "object": "chat.completion"
25427 readonly "openrouter_metadata"?: OpenRouterMetadata
25428 readonly "service_tier"?: string | null
25429 readonly "system_fingerprint": string | null
25430 readonly "usage"?: ChatUsage
25431}
25432export const ChatResult = Schema.Struct({
25433 "choices": Schema.Array(ChatChoice).annotate({ "description": "List of completion choices" }),
25434 "created": Schema.Number.annotate({ "description": "Unix timestamp of creation" }).check(
25435 Schema.isInt().annotate({ "expected": "an integer" })
25436 ),
25437 "id": Schema.String.annotate({ "description": "Unique completion identifier" }),
25438 "model": Schema.String.annotate({ "description": "Model used for completion" }),
25439 "object": Schema.Literal("chat.completion"),
25440 "openrouter_metadata": Schema.optionalKey(OpenRouterMetadata),
25441 "service_tier": Schema.optionalKey(
25442 Schema.Union([Schema.String, Schema.Null]).annotate({
25443 "description": "The service tier used by the upstream provider for this request"
25444 })
25445 ),
25446 "system_fingerprint": Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "System fingerprint" }),
25447 "usage": Schema.optionalKey(ChatUsage)
25448}).annotate({ "description": "Chat completion response", "identifier": "ChatResult" })
25449export type ChatRequest = {
25450 readonly "cache_control"?: AnthropicCacheControlDirective
25451 readonly "debug"?: ChatDebugOptions
25452 readonly "frequency_penalty"?: number | null
25453 readonly "image_config"?: ImageConfig
25454 readonly "logit_bias"?: { readonly [x: string]: number } | null
25455 readonly "logprobs"?: boolean | null
25456 readonly "max_completion_tokens"?: number | null
25457 readonly "max_tokens"?: number | null
25458 readonly "messages": ReadonlyArray<ChatMessages>
25459 readonly "metadata"?: {}
25460 readonly "min_p"?: number | null
25461 readonly "modalities"?: ReadonlyArray<"text" | "image" | "audio">
25462 readonly "model"?: ModelName
25463 readonly "models"?: ChatModelNames
25464 readonly "parallel_tool_calls"?: boolean | null
25465 readonly "plugins"?: ReadonlyArray<
25466 | AutoRouterPlugin
25467 | AutoBetaRouterPlugin
25468 | ModerationPlugin
25469 | WebSearchPlugin
25470 | WebFetchPlugin
25471 | FileParserPlugin
25472 | ResponseHealingPlugin
25473 | ContextCompressionPlugin
25474 | ParetoRouterPlugin
25475 | FusionPlugin
25476 >
25477 readonly "prediction"?: Prediction
25478 readonly "presence_penalty"?: number | null
25479 readonly "prompt_cache_key"?: string | null
25480 readonly "prompt_cache_options"?: PromptCacheOptions
25481 readonly "provider"?: ProviderPreferences
25482 readonly "reasoning"?: {
25483 readonly "effort"?: "max" | "xhigh" | "high" | "medium" | "low" | "minimal" | "none" | null
25484 readonly "summary"?: ChatReasoningSummaryVerbosityEnum
25485 }
25486 readonly "reasoning_effort"?: "max" | "xhigh" | "high" | "medium" | "low" | "minimal" | "none" | null
25487 readonly "repetition_penalty"?: number | null
25488 readonly "response_format"?:
25489 | ChatFormatTextConfig
25490 | ChatFormatJsonObjectConfig
25491 | ChatFormatJsonSchemaConfig
25492 | ChatFormatGrammarConfig
25493 | ChatFormatPythonConfig
25494 readonly "route"?: DeprecatedRoute
25495 readonly "seed"?: number | null
25496 readonly "service_tier"?: "auto" | "default" | "flex" | "priority" | "scale" | null
25497 readonly "session_id"?: string
25498 readonly "stop"?: string | ReadonlyArray<string> | null
25499 readonly "stop_server_tools_when"?: StopServerToolsWhen
25500 readonly "stream"?: boolean
25501 readonly "stream_options"?: ChatStreamOptions
25502 readonly "temperature"?: number | null
25503 readonly "tool_choice"?: ChatToolChoice
25504 readonly "tools"?: ReadonlyArray<ChatFunctionTool>
25505 readonly "top_a"?: number | null
25506 readonly "top_k"?: number | null
25507 readonly "top_logprobs"?: number | null
25508 readonly "top_p"?: number | null
25509 readonly "trace"?: TraceConfig
25510 readonly "user"?: string
25511}
25512export const ChatRequest = Schema.Struct({
25513 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
25514 "debug": Schema.optionalKey(ChatDebugOptions),
25515 "frequency_penalty": Schema.optionalKey(
25516 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
25517 .annotate({ "description": "Frequency penalty (-2.0 to 2.0)", "format": "double" })
25518 ),
25519 "image_config": Schema.optionalKey(ImageConfig),
25520 "logit_bias": Schema.optionalKey(
25521 Schema.Union([
25522 Schema.Record(
25523 Schema.String,
25524 Schema.Number.annotate({ "format": "double" }).check(
25525 Schema.isFinite().annotate({ "expected": "a finite number" })
25526 )
25527 ),
25528 Schema.Null
25529 ]).annotate({ "description": "Token logit bias adjustments" })
25530 ),
25531 "logprobs": Schema.optionalKey(
25532 Schema.Union([Schema.Boolean, Schema.Null]).annotate({ "description": "Return log probabilities" })
25533 ),
25534 "max_completion_tokens": Schema.optionalKey(
25535 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]).annotate({
25536 "description": "Maximum tokens in completion"
25537 })
25538 ),
25539 "max_tokens": Schema.optionalKey(
25540 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]).annotate({
25541 "description":
25542 "Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16."
25543 })
25544 ),
25545 "messages": Schema.Array(ChatMessages).annotate({ "description": "List of messages for the conversation" }).check(
25546 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
25547 ),
25548 "metadata": Schema.optionalKey(
25549 Schema.Struct({}).annotate({
25550 "description": "Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)"
25551 })
25552 ),
25553 "min_p": Schema.optionalKey(
25554 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
25555 .annotate({
25556 "description":
25557 "Minimum probability threshold relative to the most likely token. Tokens with probability below min_p * (probability of top token) are filtered out. Not all providers support this parameter.",
25558 "format": "double"
25559 })
25560 ),
25561 "modalities": Schema.optionalKey(
25562 Schema.Array(Schema.Literals(["text", "image", "audio"])).annotate({
25563 "description": "Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\"."
25564 })
25565 ),
25566 "model": Schema.optionalKey(ModelName),
25567 "models": Schema.optionalKey(ChatModelNames),
25568 "parallel_tool_calls": Schema.optionalKey(
25569 Schema.Union([Schema.Boolean, Schema.Null]).annotate({
25570 "description":
25571 "Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response."
25572 })
25573 ),
25574 "plugins": Schema.optionalKey(
25575 Schema.Array(
25576 Schema.Union([
25577 AutoRouterPlugin,
25578 AutoBetaRouterPlugin,
25579 ModerationPlugin,
25580 WebSearchPlugin,
25581 WebFetchPlugin,
25582 FileParserPlugin,
25583 ResponseHealingPlugin,
25584 ContextCompressionPlugin,
25585 ParetoRouterPlugin,
25586 FusionPlugin
25587 ], { mode: "oneOf" })
25588 ).annotate({ "description": "Plugins you want to enable for this request, including their settings." })
25589 ),
25590 "prediction": Schema.optionalKey(Prediction),
25591 "presence_penalty": Schema.optionalKey(
25592 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
25593 .annotate({ "description": "Presence penalty (-2.0 to 2.0)", "format": "double" })
25594 ),
25595 "prompt_cache_key": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
25596 "prompt_cache_options": Schema.optionalKey(PromptCacheOptions),
25597 "provider": Schema.optionalKey(ProviderPreferences),
25598 "reasoning": Schema.optionalKey(
25599 Schema.Struct({
25600 "effort": Schema.optionalKey(
25601 Schema.Union([
25602 Schema.Literal("max"),
25603 Schema.Literal("xhigh"),
25604 Schema.Literal("high"),
25605 Schema.Literal("medium"),
25606 Schema.Literal("low"),
25607 Schema.Literal("minimal"),
25608 Schema.Literal("none"),
25609 Schema.Null
25610 ]).annotate({ "description": "Constrains effort on reasoning for reasoning models" })
25611 ),
25612 "summary": Schema.optionalKey(ChatReasoningSummaryVerbosityEnum)
25613 }).annotate({ "description": "Configuration options for reasoning models" })
25614 ),
25615 "reasoning_effort": Schema.optionalKey(
25616 Schema.Union([
25617 Schema.Literal("max"),
25618 Schema.Literal("xhigh"),
25619 Schema.Literal("high"),
25620 Schema.Literal("medium"),
25621 Schema.Literal("low"),
25622 Schema.Literal("minimal"),
25623 Schema.Literal("none"),
25624 Schema.Null
25625 ]).annotate({
25626 "description":
25627 "Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ."
25628 })
25629 ),
25630 "repetition_penalty": Schema.optionalKey(
25631 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
25632 .annotate({
25633 "description":
25634 "Penalizes tokens based on how much they have already appeared in the text. A value of 1.0 means no penalty. Values above 1.0 penalize repeated tokens more strongly. Not all providers support this parameter.",
25635 "format": "double"
25636 })
25637 ),
25638 "response_format": Schema.optionalKey(
25639 Schema.Union([
25640 ChatFormatTextConfig,
25641 ChatFormatJsonObjectConfig,
25642 ChatFormatJsonSchemaConfig,
25643 ChatFormatGrammarConfig,
25644 ChatFormatPythonConfig
25645 ], { mode: "oneOf" }).annotate({ "description": "Response format configuration" })
25646 ),
25647 "route": Schema.optionalKey(DeprecatedRoute),
25648 "seed": Schema.optionalKey(
25649 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]).annotate({
25650 "description": "Random seed for deterministic outputs"
25651 })
25652 ),
25653 "service_tier": Schema.optionalKey(
25654 Schema.Union([
25655 Schema.Literal("auto"),
25656 Schema.Literal("default"),
25657 Schema.Literal("flex"),
25658 Schema.Literal("priority"),
25659 Schema.Literal("scale"),
25660 Schema.Null
25661 ]).annotate({ "description": "The service tier to use for processing this request." })
25662 ),
25663 "session_id": Schema.optionalKey(
25664 Schema.String.annotate({
25665 "description":
25666 "A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters."
25667 }).check(Schema.isMaxLength(256).annotate({ "expected": "a value with a length of at most 256" }))
25668 ),
25669 "stop": Schema.optionalKey(
25670 Schema.Union([
25671 Schema.String,
25672 Schema.Array(Schema.String).check(
25673 Schema.isMaxLength(4).annotate({ "expected": "a value with a length of at most 4" })
25674 ),
25675 Schema.Null
25676 ]).annotate({ "description": "Stop sequences (up to 4)" })
25677 ),
25678 "stop_server_tools_when": Schema.optionalKey(StopServerToolsWhen),
25679 "stream": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Enable streaming response" })),
25680 "stream_options": Schema.optionalKey(ChatStreamOptions),
25681 "temperature": Schema.optionalKey(
25682 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
25683 .annotate({ "description": "Sampling temperature (0-2)", "format": "double" })
25684 ),
25685 "tool_choice": Schema.optionalKey(ChatToolChoice),
25686 "tools": Schema.optionalKey(
25687 Schema.Array(ChatFunctionTool).annotate({ "description": "Available tools for function calling" })
25688 ),
25689 "top_a": Schema.optionalKey(
25690 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
25691 .annotate({
25692 "description":
25693 "Consider only tokens with \"sufficiently high\" probabilities based on the probability of the most likely token. Not all providers support this parameter.",
25694 "format": "double"
25695 })
25696 ),
25697 "top_k": Schema.optionalKey(
25698 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]).annotate({
25699 "description":
25700 "Limits the model to choose from the top K most likely tokens at each step. A value of 1 means the model will always pick the most likely next token. Not all providers support this parameter."
25701 })
25702 ),
25703 "top_logprobs": Schema.optionalKey(
25704 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]).annotate({
25705 "description": "Number of top log probabilities to return (0-20)"
25706 })
25707 ),
25708 "top_p": Schema.optionalKey(
25709 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
25710 .annotate({ "description": "Nucleus sampling parameter (0-1)", "format": "double" })
25711 ),
25712 "trace": Schema.optionalKey(TraceConfig),
25713 "user": Schema.optionalKey(Schema.String.annotate({
25714 "description":
25715 "Per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account."
25716 }))
25717}).annotate({ "description": "Chat completion request parameters", "identifier": "ChatRequest" })
25718export type ChatStreamChunk = {
25719 readonly "choices": ReadonlyArray<ChatStreamChoice>
25720 readonly "created": number
25721 readonly "error"?: {
25722 readonly "code": number
25723 readonly "message": string
25724 readonly "metadata"?: { readonly "error_type": ApiErrorType; readonly "provider_code"?: string }
25725 }
25726 readonly "id": string
25727 readonly "model": string
25728 readonly "object": "chat.completion.chunk"
25729 readonly "openrouter_metadata"?: OpenRouterMetadata
25730 readonly "service_tier"?: string | null
25731 readonly "system_fingerprint"?: string
25732 readonly "usage"?: ChatUsage
25733}
25734export const ChatStreamChunk = Schema.Struct({
25735 "choices": Schema.Array(ChatStreamChoice).annotate({ "description": "List of streaming chunk choices" }),
25736 "created": Schema.Number.annotate({ "description": "Unix timestamp of creation" }).check(
25737 Schema.isInt().annotate({ "expected": "an integer" })
25738 ),
25739 "error": Schema.optionalKey(
25740 Schema.Struct({
25741 "code": Schema.Number.annotate({ "description": "Error code", "format": "int32" }).check(
25742 Schema.isInt().annotate({ "expected": "an integer" })
25743 ),
25744 "message": Schema.String.annotate({ "description": "Error message" }),
25745 "metadata": Schema.optionalKey(
25746 Schema.Struct({
25747 "error_type": ApiErrorType,
25748 "provider_code": Schema.optionalKey(
25749 Schema.String.annotate({ "description": "Upstream provider-specific error code, when available" })
25750 )
25751 }).annotate({ "description": "Structured error metadata" })
25752 )
25753 }).annotate({ "description": "Error information" })
25754 ),
25755 "id": Schema.String.annotate({ "description": "Unique chunk identifier" }),
25756 "model": Schema.String.annotate({ "description": "Model used for completion" }),
25757 "object": Schema.Literal("chat.completion.chunk"),
25758 "openrouter_metadata": Schema.optionalKey(OpenRouterMetadata),
25759 "service_tier": Schema.optionalKey(
25760 Schema.Union([Schema.String, Schema.Null]).annotate({
25761 "description": "The service tier used by the upstream provider for this request"
25762 })
25763 ),
25764 "system_fingerprint": Schema.optionalKey(Schema.String.annotate({ "description": "System fingerprint" })),
25765 "usage": Schema.optionalKey(ChatUsage)
25766}).annotate({ "description": "Streaming chat completion chunk", "identifier": "ChatStreamChunk" })
25767export type Inputs = string | Arrays_8
25768export const Inputs = Schema.Union([Schema.String, Arrays_8]).annotate({
25769 "description": "Input for a response request - can be a string or array of items",
25770 "identifier": "Inputs"
25771})
25772export type CompletedEvent = {
25773 readonly "response": BaseResponsesResult
25774 readonly "sequence_number": number
25775 readonly "type": "response.completed"
25776}
25777export const CompletedEvent = Schema.Struct({
25778 "response": BaseResponsesResult,
25779 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25780 "type": Schema.Literal("response.completed")
25781}).annotate({
25782 "description": "Event emitted when a response has completed successfully",
25783 "identifier": "CompletedEvent"
25784})
25785export type CreatedEvent = {
25786 readonly "response": BaseResponsesResult
25787 readonly "sequence_number": number
25788 readonly "type": "response.created"
25789}
25790export const CreatedEvent = Schema.Struct({
25791 "response": BaseResponsesResult,
25792 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25793 "type": Schema.Literal("response.created")
25794}).annotate({ "description": "Event emitted when a response is created", "identifier": "CreatedEvent" })
25795export type FailedEvent = {
25796 readonly "response": BaseResponsesResult
25797 readonly "sequence_number": number
25798 readonly "type": "response.failed"
25799}
25800export const FailedEvent = Schema.Struct({
25801 "response": BaseResponsesResult,
25802 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25803 "type": Schema.Literal("response.failed")
25804}).annotate({ "description": "Event emitted when a response has failed", "identifier": "FailedEvent" })
25805export type IncompleteEvent = {
25806 readonly "response": BaseResponsesResult
25807 readonly "sequence_number": number
25808 readonly "type": "response.incomplete"
25809}
25810export const IncompleteEvent = Schema.Struct({
25811 "response": BaseResponsesResult,
25812 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25813 "type": Schema.Literal("response.incomplete")
25814}).annotate({ "description": "Event emitted when a response is incomplete", "identifier": "IncompleteEvent" })
25815export type InProgressEvent = {
25816 readonly "response": BaseResponsesResult
25817 readonly "sequence_number": number
25818 readonly "type": "response.in_progress"
25819}
25820export const InProgressEvent = Schema.Struct({
25821 "response": BaseResponsesResult,
25822 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25823 "type": Schema.Literal("response.in_progress")
25824}).annotate({ "description": "Event emitted when a response is in progress", "identifier": "InProgressEvent" })
25825export type OpenResponsesCreatedEvent = {
25826 readonly "response": OpenResponsesResult
25827 readonly "sequence_number": number
25828 readonly "type": "response.created"
25829}
25830export const OpenResponsesCreatedEvent = Schema.Struct({
25831 "response": OpenResponsesResult,
25832 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25833 "type": Schema.Literal("response.created")
25834}).annotate({ "description": "Event emitted when a response is created", "identifier": "OpenResponsesCreatedEvent" })
25835export type OpenResponsesInProgressEvent = {
25836 readonly "response": OpenResponsesResult
25837 readonly "sequence_number": number
25838 readonly "type": "response.in_progress"
25839}
25840export const OpenResponsesInProgressEvent = Schema.Struct({
25841 "response": OpenResponsesResult,
25842 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25843 "type": Schema.Literal("response.in_progress")
25844}).annotate({
25845 "description": "Event emitted when a response is in progress",
25846 "identifier": "OpenResponsesInProgressEvent"
25847})
25848export type StreamEventsResponseCompleted = {
25849 readonly "response": OpenResponsesResult
25850 readonly "sequence_number": number
25851 readonly "type": "response.completed"
25852}
25853export const StreamEventsResponseCompleted = Schema.Struct({
25854 "response": OpenResponsesResult,
25855 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25856 "type": Schema.Literal("response.completed")
25857}).annotate({
25858 "description": "Event emitted when a response has completed successfully",
25859 "identifier": "StreamEventsResponseCompleted"
25860})
25861export type StreamEventsResponseFailed = {
25862 readonly "response": OpenResponsesResult
25863 readonly "sequence_number": number
25864 readonly "type": "response.failed"
25865}
25866export const StreamEventsResponseFailed = Schema.Struct({
25867 "response": OpenResponsesResult,
25868 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25869 "type": Schema.Literal("response.failed")
25870}).annotate({ "description": "Event emitted when a response has failed", "identifier": "StreamEventsResponseFailed" })
25871export type StreamEventsResponseIncomplete = {
25872 readonly "response": OpenResponsesResult
25873 readonly "sequence_number": number
25874 readonly "type": "response.incomplete"
25875}
25876export const StreamEventsResponseIncomplete = Schema.Struct({
25877 "response": OpenResponsesResult,
25878 "sequence_number": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25879 "type": Schema.Literal("response.incomplete")
25880}).annotate({
25881 "description": "Event emitted when a response is incomplete",
25882 "identifier": "StreamEventsResponseIncomplete"
25883})
25884export type BaseMessagesResult = {
25885 readonly "container": AnthropicContainer
25886 readonly "content": ReadonlyArray<ORAnthropicContentBlock>
25887 readonly "id": string
25888 readonly "model": string
25889 readonly "role": "assistant"
25890 readonly "stop_details": AnthropicRefusalStopDetails
25891 readonly "stop_reason": ORAnthropicStopReason
25892 readonly "stop_sequence": string | null
25893 readonly "type": "message"
25894 readonly "usage": {
25895 readonly "cache_creation": AnthropicCacheCreation
25896 readonly "cache_creation_input_tokens": number | null
25897 readonly "cache_read_input_tokens": number | null
25898 readonly "inference_geo": string | null
25899 readonly "input_tokens": number
25900 readonly "output_tokens": number
25901 readonly "output_tokens_details": AnthropicOutputTokensDetails
25902 readonly "server_tool_use": AnthropicServerToolUsage
25903 readonly "service_tier": AnthropicServiceTier
25904 readonly "iterations"?: ReadonlyArray<AnthropicUsageIteration>
25905 readonly "speed"?: AnthropicSpeed
25906 }
25907}
25908export const BaseMessagesResult = Schema.Struct({
25909 "container": AnthropicContainer,
25910 "content": Schema.Array(ORAnthropicContentBlock),
25911 "id": Schema.String,
25912 "model": Schema.String,
25913 "role": Schema.Literal("assistant"),
25914 "stop_details": AnthropicRefusalStopDetails,
25915 "stop_reason": ORAnthropicStopReason,
25916 "stop_sequence": Schema.Union([Schema.String, Schema.Null]),
25917 "type": Schema.Literal("message"),
25918 "usage": Schema.Struct({
25919 "cache_creation": AnthropicCacheCreation,
25920 "cache_creation_input_tokens": Schema.Union([
25921 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25922 Schema.Null
25923 ]),
25924 "cache_read_input_tokens": Schema.Union([
25925 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25926 Schema.Null
25927 ]),
25928 "inference_geo": Schema.Union([Schema.String, Schema.Null]),
25929 "input_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25930 "output_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
25931 "output_tokens_details": AnthropicOutputTokensDetails,
25932 "server_tool_use": AnthropicServerToolUsage,
25933 "service_tier": AnthropicServiceTier,
25934 "iterations": Schema.optionalKey(Schema.Array(AnthropicUsageIteration)),
25935 "speed": Schema.optionalKey(AnthropicSpeed)
25936 })
25937}).annotate({
25938 "description": "Base Anthropic Messages API response before OpenRouter extensions",
25939 "identifier": "BaseMessagesResult"
25940})
25941export type MessagesResult = {
25942 readonly "container": AnthropicContainer
25943 readonly "content": ReadonlyArray<ORAnthropicContentBlock>
25944 readonly "id": string
25945 readonly "model": string
25946 readonly "role": "assistant"
25947 readonly "stop_details": AnthropicRefusalStopDetails
25948 readonly "stop_reason": ORAnthropicStopReason
25949 readonly "stop_sequence": string | null
25950 readonly "type": "message"
25951 readonly "usage": {
25952 readonly "cache_creation": {
25953 readonly "ephemeral_1h_input_tokens": number
25954 readonly "ephemeral_5m_input_tokens": number
25955 readonly [x: string]: Schema.Json
25956 } | null
25957 readonly "cache_creation_input_tokens": number | null
25958 readonly "cache_read_input_tokens": number | null
25959 readonly "inference_geo": string | null
25960 readonly "input_tokens": number
25961 readonly "output_tokens": number
25962 readonly "output_tokens_details": { readonly "thinking_tokens": number; readonly [x: string]: Schema.Json } | null
25963 readonly "server_tool_use": {
25964 readonly "web_fetch_requests": number
25965 readonly "web_search_requests": number
25966 readonly [x: string]: Schema.Json
25967 } | null
25968 readonly "service_tier": "standard" | "priority" | "batch" | null
25969 readonly "iterations"?: ReadonlyArray<
25970 {
25971 readonly "cache_creation"?: {
25972 readonly "ephemeral_1h_input_tokens"?: number
25973 readonly "ephemeral_5m_input_tokens"?: number
25974 readonly [x: string]: Schema.Json
25975 } | null
25976 readonly "cache_creation_input_tokens"?: number
25977 readonly "cache_read_input_tokens"?: number
25978 readonly "input_tokens"?: number
25979 readonly "output_tokens"?: number
25980 readonly "type": "compaction"
25981 } | {
25982 readonly "cache_creation"?: {
25983 readonly "ephemeral_1h_input_tokens"?: number
25984 readonly "ephemeral_5m_input_tokens"?: number
25985 readonly [x: string]: Schema.Json
25986 } | null
25987 readonly "cache_creation_input_tokens"?: number
25988 readonly "cache_read_input_tokens"?: number
25989 readonly "input_tokens"?: number
25990 readonly "output_tokens"?: number
25991 readonly "model"?: string
25992 readonly "type": never
25993 } | {
25994 readonly "cache_creation"?: {
25995 readonly "ephemeral_1h_input_tokens"?: number
25996 readonly "ephemeral_5m_input_tokens"?: number
25997 readonly [x: string]: Schema.Json
25998 } | null
25999 readonly "cache_creation_input_tokens"?: number
26000 readonly "cache_read_input_tokens"?: number
26001 readonly "input_tokens"?: number
26002 readonly "output_tokens"?: number
26003 readonly "model": string
26004 readonly "type": never
26005 } | {
26006 readonly "cache_creation"?: {
26007 readonly "ephemeral_1h_input_tokens"?: number
26008 readonly "ephemeral_5m_input_tokens"?: number
26009 readonly [x: string]: Schema.Json
26010 } | null
26011 readonly "cache_creation_input_tokens"?: number
26012 readonly "cache_read_input_tokens"?: number
26013 readonly "input_tokens"?: number
26014 readonly "output_tokens"?: number
26015 readonly "type": "compaction"
26016 } | {
26017 readonly "cache_creation"?: {
26018 readonly "ephemeral_1h_input_tokens"?: number
26019 readonly "ephemeral_5m_input_tokens"?: number
26020 readonly [x: string]: Schema.Json
26021 } | null
26022 readonly "cache_creation_input_tokens"?: number
26023 readonly "cache_read_input_tokens"?: number
26024 readonly "input_tokens"?: number
26025 readonly "output_tokens"?: number
26026 readonly "type": never
26027 readonly "model"?: string
26028 } | {
26029 readonly "cache_creation"?: {
26030 readonly "ephemeral_1h_input_tokens"?: number
26031 readonly "ephemeral_5m_input_tokens"?: number
26032 readonly [x: string]: Schema.Json
26033 } | null
26034 readonly "cache_creation_input_tokens"?: number
26035 readonly "cache_read_input_tokens"?: number
26036 readonly "input_tokens"?: number
26037 readonly "output_tokens"?: number
26038 readonly "model"?: string
26039 readonly "type": "message"
26040 } | {
26041 readonly "cache_creation"?: {
26042 readonly "ephemeral_1h_input_tokens"?: number
26043 readonly "ephemeral_5m_input_tokens"?: number
26044 readonly [x: string]: Schema.Json
26045 } | null
26046 readonly "cache_creation_input_tokens"?: number
26047 readonly "cache_read_input_tokens"?: number
26048 readonly "input_tokens"?: number
26049 readonly "output_tokens"?: number
26050 readonly "model": string
26051 readonly "type": never
26052 } | {
26053 readonly "cache_creation"?: {
26054 readonly "ephemeral_1h_input_tokens"?: number
26055 readonly "ephemeral_5m_input_tokens"?: number
26056 readonly [x: string]: Schema.Json
26057 } | null
26058 readonly "cache_creation_input_tokens"?: number
26059 readonly "cache_read_input_tokens"?: number
26060 readonly "input_tokens"?: number
26061 readonly "output_tokens"?: number
26062 readonly "type": "message"
26063 readonly "model"?: string
26064 } | {
26065 readonly "cache_creation"?: {
26066 readonly "ephemeral_1h_input_tokens"?: number
26067 readonly "ephemeral_5m_input_tokens"?: number
26068 readonly [x: string]: Schema.Json
26069 } | null
26070 readonly "cache_creation_input_tokens"?: number
26071 readonly "cache_read_input_tokens"?: number
26072 readonly "input_tokens"?: number
26073 readonly "output_tokens"?: number
26074 readonly "type": never
26075 readonly "model": string
26076 } | {
26077 readonly "cache_creation"?: {
26078 readonly "ephemeral_1h_input_tokens"?: number
26079 readonly "ephemeral_5m_input_tokens"?: number
26080 readonly [x: string]: Schema.Json
26081 } | null
26082 readonly "cache_creation_input_tokens"?: number
26083 readonly "cache_read_input_tokens"?: number
26084 readonly "input_tokens"?: number
26085 readonly "output_tokens"?: number
26086 readonly "model": string
26087 readonly "type": never
26088 } | {
26089 readonly "cache_creation"?: {
26090 readonly "ephemeral_1h_input_tokens"?: number
26091 readonly "ephemeral_5m_input_tokens"?: number
26092 readonly [x: string]: Schema.Json
26093 } | null
26094 readonly "cache_creation_input_tokens"?: number
26095 readonly "cache_read_input_tokens"?: number
26096 readonly "input_tokens"?: number
26097 readonly "output_tokens"?: number
26098 readonly "model": string
26099 readonly "type": "advisor_message"
26100 } | {
26101 readonly "cache_creation"?: {
26102 readonly "ephemeral_1h_input_tokens"?: number
26103 readonly "ephemeral_5m_input_tokens"?: number
26104 readonly [x: string]: Schema.Json
26105 } | null
26106 readonly "cache_creation_input_tokens"?: number
26107 readonly "cache_read_input_tokens"?: number
26108 readonly "input_tokens"?: number
26109 readonly "output_tokens"?: number
26110 readonly "type": "advisor_message"
26111 readonly "model": string
26112 } | {
26113 readonly "cache_creation"?: {
26114 readonly "ephemeral_1h_input_tokens"?: number
26115 readonly "ephemeral_5m_input_tokens"?: number
26116 readonly [x: string]: Schema.Json
26117 } | null
26118 readonly "cache_creation_input_tokens"?: number
26119 readonly "cache_read_input_tokens"?: number
26120 readonly "input_tokens"?: number
26121 readonly "output_tokens"?: number
26122 readonly "type": "compaction"
26123 } | {
26124 readonly "cache_creation"?: {
26125 readonly "ephemeral_1h_input_tokens"?: number
26126 readonly "ephemeral_5m_input_tokens"?: number
26127 readonly [x: string]: Schema.Json
26128 } | null
26129 readonly "cache_creation_input_tokens"?: number
26130 readonly "cache_read_input_tokens"?: number
26131 readonly "input_tokens"?: number
26132 readonly "output_tokens"?: number
26133 readonly "model"?: string
26134 readonly "type": "message"
26135 } | {
26136 readonly "cache_creation"?: {
26137 readonly "ephemeral_1h_input_tokens"?: number
26138 readonly "ephemeral_5m_input_tokens"?: number
26139 readonly [x: string]: Schema.Json
26140 } | null
26141 readonly "cache_creation_input_tokens"?: number
26142 readonly "cache_read_input_tokens"?: number
26143 readonly "input_tokens"?: number
26144 readonly "output_tokens"?: number
26145 readonly "model": string
26146 readonly "type": "advisor_message"
26147 } | {
26148 readonly "cache_creation"?: {
26149 readonly "ephemeral_1h_input_tokens"?: number
26150 readonly "ephemeral_5m_input_tokens"?: number
26151 readonly [x: string]: Schema.Json
26152 } | null
26153 readonly "cache_creation_input_tokens"?: number
26154 readonly "cache_read_input_tokens"?: number
26155 readonly "input_tokens"?: number
26156 readonly "output_tokens"?: number
26157 readonly "type": string
26158 }
26159 >
26160 readonly "speed"?: "fast" | "standard" | null
26161 readonly "cost"?: number | null
26162 readonly "cost_details"?: CostDetails
26163 readonly "is_byok"?: boolean
26164 }
26165 readonly "context_management"?: {
26166 readonly "applied_edits": ReadonlyArray<{ readonly "type": string }>
26167 readonly [x: string]: Schema.Json
26168 } | null
26169 readonly "openrouter_metadata"?: OpenRouterMetadata
26170 readonly "provider"?: ProviderName
26171}
26172export const MessagesResult = Schema.Struct({
26173 "container": AnthropicContainer,
26174 "content": Schema.Array(ORAnthropicContentBlock),
26175 "id": Schema.String,
26176 "model": Schema.String,
26177 "role": Schema.Literal("assistant"),
26178 "stop_details": AnthropicRefusalStopDetails,
26179 "stop_reason": ORAnthropicStopReason,
26180 "stop_sequence": Schema.Union([Schema.String, Schema.Null]),
26181 "type": Schema.Literal("message"),
26182 "usage": Schema.Struct({
26183 "cache_creation": Schema.Union([
26184 Schema.Union([
26185 Schema.StructWithRest(
26186 Schema.Struct({
26187 "ephemeral_1h_input_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
26188 "ephemeral_5m_input_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26189 }),
26190 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26191 )
26192 ]),
26193 Schema.Union([Schema.Null])
26194 ]),
26195 "cache_creation_input_tokens": Schema.Union([
26196 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))]),
26197 Schema.Union([Schema.Null])
26198 ]),
26199 "cache_read_input_tokens": Schema.Union([
26200 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))]),
26201 Schema.Union([Schema.Null])
26202 ]),
26203 "inference_geo": Schema.Union([Schema.Union([Schema.String]), Schema.Union([Schema.Null])]),
26204 "input_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
26205 "output_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
26206 "output_tokens_details": Schema.Union([
26207 Schema.Union([
26208 Schema.StructWithRest(
26209 Schema.Struct({
26210 "thinking_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26211 }),
26212 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26213 )
26214 ]),
26215 Schema.Union([Schema.Null])
26216 ]),
26217 "server_tool_use": Schema.Union([
26218 Schema.Union([
26219 Schema.StructWithRest(
26220 Schema.Struct({
26221 "web_fetch_requests": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
26222 "web_search_requests": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26223 }),
26224 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26225 )
26226 ]),
26227 Schema.Union([Schema.Null])
26228 ]),
26229 "service_tier": Schema.Union([
26230 Schema.Union([Schema.Literal("standard")]),
26231 Schema.Union([Schema.Literal("priority")]),
26232 Schema.Union([Schema.Literal("batch")]),
26233 Schema.Union([Schema.Union([Schema.Null])])
26234 ]),
26235 "iterations": Schema.optionalKey(Schema.Array(Schema.Union([
26236 Schema.Union([
26237 Schema.Struct({
26238 "cache_creation": Schema.optionalKey(
26239 Schema.Union([
26240 Schema.Union([
26241 Schema.StructWithRest(
26242 Schema.Struct({
26243 "ephemeral_1h_input_tokens": Schema.optionalKey(
26244 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26245 ),
26246 "ephemeral_5m_input_tokens": Schema.optionalKey(
26247 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26248 )
26249 }),
26250 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26251 )
26252 ]),
26253 Schema.Union([Schema.Null])
26254 ])
26255 ),
26256 "cache_creation_input_tokens": Schema.optionalKey(
26257 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26258 ),
26259 "cache_read_input_tokens": Schema.optionalKey(
26260 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26261 ),
26262 "input_tokens": Schema.optionalKey(
26263 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26264 ),
26265 "output_tokens": Schema.optionalKey(
26266 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26267 ),
26268 "type": Schema.Literal("compaction")
26269 }),
26270 Schema.Struct({
26271 "cache_creation": Schema.optionalKey(
26272 Schema.Union([
26273 Schema.Union([
26274 Schema.StructWithRest(
26275 Schema.Struct({
26276 "ephemeral_1h_input_tokens": Schema.optionalKey(
26277 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26278 ),
26279 "ephemeral_5m_input_tokens": Schema.optionalKey(
26280 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26281 )
26282 }),
26283 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26284 )
26285 ]),
26286 Schema.Union([Schema.Null])
26287 ])
26288 ),
26289 "cache_creation_input_tokens": Schema.optionalKey(
26290 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26291 ),
26292 "cache_read_input_tokens": Schema.optionalKey(
26293 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26294 ),
26295 "input_tokens": Schema.optionalKey(
26296 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26297 ),
26298 "output_tokens": Schema.optionalKey(
26299 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26300 ),
26301 "model": Schema.optionalKey(Schema.String),
26302 "type": Schema.Never
26303 }),
26304 Schema.Struct({
26305 "cache_creation": Schema.optionalKey(
26306 Schema.Union([
26307 Schema.Union([
26308 Schema.StructWithRest(
26309 Schema.Struct({
26310 "ephemeral_1h_input_tokens": Schema.optionalKey(
26311 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26312 ),
26313 "ephemeral_5m_input_tokens": Schema.optionalKey(
26314 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26315 )
26316 }),
26317 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26318 )
26319 ]),
26320 Schema.Union([Schema.Null])
26321 ])
26322 ),
26323 "cache_creation_input_tokens": Schema.optionalKey(
26324 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26325 ),
26326 "cache_read_input_tokens": Schema.optionalKey(
26327 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26328 ),
26329 "input_tokens": Schema.optionalKey(
26330 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26331 ),
26332 "output_tokens": Schema.optionalKey(
26333 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26334 ),
26335 "model": Schema.String,
26336 "type": Schema.Never
26337 }),
26338 Schema.Struct({
26339 "cache_creation": Schema.optionalKey(
26340 Schema.Union([
26341 Schema.Union([
26342 Schema.StructWithRest(
26343 Schema.Struct({
26344 "ephemeral_1h_input_tokens": Schema.optionalKey(
26345 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26346 ),
26347 "ephemeral_5m_input_tokens": Schema.optionalKey(
26348 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26349 )
26350 }),
26351 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26352 )
26353 ]),
26354 Schema.Union([Schema.Null])
26355 ])
26356 ),
26357 "cache_creation_input_tokens": Schema.optionalKey(
26358 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26359 ),
26360 "cache_read_input_tokens": Schema.optionalKey(
26361 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26362 ),
26363 "input_tokens": Schema.optionalKey(
26364 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26365 ),
26366 "output_tokens": Schema.optionalKey(
26367 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26368 ),
26369 "type": Schema.Literal("compaction")
26370 })
26371 ]),
26372 Schema.Union([
26373 Schema.Struct({
26374 "cache_creation": Schema.optionalKey(
26375 Schema.Union([
26376 Schema.Union([
26377 Schema.StructWithRest(
26378 Schema.Struct({
26379 "ephemeral_1h_input_tokens": Schema.optionalKey(
26380 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26381 ),
26382 "ephemeral_5m_input_tokens": Schema.optionalKey(
26383 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26384 )
26385 }),
26386 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26387 )
26388 ]),
26389 Schema.Union([Schema.Null])
26390 ])
26391 ),
26392 "cache_creation_input_tokens": Schema.optionalKey(
26393 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26394 ),
26395 "cache_read_input_tokens": Schema.optionalKey(
26396 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26397 ),
26398 "input_tokens": Schema.optionalKey(
26399 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26400 ),
26401 "output_tokens": Schema.optionalKey(
26402 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26403 ),
26404 "type": Schema.Never,
26405 "model": Schema.optionalKey(Schema.String)
26406 }),
26407 Schema.Struct({
26408 "cache_creation": Schema.optionalKey(
26409 Schema.Union([
26410 Schema.Union([
26411 Schema.StructWithRest(
26412 Schema.Struct({
26413 "ephemeral_1h_input_tokens": Schema.optionalKey(
26414 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26415 ),
26416 "ephemeral_5m_input_tokens": Schema.optionalKey(
26417 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26418 )
26419 }),
26420 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26421 )
26422 ]),
26423 Schema.Union([Schema.Null])
26424 ])
26425 ),
26426 "cache_creation_input_tokens": Schema.optionalKey(
26427 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26428 ),
26429 "cache_read_input_tokens": Schema.optionalKey(
26430 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26431 ),
26432 "input_tokens": Schema.optionalKey(
26433 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26434 ),
26435 "output_tokens": Schema.optionalKey(
26436 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26437 ),
26438 "model": Schema.optionalKey(Schema.String),
26439 "type": Schema.Literal("message")
26440 }),
26441 Schema.Struct({
26442 "cache_creation": Schema.optionalKey(
26443 Schema.Union([
26444 Schema.Union([
26445 Schema.StructWithRest(
26446 Schema.Struct({
26447 "ephemeral_1h_input_tokens": Schema.optionalKey(
26448 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26449 ),
26450 "ephemeral_5m_input_tokens": Schema.optionalKey(
26451 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26452 )
26453 }),
26454 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26455 )
26456 ]),
26457 Schema.Union([Schema.Null])
26458 ])
26459 ),
26460 "cache_creation_input_tokens": Schema.optionalKey(
26461 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26462 ),
26463 "cache_read_input_tokens": Schema.optionalKey(
26464 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26465 ),
26466 "input_tokens": Schema.optionalKey(
26467 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26468 ),
26469 "output_tokens": Schema.optionalKey(
26470 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26471 ),
26472 "model": Schema.String,
26473 "type": Schema.Never
26474 }),
26475 Schema.Struct({
26476 "cache_creation": Schema.optionalKey(
26477 Schema.Union([
26478 Schema.Union([
26479 Schema.StructWithRest(
26480 Schema.Struct({
26481 "ephemeral_1h_input_tokens": Schema.optionalKey(
26482 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26483 ),
26484 "ephemeral_5m_input_tokens": Schema.optionalKey(
26485 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26486 )
26487 }),
26488 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26489 )
26490 ]),
26491 Schema.Union([Schema.Null])
26492 ])
26493 ),
26494 "cache_creation_input_tokens": Schema.optionalKey(
26495 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26496 ),
26497 "cache_read_input_tokens": Schema.optionalKey(
26498 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26499 ),
26500 "input_tokens": Schema.optionalKey(
26501 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26502 ),
26503 "output_tokens": Schema.optionalKey(
26504 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26505 ),
26506 "type": Schema.Literal("message"),
26507 "model": Schema.optionalKey(Schema.String)
26508 })
26509 ]),
26510 Schema.Union([
26511 Schema.Struct({
26512 "cache_creation": Schema.optionalKey(
26513 Schema.Union([
26514 Schema.Union([
26515 Schema.StructWithRest(
26516 Schema.Struct({
26517 "ephemeral_1h_input_tokens": Schema.optionalKey(
26518 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26519 ),
26520 "ephemeral_5m_input_tokens": Schema.optionalKey(
26521 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26522 )
26523 }),
26524 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26525 )
26526 ]),
26527 Schema.Union([Schema.Null])
26528 ])
26529 ),
26530 "cache_creation_input_tokens": Schema.optionalKey(
26531 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26532 ),
26533 "cache_read_input_tokens": Schema.optionalKey(
26534 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26535 ),
26536 "input_tokens": Schema.optionalKey(
26537 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26538 ),
26539 "output_tokens": Schema.optionalKey(
26540 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26541 ),
26542 "type": Schema.Never,
26543 "model": Schema.String
26544 }),
26545 Schema.Struct({
26546 "cache_creation": Schema.optionalKey(
26547 Schema.Union([
26548 Schema.Union([
26549 Schema.StructWithRest(
26550 Schema.Struct({
26551 "ephemeral_1h_input_tokens": Schema.optionalKey(
26552 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26553 ),
26554 "ephemeral_5m_input_tokens": Schema.optionalKey(
26555 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26556 )
26557 }),
26558 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26559 )
26560 ]),
26561 Schema.Union([Schema.Null])
26562 ])
26563 ),
26564 "cache_creation_input_tokens": Schema.optionalKey(
26565 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26566 ),
26567 "cache_read_input_tokens": Schema.optionalKey(
26568 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26569 ),
26570 "input_tokens": Schema.optionalKey(
26571 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26572 ),
26573 "output_tokens": Schema.optionalKey(
26574 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26575 ),
26576 "model": Schema.String,
26577 "type": Schema.Never
26578 }),
26579 Schema.Struct({
26580 "cache_creation": Schema.optionalKey(
26581 Schema.Union([
26582 Schema.Union([
26583 Schema.StructWithRest(
26584 Schema.Struct({
26585 "ephemeral_1h_input_tokens": Schema.optionalKey(
26586 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26587 ),
26588 "ephemeral_5m_input_tokens": Schema.optionalKey(
26589 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26590 )
26591 }),
26592 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26593 )
26594 ]),
26595 Schema.Union([Schema.Null])
26596 ])
26597 ),
26598 "cache_creation_input_tokens": Schema.optionalKey(
26599 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26600 ),
26601 "cache_read_input_tokens": Schema.optionalKey(
26602 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26603 ),
26604 "input_tokens": Schema.optionalKey(
26605 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26606 ),
26607 "output_tokens": Schema.optionalKey(
26608 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26609 ),
26610 "model": Schema.String,
26611 "type": Schema.Literal("advisor_message")
26612 }),
26613 Schema.Struct({
26614 "cache_creation": Schema.optionalKey(
26615 Schema.Union([
26616 Schema.Union([
26617 Schema.StructWithRest(
26618 Schema.Struct({
26619 "ephemeral_1h_input_tokens": Schema.optionalKey(
26620 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26621 ),
26622 "ephemeral_5m_input_tokens": Schema.optionalKey(
26623 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26624 )
26625 }),
26626 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26627 )
26628 ]),
26629 Schema.Union([Schema.Null])
26630 ])
26631 ),
26632 "cache_creation_input_tokens": Schema.optionalKey(
26633 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26634 ),
26635 "cache_read_input_tokens": Schema.optionalKey(
26636 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26637 ),
26638 "input_tokens": Schema.optionalKey(
26639 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26640 ),
26641 "output_tokens": Schema.optionalKey(
26642 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26643 ),
26644 "type": Schema.Literal("advisor_message"),
26645 "model": Schema.String
26646 })
26647 ]),
26648 Schema.Union([
26649 Schema.Struct({
26650 "cache_creation": Schema.optionalKey(
26651 Schema.Union([
26652 Schema.Union([
26653 Schema.StructWithRest(
26654 Schema.Struct({
26655 "ephemeral_1h_input_tokens": Schema.optionalKey(
26656 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26657 ),
26658 "ephemeral_5m_input_tokens": Schema.optionalKey(
26659 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26660 )
26661 }),
26662 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26663 )
26664 ]),
26665 Schema.Union([Schema.Null])
26666 ])
26667 ),
26668 "cache_creation_input_tokens": Schema.optionalKey(
26669 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26670 ),
26671 "cache_read_input_tokens": Schema.optionalKey(
26672 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26673 ),
26674 "input_tokens": Schema.optionalKey(
26675 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26676 ),
26677 "output_tokens": Schema.optionalKey(
26678 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26679 ),
26680 "type": Schema.Literal("compaction")
26681 }),
26682 Schema.Struct({
26683 "cache_creation": Schema.optionalKey(
26684 Schema.Union([
26685 Schema.Union([
26686 Schema.StructWithRest(
26687 Schema.Struct({
26688 "ephemeral_1h_input_tokens": Schema.optionalKey(
26689 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26690 ),
26691 "ephemeral_5m_input_tokens": Schema.optionalKey(
26692 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26693 )
26694 }),
26695 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26696 )
26697 ]),
26698 Schema.Union([Schema.Null])
26699 ])
26700 ),
26701 "cache_creation_input_tokens": Schema.optionalKey(
26702 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26703 ),
26704 "cache_read_input_tokens": Schema.optionalKey(
26705 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26706 ),
26707 "input_tokens": Schema.optionalKey(
26708 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26709 ),
26710 "output_tokens": Schema.optionalKey(
26711 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26712 ),
26713 "model": Schema.optionalKey(Schema.String),
26714 "type": Schema.Literal("message")
26715 }),
26716 Schema.Struct({
26717 "cache_creation": Schema.optionalKey(
26718 Schema.Union([
26719 Schema.Union([
26720 Schema.StructWithRest(
26721 Schema.Struct({
26722 "ephemeral_1h_input_tokens": Schema.optionalKey(
26723 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26724 ),
26725 "ephemeral_5m_input_tokens": Schema.optionalKey(
26726 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26727 )
26728 }),
26729 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26730 )
26731 ]),
26732 Schema.Union([Schema.Null])
26733 ])
26734 ),
26735 "cache_creation_input_tokens": Schema.optionalKey(
26736 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26737 ),
26738 "cache_read_input_tokens": Schema.optionalKey(
26739 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26740 ),
26741 "input_tokens": Schema.optionalKey(
26742 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26743 ),
26744 "output_tokens": Schema.optionalKey(
26745 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26746 ),
26747 "model": Schema.String,
26748 "type": Schema.Literal("advisor_message")
26749 }),
26750 Schema.Struct({
26751 "cache_creation": Schema.optionalKey(
26752 Schema.Union([
26753 Schema.Union([
26754 Schema.StructWithRest(
26755 Schema.Struct({
26756 "ephemeral_1h_input_tokens": Schema.optionalKey(
26757 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26758 ),
26759 "ephemeral_5m_input_tokens": Schema.optionalKey(
26760 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26761 )
26762 }),
26763 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26764 )
26765 ]),
26766 Schema.Union([Schema.Null])
26767 ])
26768 ),
26769 "cache_creation_input_tokens": Schema.optionalKey(
26770 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26771 ),
26772 "cache_read_input_tokens": Schema.optionalKey(
26773 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26774 ),
26775 "input_tokens": Schema.optionalKey(
26776 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26777 ),
26778 "output_tokens": Schema.optionalKey(
26779 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))
26780 ),
26781 "type": Schema.String
26782 })
26783 ])
26784 ]))),
26785 "speed": Schema.optionalKey(
26786 Schema.Union([Schema.Literal("fast"), Schema.Literal("standard"), Schema.Union([Schema.Null])])
26787 ),
26788 "cost": Schema.optionalKey(
26789 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
26790 .annotate({ "format": "double" })
26791 ),
26792 "cost_details": Schema.optionalKey(CostDetails),
26793 "is_byok": Schema.optionalKey(Schema.Boolean)
26794 }),
26795 "context_management": Schema.optionalKey(
26796 Schema.Union([
26797 Schema.StructWithRest(
26798 Schema.Struct({ "applied_edits": Schema.Array(Schema.Struct({ "type": Schema.String })) }),
26799 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
26800 ),
26801 Schema.Null
26802 ])
26803 ),
26804 "openrouter_metadata": Schema.optionalKey(OpenRouterMetadata),
26805 "provider": Schema.optionalKey(ProviderName)
26806}).annotate({
26807 "description": "Non-streaming response from the Anthropic Messages API with OpenRouter extensions",
26808 "identifier": "MessagesResult"
26809})
26810export type MessagesStartEvent = {
26811 readonly "message": {
26812 readonly "container": AnthropicContainer
26813 readonly "content": ReadonlyArray<ORAnthropicContentBlock>
26814 readonly "id": string
26815 readonly "model": string
26816 readonly "provider"?:
26817 | "AnyScale"
26818 | "Atoma"
26819 | "Cent-ML"
26820 | "CrofAI"
26821 | "Enfer"
26822 | "GoPomelo"
26823 | "HuggingFace"
26824 | "Hyperbolic"
26825 | "Hyperbolic 2"
26826 | "InoCloud"
26827 | "Kluster"
26828 | "Lambda"
26829 | "Lepton"
26830 | "Lynn 2"
26831 | "Lynn"
26832 | "Mancer"
26833 | "Modal"
26834 | "Nineteen"
26835 | "OctoAI"
26836 | "Recursal"
26837 | "Reflection"
26838 | "Replicate"
26839 | "SambaNova 2"
26840 | "SF Compute"
26841 | "Targon"
26842 | "Together 2"
26843 | "Ubicloud"
26844 | "01.AI"
26845 | "AkashML"
26846 | "AI21"
26847 | "AionLabs"
26848 | "Alibaba"
26849 | "Ambient"
26850 | "Baidu"
26851 | "Amazon Bedrock"
26852 | "Amazon Nova"
26853 | "Anthropic"
26854 | "Arcee AI"
26855 | "AtlasCloud"
26856 | "Avian"
26857 | "Azure"
26858 | "BaseTen"
26859 | "BytePlus"
26860 | "Black Forest Labs"
26861 | "Cerebras"
26862 | "Chutes"
26863 | "Cirrascale"
26864 | "Clarifai"
26865 | "Cloudflare"
26866 | "Cohere"
26867 | "CoreWeave"
26868 | "Crucible"
26869 | "Crusoe"
26870 | "Darkbloom"
26871 | "Decart"
26872 | "Deepgram"
26873 | "DeepInfra"
26874 | "DeepSeek"
26875 | "DekaLLM"
26876 | "DigitalOcean"
26877 | "Featherless"
26878 | "Fireworks"
26879 | "Fish Audio"
26880 | "Friendli"
26881 | "GMICloud"
26882 | "Google"
26883 | "Google AI Studio"
26884 | "Groq"
26885 | "HeyGen"
26886 | "Inception"
26887 | "Inceptron"
26888 | "InferenceNet"
26889 | "Ionstream"
26890 | "Infermatic"
26891 | "Io Net"
26892 | "Inferact vLLM"
26893 | "Inflection"
26894 | "Liquid"
26895 | "Mara"
26896 | "Mancer 2"
26897 | "Meta"
26898 | "Minimax"
26899 | "ModelRun"
26900 | "Mistral"
26901 | "Modular"
26902 | "Moonshot AI"
26903 | "Morph"
26904 | "NCompass"
26905 | "Nebius"
26906 | "Nex AGI"
26907 | "NextBit"
26908 | "Novita"
26909 | "Nvidia"
26910 | "OpenAI"
26911 | "OpenInference"
26912 | "Parasail"
26913 | "Poolside"
26914 | "Perceptron"
26915 | "Perplexity"
26916 | "Phala"
26917 | "Recraft"
26918 | "Reka"
26919 | "Relace"
26920 | "Sail Research"
26921 | "Sakana AI"
26922 | "SambaNova"
26923 | "Seed"
26924 | "SiliconFlow"
26925 | "Sourceful"
26926 | "StepFun"
26927 | "Stealth"
26928 | "StreamLake"
26929 | "Switchpoint"
26930 | "Tencent"
26931 | "Tenstorrent"
26932 | "Together"
26933 | "Upstage"
26934 | "Venice"
26935 | "Wafer"
26936 | "WandB"
26937 | "Quiver"
26938 | "Krea"
26939 | "Runway"
26940 | "Xiaomi"
26941 | "xAI"
26942 | "Z.AI"
26943 | "FakeProvider"
26944 readonly "role": "assistant"
26945 readonly "stop_details": AnthropicRefusalStopDetails
26946 readonly "stop_reason": Schema.Json
26947 readonly "stop_sequence": Schema.Json
26948 readonly "type": "message"
26949 readonly "usage": {
26950 readonly "cache_creation": AnthropicCacheCreation
26951 readonly "cache_creation_input_tokens": number | null
26952 readonly "cache_read_input_tokens": number | null
26953 readonly "inference_geo": string | null
26954 readonly "input_tokens": number
26955 readonly "output_tokens": number
26956 readonly "output_tokens_details": AnthropicOutputTokensDetails
26957 readonly "server_tool_use": AnthropicServerToolUsage
26958 readonly "service_tier": AnthropicServiceTier
26959 readonly "iterations"?: ReadonlyArray<AnthropicUsageIteration>
26960 readonly "speed"?: AnthropicSpeed
26961 }
26962 }
26963 readonly "type": "message_start"
26964}
26965export const MessagesStartEvent = Schema.Struct({
26966 "message": Schema.Struct({
26967 "container": AnthropicContainer,
26968 "content": Schema.Array(ORAnthropicContentBlock),
26969 "id": Schema.String,
26970 "model": Schema.String,
26971 "provider": Schema.optionalKey(
26972 Schema.Literals([
26973 "AnyScale",
26974 "Atoma",
26975 "Cent-ML",
26976 "CrofAI",
26977 "Enfer",
26978 "GoPomelo",
26979 "HuggingFace",
26980 "Hyperbolic",
26981 "Hyperbolic 2",
26982 "InoCloud",
26983 "Kluster",
26984 "Lambda",
26985 "Lepton",
26986 "Lynn 2",
26987 "Lynn",
26988 "Mancer",
26989 "Modal",
26990 "Nineteen",
26991 "OctoAI",
26992 "Recursal",
26993 "Reflection",
26994 "Replicate",
26995 "SambaNova 2",
26996 "SF Compute",
26997 "Targon",
26998 "Together 2",
26999 "Ubicloud",
27000 "01.AI",
27001 "AkashML",
27002 "AI21",
27003 "AionLabs",
27004 "Alibaba",
27005 "Ambient",
27006 "Baidu",
27007 "Amazon Bedrock",
27008 "Amazon Nova",
27009 "Anthropic",
27010 "Arcee AI",
27011 "AtlasCloud",
27012 "Avian",
27013 "Azure",
27014 "BaseTen",
27015 "BytePlus",
27016 "Black Forest Labs",
27017 "Cerebras",
27018 "Chutes",
27019 "Cirrascale",
27020 "Clarifai",
27021 "Cloudflare",
27022 "Cohere",
27023 "CoreWeave",
27024 "Crucible",
27025 "Crusoe",
27026 "Darkbloom",
27027 "Decart",
27028 "Deepgram",
27029 "DeepInfra",
27030 "DeepSeek",
27031 "DekaLLM",
27032 "DigitalOcean",
27033 "Featherless",
27034 "Fireworks",
27035 "Fish Audio",
27036 "Friendli",
27037 "GMICloud",
27038 "Google",
27039 "Google AI Studio",
27040 "Groq",
27041 "HeyGen",
27042 "Inception",
27043 "Inceptron",
27044 "InferenceNet",
27045 "Ionstream",
27046 "Infermatic",
27047 "Io Net",
27048 "Inferact vLLM",
27049 "Inflection",
27050 "Liquid",
27051 "Mara",
27052 "Mancer 2",
27053 "Meta",
27054 "Minimax",
27055 "ModelRun",
27056 "Mistral",
27057 "Modular",
27058 "Moonshot AI",
27059 "Morph",
27060 "NCompass",
27061 "Nebius",
27062 "Nex AGI",
27063 "NextBit",
27064 "Novita",
27065 "Nvidia",
27066 "OpenAI",
27067 "OpenInference",
27068 "Parasail",
27069 "Poolside",
27070 "Perceptron",
27071 "Perplexity",
27072 "Phala",
27073 "Recraft",
27074 "Reka",
27075 "Relace",
27076 "Sail Research",
27077 "Sakana AI",
27078 "SambaNova",
27079 "Seed",
27080 "SiliconFlow",
27081 "Sourceful",
27082 "StepFun",
27083 "Stealth",
27084 "StreamLake",
27085 "Switchpoint",
27086 "Tencent",
27087 "Tenstorrent",
27088 "Together",
27089 "Upstage",
27090 "Venice",
27091 "Wafer",
27092 "WandB",
27093 "Quiver",
27094 "Krea",
27095 "Runway",
27096 "Xiaomi",
27097 "xAI",
27098 "Z.AI",
27099 "FakeProvider"
27100 ])
27101 ),
27102 "role": Schema.Literal("assistant"),
27103 "stop_details": AnthropicRefusalStopDetails,
27104 "stop_reason": Schema.Json.annotate({ "expected": "JSON value" }),
27105 "stop_sequence": Schema.Json.annotate({ "expected": "JSON value" }),
27106 "type": Schema.Literal("message"),
27107 "usage": Schema.Struct({
27108 "cache_creation": AnthropicCacheCreation,
27109 "cache_creation_input_tokens": Schema.Union([
27110 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
27111 Schema.Null
27112 ]),
27113 "cache_read_input_tokens": Schema.Union([
27114 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
27115 Schema.Null
27116 ]),
27117 "inference_geo": Schema.Union([Schema.String, Schema.Null]),
27118 "input_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
27119 "output_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
27120 "output_tokens_details": AnthropicOutputTokensDetails,
27121 "server_tool_use": AnthropicServerToolUsage,
27122 "service_tier": AnthropicServiceTier,
27123 "iterations": Schema.optionalKey(Schema.Array(AnthropicUsageIteration)),
27124 "speed": Schema.optionalKey(AnthropicSpeed)
27125 })
27126 }),
27127 "type": Schema.Literal("message_start")
27128}).annotate({ "description": "Event sent at the start of a streaming message", "identifier": "MessagesStartEvent" })
27129export type ImageStreamingResponse = {
27130 readonly "data":
27131 | ImageGenPartialImageEvent
27132 | ImageGenTextChunkEvent
27133 | ImageGenCompletedEvent
27134 | ImageGenStreamErrorEvent
27135}
27136export const ImageStreamingResponse = Schema.Struct({
27137 "data": Schema.Union([
27138 ImageGenPartialImageEvent,
27139 ImageGenTextChunkEvent,
27140 ImageGenCompletedEvent,
27141 ImageGenStreamErrorEvent
27142 ])
27143}).annotate({ "identifier": "ImageStreamingResponse" })
27144export type ChatStreamingResponse = { readonly "data": ChatStreamChunk }
27145export const ChatStreamingResponse = Schema.Struct({ "data": ChatStreamChunk }).annotate({
27146 "identifier": "ChatStreamingResponse"
27147})
27148export type ResponsesRequest = {
27149 readonly "background"?: boolean | null
27150 readonly "cache_control"?: AnthropicCacheControlDirective
27151 readonly "debug"?: ChatDebugOptions
27152 readonly "frequency_penalty"?: number | null
27153 readonly "image_config"?: ImageConfig
27154 readonly "include"?: ReadonlyArray<ResponseIncludesEnum> | null
27155 readonly "input"?: Inputs
27156 readonly "instructions"?: string | null
27157 readonly "max_output_tokens"?: number | null
27158 readonly "max_tool_calls"?: number | null
27159 readonly "metadata"?: RequestMetadata
27160 readonly "modalities"?: ReadonlyArray<OutputModalityEnum>
27161 readonly "model"?: string
27162 readonly "models"?: ReadonlyArray<string>
27163 readonly "parallel_tool_calls"?: boolean | null
27164 readonly "plugins"?: ReadonlyArray<
27165 | AutoRouterPlugin
27166 | AutoBetaRouterPlugin
27167 | ModerationPlugin
27168 | WebSearchPlugin
27169 | WebFetchPlugin
27170 | FileParserPlugin
27171 | ResponseHealingPlugin
27172 | ContextCompressionPlugin
27173 | ParetoRouterPlugin
27174 | FusionPlugin
27175 >
27176 readonly "presence_penalty"?: number | null
27177 readonly "previous_response_id"?: Schema.Json
27178 readonly "prompt"?: StoredPromptTemplate
27179 readonly "prompt_cache_key"?: string | null
27180 readonly "prompt_cache_options"?: PromptCacheOptions
27181 readonly "provider"?: ProviderPreferences
27182 readonly "reasoning"?: ReasoningConfig
27183 readonly "route"?: DeprecatedRoute
27184 readonly "safety_identifier"?: string | null
27185 readonly "service_tier"?: "auto" | "default" | "flex" | "priority" | "scale" | null
27186 readonly "session_id"?: string
27187 readonly "stop_server_tools_when"?: StopServerToolsWhen
27188 readonly "store"?: false
27189 readonly "stream"?: boolean
27190 readonly "temperature"?: number | null
27191 readonly "text"?: TextExtendedConfig
27192 readonly "tool_choice"?: OpenAIResponsesToolChoice
27193 readonly "tools"?: ReadonlyArray<
27194 | {
27195 readonly "description"?: string | null
27196 readonly "name": string
27197 readonly "parameters": { readonly [x: string]: Schema.Json } | null
27198 readonly "strict"?: boolean | null
27199 readonly "type": "function"
27200 }
27201 | Preview_WebSearchServerTool
27202 | Preview_20250311_WebSearchServerTool
27203 | Legacy_WebSearchServerTool
27204 | WebSearchServerTool
27205 | FileSearchServerTool
27206 | ComputerUseServerTool
27207 | CodeInterpreterServerTool
27208 | McpServerTool
27209 | ImageGenerationServerTool
27210 | CodexLocalShellTool
27211 | ShellServerTool
27212 | ApplyPatchServerTool
27213 | CustomTool
27214 | NamespaceTool
27215 | AdvisorServerTool_OpenRouter
27216 | SubagentServerTool_OpenRouter
27217 | DatetimeServerTool
27218 | FilesServerTool
27219 | FusionServerTool_OpenRouter
27220 | ImageGenerationServerTool_OpenRouter
27221 | SearchModelsServerTool_OpenRouter
27222 | WebFetchServerTool
27223 | WebSearchServerTool_OpenRouter
27224 | ApplyPatchServerTool_OpenRouter
27225 | BashServerTool
27226 | ShellServerTool_OpenRouter
27227 >
27228 readonly "top_k"?: number
27229 readonly "top_logprobs"?: number | null
27230 readonly "top_p"?: number | null
27231 readonly "trace"?: TraceConfig
27232 readonly "truncation"?: OpenAIResponsesTruncation
27233 readonly "user"?: string
27234}
27235export const ResponsesRequest = Schema.Struct({
27236 "background": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
27237 "cache_control": Schema.optionalKey(AnthropicCacheControlDirective),
27238 "debug": Schema.optionalKey(ChatDebugOptions),
27239 "frequency_penalty": Schema.optionalKey(
27240 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
27241 .annotate({ "format": "double" })
27242 ),
27243 "image_config": Schema.optionalKey(ImageConfig),
27244 "include": Schema.optionalKey(Schema.Union([Schema.Array(ResponseIncludesEnum), Schema.Null])),
27245 "input": Schema.optionalKey(Inputs),
27246 "instructions": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
27247 "max_output_tokens": Schema.optionalKey(
27248 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
27249 ),
27250 "max_tool_calls": Schema.optionalKey(
27251 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null]).annotate({
27252 "description":
27253 "Maximum number of server-tool (e.g. `openrouter:web_search`) agent steps the model may take during a request. Defaults to 30, which is also the maximum. Ignored when `stop_server_tools_when` is set."
27254 })
27255 ),
27256 "metadata": Schema.optionalKey(RequestMetadata),
27257 "modalities": Schema.optionalKey(
27258 Schema.Array(OutputModalityEnum).annotate({
27259 "description": "Output modalities for the response. Supported values are \"text\" and \"image\"."
27260 })
27261 ),
27262 "model": Schema.optionalKey(Schema.String),
27263 "models": Schema.optionalKey(Schema.Array(Schema.String)),
27264 "parallel_tool_calls": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
27265 "plugins": Schema.optionalKey(
27266 Schema.Array(
27267 Schema.Union([
27268 AutoRouterPlugin,
27269 AutoBetaRouterPlugin,
27270 ModerationPlugin,
27271 WebSearchPlugin,
27272 WebFetchPlugin,
27273 FileParserPlugin,
27274 ResponseHealingPlugin,
27275 ContextCompressionPlugin,
27276 ParetoRouterPlugin,
27277 FusionPlugin
27278 ], { mode: "oneOf" })
27279 ).annotate({ "description": "Plugins you want to enable for this request, including their settings." })
27280 ),
27281 "presence_penalty": Schema.optionalKey(
27282 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
27283 .annotate({ "format": "double" })
27284 ),
27285 "previous_response_id": Schema.optionalKey(
27286 Schema.Json.annotate({
27287 "expected": "JSON value",
27288 "description":
27289 "Not supported. The Responses API is stateless: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead."
27290 })
27291 ),
27292 "prompt": Schema.optionalKey(StoredPromptTemplate),
27293 "prompt_cache_key": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
27294 "prompt_cache_options": Schema.optionalKey(PromptCacheOptions),
27295 "provider": Schema.optionalKey(ProviderPreferences),
27296 "reasoning": Schema.optionalKey(ReasoningConfig),
27297 "route": Schema.optionalKey(DeprecatedRoute),
27298 "safety_identifier": Schema.optionalKey(
27299 Schema.Union([Schema.String, Schema.Null]).annotate({
27300 "description":
27301 "Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account."
27302 })
27303 ),
27304 "service_tier": Schema.optionalKey(
27305 Schema.Union([
27306 Schema.Literal("auto"),
27307 Schema.Literal("default"),
27308 Schema.Literal("flex"),
27309 Schema.Literal("priority"),
27310 Schema.Literal("scale"),
27311 Schema.Null
27312 ])
27313 ),
27314 "session_id": Schema.optionalKey(
27315 Schema.String.annotate({
27316 "description":
27317 "A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters."
27318 }).check(Schema.isMaxLength(256).annotate({ "expected": "a value with a length of at most 256" }))
27319 ),
27320 "stop_server_tools_when": Schema.optionalKey(StopServerToolsWhen),
27321 "store": Schema.optionalKey(Schema.Literal(false)),
27322 "stream": Schema.optionalKey(Schema.Boolean),
27323 "temperature": Schema.optionalKey(
27324 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
27325 .annotate({ "format": "double" })
27326 ),
27327 "text": Schema.optionalKey(TextExtendedConfig),
27328 "tool_choice": Schema.optionalKey(OpenAIResponsesToolChoice),
27329 "tools": Schema.optionalKey(Schema.Array(Schema.Union([
27330 Schema.Struct({
27331 "description": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
27332 "name": Schema.String,
27333 "parameters": Schema.Union([
27334 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })),
27335 Schema.Null
27336 ]),
27337 "strict": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
27338 "type": Schema.Literal("function")
27339 }).annotate({ "description": "Function tool definition" }),
27340 Preview_WebSearchServerTool,
27341 Preview_20250311_WebSearchServerTool,
27342 Legacy_WebSearchServerTool,
27343 WebSearchServerTool,
27344 FileSearchServerTool,
27345 ComputerUseServerTool,
27346 CodeInterpreterServerTool,
27347 McpServerTool,
27348 ImageGenerationServerTool,
27349 CodexLocalShellTool,
27350 ShellServerTool,
27351 ApplyPatchServerTool,
27352 CustomTool,
27353 NamespaceTool,
27354 AdvisorServerTool_OpenRouter,
27355 SubagentServerTool_OpenRouter,
27356 DatetimeServerTool,
27357 FilesServerTool,
27358 FusionServerTool_OpenRouter,
27359 ImageGenerationServerTool_OpenRouter,
27360 SearchModelsServerTool_OpenRouter,
27361 WebFetchServerTool,
27362 WebSearchServerTool_OpenRouter,
27363 ApplyPatchServerTool_OpenRouter,
27364 BashServerTool,
27365 ShellServerTool_OpenRouter
27366 ]))),
27367 "top_k": Schema.optionalKey(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))),
27368 "top_logprobs": Schema.optionalKey(
27369 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
27370 ),
27371 "top_p": Schema.optionalKey(
27372 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
27373 .annotate({ "format": "double" })
27374 ),
27375 "trace": Schema.optionalKey(TraceConfig),
27376 "truncation": Schema.optionalKey(OpenAIResponsesTruncation),
27377 "user": Schema.optionalKey(
27378 Schema.String.annotate({
27379 "description":
27380 "A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters."
27381 }).check(Schema.isMaxLength(256).annotate({ "expected": "a value with a length of at most 256" }))
27382 )
27383}).annotate({ "description": "Request schema for Responses endpoint", "identifier": "ResponsesRequest" })
27384export type StreamEvents =
27385 | OpenResponsesCreatedEvent
27386 | OpenResponsesInProgressEvent
27387 | StreamEventsResponseCompleted
27388 | StreamEventsResponseIncomplete
27389 | StreamEventsResponseFailed
27390 | ErrorEvent
27391 | StreamEventsResponseOutputItemAdded
27392 | StreamEventsResponseOutputItemDone
27393 | ContentPartAddedEvent
27394 | ContentPartDoneEvent
27395 | TextDeltaEvent
27396 | TextDoneEvent
27397 | RefusalDeltaEvent
27398 | RefusalDoneEvent
27399 | AnnotationAddedEvent
27400 | FunctionCallArgsDeltaEvent
27401 | FunctionCallArgsDoneEvent
27402 | ReasoningDeltaEvent
27403 | ReasoningDoneEvent
27404 | ReasoningSummaryPartAddedEvent
27405 | ReasoningSummaryPartDoneEvent
27406 | ReasoningSummaryTextDeltaEvent
27407 | ReasoningSummaryTextDoneEvent
27408 | ImageGenCallInProgressEvent
27409 | ImageGenCallGeneratingEvent
27410 | ImageGenCallPartialImageEvent
27411 | ImageGenCallCompletedEvent
27412 | WebSearchCallInProgressEvent
27413 | WebSearchCallSearchingEvent
27414 | WebSearchCallCompletedEvent
27415 | CustomToolCallInputDeltaEvent
27416 | CustomToolCallInputDoneEvent
27417 | ApplyPatchCallOperationDiffDeltaEvent
27418 | ApplyPatchCallOperationDiffDoneEvent
27419 | FusionCallInProgressEvent
27420 | FusionCallPanelAddedEvent
27421 | FusionCallPanelDeltaEvent
27422 | FusionCallPanelReasoningDeltaEvent
27423 | FusionCallPanelCompletedEvent
27424 | FusionCallPanelFailedEvent
27425 | FusionCallAnalysisInProgressEvent
27426 | FusionCallAnalysisCompletedEvent
27427 | FusionCallCompletedEvent
27428 | DebugEvent
27429export const StreamEvents: Schema.Schema<StreamEvents> = Schema.Union([
27430 OpenResponsesCreatedEvent,
27431 OpenResponsesInProgressEvent,
27432 StreamEventsResponseCompleted,
27433 StreamEventsResponseIncomplete,
27434 StreamEventsResponseFailed,
27435 ErrorEvent,
27436 StreamEventsResponseOutputItemAdded,
27437 StreamEventsResponseOutputItemDone,
27438 ContentPartAddedEvent,
27439 ContentPartDoneEvent,
27440 TextDeltaEvent,
27441 TextDoneEvent,
27442 RefusalDeltaEvent,
27443 RefusalDoneEvent,
27444 AnnotationAddedEvent,
27445 FunctionCallArgsDeltaEvent,
27446 FunctionCallArgsDoneEvent,
27447 ReasoningDeltaEvent,
27448 ReasoningDoneEvent,
27449 ReasoningSummaryPartAddedEvent,
27450 ReasoningSummaryPartDoneEvent,
27451 ReasoningSummaryTextDeltaEvent,
27452 ReasoningSummaryTextDoneEvent,
27453 ImageGenCallInProgressEvent,
27454 ImageGenCallGeneratingEvent,
27455 ImageGenCallPartialImageEvent,
27456 ImageGenCallCompletedEvent,
27457 WebSearchCallInProgressEvent,
27458 WebSearchCallSearchingEvent,
27459 WebSearchCallCompletedEvent,
27460 CustomToolCallInputDeltaEvent,
27461 CustomToolCallInputDoneEvent,
27462 ApplyPatchCallOperationDiffDeltaEvent,
27463 ApplyPatchCallOperationDiffDoneEvent,
27464 FusionCallInProgressEvent,
27465 FusionCallPanelAddedEvent,
27466 FusionCallPanelDeltaEvent,
27467 FusionCallPanelReasoningDeltaEvent,
27468 FusionCallPanelCompletedEvent,
27469 FusionCallPanelFailedEvent,
27470 FusionCallAnalysisInProgressEvent,
27471 FusionCallAnalysisCompletedEvent,
27472 FusionCallCompletedEvent,
27473 DebugEvent
27474], { mode: "oneOf" }).annotate({
27475 "description": "Union of all possible event types emitted during response streaming",
27476 "identifier": "StreamEvents"
27477})
27478export type MessagesStreamEvents =
27479 | MessagesStartEvent
27480 | MessagesDeltaEvent
27481 | MessagesStopEvent
27482 | MessagesContentBlockStartEvent
27483 | MessagesContentBlockDeltaEvent
27484 | MessagesContentBlockStopEvent
27485 | MessagesPingEvent
27486 | MessagesErrorEvent
27487export const MessagesStreamEvents = Schema.Union([
27488 MessagesStartEvent,
27489 MessagesDeltaEvent,
27490 MessagesStopEvent,
27491 MessagesContentBlockStartEvent,
27492 MessagesContentBlockDeltaEvent,
27493 MessagesContentBlockStopEvent,
27494 MessagesPingEvent,
27495 MessagesErrorEvent
27496], { mode: "oneOf" }).annotate({
27497 "description": "Union of all possible streaming events",
27498 "identifier": "MessagesStreamEvents"
27499})
27500export type ResponsesStreamingResponse = { readonly "data": StreamEvents }
27501export const ResponsesStreamingResponse: Schema.Schema<ResponsesStreamingResponse> = Schema.Struct({
27502 "data": StreamEvents
27503}).annotate({ "identifier": "ResponsesStreamingResponse" })
27504export type MessagesStreamingResponse = { readonly "data": MessagesStreamEvents; readonly "event": string }
27505export const MessagesStreamingResponse = Schema.Struct({ "data": MessagesStreamEvents, "event": Schema.String })
27506 .annotate({ "identifier": "MessagesStreamingResponse" })
27507// schemas
27508export type GetUserActivityParams = {
27509 readonly "HTTP-Referer"?: string
27510 readonly "X-OpenRouter-Title"?: string
27511 readonly "X-OpenRouter-Categories"?: string
27512 readonly "date"?: string
27513 readonly "api_key_hash"?: string
27514 readonly "user_id"?: string
27515}
27516export const GetUserActivityParams = Schema.Struct({
27517 "HTTP-Referer": Schema.optionalKey(Schema.String),
27518 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
27519 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
27520 "date": Schema.optionalKey(
27521 Schema.String.annotate({ "description": "Filter by a single UTC date in the last 30 days (YYYY-MM-DD format)." })
27522 ),
27523 "api_key_hash": Schema.optionalKey(
27524 Schema.String.annotate({
27525 "description": "Filter by API key hash (SHA-256 hex string, as returned by the keys API)."
27526 })
27527 ),
27528 "user_id": Schema.optionalKey(
27529 Schema.String.annotate({
27530 "description": "Filter by org member user ID. Only applicable for organization accounts."
27531 })
27532 )
27533})
27534export type GetUserActivity200 = ActivityResponse
27535export const GetUserActivity200 = ActivityResponse
27536export type GetUserActivity400 = BadRequestResponse
27537export const GetUserActivity400 = BadRequestResponse
27538export type GetUserActivity401 = UnauthorizedResponse
27539export const GetUserActivity401 = UnauthorizedResponse
27540export type GetUserActivity403 = ForbiddenResponse
27541export const GetUserActivity403 = ForbiddenResponse
27542export type GetUserActivity404 = NotFoundResponse
27543export const GetUserActivity404 = NotFoundResponse
27544export type GetUserActivity500 = InternalServerResponse
27545export const GetUserActivity500 = InternalServerResponse
27546export type GetAnalyticsMetaParams = {
27547 readonly "HTTP-Referer"?: string
27548 readonly "X-OpenRouter-Title"?: string
27549 readonly "X-OpenRouter-Categories"?: string
27550}
27551export const GetAnalyticsMetaParams = Schema.Struct({
27552 "HTTP-Referer": Schema.optionalKey(Schema.String),
27553 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
27554 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
27555})
27556export type GetAnalyticsMeta200 = {
27557 readonly "data": {
27558 readonly "dimensions": ReadonlyArray<{ readonly "display_label": string; readonly "name": string }>
27559 readonly "granularities": ReadonlyArray<
27560 { readonly "display_label": string; readonly "name": "minute" | "hour" | "day" | "week" | "month" }
27561 >
27562 readonly "metrics": ReadonlyArray<
27563 {
27564 readonly "display_format": "number" | "currency" | "percent" | "latency" | "throughput"
27565 readonly "display_label": string
27566 readonly "is_rate": boolean
27567 readonly "name": string
27568 }
27569 >
27570 readonly "operators": ReadonlyArray<
27571 {
27572 readonly "name": "eq" | "neq" | "in" | "not_in" | "gt" | "gte" | "lt" | "lte"
27573 readonly "value_type": "scalar" | "array"
27574 }
27575 >
27576 }
27577}
27578export const GetAnalyticsMeta200 = Schema.Struct({
27579 "data": Schema.Struct({
27580 "dimensions": Schema.Array(
27581 Schema.Struct({
27582 "display_label": Schema.String.annotate({ "description": "Human-readable label" }),
27583 "name": Schema.String.annotate({ "description": "Dimension identifier used in query requests" })
27584 })
27585 ),
27586 "granularities": Schema.Array(
27587 Schema.Struct({
27588 "display_label": Schema.String.annotate({ "description": "Human-readable label" }),
27589 "name": Schema.Literals(["minute", "hour", "day", "week", "month"]).annotate({
27590 "description": "Granularity identifier"
27591 })
27592 })
27593 ),
27594 "metrics": Schema.Array(Schema.Struct({
27595 "display_format": Schema.Literals(["number", "currency", "percent", "latency", "throughput"]).annotate({
27596 "description":
27597 "How this metric value should be formatted for display (e.g. percent → multiply by 100 and append %, currency → prefix with $)"
27598 }),
27599 "display_label": Schema.String.annotate({ "description": "Human-readable label" }),
27600 "is_rate": Schema.Boolean.annotate({
27601 "description": "Whether this metric is a rate/ratio (averaged, not summed)"
27602 }),
27603 "name": Schema.String.annotate({ "description": "Metric identifier used in query requests" })
27604 })),
27605 "operators": Schema.Array(Schema.Struct({
27606 "name": Schema.Literals(["eq", "neq", "in", "not_in", "gt", "gte", "lt", "lte"]).annotate({
27607 "description": "Operator identifier used in filter definitions"
27608 }),
27609 "value_type": Schema.Literals(["scalar", "array"]).annotate({
27610 "description": "Whether the operator expects a single value or an array"
27611 })
27612 }))
27613 })
27614})
27615export type GetAnalyticsMeta401 = UnauthorizedResponse
27616export const GetAnalyticsMeta401 = UnauthorizedResponse
27617export type GetAnalyticsMeta403 = ForbiddenResponse
27618export const GetAnalyticsMeta403 = ForbiddenResponse
27619export type GetAnalyticsMeta500 = InternalServerResponse
27620export const GetAnalyticsMeta500 = InternalServerResponse
27621export type QueryAnalyticsParams = {
27622 readonly "HTTP-Referer"?: string
27623 readonly "X-OpenRouter-Title"?: string
27624 readonly "X-OpenRouter-Categories"?: string
27625}
27626export const QueryAnalyticsParams = Schema.Struct({
27627 "HTTP-Referer": Schema.optionalKey(Schema.String),
27628 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
27629 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
27630})
27631export type QueryAnalyticsRequestJson = {
27632 readonly "classifier_dimensions"?: {
27633 readonly "classifier_id": string
27634 readonly "dimension_names"?: ReadonlyArray<string>
27635 readonly "include_nulls"?: boolean
27636 }
27637 readonly "classifier_filters"?: {
27638 readonly "classifier_id": string
27639 readonly "filters": ReadonlyArray<
27640 {
27641 readonly "field": string
27642 readonly "operator": string
27643 readonly "value": string | number | ReadonlyArray<string | number>
27644 }
27645 >
27646 }
27647 readonly "dimensions"?: ReadonlyArray<string>
27648 readonly "filters"?: ReadonlyArray<
27649 {
27650 readonly "field": string
27651 readonly "operator": string
27652 readonly "value": string | number | ReadonlyArray<string | number>
27653 }
27654 >
27655 readonly "granularity"?: string
27656 readonly "group_limit"?: number
27657 readonly "limit"?: number
27658 readonly "metrics": ReadonlyArray<string>
27659 readonly "order_by"?: { readonly "direction": "asc" | "desc"; readonly "field": string }
27660 readonly "time_range"?: { readonly "end": string; readonly "start": string }
27661}
27662export const QueryAnalyticsRequestJson = Schema.Struct({
27663 "classifier_dimensions": Schema.optionalKey(
27664 Schema.Struct({
27665 "classifier_id": Schema.String.annotate({
27666 "description": "UUID of the classifier whose tags to group by.",
27667 "format": "uuid"
27668 }),
27669 "dimension_names": Schema.optionalKey(
27670 Schema.Array(
27671 Schema.String.annotate({
27672 "description":
27673 "Classifier dimension name (snake_case identifier). When exactly one name is provided, the response uses it as the column key; with multiple names or none, the response uses `clf_dimension_name`/`clf_dimension_value` columns."
27674 })
27675 ).check(Schema.isMaxLength(10).annotate({ "expected": "a value with a length of at most 10" }))
27676 ),
27677 "include_nulls": Schema.optionalKey(
27678 Schema.Boolean.annotate({
27679 "description":
27680 "When true, also include generations that have no tag from this classifier. Defaults to false, which returns only classified generations."
27681 })
27682 )
27683 }).annotate({
27684 "description":
27685 "Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace."
27686 })
27687 ),
27688 "classifier_filters": Schema.optionalKey(
27689 Schema.Struct({
27690 "classifier_id": Schema.String.annotate({
27691 "description":
27692 "UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified.",
27693 "format": "uuid"
27694 }),
27695 "filters": Schema.Array(Schema.Struct({
27696 "field": Schema.String.annotate({
27697 "description":
27698 "Classifier dimension name to filter on (snake_case identifier, e.g. \"department\", \"work_type\")."
27699 }),
27700 "operator": Schema.String.annotate({
27701 "description":
27702 "Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings."
27703 }),
27704 "value": Schema.Union([
27705 Schema.String,
27706 Schema.Number.annotate({ "format": "double" }).check(
27707 Schema.isFinite().annotate({ "expected": "a finite number" })
27708 ),
27709 Schema.Array(
27710 Schema.Union([
27711 Schema.String,
27712 Schema.Number.annotate({ "format": "double" }).check(
27713 Schema.isFinite().annotate({ "expected": "a finite number" })
27714 )
27715 ])
27716 )
27717 ]).annotate({
27718 "description": "Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in."
27719 })
27720 })).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
27721 Schema.isMaxLength(10).annotate({ "expected": "a value with a length of at most 10" })
27722 )
27723 }).annotate({
27724 "description":
27725 "Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions."
27726 })
27727 ),
27728 "dimensions": Schema.optionalKey(
27729 Schema.Array(
27730 Schema.String.annotate({
27731 "description": "Dimension to group by (up to 2). Use the /meta endpoint for available dimensions."
27732 })
27733 ).check(Schema.isMaxLength(2).annotate({ "expected": "a value with a length of at most 2" }))
27734 ),
27735 "filters": Schema.optionalKey(
27736 Schema.Array(Schema.Struct({
27737 "field": Schema.String.annotate({
27738 "description": "Dimension to filter on. Use the /meta endpoint for available dimensions."
27739 }),
27740 "operator": Schema.String.annotate({ "description": "Filter operator" }),
27741 "value": Schema.Union([
27742 Schema.String,
27743 Schema.Number.annotate({ "format": "double" }).check(
27744 Schema.isFinite().annotate({ "expected": "a finite number" })
27745 ),
27746 Schema.Array(
27747 Schema.Union([
27748 Schema.String,
27749 Schema.Number.annotate({ "format": "double" }).check(
27750 Schema.isFinite().annotate({ "expected": "a finite number" })
27751 )
27752 ])
27753 )
27754 ]).annotate({
27755 "description":
27756 "Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name; `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned."
27757 })
27758 })).check(Schema.isMaxLength(20).annotate({ "expected": "a value with a length of at most 20" }))
27759 ),
27760 "granularity": Schema.optionalKey(Schema.String.annotate({ "description": "Time granularity" })),
27761 "group_limit": Schema.optionalKey(
27762 Schema.Number.annotate({
27763 "description":
27764 "Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified."
27765 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
27766 ),
27767 "limit": Schema.optionalKey(
27768 Schema.Number.annotate({
27769 "description":
27770 "Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations."
27771 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
27772 ),
27773 "metrics": Schema.Array(Schema.String.annotate({ "description": "Metric name" })).check(
27774 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
27775 ),
27776 "order_by": Schema.optionalKey(
27777 Schema.Struct({
27778 "direction": Schema.Literals(["asc", "desc"]),
27779 "field": Schema.String.annotate({
27780 "description":
27781 "Field to order by: a metric included in `metrics` (or \"request_count\", which may be ordered by without being requested), a requested dimension, or \"date\"."
27782 })
27783 })
27784 ),
27785 "time_range": Schema.optionalKey(
27786 Schema.Struct({
27787 "end": Schema.String.annotate({ "format": "date-time" }),
27788 "start": Schema.String.annotate({ "format": "date-time" })
27789 })
27790 )
27791})
27792export type QueryAnalytics200 = {
27793 readonly "data": {
27794 readonly "cachedAt"?: number
27795 readonly "data": ReadonlyArray<{}>
27796 readonly "metadata": {
27797 readonly "query_time_ms": number
27798 readonly "row_count": number
27799 readonly "truncated": boolean
27800 }
27801 readonly "warnings"?: ReadonlyArray<string>
27802 }
27803}
27804export const QueryAnalytics200 = Schema.Struct({
27805 "data": Schema.Struct({
27806 "cachedAt": Schema.optionalKey(
27807 Schema.Number.annotate({ "format": "double" }).check(
27808 Schema.isFinite().annotate({ "expected": "a finite number" })
27809 )
27810 ),
27811 "data": Schema.Array(
27812 Schema.Struct({}).annotate({ "description": "A row of analytics data with metric/dimension values" })
27813 ),
27814 "metadata": Schema.Struct({
27815 "query_time_ms": Schema.Number.annotate({ "format": "double" }).check(
27816 Schema.isFinite().annotate({ "expected": "a finite number" })
27817 ),
27818 "row_count": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
27819 "truncated": Schema.Boolean
27820 }),
27821 "warnings": Schema.optionalKey(
27822 Schema.Array(Schema.String).annotate({
27823 "description":
27824 "Warnings about filter resolution issues (e.g. unresolvable api_key_id hashes). The query still runs normally; these inform the caller that some filter values could not be resolved."
27825 })
27826 )
27827 })
27828})
27829export type QueryAnalytics400 = BadRequestResponse
27830export const QueryAnalytics400 = BadRequestResponse
27831export type QueryAnalytics401 = UnauthorizedResponse
27832export const QueryAnalytics401 = UnauthorizedResponse
27833export type QueryAnalytics403 = ForbiddenResponse
27834export const QueryAnalytics403 = ForbiddenResponse
27835export type QueryAnalytics408 = RequestTimeoutResponse
27836export const QueryAnalytics408 = RequestTimeoutResponse
27837export type QueryAnalytics500 = InternalServerResponse
27838export const QueryAnalytics500 = InternalServerResponse
27839export type CreateAudioSpeechParams = {
27840 readonly "HTTP-Referer"?: string
27841 readonly "X-OpenRouter-Title"?: string
27842 readonly "X-OpenRouter-Categories"?: string
27843}
27844export const CreateAudioSpeechParams = Schema.Struct({
27845 "HTTP-Referer": Schema.optionalKey(Schema.String),
27846 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
27847 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
27848})
27849export type CreateAudioSpeechRequestJson = SpeechRequest
27850export const CreateAudioSpeechRequestJson = SpeechRequest
27851export type CreateAudioSpeech400 = BadRequestResponse
27852export const CreateAudioSpeech400 = BadRequestResponse
27853export type CreateAudioSpeech401 = UnauthorizedResponse
27854export const CreateAudioSpeech401 = UnauthorizedResponse
27855export type CreateAudioSpeech402 = PaymentRequiredResponse
27856export const CreateAudioSpeech402 = PaymentRequiredResponse
27857export type CreateAudioSpeech404 = NotFoundResponse
27858export const CreateAudioSpeech404 = NotFoundResponse
27859export type CreateAudioSpeech429 = TooManyRequestsResponse
27860export const CreateAudioSpeech429 = TooManyRequestsResponse
27861export type CreateAudioSpeech500 = InternalServerResponse
27862export const CreateAudioSpeech500 = InternalServerResponse
27863export type CreateAudioSpeech502 = BadGatewayResponse
27864export const CreateAudioSpeech502 = BadGatewayResponse
27865export type CreateAudioSpeech503 = ServiceUnavailableResponse
27866export const CreateAudioSpeech503 = ServiceUnavailableResponse
27867export type CreateAudioSpeech524 = EdgeNetworkTimeoutResponse
27868export const CreateAudioSpeech524 = EdgeNetworkTimeoutResponse
27869export type CreateAudioSpeech529 = ProviderOverloadedResponse
27870export const CreateAudioSpeech529 = ProviderOverloadedResponse
27871export type CreateAudioTranscriptionsParams = {
27872 readonly "HTTP-Referer"?: string
27873 readonly "X-OpenRouter-Title"?: string
27874 readonly "X-OpenRouter-Categories"?: string
27875}
27876export const CreateAudioTranscriptionsParams = Schema.Struct({
27877 "HTTP-Referer": Schema.optionalKey(Schema.String),
27878 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
27879 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
27880})
27881export type CreateAudioTranscriptionsRequestJson = STTRequest
27882export const CreateAudioTranscriptionsRequestJson = STTRequest
27883export type CreateAudioTranscriptions200 = STTResponse
27884export const CreateAudioTranscriptions200 = STTResponse
27885export type CreateAudioTranscriptions400 = BadRequestResponse
27886export const CreateAudioTranscriptions400 = BadRequestResponse
27887export type CreateAudioTranscriptions401 = UnauthorizedResponse
27888export const CreateAudioTranscriptions401 = UnauthorizedResponse
27889export type CreateAudioTranscriptions402 = PaymentRequiredResponse
27890export const CreateAudioTranscriptions402 = PaymentRequiredResponse
27891export type CreateAudioTranscriptions404 = NotFoundResponse
27892export const CreateAudioTranscriptions404 = NotFoundResponse
27893export type CreateAudioTranscriptions429 = TooManyRequestsResponse
27894export const CreateAudioTranscriptions429 = TooManyRequestsResponse
27895export type CreateAudioTranscriptions500 = InternalServerResponse
27896export const CreateAudioTranscriptions500 = InternalServerResponse
27897export type CreateAudioTranscriptions502 = BadGatewayResponse
27898export const CreateAudioTranscriptions502 = BadGatewayResponse
27899export type CreateAudioTranscriptions503 = ServiceUnavailableResponse
27900export const CreateAudioTranscriptions503 = ServiceUnavailableResponse
27901export type CreateAudioTranscriptions524 = EdgeNetworkTimeoutResponse
27902export const CreateAudioTranscriptions524 = EdgeNetworkTimeoutResponse
27903export type CreateAudioTranscriptions529 = ProviderOverloadedResponse
27904export const CreateAudioTranscriptions529 = ProviderOverloadedResponse
27905export type ExchangeAuthCodeForAPIKeyParams = {
27906 readonly "HTTP-Referer"?: string
27907 readonly "X-OpenRouter-Title"?: string
27908 readonly "X-OpenRouter-Categories"?: string
27909}
27910export const ExchangeAuthCodeForAPIKeyParams = Schema.Struct({
27911 "HTTP-Referer": Schema.optionalKey(Schema.String),
27912 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
27913 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
27914})
27915export type ExchangeAuthCodeForAPIKeyRequestJson = {
27916 readonly "code": string
27917 readonly "code_challenge_method"?: "S256" | "plain" | null
27918 readonly "code_verifier"?: string
27919}
27920export const ExchangeAuthCodeForAPIKeyRequestJson = Schema.Struct({
27921 "code": Schema.String.annotate({ "description": "The authorization code received from the OAuth redirect" }),
27922 "code_challenge_method": Schema.optionalKey(
27923 Schema.Union([Schema.Literal("S256"), Schema.Literal("plain"), Schema.Null]).annotate({
27924 "description": "The method used to generate the code challenge"
27925 })
27926 ),
27927 "code_verifier": Schema.optionalKey(
27928 Schema.String.annotate({
27929 "description": "The code verifier if code_challenge was used in the authorization request"
27930 })
27931 )
27932})
27933export type ExchangeAuthCodeForAPIKey200 = { readonly "key": string; readonly "user_id": string | null }
27934export const ExchangeAuthCodeForAPIKey200 = Schema.Struct({
27935 "key": Schema.String.annotate({ "description": "The API key to use for OpenRouter requests" }),
27936 "user_id": Schema.Union([Schema.String, Schema.Null]).annotate({
27937 "description": "User ID associated with the API key"
27938 })
27939})
27940export type ExchangeAuthCodeForAPIKey400 = BadRequestResponse
27941export const ExchangeAuthCodeForAPIKey400 = BadRequestResponse
27942export type ExchangeAuthCodeForAPIKey403 = ForbiddenResponse
27943export const ExchangeAuthCodeForAPIKey403 = ForbiddenResponse
27944export type ExchangeAuthCodeForAPIKey500 = InternalServerResponse
27945export const ExchangeAuthCodeForAPIKey500 = InternalServerResponse
27946export type CreateAuthKeysCodeParams = {
27947 readonly "HTTP-Referer"?: string
27948 readonly "X-OpenRouter-Title"?: string
27949 readonly "X-OpenRouter-Categories"?: string
27950}
27951export const CreateAuthKeysCodeParams = Schema.Struct({
27952 "HTTP-Referer": Schema.optionalKey(Schema.String),
27953 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
27954 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
27955})
27956export type CreateAuthKeysCodeRequestJson = {
27957 readonly "callback_url": string
27958 readonly "code_challenge"?: string
27959 readonly "code_challenge_method"?: "S256" | "plain"
27960 readonly "expires_at"?: string | null
27961 readonly "key_label"?: string
27962 readonly "limit"?: number
27963 readonly "spawn_agent"?: string
27964 readonly "spawn_cloud"?: string
27965 readonly "usage_limit_type"?: "daily" | "weekly" | "monthly"
27966 readonly "workspace_id"?: string
27967}
27968export const CreateAuthKeysCodeRequestJson = Schema.Struct({
27969 "callback_url": Schema.String.annotate({
27970 "description":
27971 "The callback URL to redirect to after authorization. Supports https URLs and localhost/127.0.0.1 URLs on any port for local CLI tools.",
27972 "format": "uri"
27973 }),
27974 "code_challenge": Schema.optionalKey(
27975 Schema.String.annotate({ "description": "PKCE code challenge for enhanced security" })
27976 ),
27977 "code_challenge_method": Schema.optionalKey(
27978 Schema.Literals(["S256", "plain"]).annotate({ "description": "The method used to generate the code challenge" })
27979 ),
27980 "expires_at": Schema.optionalKey(
27981 Schema.Union([Schema.String, Schema.Null]).annotate({
27982 "description": "Optional expiration time for the API key to be created",
27983 "format": "date-time"
27984 })
27985 ),
27986 "key_label": Schema.optionalKey(
27987 Schema.String.annotate({
27988 "description": "Optional custom label for the API key. Defaults to the app name if not provided."
27989 }).check(Schema.isMaxLength(100).annotate({ "expected": "a value with a length of at most 100" }))
27990 ),
27991 "limit": Schema.optionalKey(
27992 Schema.Number.annotate({ "description": "Credit limit for the API key to be created", "format": "double" }).check(
27993 Schema.isFinite().annotate({ "expected": "a finite number" })
27994 )
27995 ),
27996 "spawn_agent": Schema.optionalKey(Schema.String.annotate({ "description": "Agent identifier for spawn telemetry" })),
27997 "spawn_cloud": Schema.optionalKey(Schema.String.annotate({ "description": "Cloud identifier for spawn telemetry" })),
27998 "usage_limit_type": Schema.optionalKey(
27999 Schema.Literals(["daily", "weekly", "monthly"]).annotate({
28000 "description": "Optional credit limit reset interval. When set, the credit limit resets on this interval."
28001 })
28002 ),
28003 "workspace_id": Schema.optionalKey(
28004 Schema.String.annotate({ "description": "Optional workspace ID to associate the API key with", "format": "uuid" })
28005 )
28006})
28007export type CreateAuthKeysCode200 = {
28008 readonly "data": { readonly "app_id": number; readonly "created_at": string; readonly "id": string }
28009}
28010export const CreateAuthKeysCode200 = Schema.Struct({
28011 "data": Schema.Struct({
28012 "app_id": Schema.Number.annotate({ "description": "The application ID associated with this auth code" }).check(
28013 Schema.isInt().annotate({ "expected": "an integer" })
28014 ),
28015 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the auth code was created" }),
28016 "id": Schema.String.annotate({ "description": "The authorization code ID to use in the exchange request" })
28017 }).annotate({ "description": "Auth code data" })
28018})
28019export type CreateAuthKeysCode400 = BadRequestResponse
28020export const CreateAuthKeysCode400 = BadRequestResponse
28021export type CreateAuthKeysCode401 = UnauthorizedResponse
28022export const CreateAuthKeysCode401 = UnauthorizedResponse
28023export type CreateAuthKeysCode403 = ForbiddenResponse
28024export const CreateAuthKeysCode403 = ForbiddenResponse
28025export type CreateAuthKeysCode409 = ConflictResponse
28026export const CreateAuthKeysCode409 = ConflictResponse
28027export type CreateAuthKeysCode500 = InternalServerResponse
28028export const CreateAuthKeysCode500 = InternalServerResponse
28029export type GetBenchmarksParams = {
28030 readonly "HTTP-Referer"?: string
28031 readonly "X-OpenRouter-Title"?: string
28032 readonly "X-OpenRouter-Categories"?: string
28033 readonly "source"?: "artificial-analysis" | "design-arena"
28034 readonly "task_type"?: "coding" | "intelligence" | "agentic"
28035 readonly "arena"?: "models" | "builders" | "agents"
28036 readonly "category"?: string
28037 readonly "max_results"?: number
28038}
28039export const GetBenchmarksParams = Schema.Struct({
28040 "HTTP-Referer": Schema.optionalKey(Schema.String),
28041 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28042 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
28043 "source": Schema.optionalKey(
28044 Schema.Literals(["artificial-analysis", "design-arena"]).annotate({
28045 "description":
28046 "Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources."
28047 })
28048 ),
28049 "task_type": Schema.optionalKey(
28050 Schema.Literals(["coding", "intelligence", "agentic"]).annotate({
28051 "description":
28052 "Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category."
28053 })
28054 ),
28055 "arena": Schema.optionalKey(
28056 Schema.Literals(["models", "builders", "agents"]).annotate({
28057 "description": "Design Arena only: arena to query. Defaults to `models` when source is `design-arena`."
28058 })
28059 ),
28060 "category": Schema.optionalKey(
28061 Schema.String.annotate({
28062 "description":
28063 "Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories."
28064 })
28065 ),
28066 "max_results": Schema.optionalKey(
28067 Schema.Number.annotate({
28068 "description": "Maximum number of items to return. When omitted, all matching results are returned."
28069 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
28070 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
28071 )
28072 )
28073})
28074export type GetBenchmarks200 = UnifiedBenchmarksResponse
28075export const GetBenchmarks200 = UnifiedBenchmarksResponse
28076export type GetBenchmarks400 = BadRequestResponse
28077export const GetBenchmarks400 = BadRequestResponse
28078export type GetBenchmarks401 = UnauthorizedResponse
28079export const GetBenchmarks401 = UnauthorizedResponse
28080export type GetBenchmarks429 = TooManyRequestsResponse
28081export const GetBenchmarks429 = TooManyRequestsResponse
28082export type GetBenchmarks500 = InternalServerResponse
28083export const GetBenchmarks500 = InternalServerResponse
28084export type ListBYOKKeysParams = {
28085 readonly "HTTP-Referer"?: string
28086 readonly "X-OpenRouter-Title"?: string
28087 readonly "X-OpenRouter-Categories"?: string
28088 readonly "offset"?: number | null
28089 readonly "limit"?: number
28090 readonly "workspace_id"?: string
28091 readonly "provider"?:
28092 | "ai21"
28093 | "aion-labs"
28094 | "akashml"
28095 | "alibaba"
28096 | "amazon-bedrock"
28097 | "amazon-nova"
28098 | "ambient"
28099 | "anthropic"
28100 | "arcee-ai"
28101 | "atlas-cloud"
28102 | "avian"
28103 | "azure"
28104 | "baidu"
28105 | "baseten"
28106 | "black-forest-labs"
28107 | "byteplus"
28108 | "cerebras"
28109 | "chutes"
28110 | "cirrascale"
28111 | "clarifai"
28112 | "cloudflare"
28113 | "cohere"
28114 | "coreweave"
28115 | "crusoe"
28116 | "darkbloom"
28117 | "decart"
28118 | "deepgram"
28119 | "deepinfra"
28120 | "deepseek"
28121 | "dekallm"
28122 | "digitalocean"
28123 | "featherless"
28124 | "fireworks"
28125 | "fish-audio"
28126 | "friendli"
28127 | "gmicloud"
28128 | "google-ai-studio"
28129 | "google-vertex"
28130 | "groq"
28131 | "heygen"
28132 | "inception"
28133 | "inceptron"
28134 | "inferact-vllm"
28135 | "inference-net"
28136 | "infermatic"
28137 | "inflection"
28138 | "io-net"
28139 | "ionstream"
28140 | "krea"
28141 | "liquid"
28142 | "mancer"
28143 | "mara"
28144 | "meta"
28145 | "minimax"
28146 | "mistral"
28147 | "modelrun"
28148 | "modular"
28149 | "moonshotai"
28150 | "morph"
28151 | "ncompass"
28152 | "nebius"
28153 | "nex-agi"
28154 | "nextbit"
28155 | "novita"
28156 | "nvidia"
28157 | "open-inference"
28158 | "openai"
28159 | "parasail"
28160 | "perceptron"
28161 | "perplexity"
28162 | "phala"
28163 | "poolside"
28164 | "quiver"
28165 | "recraft"
28166 | "reka"
28167 | "relace"
28168 | "runway"
28169 | "sail-research"
28170 | "sakana"
28171 | "sambanova"
28172 | "seed"
28173 | "siliconflow"
28174 | "sourceful"
28175 | "stepfun"
28176 | "streamlake"
28177 | "switchpoint"
28178 | "tencent"
28179 | "tenstorrent"
28180 | "together"
28181 | "upstage"
28182 | "venice"
28183 | "wafer"
28184 | "wandb"
28185 | "xai"
28186 | "xiaomi"
28187 | "z-ai"
28188}
28189export const ListBYOKKeysParams = Schema.Struct({
28190 "HTTP-Referer": Schema.optionalKey(Schema.String),
28191 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28192 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
28193 "offset": Schema.optionalKey(
28194 Schema.Union([
28195 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
28196 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
28197 ),
28198 Schema.Null
28199 ]).annotate({ "description": "Number of records to skip for pagination" })
28200 ),
28201 "limit": Schema.optionalKey(
28202 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
28203 Schema.isInt().annotate({ "expected": "an integer" })
28204 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
28205 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
28206 )
28207 ),
28208 "workspace_id": Schema.optionalKey(
28209 Schema.String.annotate({
28210 "description": "Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace.",
28211 "format": "uuid"
28212 })
28213 ),
28214 "provider": Schema.optionalKey(
28215 Schema.Literals([
28216 "ai21",
28217 "aion-labs",
28218 "akashml",
28219 "alibaba",
28220 "amazon-bedrock",
28221 "amazon-nova",
28222 "ambient",
28223 "anthropic",
28224 "arcee-ai",
28225 "atlas-cloud",
28226 "avian",
28227 "azure",
28228 "baidu",
28229 "baseten",
28230 "black-forest-labs",
28231 "byteplus",
28232 "cerebras",
28233 "chutes",
28234 "cirrascale",
28235 "clarifai",
28236 "cloudflare",
28237 "cohere",
28238 "coreweave",
28239 "crusoe",
28240 "darkbloom",
28241 "decart",
28242 "deepgram",
28243 "deepinfra",
28244 "deepseek",
28245 "dekallm",
28246 "digitalocean",
28247 "featherless",
28248 "fireworks",
28249 "fish-audio",
28250 "friendli",
28251 "gmicloud",
28252 "google-ai-studio",
28253 "google-vertex",
28254 "groq",
28255 "heygen",
28256 "inception",
28257 "inceptron",
28258 "inferact-vllm",
28259 "inference-net",
28260 "infermatic",
28261 "inflection",
28262 "io-net",
28263 "ionstream",
28264 "krea",
28265 "liquid",
28266 "mancer",
28267 "mara",
28268 "meta",
28269 "minimax",
28270 "mistral",
28271 "modelrun",
28272 "modular",
28273 "moonshotai",
28274 "morph",
28275 "ncompass",
28276 "nebius",
28277 "nex-agi",
28278 "nextbit",
28279 "novita",
28280 "nvidia",
28281 "open-inference",
28282 "openai",
28283 "parasail",
28284 "perceptron",
28285 "perplexity",
28286 "phala",
28287 "poolside",
28288 "quiver",
28289 "recraft",
28290 "reka",
28291 "relace",
28292 "runway",
28293 "sail-research",
28294 "sakana",
28295 "sambanova",
28296 "seed",
28297 "siliconflow",
28298 "sourceful",
28299 "stepfun",
28300 "streamlake",
28301 "switchpoint",
28302 "tencent",
28303 "tenstorrent",
28304 "together",
28305 "upstage",
28306 "venice",
28307 "wafer",
28308 "wandb",
28309 "xai",
28310 "xiaomi",
28311 "z-ai"
28312 ]).annotate({
28313 "description": "Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`)."
28314 })
28315 )
28316})
28317export type ListBYOKKeys200 = ListBYOKKeysResponse
28318export const ListBYOKKeys200 = ListBYOKKeysResponse
28319export type ListBYOKKeys400 = BadRequestResponse
28320export const ListBYOKKeys400 = BadRequestResponse
28321export type ListBYOKKeys401 = UnauthorizedResponse
28322export const ListBYOKKeys401 = UnauthorizedResponse
28323export type ListBYOKKeys500 = InternalServerResponse
28324export const ListBYOKKeys500 = InternalServerResponse
28325export type CreateBYOKKeyParams = {
28326 readonly "HTTP-Referer"?: string
28327 readonly "X-OpenRouter-Title"?: string
28328 readonly "X-OpenRouter-Categories"?: string
28329}
28330export const CreateBYOKKeyParams = Schema.Struct({
28331 "HTTP-Referer": Schema.optionalKey(Schema.String),
28332 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28333 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
28334})
28335export type CreateBYOKKeyRequestJson = CreateBYOKKeyRequest
28336export const CreateBYOKKeyRequestJson = CreateBYOKKeyRequest
28337export type CreateBYOKKey201 = CreateBYOKKeyResponse
28338export const CreateBYOKKey201 = CreateBYOKKeyResponse
28339export type CreateBYOKKey400 = BadRequestResponse
28340export const CreateBYOKKey400 = BadRequestResponse
28341export type CreateBYOKKey401 = UnauthorizedResponse
28342export const CreateBYOKKey401 = UnauthorizedResponse
28343export type CreateBYOKKey403 = ForbiddenResponse
28344export const CreateBYOKKey403 = ForbiddenResponse
28345export type CreateBYOKKey500 = InternalServerResponse
28346export const CreateBYOKKey500 = InternalServerResponse
28347export type GetBYOKKeyParams = {
28348 readonly "HTTP-Referer"?: string
28349 readonly "X-OpenRouter-Title"?: string
28350 readonly "X-OpenRouter-Categories"?: string
28351}
28352export const GetBYOKKeyParams = Schema.Struct({
28353 "HTTP-Referer": Schema.optionalKey(Schema.String),
28354 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28355 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
28356})
28357export type GetBYOKKey200 = GetBYOKKeyResponse
28358export const GetBYOKKey200 = GetBYOKKeyResponse
28359export type GetBYOKKey401 = UnauthorizedResponse
28360export const GetBYOKKey401 = UnauthorizedResponse
28361export type GetBYOKKey404 = NotFoundResponse
28362export const GetBYOKKey404 = NotFoundResponse
28363export type GetBYOKKey500 = InternalServerResponse
28364export const GetBYOKKey500 = InternalServerResponse
28365export type DeleteBYOKKeyParams = {
28366 readonly "HTTP-Referer"?: string
28367 readonly "X-OpenRouter-Title"?: string
28368 readonly "X-OpenRouter-Categories"?: string
28369}
28370export const DeleteBYOKKeyParams = Schema.Struct({
28371 "HTTP-Referer": Schema.optionalKey(Schema.String),
28372 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28373 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
28374})
28375export type DeleteBYOKKey200 = DeleteBYOKKeyResponse
28376export const DeleteBYOKKey200 = DeleteBYOKKeyResponse
28377export type DeleteBYOKKey401 = UnauthorizedResponse
28378export const DeleteBYOKKey401 = UnauthorizedResponse
28379export type DeleteBYOKKey404 = NotFoundResponse
28380export const DeleteBYOKKey404 = NotFoundResponse
28381export type DeleteBYOKKey500 = InternalServerResponse
28382export const DeleteBYOKKey500 = InternalServerResponse
28383export type UpdateBYOKKeyParams = {
28384 readonly "HTTP-Referer"?: string
28385 readonly "X-OpenRouter-Title"?: string
28386 readonly "X-OpenRouter-Categories"?: string
28387}
28388export const UpdateBYOKKeyParams = Schema.Struct({
28389 "HTTP-Referer": Schema.optionalKey(Schema.String),
28390 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28391 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
28392})
28393export type UpdateBYOKKeyRequestJson = UpdateBYOKKeyRequest
28394export const UpdateBYOKKeyRequestJson = UpdateBYOKKeyRequest
28395export type UpdateBYOKKey200 = UpdateBYOKKeyResponse
28396export const UpdateBYOKKey200 = UpdateBYOKKeyResponse
28397export type UpdateBYOKKey400 = BadRequestResponse
28398export const UpdateBYOKKey400 = BadRequestResponse
28399export type UpdateBYOKKey401 = UnauthorizedResponse
28400export const UpdateBYOKKey401 = UnauthorizedResponse
28401export type UpdateBYOKKey404 = NotFoundResponse
28402export const UpdateBYOKKey404 = NotFoundResponse
28403export type UpdateBYOKKey500 = InternalServerResponse
28404export const UpdateBYOKKey500 = InternalServerResponse
28405export type SendChatCompletionRequestParams = {
28406 readonly "HTTP-Referer"?: string
28407 readonly "X-OpenRouter-Title"?: string
28408 readonly "X-OpenRouter-Categories"?: string
28409 readonly "X-OpenRouter-Metadata"?: MetadataLevel
28410}
28411export const SendChatCompletionRequestParams = Schema.Struct({
28412 "HTTP-Referer": Schema.optionalKey(Schema.String),
28413 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28414 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
28415 "X-OpenRouter-Metadata": Schema.optionalKey(MetadataLevel)
28416})
28417export type SendChatCompletionRequestRequestJson = ChatRequest
28418export const SendChatCompletionRequestRequestJson = ChatRequest
28419export type SendChatCompletionRequest200 = ChatResult
28420export const SendChatCompletionRequest200 = ChatResult
28421export type SendChatCompletionRequest200Sse = ChatStreamingResponse
28422export const SendChatCompletionRequest200Sse = ChatStreamingResponse
28423export type SendChatCompletionRequest400 = BadRequestResponse
28424export const SendChatCompletionRequest400 = BadRequestResponse
28425export type SendChatCompletionRequest401 = UnauthorizedResponse
28426export const SendChatCompletionRequest401 = UnauthorizedResponse
28427export type SendChatCompletionRequest402 = PaymentRequiredResponse
28428export const SendChatCompletionRequest402 = PaymentRequiredResponse
28429export type SendChatCompletionRequest403 = ForbiddenResponse
28430export const SendChatCompletionRequest403 = ForbiddenResponse
28431export type SendChatCompletionRequest404 = NotFoundResponse
28432export const SendChatCompletionRequest404 = NotFoundResponse
28433export type SendChatCompletionRequest408 = RequestTimeoutResponse
28434export const SendChatCompletionRequest408 = RequestTimeoutResponse
28435export type SendChatCompletionRequest413 = PayloadTooLargeResponse
28436export const SendChatCompletionRequest413 = PayloadTooLargeResponse
28437export type SendChatCompletionRequest422 = UnprocessableEntityResponse
28438export const SendChatCompletionRequest422 = UnprocessableEntityResponse
28439export type SendChatCompletionRequest429 = TooManyRequestsResponse
28440export const SendChatCompletionRequest429 = TooManyRequestsResponse
28441export type SendChatCompletionRequest500 = InternalServerResponse
28442export const SendChatCompletionRequest500 = InternalServerResponse
28443export type SendChatCompletionRequest502 = BadGatewayResponse
28444export const SendChatCompletionRequest502 = BadGatewayResponse
28445export type SendChatCompletionRequest503 = ServiceUnavailableResponse
28446export const SendChatCompletionRequest503 = ServiceUnavailableResponse
28447export type SendChatCompletionRequest524 = EdgeNetworkTimeoutResponse
28448export const SendChatCompletionRequest524 = EdgeNetworkTimeoutResponse
28449export type SendChatCompletionRequest529 = ProviderOverloadedResponse
28450export const SendChatCompletionRequest529 = ProviderOverloadedResponse
28451export type GetTaskClassificationsParams = {
28452 readonly "HTTP-Referer"?: string
28453 readonly "X-OpenRouter-Title"?: string
28454 readonly "X-OpenRouter-Categories"?: string
28455 readonly "window"?: "7d"
28456}
28457export const GetTaskClassificationsParams = Schema.Struct({
28458 "HTTP-Referer": Schema.optionalKey(Schema.String),
28459 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28460 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
28461 "window": Schema.optionalKey(
28462 Schema.Literal("7d").annotate({
28463 "description":
28464 "Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported."
28465 })
28466 )
28467})
28468export type GetTaskClassifications200 = TaskClassificationResponse
28469export const GetTaskClassifications200 = TaskClassificationResponse
28470export type GetTaskClassifications400 = BadRequestResponse
28471export const GetTaskClassifications400 = BadRequestResponse
28472export type GetTaskClassifications401 = UnauthorizedResponse
28473export const GetTaskClassifications401 = UnauthorizedResponse
28474export type GetTaskClassifications429 = TooManyRequestsResponse
28475export const GetTaskClassifications429 = TooManyRequestsResponse
28476export type GetTaskClassifications500 = InternalServerResponse
28477export const GetTaskClassifications500 = InternalServerResponse
28478export type GetCreditsParams = {
28479 readonly "HTTP-Referer"?: string
28480 readonly "X-OpenRouter-Title"?: string
28481 readonly "X-OpenRouter-Categories"?: string
28482}
28483export const GetCreditsParams = Schema.Struct({
28484 "HTTP-Referer": Schema.optionalKey(Schema.String),
28485 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28486 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
28487})
28488export type GetCredits200 = { readonly "data": { readonly "total_credits": number; readonly "total_usage": number } }
28489export const GetCredits200 = Schema.Struct({
28490 "data": Schema.Struct({
28491 "total_credits": Schema.Number.annotate({ "description": "Total credits purchased", "format": "double" }).check(
28492 Schema.isFinite().annotate({ "expected": "a finite number" })
28493 ),
28494 "total_usage": Schema.Number.annotate({ "description": "Total credits used", "format": "double" }).check(
28495 Schema.isFinite().annotate({ "expected": "a finite number" })
28496 )
28497 })
28498}).annotate({ "description": "Total credits purchased and used" })
28499export type GetCredits401 = UnauthorizedResponse
28500export const GetCredits401 = UnauthorizedResponse
28501export type GetCredits403 = ForbiddenResponse
28502export const GetCredits403 = ForbiddenResponse
28503export type GetCredits500 = InternalServerResponse
28504export const GetCredits500 = InternalServerResponse
28505export type CreateCoinbaseChargeParams = {
28506 readonly "HTTP-Referer"?: string
28507 readonly "X-OpenRouter-Title"?: string
28508 readonly "X-OpenRouter-Categories"?: string
28509}
28510export const CreateCoinbaseChargeParams = Schema.Struct({
28511 "HTTP-Referer": Schema.optionalKey(Schema.String),
28512 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28513 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
28514})
28515export type CreateCoinbaseCharge410 = GoneResponse
28516export const CreateCoinbaseCharge410 = GoneResponse
28517export type GetAppRankingsParams = {
28518 readonly "HTTP-Referer"?: string
28519 readonly "X-OpenRouter-Title"?: string
28520 readonly "X-OpenRouter-Categories"?: string
28521 readonly "category"?: "coding" | "creative" | "productivity" | "entertainment"
28522 readonly "subcategory"?:
28523 | "cli-agent"
28524 | "ide-extension"
28525 | "cloud-agent"
28526 | "programming-app"
28527 | "native-app-builder"
28528 | "creative-writing"
28529 | "video-gen"
28530 | "image-gen"
28531 | "audio-gen"
28532 | "roleplay"
28533 | "game"
28534 | "writing-assistant"
28535 | "general-chat"
28536 | "personal-agent"
28537 | "legal"
28538 readonly "sort"?: "popular" | "trending"
28539 readonly "start_date"?: string
28540 readonly "end_date"?: string
28541 readonly "limit"?: number
28542 readonly "offset"?: number | null
28543}
28544export const GetAppRankingsParams = Schema.Struct({
28545 "HTTP-Referer": Schema.optionalKey(Schema.String),
28546 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28547 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
28548 "category": Schema.optionalKey(
28549 Schema.Literals(["coding", "creative", "productivity", "entertainment"]).annotate({
28550 "description":
28551 "Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group."
28552 })
28553 ),
28554 "subcategory": Schema.optionalKey(
28555 Schema.Literals([
28556 "cli-agent",
28557 "ide-extension",
28558 "cloud-agent",
28559 "programming-app",
28560 "native-app-builder",
28561 "creative-writing",
28562 "video-gen",
28563 "image-gen",
28564 "audio-gen",
28565 "roleplay",
28566 "game",
28567 "writing-assistant",
28568 "general-chat",
28569 "personal-agent",
28570 "legal"
28571 ]).annotate({
28572 "description":
28573 "Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent."
28574 })
28575 ),
28576 "sort": Schema.optionalKey(
28577 Schema.Literals(["popular", "trending"]).annotate({
28578 "description":
28579 "`popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results."
28580 })
28581 ),
28582 "start_date": Schema.optionalKey(
28583 Schema.String.annotate({
28584 "description":
28585 "Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`."
28586 }).check(
28587 Schema.isPattern(new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).annotate({
28588 "expected": "a string matching the RegExp ^\\d{4}-\\d{2}-\\d{2}$"
28589 })
28590 )
28591 ),
28592 "end_date": Schema.optionalKey(
28593 Schema.String.annotate({
28594 "description":
28595 "End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400."
28596 }).check(
28597 Schema.isPattern(new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).annotate({
28598 "expected": "a string matching the RegExp ^\\d{4}-\\d{2}-\\d{2}$"
28599 })
28600 )
28601 ),
28602 "limit": Schema.optionalKey(
28603 Schema.Number.annotate({ "description": "Maximum number of apps to return (1-100). Defaults to 50." }).check(
28604 Schema.isInt().annotate({ "expected": "an integer" })
28605 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
28606 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
28607 )
28608 ),
28609 "offset": Schema.optionalKey(
28610 Schema.Union([
28611 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
28612 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
28613 ).check(Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })),
28614 Schema.Null
28615 ]).annotate({
28616 "description":
28617 "Number of ranked apps to skip before the first returned row (0-100). Defaults to 0. `rank` stays absolute, so the first row of `offset=50` is `rank: 51`."
28618 })
28619 )
28620})
28621export type GetAppRankings200 = AppRankingsResponse
28622export const GetAppRankings200 = AppRankingsResponse
28623export type GetAppRankings400 = BadRequestResponse
28624export const GetAppRankings400 = BadRequestResponse
28625export type GetAppRankings401 = UnauthorizedResponse
28626export const GetAppRankings401 = UnauthorizedResponse
28627export type GetAppRankings429 = TooManyRequestsResponse
28628export const GetAppRankings429 = TooManyRequestsResponse
28629export type GetAppRankings500 = InternalServerResponse
28630export const GetAppRankings500 = InternalServerResponse
28631export type GetRankingsDailyParams = {
28632 readonly "HTTP-Referer"?: string
28633 readonly "X-OpenRouter-Title"?: string
28634 readonly "X-OpenRouter-Categories"?: string
28635 readonly "start_date"?: string
28636 readonly "end_date"?: string
28637 readonly "period"?: "day" | "week" | "month"
28638 readonly "modality"?: "text" | "image" | "image_output" | "audio" | "tool_calling"
28639 readonly "context_bucket"?: "1K" | "10K" | "100K" | "1M" | "10M"
28640 readonly "category"?:
28641 | "programming"
28642 | "roleplay"
28643 | "marketing"
28644 | "marketing/seo"
28645 | "technology"
28646 | "science"
28647 | "translation"
28648 | "legal"
28649 | "finance"
28650 | "health"
28651 | "trivia"
28652 | "academia"
28653 readonly "language_type"?: "natural" | "programming"
28654}
28655export const GetRankingsDailyParams = Schema.Struct({
28656 "HTTP-Referer": Schema.optionalKey(Schema.String),
28657 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28658 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
28659 "start_date": Schema.optionalKey(
28660 Schema.String.annotate({
28661 "description":
28662 "Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`."
28663 }).check(
28664 Schema.isPattern(new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).annotate({
28665 "expected": "a string matching the RegExp ^\\d{4}-\\d{2}-\\d{2}$"
28666 })
28667 )
28668 ),
28669 "end_date": Schema.optionalKey(
28670 Schema.String.annotate({
28671 "description":
28672 "End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400."
28673 }).check(
28674 Schema.isPattern(new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).annotate({
28675 "expected": "a string matching the RegExp ^\\d{4}-\\d{2}-\\d{2}$"
28676 })
28677 )
28678 ),
28679 "period": Schema.optionalKey(
28680 Schema.Literals(["day", "week", "month"]).annotate({
28681 "description":
28682 "Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries."
28683 })
28684 ),
28685 "modality": Schema.optionalKey(
28686 Schema.Literals(["text", "image", "image_output", "audio", "tool_calling"]).annotate({
28687 "description":
28688 "Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`."
28689 })
28690 ),
28691 "context_bucket": Schema.optionalKey(
28692 Schema.Literals(["1K", "10K", "100K", "1M", "10M"]).annotate({
28693 "description":
28694 "Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`."
28695 })
28696 ),
28697 "category": Schema.optionalKey(
28698 Schema.Literals([
28699 "programming",
28700 "roleplay",
28701 "marketing",
28702 "marketing/seo",
28703 "technology",
28704 "science",
28705 "translation",
28706 "legal",
28707 "finance",
28708 "health",
28709 "trivia",
28710 "academia"
28711 ]).annotate({
28712 "description":
28713 "Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`."
28714 })
28715 ),
28716 "language_type": Schema.optionalKey(
28717 Schema.Literals(["natural", "programming"]).annotate({
28718 "description":
28719 "Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`."
28720 })
28721 )
28722})
28723export type GetRankingsDaily200 = RankingsDailyResponse
28724export const GetRankingsDaily200 = RankingsDailyResponse
28725export type GetRankingsDaily400 = BadRequestResponse
28726export const GetRankingsDaily400 = BadRequestResponse
28727export type GetRankingsDaily401 = UnauthorizedResponse
28728export const GetRankingsDaily401 = UnauthorizedResponse
28729export type GetRankingsDaily429 = TooManyRequestsResponse
28730export const GetRankingsDaily429 = TooManyRequestsResponse
28731export type GetRankingsDaily500 = InternalServerResponse
28732export const GetRankingsDaily500 = InternalServerResponse
28733export type CreateEmbeddingsParams = {
28734 readonly "HTTP-Referer"?: string
28735 readonly "X-OpenRouter-Title"?: string
28736 readonly "X-OpenRouter-Categories"?: string
28737}
28738export const CreateEmbeddingsParams = Schema.Struct({
28739 "HTTP-Referer": Schema.optionalKey(Schema.String),
28740 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28741 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
28742})
28743export type CreateEmbeddingsRequestJson = {
28744 readonly "dimensions"?: number
28745 readonly "encoding_format"?: "float" | "base64"
28746 readonly "input":
28747 | string
28748 | ReadonlyArray<string>
28749 | ReadonlyArray<number>
28750 | ReadonlyArray<ReadonlyArray<number>>
28751 | ReadonlyArray<
28752 {
28753 readonly "content": ReadonlyArray<
28754 | { readonly "text": string; readonly "type": "text" }
28755 | { readonly "image_url": { readonly "url": string }; readonly "type": "image_url" }
28756 | ContentPartInputAudio
28757 | ContentPartInputVideo
28758 | ContentPartInputFile
28759 >
28760 }
28761 >
28762 readonly "input_type"?: string
28763 readonly "model": string
28764 readonly "provider"?: ProviderPreferences
28765 readonly "user"?: string
28766}
28767export const CreateEmbeddingsRequestJson = Schema.Struct({
28768 "dimensions": Schema.optionalKey(
28769 Schema.Number.annotate({ "description": "The number of dimensions for the output embeddings" }).check(
28770 Schema.isInt().annotate({ "expected": "an integer" })
28771 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" }))
28772 ),
28773 "encoding_format": Schema.optionalKey(
28774 Schema.Literals(["float", "base64"]).annotate({ "description": "The format of the output embeddings" })
28775 ),
28776 "input": Schema.Union([
28777 Schema.String,
28778 Schema.Array(Schema.String),
28779 Schema.Array(Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" }))),
28780 Schema.Array(Schema.Array(Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })))),
28781 Schema.Array(Schema.Struct({
28782 "content": Schema.Array(
28783 Schema.Union([
28784 Schema.Struct({ "text": Schema.String, "type": Schema.Literal("text") }),
28785 Schema.Struct({ "image_url": Schema.Struct({ "url": Schema.String }), "type": Schema.Literal("image_url") }),
28786 ContentPartInputAudio,
28787 ContentPartInputVideo,
28788 ContentPartInputFile
28789 ], { mode: "oneOf" })
28790 )
28791 }))
28792 ]).annotate({ "description": "Text, token, or multimodal input(s) to embed" }),
28793 "input_type": Schema.optionalKey(
28794 Schema.String.annotate({ "description": "The type of input (e.g. search_query, search_document)" })
28795 ),
28796 "model": Schema.String.annotate({ "description": "The model to use for embeddings" }),
28797 "provider": Schema.optionalKey(
28798 Schema.suspend((): Schema.Codec<ProviderPreferences> => ProviderPreferences).annotate({
28799 "description": "Provider routing preferences for the request."
28800 })
28801 ),
28802 "user": Schema.optionalKey(Schema.String.annotate({ "description": "A unique identifier for the end-user" }))
28803}).annotate({ "description": "Embeddings request input" })
28804export type CreateEmbeddings200 = {
28805 readonly "data": ReadonlyArray<
28806 { readonly "embedding": ReadonlyArray<number> | string; readonly "index"?: number; readonly "object": "embedding" }
28807 >
28808 readonly "id"?: string
28809 readonly "model": string
28810 readonly "object": "list"
28811 readonly "usage"?: {
28812 readonly "cost"?: number
28813 readonly "cost_details"?: CostDetails
28814 readonly "is_byok"?: boolean
28815 readonly "prompt_tokens": number
28816 readonly "prompt_tokens_details"?: {
28817 readonly "audio_tokens"?: number
28818 readonly "file_tokens"?: number
28819 readonly "image_tokens"?: number
28820 readonly "text_tokens"?: number
28821 readonly "video_tokens"?: number
28822 }
28823 readonly "total_tokens": number
28824 }
28825}
28826export const CreateEmbeddings200 = Schema.Struct({
28827 "data": Schema.Array(
28828 Schema.Struct({
28829 "embedding": Schema.Union([
28830 Schema.Array(Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" }))),
28831 Schema.String
28832 ]).annotate({ "description": "Embedding vector as an array of floats or a base64 string" }),
28833 "index": Schema.optionalKey(
28834 Schema.Number.annotate({ "description": "Index of the embedding in the input list" }).check(
28835 Schema.isInt().annotate({ "expected": "an integer" })
28836 )
28837 ),
28838 "object": Schema.Literal("embedding")
28839 }).annotate({ "description": "A single embedding object" })
28840 ).annotate({ "description": "List of embedding objects" }),
28841 "id": Schema.optionalKey(Schema.String.annotate({ "description": "Unique identifier for the embeddings response" })),
28842 "model": Schema.String.annotate({ "description": "The model used for embeddings" }),
28843 "object": Schema.Literal("list"),
28844 "usage": Schema.optionalKey(
28845 Schema.Struct({
28846 "cost": Schema.optionalKey(
28847 Schema.Number.annotate({ "description": "Cost of the request in credits", "format": "double" }).check(
28848 Schema.isFinite().annotate({ "expected": "a finite number" })
28849 )
28850 ),
28851 "cost_details": Schema.optionalKey(CostDetails),
28852 "is_byok": Schema.optionalKey(
28853 Schema.Boolean.annotate({
28854 "description": "Whether a request was made using a Bring Your Own Key configuration"
28855 })
28856 ),
28857 "prompt_tokens": Schema.Number.annotate({ "description": "Number of tokens in the input" }).check(
28858 Schema.isInt().annotate({ "expected": "an integer" })
28859 ),
28860 "prompt_tokens_details": Schema.optionalKey(
28861 Schema.Struct({
28862 "audio_tokens": Schema.optionalKey(
28863 Schema.Number.annotate({ "description": "Number of audio tokens in the input" }).check(
28864 Schema.isInt().annotate({ "expected": "an integer" })
28865 )
28866 ),
28867 "file_tokens": Schema.optionalKey(
28868 Schema.Number.annotate({ "description": "Number of file/document tokens in the input" }).check(
28869 Schema.isInt().annotate({ "expected": "an integer" })
28870 )
28871 ),
28872 "image_tokens": Schema.optionalKey(
28873 Schema.Number.annotate({ "description": "Number of image tokens in the input" }).check(
28874 Schema.isInt().annotate({ "expected": "an integer" })
28875 )
28876 ),
28877 "text_tokens": Schema.optionalKey(
28878 Schema.Number.annotate({ "description": "Number of text tokens in the input" }).check(
28879 Schema.isInt().annotate({ "expected": "an integer" })
28880 )
28881 ),
28882 "video_tokens": Schema.optionalKey(
28883 Schema.Number.annotate({ "description": "Number of video tokens in the input" }).check(
28884 Schema.isInt().annotate({ "expected": "an integer" })
28885 )
28886 )
28887 }).annotate({
28888 "description":
28889 "Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included."
28890 })
28891 ),
28892 "total_tokens": Schema.Number.annotate({ "description": "Total number of tokens used" }).check(
28893 Schema.isInt().annotate({ "expected": "an integer" })
28894 )
28895 }).annotate({ "description": "Token usage statistics" })
28896 )
28897}).annotate({ "description": "Embeddings response containing embedding vectors" })
28898export type CreateEmbeddings200Sse = string
28899export const CreateEmbeddings200Sse = Schema.String.annotate({
28900 "description": "Not used for embeddings - embeddings do not support streaming"
28901})
28902export type CreateEmbeddings400 = BadRequestResponse
28903export const CreateEmbeddings400 = BadRequestResponse
28904export type CreateEmbeddings401 = UnauthorizedResponse
28905export const CreateEmbeddings401 = UnauthorizedResponse
28906export type CreateEmbeddings402 = PaymentRequiredResponse
28907export const CreateEmbeddings402 = PaymentRequiredResponse
28908export type CreateEmbeddings404 = NotFoundResponse
28909export const CreateEmbeddings404 = NotFoundResponse
28910export type CreateEmbeddings429 = TooManyRequestsResponse
28911export const CreateEmbeddings429 = TooManyRequestsResponse
28912export type CreateEmbeddings500 = InternalServerResponse
28913export const CreateEmbeddings500 = InternalServerResponse
28914export type CreateEmbeddings502 = BadGatewayResponse
28915export const CreateEmbeddings502 = BadGatewayResponse
28916export type CreateEmbeddings503 = ServiceUnavailableResponse
28917export const CreateEmbeddings503 = ServiceUnavailableResponse
28918export type CreateEmbeddings524 = EdgeNetworkTimeoutResponse
28919export const CreateEmbeddings524 = EdgeNetworkTimeoutResponse
28920export type CreateEmbeddings529 = ProviderOverloadedResponse
28921export const CreateEmbeddings529 = ProviderOverloadedResponse
28922export type ListEmbeddingsModelsParams = {
28923 readonly "HTTP-Referer"?: string
28924 readonly "X-OpenRouter-Title"?: string
28925 readonly "X-OpenRouter-Categories"?: string
28926 readonly "offset"?: number | null
28927 readonly "limit"?: number
28928}
28929export const ListEmbeddingsModelsParams = Schema.Struct({
28930 "HTTP-Referer": Schema.optionalKey(Schema.String),
28931 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28932 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
28933 "offset": Schema.optionalKey(
28934 Schema.Union([
28935 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
28936 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
28937 ),
28938 Schema.Null
28939 ]).annotate({
28940 "description":
28941 "Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned"
28942 })
28943 ),
28944 "limit": Schema.optionalKey(
28945 Schema.Number.annotate({
28946 "description":
28947 "Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned"
28948 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
28949 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
28950 ).check(Schema.isLessThanOrEqualTo(1000).annotate({ "expected": "a value less than or equal to 1000" }))
28951 )
28952})
28953export type ListEmbeddingsModels200 = ModelsListResponse
28954export const ListEmbeddingsModels200 = ModelsListResponse
28955export type ListEmbeddingsModels400 = BadRequestResponse
28956export const ListEmbeddingsModels400 = BadRequestResponse
28957export type ListEmbeddingsModels500 = InternalServerResponse
28958export const ListEmbeddingsModels500 = InternalServerResponse
28959export type ListEndpointsZdrParams = {
28960 readonly "HTTP-Referer"?: string
28961 readonly "X-OpenRouter-Title"?: string
28962 readonly "X-OpenRouter-Categories"?: string
28963}
28964export const ListEndpointsZdrParams = Schema.Struct({
28965 "HTTP-Referer": Schema.optionalKey(Schema.String),
28966 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28967 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
28968})
28969export type ListEndpointsZdr200 = { readonly "data": ReadonlyArray<PublicEndpoint> }
28970export const ListEndpointsZdr200 = Schema.Struct({ "data": Schema.Array(PublicEndpoint) })
28971export type ListEndpointsZdr403 = ForbiddenResponse
28972export const ListEndpointsZdr403 = ForbiddenResponse
28973export type ListEndpointsZdr500 = InternalServerResponse
28974export const ListEndpointsZdr500 = InternalServerResponse
28975export type ListFilesParams = {
28976 readonly "HTTP-Referer"?: string
28977 readonly "X-OpenRouter-Title"?: string
28978 readonly "X-OpenRouter-Categories"?: string
28979 readonly "limit"?: number
28980 readonly "cursor"?: string
28981 readonly "workspace_id"?: string
28982}
28983export const ListFilesParams = Schema.Struct({
28984 "HTTP-Referer": Schema.optionalKey(Schema.String),
28985 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
28986 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
28987 "limit": Schema.optionalKey(
28988 Schema.Number.annotate({ "description": "Maximum number of files to return (1–1000)." }).check(
28989 Schema.isInt().annotate({ "expected": "an integer" })
28990 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
28991 Schema.isLessThanOrEqualTo(1000).annotate({ "expected": "a value less than or equal to 1000" })
28992 )
28993 ),
28994 "cursor": Schema.optionalKey(
28995 Schema.String.annotate({ "description": "Opaque pagination cursor from a previous response." })
28996 ),
28997 "workspace_id": Schema.optionalKey(
28998 Schema.String.annotate({
28999 "description": "Workspace to scope the request to. Defaults to the caller’s default workspace.",
29000 "format": "uuid"
29001 })
29002 )
29003})
29004export type ListFiles200 = FileListResponse
29005export const ListFiles200 = FileListResponse
29006export type ListFiles400 = BadRequestResponse
29007export const ListFiles400 = BadRequestResponse
29008export type ListFiles401 = UnauthorizedResponse
29009export const ListFiles401 = UnauthorizedResponse
29010export type ListFiles429 = TooManyRequestsResponse
29011export const ListFiles429 = TooManyRequestsResponse
29012export type ListFiles500 = InternalServerResponse
29013export const ListFiles500 = InternalServerResponse
29014export type UploadFileParams = {
29015 readonly "HTTP-Referer"?: string
29016 readonly "X-OpenRouter-Title"?: string
29017 readonly "X-OpenRouter-Categories"?: string
29018 readonly "workspace_id"?: string
29019}
29020export const UploadFileParams = Schema.Struct({
29021 "HTTP-Referer": Schema.optionalKey(Schema.String),
29022 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29023 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29024 "workspace_id": Schema.optionalKey(
29025 Schema.String.annotate({
29026 "description": "Workspace to scope the request to. Defaults to the caller’s default workspace.",
29027 "format": "uuid"
29028 })
29029 )
29030})
29031export type UploadFileRequestFormData = { readonly "file": string }
29032export const UploadFileRequestFormData = Schema.Struct({ "file": Schema.String.annotate({ "format": "binary" }) })
29033export type UploadFile200 = FileMetadata
29034export const UploadFile200 = FileMetadata
29035export type UploadFile400 = BadRequestResponse
29036export const UploadFile400 = BadRequestResponse
29037export type UploadFile401 = UnauthorizedResponse
29038export const UploadFile401 = UnauthorizedResponse
29039export type UploadFile403 = ForbiddenResponse
29040export const UploadFile403 = ForbiddenResponse
29041export type UploadFile413 = PayloadTooLargeResponse
29042export const UploadFile413 = PayloadTooLargeResponse
29043export type UploadFile429 = TooManyRequestsResponse
29044export const UploadFile429 = TooManyRequestsResponse
29045export type UploadFile500 = InternalServerResponse
29046export const UploadFile500 = InternalServerResponse
29047export type GetFileMetadataParams = {
29048 readonly "HTTP-Referer"?: string
29049 readonly "X-OpenRouter-Title"?: string
29050 readonly "X-OpenRouter-Categories"?: string
29051 readonly "workspace_id"?: string
29052}
29053export const GetFileMetadataParams = Schema.Struct({
29054 "HTTP-Referer": Schema.optionalKey(Schema.String),
29055 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29056 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29057 "workspace_id": Schema.optionalKey(
29058 Schema.String.annotate({
29059 "description": "Workspace to scope the request to. Defaults to the caller’s default workspace.",
29060 "format": "uuid"
29061 })
29062 )
29063})
29064export type GetFileMetadata200 = FileMetadata
29065export const GetFileMetadata200 = FileMetadata
29066export type GetFileMetadata401 = UnauthorizedResponse
29067export const GetFileMetadata401 = UnauthorizedResponse
29068export type GetFileMetadata404 = NotFoundResponse
29069export const GetFileMetadata404 = NotFoundResponse
29070export type GetFileMetadata429 = TooManyRequestsResponse
29071export const GetFileMetadata429 = TooManyRequestsResponse
29072export type GetFileMetadata500 = InternalServerResponse
29073export const GetFileMetadata500 = InternalServerResponse
29074export type DeleteFileParams = {
29075 readonly "HTTP-Referer"?: string
29076 readonly "X-OpenRouter-Title"?: string
29077 readonly "X-OpenRouter-Categories"?: string
29078 readonly "workspace_id"?: string
29079}
29080export const DeleteFileParams = Schema.Struct({
29081 "HTTP-Referer": Schema.optionalKey(Schema.String),
29082 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29083 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29084 "workspace_id": Schema.optionalKey(
29085 Schema.String.annotate({
29086 "description": "Workspace to scope the request to. Defaults to the caller’s default workspace.",
29087 "format": "uuid"
29088 })
29089 )
29090})
29091export type DeleteFile200 = FileDeleteResponse
29092export const DeleteFile200 = FileDeleteResponse
29093export type DeleteFile401 = UnauthorizedResponse
29094export const DeleteFile401 = UnauthorizedResponse
29095export type DeleteFile404 = NotFoundResponse
29096export const DeleteFile404 = NotFoundResponse
29097export type DeleteFile429 = TooManyRequestsResponse
29098export const DeleteFile429 = TooManyRequestsResponse
29099export type DeleteFile500 = InternalServerResponse
29100export const DeleteFile500 = InternalServerResponse
29101export type DownloadFileContentParams = {
29102 readonly "HTTP-Referer"?: string
29103 readonly "X-OpenRouter-Title"?: string
29104 readonly "X-OpenRouter-Categories"?: string
29105 readonly "workspace_id"?: string
29106}
29107export const DownloadFileContentParams = Schema.Struct({
29108 "HTTP-Referer": Schema.optionalKey(Schema.String),
29109 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29110 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29111 "workspace_id": Schema.optionalKey(
29112 Schema.String.annotate({
29113 "description": "Workspace to scope the request to. Defaults to the caller’s default workspace.",
29114 "format": "uuid"
29115 })
29116 )
29117})
29118export type DownloadFileContent400 = BadRequestResponse
29119export const DownloadFileContent400 = BadRequestResponse
29120export type DownloadFileContent401 = UnauthorizedResponse
29121export const DownloadFileContent401 = UnauthorizedResponse
29122export type DownloadFileContent404 = NotFoundResponse
29123export const DownloadFileContent404 = NotFoundResponse
29124export type DownloadFileContent429 = TooManyRequestsResponse
29125export const DownloadFileContent429 = TooManyRequestsResponse
29126export type DownloadFileContent500 = InternalServerResponse
29127export const DownloadFileContent500 = InternalServerResponse
29128export type GetGenerationParams = {
29129 readonly "HTTP-Referer"?: string
29130 readonly "X-OpenRouter-Title"?: string
29131 readonly "X-OpenRouter-Categories"?: string
29132 readonly "id": string
29133}
29134export const GetGenerationParams = Schema.Struct({
29135 "HTTP-Referer": Schema.optionalKey(Schema.String),
29136 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29137 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29138 "id": Schema.String.annotate({ "description": "The generation ID" }).check(
29139 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
29140 )
29141})
29142export type GetGeneration200 = GenerationResponse
29143export const GetGeneration200 = GenerationResponse
29144export type GetGeneration401 = UnauthorizedResponse
29145export const GetGeneration401 = UnauthorizedResponse
29146export type GetGeneration402 = PaymentRequiredResponse
29147export const GetGeneration402 = PaymentRequiredResponse
29148export type GetGeneration404 = NotFoundResponse
29149export const GetGeneration404 = NotFoundResponse
29150export type GetGeneration429 = TooManyRequestsResponse
29151export const GetGeneration429 = TooManyRequestsResponse
29152export type GetGeneration500 = InternalServerResponse
29153export const GetGeneration500 = InternalServerResponse
29154export type GetGeneration502 = BadGatewayResponse
29155export const GetGeneration502 = BadGatewayResponse
29156export type GetGeneration524 = EdgeNetworkTimeoutResponse
29157export const GetGeneration524 = EdgeNetworkTimeoutResponse
29158export type GetGeneration529 = ProviderOverloadedResponse
29159export const GetGeneration529 = ProviderOverloadedResponse
29160export type ListGenerationContentParams = {
29161 readonly "HTTP-Referer"?: string
29162 readonly "X-OpenRouter-Title"?: string
29163 readonly "X-OpenRouter-Categories"?: string
29164 readonly "id": string
29165}
29166export const ListGenerationContentParams = Schema.Struct({
29167 "HTTP-Referer": Schema.optionalKey(Schema.String),
29168 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29169 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29170 "id": Schema.String.annotate({ "description": "The generation ID" }).check(
29171 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
29172 )
29173})
29174export type ListGenerationContent200 = GenerationContentResponse
29175export const ListGenerationContent200 = GenerationContentResponse
29176export type ListGenerationContent401 = UnauthorizedResponse
29177export const ListGenerationContent401 = UnauthorizedResponse
29178export type ListGenerationContent403 = ForbiddenResponse
29179export const ListGenerationContent403 = ForbiddenResponse
29180export type ListGenerationContent404 = NotFoundResponse
29181export const ListGenerationContent404 = NotFoundResponse
29182export type ListGenerationContent429 = TooManyRequestsResponse
29183export const ListGenerationContent429 = TooManyRequestsResponse
29184export type ListGenerationContent500 = InternalServerResponse
29185export const ListGenerationContent500 = InternalServerResponse
29186export type ListGenerationContent502 = BadGatewayResponse
29187export const ListGenerationContent502 = BadGatewayResponse
29188export type ListGenerationContent524 = EdgeNetworkTimeoutResponse
29189export const ListGenerationContent524 = EdgeNetworkTimeoutResponse
29190export type ListGenerationContent529 = ProviderOverloadedResponse
29191export const ListGenerationContent529 = ProviderOverloadedResponse
29192export type SubmitGenerationFeedbackParams = {
29193 readonly "HTTP-Referer"?: string
29194 readonly "X-OpenRouter-Title"?: string
29195 readonly "X-OpenRouter-Categories"?: string
29196}
29197export const SubmitGenerationFeedbackParams = Schema.Struct({
29198 "HTTP-Referer": Schema.optionalKey(Schema.String),
29199 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29200 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29201})
29202export type SubmitGenerationFeedbackRequestJson = SubmitGenerationFeedbackRequest
29203export const SubmitGenerationFeedbackRequestJson = SubmitGenerationFeedbackRequest
29204export type SubmitGenerationFeedback200 = SubmitGenerationFeedbackResponse
29205export const SubmitGenerationFeedback200 = SubmitGenerationFeedbackResponse
29206export type SubmitGenerationFeedback400 = BadRequestResponse
29207export const SubmitGenerationFeedback400 = BadRequestResponse
29208export type SubmitGenerationFeedback401 = UnauthorizedResponse
29209export const SubmitGenerationFeedback401 = UnauthorizedResponse
29210export type SubmitGenerationFeedback404 = NotFoundResponse
29211export const SubmitGenerationFeedback404 = NotFoundResponse
29212export type SubmitGenerationFeedback429 = TooManyRequestsResponse
29213export const SubmitGenerationFeedback429 = TooManyRequestsResponse
29214export type SubmitGenerationFeedback500 = InternalServerResponse
29215export const SubmitGenerationFeedback500 = InternalServerResponse
29216export type ListGuardrailsParams = {
29217 readonly "HTTP-Referer"?: string
29218 readonly "X-OpenRouter-Title"?: string
29219 readonly "X-OpenRouter-Categories"?: string
29220 readonly "offset"?: number | null
29221 readonly "limit"?: number
29222 readonly "workspace_id"?: string
29223}
29224export const ListGuardrailsParams = Schema.Struct({
29225 "HTTP-Referer": Schema.optionalKey(Schema.String),
29226 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29227 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29228 "offset": Schema.optionalKey(
29229 Schema.Union([
29230 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
29231 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
29232 ),
29233 Schema.Null
29234 ]).annotate({ "description": "Number of records to skip for pagination" })
29235 ),
29236 "limit": Schema.optionalKey(
29237 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
29238 Schema.isInt().annotate({ "expected": "an integer" })
29239 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
29240 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
29241 )
29242 ),
29243 "workspace_id": Schema.optionalKey(
29244 Schema.String.annotate({
29245 "description": "Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned.",
29246 "format": "uuid"
29247 })
29248 )
29249})
29250export type ListGuardrails200 = ListGuardrailsResponse
29251export const ListGuardrails200 = ListGuardrailsResponse
29252export type ListGuardrails400 = BadRequestResponse
29253export const ListGuardrails400 = BadRequestResponse
29254export type ListGuardrails401 = UnauthorizedResponse
29255export const ListGuardrails401 = UnauthorizedResponse
29256export type ListGuardrails500 = InternalServerResponse
29257export const ListGuardrails500 = InternalServerResponse
29258export type CreateGuardrailParams = {
29259 readonly "HTTP-Referer"?: string
29260 readonly "X-OpenRouter-Title"?: string
29261 readonly "X-OpenRouter-Categories"?: string
29262}
29263export const CreateGuardrailParams = Schema.Struct({
29264 "HTTP-Referer": Schema.optionalKey(Schema.String),
29265 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29266 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29267})
29268export type CreateGuardrailRequestJson = CreateGuardrailRequest
29269export const CreateGuardrailRequestJson = CreateGuardrailRequest
29270export type CreateGuardrail201 = CreateGuardrailResponse
29271export const CreateGuardrail201 = CreateGuardrailResponse
29272export type CreateGuardrail400 = BadRequestResponse
29273export const CreateGuardrail400 = BadRequestResponse
29274export type CreateGuardrail401 = UnauthorizedResponse
29275export const CreateGuardrail401 = UnauthorizedResponse
29276export type CreateGuardrail403 = ForbiddenResponse
29277export const CreateGuardrail403 = ForbiddenResponse
29278export type CreateGuardrail500 = InternalServerResponse
29279export const CreateGuardrail500 = InternalServerResponse
29280export type GetGuardrailParams = {
29281 readonly "HTTP-Referer"?: string
29282 readonly "X-OpenRouter-Title"?: string
29283 readonly "X-OpenRouter-Categories"?: string
29284}
29285export const GetGuardrailParams = Schema.Struct({
29286 "HTTP-Referer": Schema.optionalKey(Schema.String),
29287 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29288 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29289})
29290export type GetGuardrail200 = GetGuardrailResponse
29291export const GetGuardrail200 = GetGuardrailResponse
29292export type GetGuardrail401 = UnauthorizedResponse
29293export const GetGuardrail401 = UnauthorizedResponse
29294export type GetGuardrail404 = NotFoundResponse
29295export const GetGuardrail404 = NotFoundResponse
29296export type GetGuardrail500 = InternalServerResponse
29297export const GetGuardrail500 = InternalServerResponse
29298export type DeleteGuardrailParams = {
29299 readonly "HTTP-Referer"?: string
29300 readonly "X-OpenRouter-Title"?: string
29301 readonly "X-OpenRouter-Categories"?: string
29302}
29303export const DeleteGuardrailParams = Schema.Struct({
29304 "HTTP-Referer": Schema.optionalKey(Schema.String),
29305 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29306 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29307})
29308export type DeleteGuardrail200 = DeleteGuardrailResponse
29309export const DeleteGuardrail200 = DeleteGuardrailResponse
29310export type DeleteGuardrail401 = UnauthorizedResponse
29311export const DeleteGuardrail401 = UnauthorizedResponse
29312export type DeleteGuardrail404 = NotFoundResponse
29313export const DeleteGuardrail404 = NotFoundResponse
29314export type DeleteGuardrail500 = InternalServerResponse
29315export const DeleteGuardrail500 = InternalServerResponse
29316export type UpdateGuardrailParams = {
29317 readonly "HTTP-Referer"?: string
29318 readonly "X-OpenRouter-Title"?: string
29319 readonly "X-OpenRouter-Categories"?: string
29320}
29321export const UpdateGuardrailParams = Schema.Struct({
29322 "HTTP-Referer": Schema.optionalKey(Schema.String),
29323 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29324 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29325})
29326export type UpdateGuardrailRequestJson = UpdateGuardrailRequest
29327export const UpdateGuardrailRequestJson = UpdateGuardrailRequest
29328export type UpdateGuardrail200 = UpdateGuardrailResponse
29329export const UpdateGuardrail200 = UpdateGuardrailResponse
29330export type UpdateGuardrail400 = BadRequestResponse
29331export const UpdateGuardrail400 = BadRequestResponse
29332export type UpdateGuardrail401 = UnauthorizedResponse
29333export const UpdateGuardrail401 = UnauthorizedResponse
29334export type UpdateGuardrail404 = NotFoundResponse
29335export const UpdateGuardrail404 = NotFoundResponse
29336export type UpdateGuardrail500 = InternalServerResponse
29337export const UpdateGuardrail500 = InternalServerResponse
29338export type ListGuardrailKeyAssignmentsParams = {
29339 readonly "HTTP-Referer"?: string
29340 readonly "X-OpenRouter-Title"?: string
29341 readonly "X-OpenRouter-Categories"?: string
29342 readonly "offset"?: number | null
29343 readonly "limit"?: number
29344}
29345export const ListGuardrailKeyAssignmentsParams = Schema.Struct({
29346 "HTTP-Referer": Schema.optionalKey(Schema.String),
29347 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29348 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29349 "offset": Schema.optionalKey(
29350 Schema.Union([
29351 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
29352 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
29353 ),
29354 Schema.Null
29355 ]).annotate({ "description": "Number of records to skip for pagination" })
29356 ),
29357 "limit": Schema.optionalKey(
29358 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
29359 Schema.isInt().annotate({ "expected": "an integer" })
29360 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
29361 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
29362 )
29363 )
29364})
29365export type ListGuardrailKeyAssignments200 = ListKeyAssignmentsResponse
29366export const ListGuardrailKeyAssignments200 = ListKeyAssignmentsResponse
29367export type ListGuardrailKeyAssignments401 = UnauthorizedResponse
29368export const ListGuardrailKeyAssignments401 = UnauthorizedResponse
29369export type ListGuardrailKeyAssignments404 = NotFoundResponse
29370export const ListGuardrailKeyAssignments404 = NotFoundResponse
29371export type ListGuardrailKeyAssignments500 = InternalServerResponse
29372export const ListGuardrailKeyAssignments500 = InternalServerResponse
29373export type BulkAssignKeysToGuardrailParams = {
29374 readonly "HTTP-Referer"?: string
29375 readonly "X-OpenRouter-Title"?: string
29376 readonly "X-OpenRouter-Categories"?: string
29377}
29378export const BulkAssignKeysToGuardrailParams = Schema.Struct({
29379 "HTTP-Referer": Schema.optionalKey(Schema.String),
29380 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29381 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29382})
29383export type BulkAssignKeysToGuardrailRequestJson = BulkAssignKeysRequest
29384export const BulkAssignKeysToGuardrailRequestJson = BulkAssignKeysRequest
29385export type BulkAssignKeysToGuardrail200 = BulkAssignKeysResponse
29386export const BulkAssignKeysToGuardrail200 = BulkAssignKeysResponse
29387export type BulkAssignKeysToGuardrail400 = BadRequestResponse
29388export const BulkAssignKeysToGuardrail400 = BadRequestResponse
29389export type BulkAssignKeysToGuardrail401 = UnauthorizedResponse
29390export const BulkAssignKeysToGuardrail401 = UnauthorizedResponse
29391export type BulkAssignKeysToGuardrail404 = NotFoundResponse
29392export const BulkAssignKeysToGuardrail404 = NotFoundResponse
29393export type BulkAssignKeysToGuardrail500 = InternalServerResponse
29394export const BulkAssignKeysToGuardrail500 = InternalServerResponse
29395export type BulkUnassignKeysFromGuardrailParams = {
29396 readonly "HTTP-Referer"?: string
29397 readonly "X-OpenRouter-Title"?: string
29398 readonly "X-OpenRouter-Categories"?: string
29399}
29400export const BulkUnassignKeysFromGuardrailParams = Schema.Struct({
29401 "HTTP-Referer": Schema.optionalKey(Schema.String),
29402 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29403 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29404})
29405export type BulkUnassignKeysFromGuardrailRequestJson = BulkUnassignKeysRequest
29406export const BulkUnassignKeysFromGuardrailRequestJson = BulkUnassignKeysRequest
29407export type BulkUnassignKeysFromGuardrail200 = BulkUnassignKeysResponse
29408export const BulkUnassignKeysFromGuardrail200 = BulkUnassignKeysResponse
29409export type BulkUnassignKeysFromGuardrail400 = BadRequestResponse
29410export const BulkUnassignKeysFromGuardrail400 = BadRequestResponse
29411export type BulkUnassignKeysFromGuardrail401 = UnauthorizedResponse
29412export const BulkUnassignKeysFromGuardrail401 = UnauthorizedResponse
29413export type BulkUnassignKeysFromGuardrail404 = NotFoundResponse
29414export const BulkUnassignKeysFromGuardrail404 = NotFoundResponse
29415export type BulkUnassignKeysFromGuardrail500 = InternalServerResponse
29416export const BulkUnassignKeysFromGuardrail500 = InternalServerResponse
29417export type ListGuardrailMemberAssignmentsParams = {
29418 readonly "HTTP-Referer"?: string
29419 readonly "X-OpenRouter-Title"?: string
29420 readonly "X-OpenRouter-Categories"?: string
29421 readonly "offset"?: number | null
29422 readonly "limit"?: number
29423}
29424export const ListGuardrailMemberAssignmentsParams = Schema.Struct({
29425 "HTTP-Referer": Schema.optionalKey(Schema.String),
29426 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29427 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29428 "offset": Schema.optionalKey(
29429 Schema.Union([
29430 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
29431 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
29432 ),
29433 Schema.Null
29434 ]).annotate({ "description": "Number of records to skip for pagination" })
29435 ),
29436 "limit": Schema.optionalKey(
29437 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
29438 Schema.isInt().annotate({ "expected": "an integer" })
29439 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
29440 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
29441 )
29442 )
29443})
29444export type ListGuardrailMemberAssignments200 = ListMemberAssignmentsResponse
29445export const ListGuardrailMemberAssignments200 = ListMemberAssignmentsResponse
29446export type ListGuardrailMemberAssignments401 = UnauthorizedResponse
29447export const ListGuardrailMemberAssignments401 = UnauthorizedResponse
29448export type ListGuardrailMemberAssignments404 = NotFoundResponse
29449export const ListGuardrailMemberAssignments404 = NotFoundResponse
29450export type ListGuardrailMemberAssignments500 = InternalServerResponse
29451export const ListGuardrailMemberAssignments500 = InternalServerResponse
29452export type BulkAssignMembersToGuardrailParams = {
29453 readonly "HTTP-Referer"?: string
29454 readonly "X-OpenRouter-Title"?: string
29455 readonly "X-OpenRouter-Categories"?: string
29456}
29457export const BulkAssignMembersToGuardrailParams = Schema.Struct({
29458 "HTTP-Referer": Schema.optionalKey(Schema.String),
29459 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29460 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29461})
29462export type BulkAssignMembersToGuardrailRequestJson = BulkAssignMembersRequest
29463export const BulkAssignMembersToGuardrailRequestJson = BulkAssignMembersRequest
29464export type BulkAssignMembersToGuardrail200 = BulkAssignMembersResponse
29465export const BulkAssignMembersToGuardrail200 = BulkAssignMembersResponse
29466export type BulkAssignMembersToGuardrail400 = BadRequestResponse
29467export const BulkAssignMembersToGuardrail400 = BadRequestResponse
29468export type BulkAssignMembersToGuardrail401 = UnauthorizedResponse
29469export const BulkAssignMembersToGuardrail401 = UnauthorizedResponse
29470export type BulkAssignMembersToGuardrail404 = NotFoundResponse
29471export const BulkAssignMembersToGuardrail404 = NotFoundResponse
29472export type BulkAssignMembersToGuardrail500 = InternalServerResponse
29473export const BulkAssignMembersToGuardrail500 = InternalServerResponse
29474export type BulkUnassignMembersFromGuardrailParams = {
29475 readonly "HTTP-Referer"?: string
29476 readonly "X-OpenRouter-Title"?: string
29477 readonly "X-OpenRouter-Categories"?: string
29478}
29479export const BulkUnassignMembersFromGuardrailParams = Schema.Struct({
29480 "HTTP-Referer": Schema.optionalKey(Schema.String),
29481 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29482 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29483})
29484export type BulkUnassignMembersFromGuardrailRequestJson = BulkUnassignMembersRequest
29485export const BulkUnassignMembersFromGuardrailRequestJson = BulkUnassignMembersRequest
29486export type BulkUnassignMembersFromGuardrail200 = BulkUnassignMembersResponse
29487export const BulkUnassignMembersFromGuardrail200 = BulkUnassignMembersResponse
29488export type BulkUnassignMembersFromGuardrail400 = BadRequestResponse
29489export const BulkUnassignMembersFromGuardrail400 = BadRequestResponse
29490export type BulkUnassignMembersFromGuardrail401 = UnauthorizedResponse
29491export const BulkUnassignMembersFromGuardrail401 = UnauthorizedResponse
29492export type BulkUnassignMembersFromGuardrail404 = NotFoundResponse
29493export const BulkUnassignMembersFromGuardrail404 = NotFoundResponse
29494export type BulkUnassignMembersFromGuardrail500 = InternalServerResponse
29495export const BulkUnassignMembersFromGuardrail500 = InternalServerResponse
29496export type ListKeyAssignmentsParams = {
29497 readonly "HTTP-Referer"?: string
29498 readonly "X-OpenRouter-Title"?: string
29499 readonly "X-OpenRouter-Categories"?: string
29500 readonly "offset"?: number | null
29501 readonly "limit"?: number
29502}
29503export const ListKeyAssignmentsParams = Schema.Struct({
29504 "HTTP-Referer": Schema.optionalKey(Schema.String),
29505 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29506 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29507 "offset": Schema.optionalKey(
29508 Schema.Union([
29509 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
29510 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
29511 ),
29512 Schema.Null
29513 ]).annotate({ "description": "Number of records to skip for pagination" })
29514 ),
29515 "limit": Schema.optionalKey(
29516 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
29517 Schema.isInt().annotate({ "expected": "an integer" })
29518 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
29519 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
29520 )
29521 )
29522})
29523export type ListKeyAssignments200 = ListKeyAssignmentsResponse
29524export const ListKeyAssignments200 = ListKeyAssignmentsResponse
29525export type ListKeyAssignments401 = UnauthorizedResponse
29526export const ListKeyAssignments401 = UnauthorizedResponse
29527export type ListKeyAssignments500 = InternalServerResponse
29528export const ListKeyAssignments500 = InternalServerResponse
29529export type ListMemberAssignmentsParams = {
29530 readonly "HTTP-Referer"?: string
29531 readonly "X-OpenRouter-Title"?: string
29532 readonly "X-OpenRouter-Categories"?: string
29533 readonly "offset"?: number | null
29534 readonly "limit"?: number
29535}
29536export const ListMemberAssignmentsParams = Schema.Struct({
29537 "HTTP-Referer": Schema.optionalKey(Schema.String),
29538 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29539 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29540 "offset": Schema.optionalKey(
29541 Schema.Union([
29542 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
29543 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
29544 ),
29545 Schema.Null
29546 ]).annotate({ "description": "Number of records to skip for pagination" })
29547 ),
29548 "limit": Schema.optionalKey(
29549 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
29550 Schema.isInt().annotate({ "expected": "an integer" })
29551 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
29552 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
29553 )
29554 )
29555})
29556export type ListMemberAssignments200 = ListMemberAssignmentsResponse
29557export const ListMemberAssignments200 = ListMemberAssignmentsResponse
29558export type ListMemberAssignments401 = UnauthorizedResponse
29559export const ListMemberAssignments401 = UnauthorizedResponse
29560export type ListMemberAssignments500 = InternalServerResponse
29561export const ListMemberAssignments500 = InternalServerResponse
29562export type CreateImagesParams = {
29563 readonly "HTTP-Referer"?: string
29564 readonly "X-OpenRouter-Title"?: string
29565 readonly "X-OpenRouter-Categories"?: string
29566}
29567export const CreateImagesParams = Schema.Struct({
29568 "HTTP-Referer": Schema.optionalKey(Schema.String),
29569 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29570 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29571})
29572export type CreateImagesRequestJson = ImageGenerationRequest
29573export const CreateImagesRequestJson = ImageGenerationRequest
29574export type CreateImages200 = ImageGenerationResponse
29575export const CreateImages200 = ImageGenerationResponse
29576export type CreateImages200Sse = ImageStreamingResponse
29577export const CreateImages200Sse = ImageStreamingResponse
29578export type CreateImages400 = BadRequestResponse
29579export const CreateImages400 = BadRequestResponse
29580export type CreateImages401 = UnauthorizedResponse
29581export const CreateImages401 = UnauthorizedResponse
29582export type CreateImages402 = PaymentRequiredResponse
29583export const CreateImages402 = PaymentRequiredResponse
29584export type CreateImages403 = ForbiddenResponse
29585export const CreateImages403 = ForbiddenResponse
29586export type CreateImages404 = NotFoundResponse
29587export const CreateImages404 = NotFoundResponse
29588export type CreateImages413 = PayloadTooLargeResponse
29589export const CreateImages413 = PayloadTooLargeResponse
29590export type CreateImages429 = TooManyRequestsResponse
29591export const CreateImages429 = TooManyRequestsResponse
29592export type CreateImages500 = InternalServerResponse
29593export const CreateImages500 = InternalServerResponse
29594export type CreateImages502 = BadGatewayResponse
29595export const CreateImages502 = BadGatewayResponse
29596export type CreateImages524 = EdgeNetworkTimeoutResponse
29597export const CreateImages524 = EdgeNetworkTimeoutResponse
29598export type CreateImages529 = ProviderOverloadedResponse
29599export const CreateImages529 = ProviderOverloadedResponse
29600export type ListImageModelsParams = {
29601 readonly "HTTP-Referer"?: string
29602 readonly "X-OpenRouter-Title"?: string
29603 readonly "X-OpenRouter-Categories"?: string
29604}
29605export const ListImageModelsParams = Schema.Struct({
29606 "HTTP-Referer": Schema.optionalKey(Schema.String),
29607 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29608 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29609})
29610export type ListImageModels200 = ImageModelsListResponse
29611export const ListImageModels200 = ImageModelsListResponse
29612export type ListImageModels500 = InternalServerResponse
29613export const ListImageModels500 = InternalServerResponse
29614export type ListImageModelEndpointsParams = {
29615 readonly "HTTP-Referer"?: string
29616 readonly "X-OpenRouter-Title"?: string
29617 readonly "X-OpenRouter-Categories"?: string
29618}
29619export const ListImageModelEndpointsParams = Schema.Struct({
29620 "HTTP-Referer": Schema.optionalKey(Schema.String),
29621 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29622 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29623})
29624export type ListImageModelEndpoints200 = ImageModelEndpointsResponse
29625export const ListImageModelEndpoints200 = ImageModelEndpointsResponse
29626export type ListImageModelEndpoints404 = NotFoundResponse
29627export const ListImageModelEndpoints404 = NotFoundResponse
29628export type ListImageModelEndpoints500 = InternalServerResponse
29629export const ListImageModelEndpoints500 = InternalServerResponse
29630export type GetCurrentKeyParams = {
29631 readonly "HTTP-Referer"?: string
29632 readonly "X-OpenRouter-Title"?: string
29633 readonly "X-OpenRouter-Categories"?: string
29634}
29635export const GetCurrentKeyParams = Schema.Struct({
29636 "HTTP-Referer": Schema.optionalKey(Schema.String),
29637 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29638 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29639})
29640export type GetCurrentKey200 = {
29641 readonly "data": {
29642 readonly "byok_usage": number
29643 readonly "byok_usage_daily": number
29644 readonly "byok_usage_monthly": number
29645 readonly "byok_usage_weekly": number
29646 readonly "creator_user_id": string | null
29647 readonly "expires_at"?: string | null
29648 readonly "include_byok_in_limit": boolean
29649 readonly "is_free_tier": boolean
29650 readonly "is_management_key": boolean
29651 readonly "is_provisioning_key": boolean
29652 readonly "label": string
29653 readonly "limit": number | null
29654 readonly "limit_remaining": number | null
29655 readonly "limit_reset": string | null
29656 readonly "rate_limit": { readonly "interval": string; readonly "note": string; readonly "requests": number }
29657 readonly "usage": number
29658 readonly "usage_daily": number
29659 readonly "usage_monthly": number
29660 readonly "usage_weekly": number
29661 }
29662}
29663export const GetCurrentKey200 = Schema.Struct({
29664 "data": Schema.Struct({
29665 "byok_usage": Schema.Number.annotate({
29666 "description": "Total external BYOK usage (in USD) for the API key",
29667 "format": "double"
29668 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29669 "byok_usage_daily": Schema.Number.annotate({
29670 "description": "External BYOK usage (in USD) for the current UTC day",
29671 "format": "double"
29672 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29673 "byok_usage_monthly": Schema.Number.annotate({
29674 "description": "External BYOK usage (in USD) for current UTC month",
29675 "format": "double"
29676 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29677 "byok_usage_weekly": Schema.Number.annotate({
29678 "description": "External BYOK usage (in USD) for the current UTC week (Monday-Sunday)",
29679 "format": "double"
29680 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29681 "creator_user_id": Schema.Union([Schema.String, Schema.Null]).annotate({
29682 "description":
29683 "The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."
29684 }),
29685 "expires_at": Schema.optionalKey(
29686 Schema.Union([Schema.String, Schema.Null]).annotate({
29687 "description": "ISO 8601 UTC timestamp when the API key expires, or null if no expiration",
29688 "format": "date-time"
29689 })
29690 ),
29691 "include_byok_in_limit": Schema.Boolean.annotate({
29692 "description": "Whether to include external BYOK usage in the credit limit"
29693 }),
29694 "is_free_tier": Schema.Boolean.annotate({ "description": "Whether this is a free tier API key" }),
29695 "is_management_key": Schema.Boolean.annotate({ "description": "Whether this is a management key" }),
29696 "is_provisioning_key": Schema.Boolean.annotate({ "description": "Whether this is a management key" }),
29697 "label": Schema.String.annotate({ "description": "Human-readable label for the API key" }),
29698 "limit": Schema.Union([
29699 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29700 Schema.Null
29701 ]).annotate({ "description": "Spending limit for the API key in USD", "format": "double" }),
29702 "limit_remaining": Schema.Union([
29703 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29704 Schema.Null
29705 ]).annotate({ "description": "Remaining spending limit in USD", "format": "double" }),
29706 "limit_reset": Schema.Union([Schema.String, Schema.Null]).annotate({
29707 "description": "Type of limit reset for the API key"
29708 }),
29709 "rate_limit": Schema.Struct({
29710 "interval": Schema.String.annotate({ "description": "Rate limit interval" }),
29711 "note": Schema.String.annotate({ "description": "Note about the rate limit" }),
29712 "requests": Schema.Number.annotate({ "description": "Number of requests allowed per interval" }).check(
29713 Schema.isInt().annotate({ "expected": "an integer" })
29714 )
29715 }).annotate({ "description": "Legacy rate limit information about a key. Will always return -1." }),
29716 "usage": Schema.Number.annotate({
29717 "description": "Total OpenRouter credit usage (in USD) for the API key",
29718 "format": "double"
29719 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29720 "usage_daily": Schema.Number.annotate({
29721 "description": "OpenRouter credit usage (in USD) for the current UTC day",
29722 "format": "double"
29723 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29724 "usage_monthly": Schema.Number.annotate({
29725 "description": "OpenRouter credit usage (in USD) for the current UTC month",
29726 "format": "double"
29727 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29728 "usage_weekly": Schema.Number.annotate({
29729 "description": "OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)",
29730 "format": "double"
29731 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
29732 }).annotate({ "description": "Current API key information" })
29733})
29734export type GetCurrentKey401 = UnauthorizedResponse
29735export const GetCurrentKey401 = UnauthorizedResponse
29736export type GetCurrentKey500 = InternalServerResponse
29737export const GetCurrentKey500 = InternalServerResponse
29738export type ListParams = {
29739 readonly "HTTP-Referer"?: string
29740 readonly "X-OpenRouter-Title"?: string
29741 readonly "X-OpenRouter-Categories"?: string
29742 readonly "include_disabled"?: boolean
29743 readonly "offset"?: number | null
29744 readonly "workspace_id"?: string
29745}
29746export const ListParams = Schema.Struct({
29747 "HTTP-Referer": Schema.optionalKey(Schema.String),
29748 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29749 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
29750 "include_disabled": Schema.optionalKey(
29751 Schema.Boolean.annotate({ "description": "Whether to include disabled API keys in the response" })
29752 ),
29753 "offset": Schema.optionalKey(
29754 Schema.Union([
29755 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
29756 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
29757 ),
29758 Schema.Null
29759 ]).annotate({ "description": "Number of API keys to skip for pagination" })
29760 ),
29761 "workspace_id": Schema.optionalKey(
29762 Schema.String.annotate({
29763 "description": "Filter API keys by workspace ID. By default, keys in the default workspace are returned.",
29764 "format": "uuid"
29765 })
29766 )
29767})
29768export type List200 = {
29769 readonly "data": ReadonlyArray<
29770 {
29771 readonly "byok_usage": number
29772 readonly "byok_usage_daily": number
29773 readonly "byok_usage_monthly": number
29774 readonly "byok_usage_weekly": number
29775 readonly "created_at": string
29776 readonly "creator_user_id": string | null
29777 readonly "disabled": boolean
29778 readonly "expires_at"?: string | null
29779 readonly "hash": string
29780 readonly "include_byok_in_limit": boolean
29781 readonly "label": string
29782 readonly "limit": number | null
29783 readonly "limit_remaining": number | null
29784 readonly "limit_reset": string | null
29785 readonly "name": string
29786 readonly "updated_at": string | null
29787 readonly "usage": number
29788 readonly "usage_daily": number
29789 readonly "usage_monthly": number
29790 readonly "usage_weekly": number
29791 readonly "workspace_id": string
29792 }
29793 >
29794}
29795export const List200 = Schema.Struct({
29796 "data": Schema.Array(Schema.Struct({
29797 "byok_usage": Schema.Number.annotate({
29798 "description": "Total external BYOK usage (in USD) for the API key",
29799 "format": "double"
29800 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29801 "byok_usage_daily": Schema.Number.annotate({
29802 "description": "External BYOK usage (in USD) for the current UTC day",
29803 "format": "double"
29804 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29805 "byok_usage_monthly": Schema.Number.annotate({
29806 "description": "External BYOK usage (in USD) for current UTC month",
29807 "format": "double"
29808 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29809 "byok_usage_weekly": Schema.Number.annotate({
29810 "description": "External BYOK usage (in USD) for the current UTC week (Monday-Sunday)",
29811 "format": "double"
29812 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29813 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the API key was created" }),
29814 "creator_user_id": Schema.Union([Schema.String, Schema.Null]).annotate({
29815 "description":
29816 "The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."
29817 }),
29818 "disabled": Schema.Boolean.annotate({ "description": "Whether the API key is disabled" }),
29819 "expires_at": Schema.optionalKey(
29820 Schema.Union([Schema.String, Schema.Null]).annotate({
29821 "description": "ISO 8601 UTC timestamp when the API key expires, or null if no expiration",
29822 "format": "date-time"
29823 })
29824 ),
29825 "hash": Schema.String.annotate({ "description": "Unique hash identifier for the API key" }),
29826 "include_byok_in_limit": Schema.Boolean.annotate({
29827 "description": "Whether to include external BYOK usage in the credit limit"
29828 }),
29829 "label": Schema.String.annotate({ "description": "Human-readable label for the API key" }),
29830 "limit": Schema.Union([
29831 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29832 Schema.Null
29833 ]).annotate({ "description": "Spending limit for the API key in USD", "format": "double" }),
29834 "limit_remaining": Schema.Union([
29835 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29836 Schema.Null
29837 ]).annotate({ "description": "Remaining spending limit in USD", "format": "double" }),
29838 "limit_reset": Schema.Union([Schema.String, Schema.Null]).annotate({
29839 "description": "Type of limit reset for the API key"
29840 }),
29841 "name": Schema.String.annotate({ "description": "Name of the API key" }),
29842 "updated_at": Schema.Union([Schema.String, Schema.Null]).annotate({
29843 "description": "ISO 8601 timestamp of when the API key was last updated"
29844 }),
29845 "usage": Schema.Number.annotate({
29846 "description": "Total OpenRouter credit usage (in USD) for the API key",
29847 "format": "double"
29848 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29849 "usage_daily": Schema.Number.annotate({
29850 "description": "OpenRouter credit usage (in USD) for the current UTC day",
29851 "format": "double"
29852 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29853 "usage_monthly": Schema.Number.annotate({
29854 "description": "OpenRouter credit usage (in USD) for the current UTC month",
29855 "format": "double"
29856 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29857 "usage_weekly": Schema.Number.annotate({
29858 "description": "OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)",
29859 "format": "double"
29860 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29861 "workspace_id": Schema.String.annotate({ "description": "The workspace ID this API key belongs to." })
29862 })).annotate({ "description": "List of API keys" })
29863})
29864export type List400 = BadRequestResponse
29865export const List400 = BadRequestResponse
29866export type List401 = UnauthorizedResponse
29867export const List401 = UnauthorizedResponse
29868export type List429 = TooManyRequestsResponse
29869export const List429 = TooManyRequestsResponse
29870export type List500 = InternalServerResponse
29871export const List500 = InternalServerResponse
29872export type CreateKeysParams = {
29873 readonly "HTTP-Referer"?: string
29874 readonly "X-OpenRouter-Title"?: string
29875 readonly "X-OpenRouter-Categories"?: string
29876}
29877export const CreateKeysParams = Schema.Struct({
29878 "HTTP-Referer": Schema.optionalKey(Schema.String),
29879 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
29880 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
29881})
29882export type CreateKeysRequestJson = {
29883 readonly "creator_user_id"?: string | null
29884 readonly "expires_at"?: string | null
29885 readonly "include_byok_in_limit"?: boolean
29886 readonly "limit"?: number | null
29887 readonly "limit_reset"?: "daily" | "weekly" | "monthly" | null
29888 readonly "name": string
29889 readonly "workspace_id"?: string
29890}
29891export const CreateKeysRequestJson = Schema.Struct({
29892 "creator_user_id": Schema.optionalKey(
29893 Schema.Union([
29894 Schema.String.check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })),
29895 Schema.Null
29896 ]).annotate({
29897 "description":
29898 "Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key."
29899 })
29900 ),
29901 "expires_at": Schema.optionalKey(
29902 Schema.Union([Schema.String, Schema.Null]).annotate({
29903 "description":
29904 "Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected",
29905 "format": "date-time"
29906 })
29907 ),
29908 "include_byok_in_limit": Schema.optionalKey(
29909 Schema.Boolean.annotate({ "description": "Whether to include BYOK usage in the limit" })
29910 ),
29911 "limit": Schema.optionalKey(
29912 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
29913 .annotate({ "description": "Optional spending limit for the API key in USD", "format": "double" })
29914 ),
29915 "limit_reset": Schema.optionalKey(
29916 Schema.Union([Schema.Literal("daily"), Schema.Literal("weekly"), Schema.Literal("monthly"), Schema.Null]).annotate({
29917 "description":
29918 "Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday."
29919 })
29920 ),
29921 "name": Schema.String.annotate({ "description": "Name for the new API key" }).check(
29922 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
29923 ),
29924 "workspace_id": Schema.optionalKey(
29925 Schema.String.annotate({
29926 "description": "The workspace to create the API key in. Defaults to the default workspace if not provided.",
29927 "format": "uuid"
29928 })
29929 )
29930})
29931export type CreateKeys201 = {
29932 readonly "data": {
29933 readonly "byok_usage": number
29934 readonly "byok_usage_daily": number
29935 readonly "byok_usage_monthly": number
29936 readonly "byok_usage_weekly": number
29937 readonly "created_at": string
29938 readonly "creator_user_id": string | null
29939 readonly "disabled": boolean
29940 readonly "expires_at"?: string | null
29941 readonly "hash": string
29942 readonly "include_byok_in_limit": boolean
29943 readonly "label": string
29944 readonly "limit": number | null
29945 readonly "limit_remaining": number | null
29946 readonly "limit_reset": string | null
29947 readonly "name": string
29948 readonly "updated_at": string | null
29949 readonly "usage": number
29950 readonly "usage_daily": number
29951 readonly "usage_monthly": number
29952 readonly "usage_weekly": number
29953 readonly "workspace_id": string
29954 }
29955 readonly "key": string
29956}
29957export const CreateKeys201 = Schema.Struct({
29958 "data": Schema.Struct({
29959 "byok_usage": Schema.Number.annotate({
29960 "description": "Total external BYOK usage (in USD) for the API key",
29961 "format": "double"
29962 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29963 "byok_usage_daily": Schema.Number.annotate({
29964 "description": "External BYOK usage (in USD) for the current UTC day",
29965 "format": "double"
29966 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29967 "byok_usage_monthly": Schema.Number.annotate({
29968 "description": "External BYOK usage (in USD) for current UTC month",
29969 "format": "double"
29970 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29971 "byok_usage_weekly": Schema.Number.annotate({
29972 "description": "External BYOK usage (in USD) for the current UTC week (Monday-Sunday)",
29973 "format": "double"
29974 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29975 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the API key was created" }),
29976 "creator_user_id": Schema.Union([Schema.String, Schema.Null]).annotate({
29977 "description":
29978 "The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."
29979 }),
29980 "disabled": Schema.Boolean.annotate({ "description": "Whether the API key is disabled" }),
29981 "expires_at": Schema.optionalKey(
29982 Schema.Union([Schema.String, Schema.Null]).annotate({
29983 "description": "ISO 8601 UTC timestamp when the API key expires, or null if no expiration",
29984 "format": "date-time"
29985 })
29986 ),
29987 "hash": Schema.String.annotate({ "description": "Unique hash identifier for the API key" }),
29988 "include_byok_in_limit": Schema.Boolean.annotate({
29989 "description": "Whether to include external BYOK usage in the credit limit"
29990 }),
29991 "label": Schema.String.annotate({ "description": "Human-readable label for the API key" }),
29992 "limit": Schema.Union([
29993 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29994 Schema.Null
29995 ]).annotate({ "description": "Spending limit for the API key in USD", "format": "double" }),
29996 "limit_remaining": Schema.Union([
29997 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
29998 Schema.Null
29999 ]).annotate({ "description": "Remaining spending limit in USD", "format": "double" }),
30000 "limit_reset": Schema.Union([Schema.String, Schema.Null]).annotate({
30001 "description": "Type of limit reset for the API key"
30002 }),
30003 "name": Schema.String.annotate({ "description": "Name of the API key" }),
30004 "updated_at": Schema.Union([Schema.String, Schema.Null]).annotate({
30005 "description": "ISO 8601 timestamp of when the API key was last updated"
30006 }),
30007 "usage": Schema.Number.annotate({
30008 "description": "Total OpenRouter credit usage (in USD) for the API key",
30009 "format": "double"
30010 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30011 "usage_daily": Schema.Number.annotate({
30012 "description": "OpenRouter credit usage (in USD) for the current UTC day",
30013 "format": "double"
30014 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30015 "usage_monthly": Schema.Number.annotate({
30016 "description": "OpenRouter credit usage (in USD) for the current UTC month",
30017 "format": "double"
30018 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30019 "usage_weekly": Schema.Number.annotate({
30020 "description": "OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)",
30021 "format": "double"
30022 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30023 "workspace_id": Schema.String.annotate({ "description": "The workspace ID this API key belongs to." })
30024 }).annotate({ "description": "The created API key information" }),
30025 "key": Schema.String.annotate({ "description": "The actual API key string (only shown once)" })
30026})
30027export type CreateKeys400 = BadRequestResponse
30028export const CreateKeys400 = BadRequestResponse
30029export type CreateKeys401 = UnauthorizedResponse
30030export const CreateKeys401 = UnauthorizedResponse
30031export type CreateKeys403 = ForbiddenResponse
30032export const CreateKeys403 = ForbiddenResponse
30033export type CreateKeys429 = TooManyRequestsResponse
30034export const CreateKeys429 = TooManyRequestsResponse
30035export type CreateKeys500 = InternalServerResponse
30036export const CreateKeys500 = InternalServerResponse
30037export type GetKeyParams = {
30038 readonly "HTTP-Referer"?: string
30039 readonly "X-OpenRouter-Title"?: string
30040 readonly "X-OpenRouter-Categories"?: string
30041}
30042export const GetKeyParams = Schema.Struct({
30043 "HTTP-Referer": Schema.optionalKey(Schema.String),
30044 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30045 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
30046})
30047export type GetKey200 = {
30048 readonly "data": {
30049 readonly "byok_usage": number
30050 readonly "byok_usage_daily": number
30051 readonly "byok_usage_monthly": number
30052 readonly "byok_usage_weekly": number
30053 readonly "created_at": string
30054 readonly "creator_user_id": string | null
30055 readonly "disabled": boolean
30056 readonly "expires_at"?: string | null
30057 readonly "hash": string
30058 readonly "include_byok_in_limit": boolean
30059 readonly "label": string
30060 readonly "limit": number | null
30061 readonly "limit_remaining": number | null
30062 readonly "limit_reset": string | null
30063 readonly "name": string
30064 readonly "updated_at": string | null
30065 readonly "usage": number
30066 readonly "usage_daily": number
30067 readonly "usage_monthly": number
30068 readonly "usage_weekly": number
30069 readonly "workspace_id": string
30070 }
30071}
30072export const GetKey200 = Schema.Struct({
30073 "data": Schema.Struct({
30074 "byok_usage": Schema.Number.annotate({
30075 "description": "Total external BYOK usage (in USD) for the API key",
30076 "format": "double"
30077 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30078 "byok_usage_daily": Schema.Number.annotate({
30079 "description": "External BYOK usage (in USD) for the current UTC day",
30080 "format": "double"
30081 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30082 "byok_usage_monthly": Schema.Number.annotate({
30083 "description": "External BYOK usage (in USD) for current UTC month",
30084 "format": "double"
30085 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30086 "byok_usage_weekly": Schema.Number.annotate({
30087 "description": "External BYOK usage (in USD) for the current UTC week (Monday-Sunday)",
30088 "format": "double"
30089 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30090 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the API key was created" }),
30091 "creator_user_id": Schema.Union([Schema.String, Schema.Null]).annotate({
30092 "description":
30093 "The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."
30094 }),
30095 "disabled": Schema.Boolean.annotate({ "description": "Whether the API key is disabled" }),
30096 "expires_at": Schema.optionalKey(
30097 Schema.Union([Schema.String, Schema.Null]).annotate({
30098 "description": "ISO 8601 UTC timestamp when the API key expires, or null if no expiration",
30099 "format": "date-time"
30100 })
30101 ),
30102 "hash": Schema.String.annotate({ "description": "Unique hash identifier for the API key" }),
30103 "include_byok_in_limit": Schema.Boolean.annotate({
30104 "description": "Whether to include external BYOK usage in the credit limit"
30105 }),
30106 "label": Schema.String.annotate({ "description": "Human-readable label for the API key" }),
30107 "limit": Schema.Union([
30108 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30109 Schema.Null
30110 ]).annotate({ "description": "Spending limit for the API key in USD", "format": "double" }),
30111 "limit_remaining": Schema.Union([
30112 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30113 Schema.Null
30114 ]).annotate({ "description": "Remaining spending limit in USD", "format": "double" }),
30115 "limit_reset": Schema.Union([Schema.String, Schema.Null]).annotate({
30116 "description": "Type of limit reset for the API key"
30117 }),
30118 "name": Schema.String.annotate({ "description": "Name of the API key" }),
30119 "updated_at": Schema.Union([Schema.String, Schema.Null]).annotate({
30120 "description": "ISO 8601 timestamp of when the API key was last updated"
30121 }),
30122 "usage": Schema.Number.annotate({
30123 "description": "Total OpenRouter credit usage (in USD) for the API key",
30124 "format": "double"
30125 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30126 "usage_daily": Schema.Number.annotate({
30127 "description": "OpenRouter credit usage (in USD) for the current UTC day",
30128 "format": "double"
30129 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30130 "usage_monthly": Schema.Number.annotate({
30131 "description": "OpenRouter credit usage (in USD) for the current UTC month",
30132 "format": "double"
30133 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30134 "usage_weekly": Schema.Number.annotate({
30135 "description": "OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)",
30136 "format": "double"
30137 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30138 "workspace_id": Schema.String.annotate({ "description": "The workspace ID this API key belongs to." })
30139 }).annotate({ "description": "The API key information" })
30140})
30141export type GetKey401 = UnauthorizedResponse
30142export const GetKey401 = UnauthorizedResponse
30143export type GetKey404 = NotFoundResponse
30144export const GetKey404 = NotFoundResponse
30145export type GetKey429 = TooManyRequestsResponse
30146export const GetKey429 = TooManyRequestsResponse
30147export type GetKey500 = InternalServerResponse
30148export const GetKey500 = InternalServerResponse
30149export type DeleteKeysParams = {
30150 readonly "HTTP-Referer"?: string
30151 readonly "X-OpenRouter-Title"?: string
30152 readonly "X-OpenRouter-Categories"?: string
30153}
30154export const DeleteKeysParams = Schema.Struct({
30155 "HTTP-Referer": Schema.optionalKey(Schema.String),
30156 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30157 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
30158})
30159export type DeleteKeys200 = { readonly "deleted": true }
30160export const DeleteKeys200 = Schema.Struct({
30161 "deleted": Schema.Literal(true).annotate({ "description": "Confirmation that the API key was deleted" })
30162})
30163export type DeleteKeys401 = UnauthorizedResponse
30164export const DeleteKeys401 = UnauthorizedResponse
30165export type DeleteKeys404 = NotFoundResponse
30166export const DeleteKeys404 = NotFoundResponse
30167export type DeleteKeys429 = TooManyRequestsResponse
30168export const DeleteKeys429 = TooManyRequestsResponse
30169export type DeleteKeys500 = InternalServerResponse
30170export const DeleteKeys500 = InternalServerResponse
30171export type UpdateKeysParams = {
30172 readonly "HTTP-Referer"?: string
30173 readonly "X-OpenRouter-Title"?: string
30174 readonly "X-OpenRouter-Categories"?: string
30175}
30176export const UpdateKeysParams = Schema.Struct({
30177 "HTTP-Referer": Schema.optionalKey(Schema.String),
30178 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30179 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
30180})
30181export type UpdateKeysRequestJson = {
30182 readonly "disabled"?: boolean
30183 readonly "include_byok_in_limit"?: boolean
30184 readonly "limit"?: number | null
30185 readonly "limit_reset"?: "daily" | "weekly" | "monthly" | null
30186 readonly "name"?: string
30187}
30188export const UpdateKeysRequestJson = Schema.Struct({
30189 "disabled": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Whether to disable the API key" })),
30190 "include_byok_in_limit": Schema.optionalKey(
30191 Schema.Boolean.annotate({ "description": "Whether to include BYOK usage in the limit" })
30192 ),
30193 "limit": Schema.optionalKey(
30194 Schema.Union([Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })), Schema.Null])
30195 .annotate({ "description": "New spending limit for the API key in USD", "format": "double" })
30196 ),
30197 "limit_reset": Schema.optionalKey(
30198 Schema.Union([Schema.Literal("daily"), Schema.Literal("weekly"), Schema.Literal("monthly"), Schema.Null]).annotate({
30199 "description":
30200 "New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday."
30201 })
30202 ),
30203 "name": Schema.optionalKey(Schema.String.annotate({ "description": "New name for the API key" }))
30204})
30205export type UpdateKeys200 = {
30206 readonly "data": {
30207 readonly "byok_usage": number
30208 readonly "byok_usage_daily": number
30209 readonly "byok_usage_monthly": number
30210 readonly "byok_usage_weekly": number
30211 readonly "created_at": string
30212 readonly "creator_user_id": string | null
30213 readonly "disabled": boolean
30214 readonly "expires_at"?: string | null
30215 readonly "hash": string
30216 readonly "include_byok_in_limit": boolean
30217 readonly "label": string
30218 readonly "limit": number | null
30219 readonly "limit_remaining": number | null
30220 readonly "limit_reset": string | null
30221 readonly "name": string
30222 readonly "updated_at": string | null
30223 readonly "usage": number
30224 readonly "usage_daily": number
30225 readonly "usage_monthly": number
30226 readonly "usage_weekly": number
30227 readonly "workspace_id": string
30228 }
30229}
30230export const UpdateKeys200 = Schema.Struct({
30231 "data": Schema.Struct({
30232 "byok_usage": Schema.Number.annotate({
30233 "description": "Total external BYOK usage (in USD) for the API key",
30234 "format": "double"
30235 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30236 "byok_usage_daily": Schema.Number.annotate({
30237 "description": "External BYOK usage (in USD) for the current UTC day",
30238 "format": "double"
30239 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30240 "byok_usage_monthly": Schema.Number.annotate({
30241 "description": "External BYOK usage (in USD) for current UTC month",
30242 "format": "double"
30243 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30244 "byok_usage_weekly": Schema.Number.annotate({
30245 "description": "External BYOK usage (in USD) for the current UTC week (Monday-Sunday)",
30246 "format": "double"
30247 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30248 "created_at": Schema.String.annotate({ "description": "ISO 8601 timestamp of when the API key was created" }),
30249 "creator_user_id": Schema.Union([Schema.String, Schema.Null]).annotate({
30250 "description":
30251 "The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."
30252 }),
30253 "disabled": Schema.Boolean.annotate({ "description": "Whether the API key is disabled" }),
30254 "expires_at": Schema.optionalKey(
30255 Schema.Union([Schema.String, Schema.Null]).annotate({
30256 "description": "ISO 8601 UTC timestamp when the API key expires, or null if no expiration",
30257 "format": "date-time"
30258 })
30259 ),
30260 "hash": Schema.String.annotate({ "description": "Unique hash identifier for the API key" }),
30261 "include_byok_in_limit": Schema.Boolean.annotate({
30262 "description": "Whether to include external BYOK usage in the credit limit"
30263 }),
30264 "label": Schema.String.annotate({ "description": "Human-readable label for the API key" }),
30265 "limit": Schema.Union([
30266 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30267 Schema.Null
30268 ]).annotate({ "description": "Spending limit for the API key in USD", "format": "double" }),
30269 "limit_remaining": Schema.Union([
30270 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30271 Schema.Null
30272 ]).annotate({ "description": "Remaining spending limit in USD", "format": "double" }),
30273 "limit_reset": Schema.Union([Schema.String, Schema.Null]).annotate({
30274 "description": "Type of limit reset for the API key"
30275 }),
30276 "name": Schema.String.annotate({ "description": "Name of the API key" }),
30277 "updated_at": Schema.Union([Schema.String, Schema.Null]).annotate({
30278 "description": "ISO 8601 timestamp of when the API key was last updated"
30279 }),
30280 "usage": Schema.Number.annotate({
30281 "description": "Total OpenRouter credit usage (in USD) for the API key",
30282 "format": "double"
30283 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30284 "usage_daily": Schema.Number.annotate({
30285 "description": "OpenRouter credit usage (in USD) for the current UTC day",
30286 "format": "double"
30287 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30288 "usage_monthly": Schema.Number.annotate({
30289 "description": "OpenRouter credit usage (in USD) for the current UTC month",
30290 "format": "double"
30291 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30292 "usage_weekly": Schema.Number.annotate({
30293 "description": "OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)",
30294 "format": "double"
30295 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
30296 "workspace_id": Schema.String.annotate({ "description": "The workspace ID this API key belongs to." })
30297 }).annotate({ "description": "The updated API key information" })
30298})
30299export type UpdateKeys400 = BadRequestResponse
30300export const UpdateKeys400 = BadRequestResponse
30301export type UpdateKeys401 = UnauthorizedResponse
30302export const UpdateKeys401 = UnauthorizedResponse
30303export type UpdateKeys404 = NotFoundResponse
30304export const UpdateKeys404 = NotFoundResponse
30305export type UpdateKeys429 = TooManyRequestsResponse
30306export const UpdateKeys429 = TooManyRequestsResponse
30307export type UpdateKeys500 = InternalServerResponse
30308export const UpdateKeys500 = InternalServerResponse
30309export type CreateMessagesParams = {
30310 readonly "HTTP-Referer"?: string
30311 readonly "X-OpenRouter-Title"?: string
30312 readonly "X-OpenRouter-Categories"?: string
30313 readonly "X-OpenRouter-Metadata"?: MetadataLevel
30314}
30315export const CreateMessagesParams = Schema.Struct({
30316 "HTTP-Referer": Schema.optionalKey(Schema.String),
30317 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30318 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
30319 "X-OpenRouter-Metadata": Schema.optionalKey(MetadataLevel)
30320})
30321export type CreateMessagesRequestJson = MessagesRequest
30322export const CreateMessagesRequestJson = MessagesRequest
30323export type CreateMessages200 = MessagesResult
30324export const CreateMessages200 = MessagesResult
30325export type CreateMessages200Sse = MessagesStreamingResponse
30326export const CreateMessages200Sse = MessagesStreamingResponse
30327export type CreateMessages400 = MessagesErrorResponse
30328export const CreateMessages400 = MessagesErrorResponse
30329export type CreateMessages401 = MessagesErrorResponse
30330export const CreateMessages401 = MessagesErrorResponse
30331export type CreateMessages403 = ForbiddenResponse
30332export const CreateMessages403 = ForbiddenResponse
30333export type CreateMessages404 = MessagesErrorResponse
30334export const CreateMessages404 = MessagesErrorResponse
30335export type CreateMessages429 = MessagesErrorResponse
30336export const CreateMessages429 = MessagesErrorResponse
30337export type CreateMessages500 = MessagesErrorResponse
30338export const CreateMessages500 = MessagesErrorResponse
30339export type CreateMessages503 = MessagesErrorResponse
30340export const CreateMessages503 = MessagesErrorResponse
30341export type CreateMessages529 = MessagesErrorResponse
30342export const CreateMessages529 = MessagesErrorResponse
30343export type GetModelParams = {
30344 readonly "HTTP-Referer"?: string
30345 readonly "X-OpenRouter-Title"?: string
30346 readonly "X-OpenRouter-Categories"?: string
30347}
30348export const GetModelParams = Schema.Struct({
30349 "HTTP-Referer": Schema.optionalKey(Schema.String),
30350 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30351 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
30352})
30353export type GetModel200 = ModelResponse
30354export const GetModel200 = ModelResponse
30355export type GetModel403 = ForbiddenResponse
30356export const GetModel403 = ForbiddenResponse
30357export type GetModel404 = NotFoundResponse
30358export const GetModel404 = NotFoundResponse
30359export type GetModel500 = InternalServerResponse
30360export const GetModel500 = InternalServerResponse
30361export type GetModelsParams = {
30362 readonly "HTTP-Referer"?: string
30363 readonly "X-OpenRouter-Title"?: string
30364 readonly "X-OpenRouter-Categories"?: string
30365 readonly "offset"?: number | null
30366 readonly "limit"?: number
30367 readonly "category"?:
30368 | "programming"
30369 | "roleplay"
30370 | "marketing"
30371 | "marketing/seo"
30372 | "technology"
30373 | "science"
30374 | "translation"
30375 | "legal"
30376 | "finance"
30377 | "health"
30378 | "trivia"
30379 | "academia"
30380 readonly "supported_parameters"?: string
30381 readonly "output_modalities"?: string
30382 readonly "sort"?:
30383 | "most-popular"
30384 | "newest"
30385 | "top-weekly"
30386 | "pricing-low-to-high"
30387 | "pricing-high-to-low"
30388 | "context-high-to-low"
30389 | "throughput-high-to-low"
30390 | "latency-low-to-high"
30391 | "intelligence-high-to-low"
30392 | "coding-high-to-low"
30393 | "agentic-high-to-low"
30394 | "design-arena-elo-high-to-low"
30395 readonly "q"?: string
30396 readonly "input_modalities"?: string
30397 readonly "context"?: number
30398 readonly "min_price"?: number | null
30399 readonly "max_price"?: number | null
30400 readonly "arch"?: string
30401 readonly "model_authors"?: string
30402 readonly "providers"?: string
30403 readonly "distillable"?: "true" | "false"
30404 readonly "zdr"?: "true"
30405 readonly "region"?: "eu"
30406 readonly "min_output_price"?: number | null
30407 readonly "max_output_price"?: number | null
30408 readonly "min_age_days"?: number | null
30409 readonly "max_age_days"?: number | null
30410 readonly "min_intelligence_index"?: number | null
30411 readonly "max_intelligence_index"?: number | null
30412 readonly "min_coding_index"?: number | null
30413 readonly "max_coding_index"?: number | null
30414 readonly "min_agentic_index"?: number | null
30415 readonly "max_agentic_index"?: number | null
30416 readonly "min_tool_success_rate"?: number | null
30417 readonly "max_tool_success_rate"?: number | null
30418}
30419export const GetModelsParams = Schema.Struct({
30420 "HTTP-Referer": Schema.optionalKey(Schema.String),
30421 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30422 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
30423 "offset": Schema.optionalKey(
30424 Schema.Union([
30425 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
30426 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30427 ),
30428 Schema.Null
30429 ]).annotate({
30430 "description":
30431 "Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned"
30432 })
30433 ),
30434 "limit": Schema.optionalKey(
30435 Schema.Number.annotate({
30436 "description":
30437 "Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned"
30438 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
30439 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
30440 ).check(Schema.isLessThanOrEqualTo(1000).annotate({ "expected": "a value less than or equal to 1000" }))
30441 ),
30442 "category": Schema.optionalKey(
30443 Schema.Literals([
30444 "programming",
30445 "roleplay",
30446 "marketing",
30447 "marketing/seo",
30448 "technology",
30449 "science",
30450 "translation",
30451 "legal",
30452 "finance",
30453 "health",
30454 "trivia",
30455 "academia"
30456 ]).annotate({ "description": "Filter models by use case category" })
30457 ),
30458 "supported_parameters": Schema.optionalKey(
30459 Schema.String.annotate({ "description": "Filter models by supported parameter (comma-separated)" })
30460 ),
30461 "output_modalities": Schema.optionalKey(
30462 Schema.String.annotate({
30463 "description":
30464 "Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."
30465 })
30466 ),
30467 "sort": Schema.optionalKey(
30468 Schema.Literals([
30469 "most-popular",
30470 "newest",
30471 "top-weekly",
30472 "pricing-low-to-high",
30473 "pricing-high-to-low",
30474 "context-high-to-low",
30475 "throughput-high-to-low",
30476 "latency-low-to-high",
30477 "intelligence-high-to-low",
30478 "coding-high-to-low",
30479 "agentic-high-to-low",
30480 "design-arena-elo-high-to-low"
30481 ]).annotate({
30482 "description":
30483 "Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved."
30484 })
30485 ),
30486 "q": Schema.optionalKey(Schema.String.annotate({ "description": "Free-text search by model name or slug." })),
30487 "input_modalities": Schema.optionalKey(
30488 Schema.String.annotate({
30489 "description": "Filter models by input modality. Comma-separated list of: text, image, audio, file."
30490 })
30491 ),
30492 "context": Schema.optionalKey(
30493 Schema.Number.annotate({
30494 "description": "Minimum context length (tokens). Models with smaller context are excluded."
30495 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
30496 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
30497 )
30498 ),
30499 "min_price": Schema.optionalKey(
30500 Schema.Union([
30501 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30502 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30503 ),
30504 Schema.Null
30505 ]).annotate({ "description": "Minimum prompt price in $/M tokens." })
30506 ),
30507 "max_price": Schema.optionalKey(
30508 Schema.Union([
30509 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30510 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30511 ),
30512 Schema.Null
30513 ]).annotate({ "description": "Maximum prompt price in $/M tokens." })
30514 ),
30515 "arch": Schema.optionalKey(
30516 Schema.String.annotate({
30517 "description": "Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama)."
30518 })
30519 ),
30520 "model_authors": Schema.optionalKey(
30521 Schema.String.annotate({
30522 "description": "Filter models by the organization that created the model. Comma-separated list of author slugs."
30523 })
30524 ),
30525 "providers": Schema.optionalKey(
30526 Schema.String.annotate({
30527 "description": "Filter models by hosting provider. Comma-separated list of provider names."
30528 })
30529 ),
30530 "distillable": Schema.optionalKey(
30531 Schema.Literals(["true", "false"]).annotate({
30532 "description":
30533 "Filter by distillation capability. \"true\" returns only distillable models, \"false\" excludes them."
30534 })
30535 ),
30536 "zdr": Schema.optionalKey(
30537 Schema.Literal("true").annotate({
30538 "description": "When set to \"true\", return only models with zero data retention endpoints."
30539 })
30540 ),
30541 "region": Schema.optionalKey(
30542 Schema.Literal("eu").annotate({
30543 "description": "Filter to models with endpoints in the given data region. Currently only \"eu\" is supported."
30544 })
30545 ),
30546 "min_output_price": Schema.optionalKey(
30547 Schema.Union([
30548 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30549 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30550 ),
30551 Schema.Null
30552 ]).annotate({ "description": "Minimum completion (output) price in $/M tokens." })
30553 ),
30554 "max_output_price": Schema.optionalKey(
30555 Schema.Union([
30556 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30557 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30558 ),
30559 Schema.Null
30560 ]).annotate({ "description": "Maximum completion (output) price in $/M tokens." })
30561 ),
30562 "min_age_days": Schema.optionalKey(
30563 Schema.Union([
30564 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
30565 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30566 ),
30567 Schema.Null
30568 ]).annotate({ "description": "Minimum model age in days since its creation date." })
30569 ),
30570 "max_age_days": Schema.optionalKey(
30571 Schema.Union([
30572 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
30573 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30574 ),
30575 Schema.Null
30576 ]).annotate({ "description": "Maximum model age in days since its creation date." })
30577 ),
30578 "min_intelligence_index": Schema.optionalKey(
30579 Schema.Union([
30580 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30581 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30582 ),
30583 Schema.Null
30584 ]).annotate({ "description": "Minimum Artificial Analysis intelligence index." })
30585 ),
30586 "max_intelligence_index": Schema.optionalKey(
30587 Schema.Union([
30588 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30589 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30590 ),
30591 Schema.Null
30592 ]).annotate({ "description": "Maximum Artificial Analysis intelligence index." })
30593 ),
30594 "min_coding_index": Schema.optionalKey(
30595 Schema.Union([
30596 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30597 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30598 ),
30599 Schema.Null
30600 ]).annotate({ "description": "Minimum Artificial Analysis coding index." })
30601 ),
30602 "max_coding_index": Schema.optionalKey(
30603 Schema.Union([
30604 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30605 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30606 ),
30607 Schema.Null
30608 ]).annotate({ "description": "Maximum Artificial Analysis coding index." })
30609 ),
30610 "min_agentic_index": Schema.optionalKey(
30611 Schema.Union([
30612 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30613 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30614 ),
30615 Schema.Null
30616 ]).annotate({ "description": "Minimum Artificial Analysis agentic index." })
30617 ),
30618 "max_agentic_index": Schema.optionalKey(
30619 Schema.Union([
30620 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30621 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30622 ),
30623 Schema.Null
30624 ]).annotate({ "description": "Maximum Artificial Analysis agentic index." })
30625 ),
30626 "min_tool_success_rate": Schema.optionalKey(
30627 Schema.Union([
30628 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30629 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30630 ).check(Schema.isLessThanOrEqualTo(1).annotate({ "expected": "a value less than or equal to 1" })),
30631 Schema.Null
30632 ]).annotate({
30633 "description":
30634 "Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason)."
30635 })
30636 ),
30637 "max_tool_success_rate": Schema.optionalKey(
30638 Schema.Union([
30639 Schema.Number.check(Schema.isFinite().annotate({ "expected": "a finite number" })).check(
30640 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30641 ).check(Schema.isLessThanOrEqualTo(1).annotate({ "expected": "a value less than or equal to 1" })),
30642 Schema.Null
30643 ]).annotate({ "description": "Maximum tool-calling success rate, as a fraction in [0, 1]." })
30644 )
30645})
30646export type GetModels200 = ModelsListResponse
30647export const GetModels200 = ModelsListResponse
30648export type GetModels400 = BadRequestResponse
30649export const GetModels400 = BadRequestResponse
30650export type GetModels403 = ForbiddenResponse
30651export const GetModels403 = ForbiddenResponse
30652export type GetModels500 = InternalServerResponse
30653export const GetModels500 = InternalServerResponse
30654export type ListEndpointsParams = {
30655 readonly "HTTP-Referer"?: string
30656 readonly "X-OpenRouter-Title"?: string
30657 readonly "X-OpenRouter-Categories"?: string
30658}
30659export const ListEndpointsParams = Schema.Struct({
30660 "HTTP-Referer": Schema.optionalKey(Schema.String),
30661 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30662 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
30663})
30664export type ListEndpoints200 = { readonly "data": ListEndpointsResponse }
30665export const ListEndpoints200 = Schema.Struct({ "data": ListEndpointsResponse })
30666export type ListEndpoints403 = ForbiddenResponse
30667export const ListEndpoints403 = ForbiddenResponse
30668export type ListEndpoints404 = NotFoundResponse
30669export const ListEndpoints404 = NotFoundResponse
30670export type ListEndpoints500 = InternalServerResponse
30671export const ListEndpoints500 = InternalServerResponse
30672export type ListModelsCountParams = {
30673 readonly "HTTP-Referer"?: string
30674 readonly "X-OpenRouter-Title"?: string
30675 readonly "X-OpenRouter-Categories"?: string
30676 readonly "output_modalities"?: string
30677}
30678export const ListModelsCountParams = Schema.Struct({
30679 "HTTP-Referer": Schema.optionalKey(Schema.String),
30680 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30681 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
30682 "output_modalities": Schema.optionalKey(
30683 Schema.String.annotate({
30684 "description":
30685 "Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."
30686 })
30687 )
30688})
30689export type ListModelsCount200 = ModelsCountResponse
30690export const ListModelsCount200 = ModelsCountResponse
30691export type ListModelsCount400 = BadRequestResponse
30692export const ListModelsCount400 = BadRequestResponse
30693export type ListModelsCount403 = ForbiddenResponse
30694export const ListModelsCount403 = ForbiddenResponse
30695export type ListModelsCount500 = InternalServerResponse
30696export const ListModelsCount500 = InternalServerResponse
30697export type ListModelsUserParams = {
30698 readonly "HTTP-Referer"?: string
30699 readonly "X-OpenRouter-Title"?: string
30700 readonly "X-OpenRouter-Categories"?: string
30701 readonly "offset"?: number | null
30702 readonly "limit"?: number
30703}
30704export const ListModelsUserParams = Schema.Struct({
30705 "HTTP-Referer": Schema.optionalKey(Schema.String),
30706 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30707 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
30708 "offset": Schema.optionalKey(
30709 Schema.Union([
30710 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
30711 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30712 ),
30713 Schema.Null
30714 ]).annotate({
30715 "description":
30716 "Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned"
30717 })
30718 ),
30719 "limit": Schema.optionalKey(
30720 Schema.Number.annotate({
30721 "description":
30722 "Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned"
30723 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
30724 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
30725 ).check(Schema.isLessThanOrEqualTo(1000).annotate({ "expected": "a value less than or equal to 1000" }))
30726 )
30727})
30728export type ListModelsUser200 = ModelsListResponse
30729export const ListModelsUser200 = ModelsListResponse
30730export type ListModelsUser401 = UnauthorizedResponse
30731export const ListModelsUser401 = UnauthorizedResponse
30732export type ListModelsUser403 = ForbiddenResponse
30733export const ListModelsUser403 = ForbiddenResponse
30734export type ListModelsUser404 = NotFoundResponse
30735export const ListModelsUser404 = NotFoundResponse
30736export type ListModelsUser500 = InternalServerResponse
30737export const ListModelsUser500 = InternalServerResponse
30738export type ListObservabilityDestinationsParams = {
30739 readonly "HTTP-Referer"?: string
30740 readonly "X-OpenRouter-Title"?: string
30741 readonly "X-OpenRouter-Categories"?: string
30742 readonly "offset"?: number | null
30743 readonly "limit"?: number
30744 readonly "workspace_id"?: string
30745}
30746export const ListObservabilityDestinationsParams = Schema.Struct({
30747 "HTTP-Referer": Schema.optionalKey(Schema.String),
30748 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30749 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
30750 "offset": Schema.optionalKey(
30751 Schema.Union([
30752 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
30753 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30754 ),
30755 Schema.Null
30756 ]).annotate({ "description": "Number of records to skip for pagination" })
30757 ),
30758 "limit": Schema.optionalKey(
30759 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
30760 Schema.isInt().annotate({ "expected": "an integer" })
30761 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
30762 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
30763 )
30764 ),
30765 "workspace_id": Schema.optionalKey(
30766 Schema.String.annotate({
30767 "description": "Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace.",
30768 "format": "uuid"
30769 })
30770 )
30771})
30772export type ListObservabilityDestinations200 = ListObservabilityDestinationsResponse
30773export const ListObservabilityDestinations200 = ListObservabilityDestinationsResponse
30774export type ListObservabilityDestinations400 = BadRequestResponse
30775export const ListObservabilityDestinations400 = BadRequestResponse
30776export type ListObservabilityDestinations401 = UnauthorizedResponse
30777export const ListObservabilityDestinations401 = UnauthorizedResponse
30778export type ListObservabilityDestinations500 = InternalServerResponse
30779export const ListObservabilityDestinations500 = InternalServerResponse
30780export type CreateObservabilityDestinationParams = {
30781 readonly "HTTP-Referer"?: string
30782 readonly "X-OpenRouter-Title"?: string
30783 readonly "X-OpenRouter-Categories"?: string
30784}
30785export const CreateObservabilityDestinationParams = Schema.Struct({
30786 "HTTP-Referer": Schema.optionalKey(Schema.String),
30787 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30788 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
30789})
30790export type CreateObservabilityDestinationRequestJson = CreateObservabilityDestinationRequest
30791export const CreateObservabilityDestinationRequestJson = CreateObservabilityDestinationRequest
30792export type CreateObservabilityDestination201 = CreateObservabilityDestinationResponse
30793export const CreateObservabilityDestination201 = CreateObservabilityDestinationResponse
30794export type CreateObservabilityDestination400 = BadRequestResponse
30795export const CreateObservabilityDestination400 = BadRequestResponse
30796export type CreateObservabilityDestination401 = UnauthorizedResponse
30797export const CreateObservabilityDestination401 = UnauthorizedResponse
30798export type CreateObservabilityDestination403 = ForbiddenResponse
30799export const CreateObservabilityDestination403 = ForbiddenResponse
30800export type CreateObservabilityDestination409 = ConflictResponse
30801export const CreateObservabilityDestination409 = ConflictResponse
30802export type CreateObservabilityDestination500 = InternalServerResponse
30803export const CreateObservabilityDestination500 = InternalServerResponse
30804export type GetObservabilityDestinationParams = {
30805 readonly "HTTP-Referer"?: string
30806 readonly "X-OpenRouter-Title"?: string
30807 readonly "X-OpenRouter-Categories"?: string
30808}
30809export const GetObservabilityDestinationParams = Schema.Struct({
30810 "HTTP-Referer": Schema.optionalKey(Schema.String),
30811 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30812 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
30813})
30814export type GetObservabilityDestination200 = GetObservabilityDestinationResponse
30815export const GetObservabilityDestination200 = GetObservabilityDestinationResponse
30816export type GetObservabilityDestination401 = UnauthorizedResponse
30817export const GetObservabilityDestination401 = UnauthorizedResponse
30818export type GetObservabilityDestination404 = NotFoundResponse
30819export const GetObservabilityDestination404 = NotFoundResponse
30820export type GetObservabilityDestination500 = InternalServerResponse
30821export const GetObservabilityDestination500 = InternalServerResponse
30822export type DeleteObservabilityDestinationParams = {
30823 readonly "HTTP-Referer"?: string
30824 readonly "X-OpenRouter-Title"?: string
30825 readonly "X-OpenRouter-Categories"?: string
30826}
30827export const DeleteObservabilityDestinationParams = Schema.Struct({
30828 "HTTP-Referer": Schema.optionalKey(Schema.String),
30829 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30830 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
30831})
30832export type DeleteObservabilityDestination200 = DeleteObservabilityDestinationResponse
30833export const DeleteObservabilityDestination200 = DeleteObservabilityDestinationResponse
30834export type DeleteObservabilityDestination401 = UnauthorizedResponse
30835export const DeleteObservabilityDestination401 = UnauthorizedResponse
30836export type DeleteObservabilityDestination404 = NotFoundResponse
30837export const DeleteObservabilityDestination404 = NotFoundResponse
30838export type DeleteObservabilityDestination500 = InternalServerResponse
30839export const DeleteObservabilityDestination500 = InternalServerResponse
30840export type UpdateObservabilityDestinationParams = {
30841 readonly "HTTP-Referer"?: string
30842 readonly "X-OpenRouter-Title"?: string
30843 readonly "X-OpenRouter-Categories"?: string
30844}
30845export const UpdateObservabilityDestinationParams = Schema.Struct({
30846 "HTTP-Referer": Schema.optionalKey(Schema.String),
30847 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30848 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
30849})
30850export type UpdateObservabilityDestinationRequestJson = UpdateObservabilityDestinationRequest
30851export const UpdateObservabilityDestinationRequestJson = UpdateObservabilityDestinationRequest
30852export type UpdateObservabilityDestination200 = UpdateObservabilityDestinationResponse
30853export const UpdateObservabilityDestination200 = UpdateObservabilityDestinationResponse
30854export type UpdateObservabilityDestination400 = BadRequestResponse
30855export const UpdateObservabilityDestination400 = BadRequestResponse
30856export type UpdateObservabilityDestination401 = UnauthorizedResponse
30857export const UpdateObservabilityDestination401 = UnauthorizedResponse
30858export type UpdateObservabilityDestination404 = NotFoundResponse
30859export const UpdateObservabilityDestination404 = NotFoundResponse
30860export type UpdateObservabilityDestination409 = ConflictResponse
30861export const UpdateObservabilityDestination409 = ConflictResponse
30862export type UpdateObservabilityDestination500 = InternalServerResponse
30863export const UpdateObservabilityDestination500 = InternalServerResponse
30864export type ListOrganizationMembersParams = {
30865 readonly "HTTP-Referer"?: string
30866 readonly "X-OpenRouter-Title"?: string
30867 readonly "X-OpenRouter-Categories"?: string
30868 readonly "offset"?: number | null
30869 readonly "limit"?: number
30870}
30871export const ListOrganizationMembersParams = Schema.Struct({
30872 "HTTP-Referer": Schema.optionalKey(Schema.String),
30873 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30874 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
30875 "offset": Schema.optionalKey(
30876 Schema.Union([
30877 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
30878 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30879 ),
30880 Schema.Null
30881 ]).annotate({ "description": "Number of records to skip for pagination" })
30882 ),
30883 "limit": Schema.optionalKey(
30884 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
30885 Schema.isInt().annotate({ "expected": "an integer" })
30886 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
30887 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
30888 )
30889 )
30890})
30891export type ListOrganizationMembers200 = {
30892 readonly "data": ReadonlyArray<
30893 {
30894 readonly "email": string
30895 readonly "first_name": string | null
30896 readonly "id": string
30897 readonly "last_name": string | null
30898 readonly "role": "org:admin" | "org:member"
30899 }
30900 >
30901 readonly "total_count": number
30902}
30903export const ListOrganizationMembers200 = Schema.Struct({
30904 "data": Schema.Array(Schema.Struct({
30905 "email": Schema.String.annotate({ "description": "Email address of the member" }),
30906 "first_name": Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "First name of the member" }),
30907 "id": Schema.String.annotate({ "description": "User ID of the organization member" }),
30908 "last_name": Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "Last name of the member" }),
30909 "role": Schema.Literals(["org:admin", "org:member"]).annotate({
30910 "description": "Role of the member in the organization"
30911 })
30912 })).annotate({ "description": "List of organization members" }),
30913 "total_count": Schema.Number.annotate({ "description": "Total number of members in the organization" }).check(
30914 Schema.isInt().annotate({ "expected": "an integer" })
30915 )
30916})
30917export type ListOrganizationMembers401 = UnauthorizedResponse
30918export const ListOrganizationMembers401 = UnauthorizedResponse
30919export type ListOrganizationMembers404 = NotFoundResponse
30920export const ListOrganizationMembers404 = NotFoundResponse
30921export type ListOrganizationMembers500 = InternalServerResponse
30922export const ListOrganizationMembers500 = InternalServerResponse
30923export type ListPresetsParams = {
30924 readonly "HTTP-Referer"?: string
30925 readonly "X-OpenRouter-Title"?: string
30926 readonly "X-OpenRouter-Categories"?: string
30927 readonly "offset"?: number | null
30928 readonly "limit"?: number
30929}
30930export const ListPresetsParams = Schema.Struct({
30931 "HTTP-Referer": Schema.optionalKey(Schema.String),
30932 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30933 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
30934 "offset": Schema.optionalKey(
30935 Schema.Union([
30936 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
30937 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
30938 ),
30939 Schema.Null
30940 ]).annotate({ "description": "Number of records to skip for pagination" })
30941 ),
30942 "limit": Schema.optionalKey(
30943 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
30944 Schema.isInt().annotate({ "expected": "an integer" })
30945 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
30946 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
30947 )
30948 )
30949})
30950export type ListPresets200 = ListPresetsResponse
30951export const ListPresets200 = ListPresetsResponse
30952export type ListPresets400 = BadRequestResponse
30953export const ListPresets400 = BadRequestResponse
30954export type ListPresets401 = UnauthorizedResponse
30955export const ListPresets401 = UnauthorizedResponse
30956export type ListPresets500 = InternalServerResponse
30957export const ListPresets500 = InternalServerResponse
30958export type GetPresetParams = {
30959 readonly "HTTP-Referer"?: string
30960 readonly "X-OpenRouter-Title"?: string
30961 readonly "X-OpenRouter-Categories"?: string
30962}
30963export const GetPresetParams = Schema.Struct({
30964 "HTTP-Referer": Schema.optionalKey(Schema.String),
30965 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30966 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
30967})
30968export type GetPreset200 = GetPresetResponse
30969export const GetPreset200 = GetPresetResponse
30970export type GetPreset400 = BadRequestResponse
30971export const GetPreset400 = BadRequestResponse
30972export type GetPreset401 = UnauthorizedResponse
30973export const GetPreset401 = UnauthorizedResponse
30974export type GetPreset404 = NotFoundResponse
30975export const GetPreset404 = NotFoundResponse
30976export type GetPreset500 = InternalServerResponse
30977export const GetPreset500 = InternalServerResponse
30978export type CreatePresetsChatCompletionsParams = {
30979 readonly "HTTP-Referer"?: string
30980 readonly "X-OpenRouter-Title"?: string
30981 readonly "X-OpenRouter-Categories"?: string
30982}
30983export const CreatePresetsChatCompletionsParams = Schema.Struct({
30984 "HTTP-Referer": Schema.optionalKey(Schema.String),
30985 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
30986 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
30987})
30988export type CreatePresetsChatCompletionsRequestJson = ChatRequest
30989export const CreatePresetsChatCompletionsRequestJson = ChatRequest
30990export type CreatePresetsChatCompletions200 = CreatePresetFromInferenceResponse
30991export const CreatePresetsChatCompletions200 = CreatePresetFromInferenceResponse
30992export type CreatePresetsChatCompletions400 = BadRequestResponse
30993export const CreatePresetsChatCompletions400 = BadRequestResponse
30994export type CreatePresetsChatCompletions401 = UnauthorizedResponse
30995export const CreatePresetsChatCompletions401 = UnauthorizedResponse
30996export type CreatePresetsChatCompletions403 = ForbiddenResponse
30997export const CreatePresetsChatCompletions403 = ForbiddenResponse
30998export type CreatePresetsChatCompletions404 = NotFoundResponse
30999export const CreatePresetsChatCompletions404 = NotFoundResponse
31000export type CreatePresetsChatCompletions409 = ConflictResponse
31001export const CreatePresetsChatCompletions409 = ConflictResponse
31002export type CreatePresetsChatCompletions500 = InternalServerResponse
31003export const CreatePresetsChatCompletions500 = InternalServerResponse
31004export type CreatePresetsMessagesParams = {
31005 readonly "HTTP-Referer"?: string
31006 readonly "X-OpenRouter-Title"?: string
31007 readonly "X-OpenRouter-Categories"?: string
31008}
31009export const CreatePresetsMessagesParams = Schema.Struct({
31010 "HTTP-Referer": Schema.optionalKey(Schema.String),
31011 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
31012 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
31013})
31014export type CreatePresetsMessagesRequestJson = MessagesRequest
31015export const CreatePresetsMessagesRequestJson = MessagesRequest
31016export type CreatePresetsMessages200 = CreatePresetFromInferenceResponse
31017export const CreatePresetsMessages200 = CreatePresetFromInferenceResponse
31018export type CreatePresetsMessages400 = BadRequestResponse
31019export const CreatePresetsMessages400 = BadRequestResponse
31020export type CreatePresetsMessages401 = UnauthorizedResponse
31021export const CreatePresetsMessages401 = UnauthorizedResponse
31022export type CreatePresetsMessages403 = ForbiddenResponse
31023export const CreatePresetsMessages403 = ForbiddenResponse
31024export type CreatePresetsMessages404 = NotFoundResponse
31025export const CreatePresetsMessages404 = NotFoundResponse
31026export type CreatePresetsMessages409 = ConflictResponse
31027export const CreatePresetsMessages409 = ConflictResponse
31028export type CreatePresetsMessages500 = InternalServerResponse
31029export const CreatePresetsMessages500 = InternalServerResponse
31030export type CreatePresetsResponsesParams = {
31031 readonly "HTTP-Referer"?: string
31032 readonly "X-OpenRouter-Title"?: string
31033 readonly "X-OpenRouter-Categories"?: string
31034}
31035export const CreatePresetsResponsesParams = Schema.Struct({
31036 "HTTP-Referer": Schema.optionalKey(Schema.String),
31037 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
31038 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
31039})
31040export type CreatePresetsResponsesRequestJson = ResponsesRequest
31041export const CreatePresetsResponsesRequestJson = ResponsesRequest
31042export type CreatePresetsResponses200 = CreatePresetFromInferenceResponse
31043export const CreatePresetsResponses200 = CreatePresetFromInferenceResponse
31044export type CreatePresetsResponses400 = BadRequestResponse
31045export const CreatePresetsResponses400 = BadRequestResponse
31046export type CreatePresetsResponses401 = UnauthorizedResponse
31047export const CreatePresetsResponses401 = UnauthorizedResponse
31048export type CreatePresetsResponses403 = ForbiddenResponse
31049export const CreatePresetsResponses403 = ForbiddenResponse
31050export type CreatePresetsResponses404 = NotFoundResponse
31051export const CreatePresetsResponses404 = NotFoundResponse
31052export type CreatePresetsResponses409 = ConflictResponse
31053export const CreatePresetsResponses409 = ConflictResponse
31054export type CreatePresetsResponses500 = InternalServerResponse
31055export const CreatePresetsResponses500 = InternalServerResponse
31056export type ListPresetVersionsParams = {
31057 readonly "HTTP-Referer"?: string
31058 readonly "X-OpenRouter-Title"?: string
31059 readonly "X-OpenRouter-Categories"?: string
31060 readonly "offset"?: number | null
31061 readonly "limit"?: number
31062}
31063export const ListPresetVersionsParams = Schema.Struct({
31064 "HTTP-Referer": Schema.optionalKey(Schema.String),
31065 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
31066 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
31067 "offset": Schema.optionalKey(
31068 Schema.Union([
31069 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
31070 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
31071 ),
31072 Schema.Null
31073 ]).annotate({ "description": "Number of records to skip for pagination" })
31074 ),
31075 "limit": Schema.optionalKey(
31076 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
31077 Schema.isInt().annotate({ "expected": "an integer" })
31078 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
31079 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
31080 )
31081 )
31082})
31083export type ListPresetVersions200 = ListPresetVersionsResponse
31084export const ListPresetVersions200 = ListPresetVersionsResponse
31085export type ListPresetVersions400 = BadRequestResponse
31086export const ListPresetVersions400 = BadRequestResponse
31087export type ListPresetVersions401 = UnauthorizedResponse
31088export const ListPresetVersions401 = UnauthorizedResponse
31089export type ListPresetVersions404 = NotFoundResponse
31090export const ListPresetVersions404 = NotFoundResponse
31091export type ListPresetVersions500 = InternalServerResponse
31092export const ListPresetVersions500 = InternalServerResponse
31093export type GetPresetVersionParams = {
31094 readonly "HTTP-Referer"?: string
31095 readonly "X-OpenRouter-Title"?: string
31096 readonly "X-OpenRouter-Categories"?: string
31097}
31098export const GetPresetVersionParams = Schema.Struct({
31099 "HTTP-Referer": Schema.optionalKey(Schema.String),
31100 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
31101 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
31102})
31103export type GetPresetVersion200 = GetPresetVersionResponse
31104export const GetPresetVersion200 = GetPresetVersionResponse
31105export type GetPresetVersion400 = BadRequestResponse
31106export const GetPresetVersion400 = BadRequestResponse
31107export type GetPresetVersion401 = UnauthorizedResponse
31108export const GetPresetVersion401 = UnauthorizedResponse
31109export type GetPresetVersion404 = NotFoundResponse
31110export const GetPresetVersion404 = NotFoundResponse
31111export type GetPresetVersion500 = InternalServerResponse
31112export const GetPresetVersion500 = InternalServerResponse
31113export type ListProvidersParams = {
31114 readonly "HTTP-Referer"?: string
31115 readonly "X-OpenRouter-Title"?: string
31116 readonly "X-OpenRouter-Categories"?: string
31117}
31118export const ListProvidersParams = Schema.Struct({
31119 "HTTP-Referer": Schema.optionalKey(Schema.String),
31120 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
31121 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
31122})
31123export type ListProviders200 = {
31124 readonly "data": ReadonlyArray<
31125 {
31126 readonly "datacenters"?:
31127 | ReadonlyArray<
31128 | "AD"
31129 | "AE"
31130 | "AF"
31131 | "AG"
31132 | "AI"
31133 | "AL"
31134 | "AM"
31135 | "AO"
31136 | "AQ"
31137 | "AR"
31138 | "AS"
31139 | "AT"
31140 | "AU"
31141 | "AW"
31142 | "AX"
31143 | "AZ"
31144 | "BA"
31145 | "BB"
31146 | "BD"
31147 | "BE"
31148 | "BF"
31149 | "BG"
31150 | "BH"
31151 | "BI"
31152 | "BJ"
31153 | "BL"
31154 | "BM"
31155 | "BN"
31156 | "BO"
31157 | "BQ"
31158 | "BR"
31159 | "BS"
31160 | "BT"
31161 | "BV"
31162 | "BW"
31163 | "BY"
31164 | "BZ"
31165 | "CA"
31166 | "CC"
31167 | "CD"
31168 | "CF"
31169 | "CG"
31170 | "CH"
31171 | "CI"
31172 | "CK"
31173 | "CL"
31174 | "CM"
31175 | "CN"
31176 | "CO"
31177 | "CR"
31178 | "CU"
31179 | "CV"
31180 | "CW"
31181 | "CX"
31182 | "CY"
31183 | "CZ"
31184 | "DE"
31185 | "DJ"
31186 | "DK"
31187 | "DM"
31188 | "DO"
31189 | "DZ"
31190 | "EC"
31191 | "EE"
31192 | "EG"
31193 | "EH"
31194 | "ER"
31195 | "ES"
31196 | "ET"
31197 | "FI"
31198 | "FJ"
31199 | "FK"
31200 | "FM"
31201 | "FO"
31202 | "FR"
31203 | "GA"
31204 | "GB"
31205 | "GD"
31206 | "GE"
31207 | "GF"
31208 | "GG"
31209 | "GH"
31210 | "GI"
31211 | "GL"
31212 | "GM"
31213 | "GN"
31214 | "GP"
31215 | "GQ"
31216 | "GR"
31217 | "GS"
31218 | "GT"
31219 | "GU"
31220 | "GW"
31221 | "GY"
31222 | "HK"
31223 | "HM"
31224 | "HN"
31225 | "HR"
31226 | "HT"
31227 | "HU"
31228 | "ID"
31229 | "IE"
31230 | "IL"
31231 | "IM"
31232 | "IN"
31233 | "IO"
31234 | "IQ"
31235 | "IR"
31236 | "IS"
31237 | "IT"
31238 | "JE"
31239 | "JM"
31240 | "JO"
31241 | "JP"
31242 | "KE"
31243 | "KG"
31244 | "KH"
31245 | "KI"
31246 | "KM"
31247 | "KN"
31248 | "KP"
31249 | "KR"
31250 | "KW"
31251 | "KY"
31252 | "KZ"
31253 | "LA"
31254 | "LB"
31255 | "LC"
31256 | "LI"
31257 | "LK"
31258 | "LR"
31259 | "LS"
31260 | "LT"
31261 | "LU"
31262 | "LV"
31263 | "LY"
31264 | "MA"
31265 | "MC"
31266 | "MD"
31267 | "ME"
31268 | "MF"
31269 | "MG"
31270 | "MH"
31271 | "MK"
31272 | "ML"
31273 | "MM"
31274 | "MN"
31275 | "MO"
31276 | "MP"
31277 | "MQ"
31278 | "MR"
31279 | "MS"
31280 | "MT"
31281 | "MU"
31282 | "MV"
31283 | "MW"
31284 | "MX"
31285 | "MY"
31286 | "MZ"
31287 | "NA"
31288 | "NC"
31289 | "NE"
31290 | "NF"
31291 | "NG"
31292 | "NI"
31293 | "NL"
31294 | "NO"
31295 | "NP"
31296 | "NR"
31297 | "NU"
31298 | "NZ"
31299 | "OM"
31300 | "PA"
31301 | "PE"
31302 | "PF"
31303 | "PG"
31304 | "PH"
31305 | "PK"
31306 | "PL"
31307 | "PM"
31308 | "PN"
31309 | "PR"
31310 | "PS"
31311 | "PT"
31312 | "PW"
31313 | "PY"
31314 | "QA"
31315 | "RE"
31316 | "RO"
31317 | "RS"
31318 | "RU"
31319 | "RW"
31320 | "SA"
31321 | "SB"
31322 | "SC"
31323 | "SD"
31324 | "SE"
31325 | "SG"
31326 | "SH"
31327 | "SI"
31328 | "SJ"
31329 | "SK"
31330 | "SL"
31331 | "SM"
31332 | "SN"
31333 | "SO"
31334 | "SR"
31335 | "SS"
31336 | "ST"
31337 | "SV"
31338 | "SX"
31339 | "SY"
31340 | "SZ"
31341 | "TC"
31342 | "TD"
31343 | "TF"
31344 | "TG"
31345 | "TH"
31346 | "TJ"
31347 | "TK"
31348 | "TL"
31349 | "TM"
31350 | "TN"
31351 | "TO"
31352 | "TR"
31353 | "TT"
31354 | "TV"
31355 | "TW"
31356 | "TZ"
31357 | "UA"
31358 | "UG"
31359 | "UM"
31360 | "US"
31361 | "UY"
31362 | "UZ"
31363 | "VA"
31364 | "VC"
31365 | "VE"
31366 | "VG"
31367 | "VI"
31368 | "VN"
31369 | "VU"
31370 | "WF"
31371 | "WS"
31372 | "YE"
31373 | "YT"
31374 | "ZA"
31375 | "ZM"
31376 | "ZW"
31377 >
31378 | null
31379 readonly "headquarters"?:
31380 | "AD"
31381 | "AE"
31382 | "AF"
31383 | "AG"
31384 | "AI"
31385 | "AL"
31386 | "AM"
31387 | "AO"
31388 | "AQ"
31389 | "AR"
31390 | "AS"
31391 | "AT"
31392 | "AU"
31393 | "AW"
31394 | "AX"
31395 | "AZ"
31396 | "BA"
31397 | "BB"
31398 | "BD"
31399 | "BE"
31400 | "BF"
31401 | "BG"
31402 | "BH"
31403 | "BI"
31404 | "BJ"
31405 | "BL"
31406 | "BM"
31407 | "BN"
31408 | "BO"
31409 | "BQ"
31410 | "BR"
31411 | "BS"
31412 | "BT"
31413 | "BV"
31414 | "BW"
31415 | "BY"
31416 | "BZ"
31417 | "CA"
31418 | "CC"
31419 | "CD"
31420 | "CF"
31421 | "CG"
31422 | "CH"
31423 | "CI"
31424 | "CK"
31425 | "CL"
31426 | "CM"
31427 | "CN"
31428 | "CO"
31429 | "CR"
31430 | "CU"
31431 | "CV"
31432 | "CW"
31433 | "CX"
31434 | "CY"
31435 | "CZ"
31436 | "DE"
31437 | "DJ"
31438 | "DK"
31439 | "DM"
31440 | "DO"
31441 | "DZ"
31442 | "EC"
31443 | "EE"
31444 | "EG"
31445 | "EH"
31446 | "ER"
31447 | "ES"
31448 | "ET"
31449 | "FI"
31450 | "FJ"
31451 | "FK"
31452 | "FM"
31453 | "FO"
31454 | "FR"
31455 | "GA"
31456 | "GB"
31457 | "GD"
31458 | "GE"
31459 | "GF"
31460 | "GG"
31461 | "GH"
31462 | "GI"
31463 | "GL"
31464 | "GM"
31465 | "GN"
31466 | "GP"
31467 | "GQ"
31468 | "GR"
31469 | "GS"
31470 | "GT"
31471 | "GU"
31472 | "GW"
31473 | "GY"
31474 | "HK"
31475 | "HM"
31476 | "HN"
31477 | "HR"
31478 | "HT"
31479 | "HU"
31480 | "ID"
31481 | "IE"
31482 | "IL"
31483 | "IM"
31484 | "IN"
31485 | "IO"
31486 | "IQ"
31487 | "IR"
31488 | "IS"
31489 | "IT"
31490 | "JE"
31491 | "JM"
31492 | "JO"
31493 | "JP"
31494 | "KE"
31495 | "KG"
31496 | "KH"
31497 | "KI"
31498 | "KM"
31499 | "KN"
31500 | "KP"
31501 | "KR"
31502 | "KW"
31503 | "KY"
31504 | "KZ"
31505 | "LA"
31506 | "LB"
31507 | "LC"
31508 | "LI"
31509 | "LK"
31510 | "LR"
31511 | "LS"
31512 | "LT"
31513 | "LU"
31514 | "LV"
31515 | "LY"
31516 | "MA"
31517 | "MC"
31518 | "MD"
31519 | "ME"
31520 | "MF"
31521 | "MG"
31522 | "MH"
31523 | "MK"
31524 | "ML"
31525 | "MM"
31526 | "MN"
31527 | "MO"
31528 | "MP"
31529 | "MQ"
31530 | "MR"
31531 | "MS"
31532 | "MT"
31533 | "MU"
31534 | "MV"
31535 | "MW"
31536 | "MX"
31537 | "MY"
31538 | "MZ"
31539 | "NA"
31540 | "NC"
31541 | "NE"
31542 | "NF"
31543 | "NG"
31544 | "NI"
31545 | "NL"
31546 | "NO"
31547 | "NP"
31548 | "NR"
31549 | "NU"
31550 | "NZ"
31551 | "OM"
31552 | "PA"
31553 | "PE"
31554 | "PF"
31555 | "PG"
31556 | "PH"
31557 | "PK"
31558 | "PL"
31559 | "PM"
31560 | "PN"
31561 | "PR"
31562 | "PS"
31563 | "PT"
31564 | "PW"
31565 | "PY"
31566 | "QA"
31567 | "RE"
31568 | "RO"
31569 | "RS"
31570 | "RU"
31571 | "RW"
31572 | "SA"
31573 | "SB"
31574 | "SC"
31575 | "SD"
31576 | "SE"
31577 | "SG"
31578 | "SH"
31579 | "SI"
31580 | "SJ"
31581 | "SK"
31582 | "SL"
31583 | "SM"
31584 | "SN"
31585 | "SO"
31586 | "SR"
31587 | "SS"
31588 | "ST"
31589 | "SV"
31590 | "SX"
31591 | "SY"
31592 | "SZ"
31593 | "TC"
31594 | "TD"
31595 | "TF"
31596 | "TG"
31597 | "TH"
31598 | "TJ"
31599 | "TK"
31600 | "TL"
31601 | "TM"
31602 | "TN"
31603 | "TO"
31604 | "TR"
31605 | "TT"
31606 | "TV"
31607 | "TW"
31608 | "TZ"
31609 | "UA"
31610 | "UG"
31611 | "UM"
31612 | "US"
31613 | "UY"
31614 | "UZ"
31615 | "VA"
31616 | "VC"
31617 | "VE"
31618 | "VG"
31619 | "VI"
31620 | "VN"
31621 | "VU"
31622 | "WF"
31623 | "WS"
31624 | "YE"
31625 | "YT"
31626 | "ZA"
31627 | "ZM"
31628 | "ZW"
31629 | null
31630 readonly "name": string
31631 readonly "privacy_policy_url": string | null
31632 readonly "slug": string
31633 readonly "status_page_url"?: string | null
31634 readonly "terms_of_service_url"?: string | null
31635 }
31636 >
31637}
31638export const ListProviders200 = Schema.Struct({
31639 "data": Schema.Array(Schema.Struct({
31640 "datacenters": Schema.optionalKey(
31641 Schema.Union([
31642 Schema.Array(
31643 Schema.Literals([
31644 "AD",
31645 "AE",
31646 "AF",
31647 "AG",
31648 "AI",
31649 "AL",
31650 "AM",
31651 "AO",
31652 "AQ",
31653 "AR",
31654 "AS",
31655 "AT",
31656 "AU",
31657 "AW",
31658 "AX",
31659 "AZ",
31660 "BA",
31661 "BB",
31662 "BD",
31663 "BE",
31664 "BF",
31665 "BG",
31666 "BH",
31667 "BI",
31668 "BJ",
31669 "BL",
31670 "BM",
31671 "BN",
31672 "BO",
31673 "BQ",
31674 "BR",
31675 "BS",
31676 "BT",
31677 "BV",
31678 "BW",
31679 "BY",
31680 "BZ",
31681 "CA",
31682 "CC",
31683 "CD",
31684 "CF",
31685 "CG",
31686 "CH",
31687 "CI",
31688 "CK",
31689 "CL",
31690 "CM",
31691 "CN",
31692 "CO",
31693 "CR",
31694 "CU",
31695 "CV",
31696 "CW",
31697 "CX",
31698 "CY",
31699 "CZ",
31700 "DE",
31701 "DJ",
31702 "DK",
31703 "DM",
31704 "DO",
31705 "DZ",
31706 "EC",
31707 "EE",
31708 "EG",
31709 "EH",
31710 "ER",
31711 "ES",
31712 "ET",
31713 "FI",
31714 "FJ",
31715 "FK",
31716 "FM",
31717 "FO",
31718 "FR",
31719 "GA",
31720 "GB",
31721 "GD",
31722 "GE",
31723 "GF",
31724 "GG",
31725 "GH",
31726 "GI",
31727 "GL",
31728 "GM",
31729 "GN",
31730 "GP",
31731 "GQ",
31732 "GR",
31733 "GS",
31734 "GT",
31735 "GU",
31736 "GW",
31737 "GY",
31738 "HK",
31739 "HM",
31740 "HN",
31741 "HR",
31742 "HT",
31743 "HU",
31744 "ID",
31745 "IE",
31746 "IL",
31747 "IM",
31748 "IN",
31749 "IO",
31750 "IQ",
31751 "IR",
31752 "IS",
31753 "IT",
31754 "JE",
31755 "JM",
31756 "JO",
31757 "JP",
31758 "KE",
31759 "KG",
31760 "KH",
31761 "KI",
31762 "KM",
31763 "KN",
31764 "KP",
31765 "KR",
31766 "KW",
31767 "KY",
31768 "KZ",
31769 "LA",
31770 "LB",
31771 "LC",
31772 "LI",
31773 "LK",
31774 "LR",
31775 "LS",
31776 "LT",
31777 "LU",
31778 "LV",
31779 "LY",
31780 "MA",
31781 "MC",
31782 "MD",
31783 "ME",
31784 "MF",
31785 "MG",
31786 "MH",
31787 "MK",
31788 "ML",
31789 "MM",
31790 "MN",
31791 "MO",
31792 "MP",
31793 "MQ",
31794 "MR",
31795 "MS",
31796 "MT",
31797 "MU",
31798 "MV",
31799 "MW",
31800 "MX",
31801 "MY",
31802 "MZ",
31803 "NA",
31804 "NC",
31805 "NE",
31806 "NF",
31807 "NG",
31808 "NI",
31809 "NL",
31810 "NO",
31811 "NP",
31812 "NR",
31813 "NU",
31814 "NZ",
31815 "OM",
31816 "PA",
31817 "PE",
31818 "PF",
31819 "PG",
31820 "PH",
31821 "PK",
31822 "PL",
31823 "PM",
31824 "PN",
31825 "PR",
31826 "PS",
31827 "PT",
31828 "PW",
31829 "PY",
31830 "QA",
31831 "RE",
31832 "RO",
31833 "RS",
31834 "RU",
31835 "RW",
31836 "SA",
31837 "SB",
31838 "SC",
31839 "SD",
31840 "SE",
31841 "SG",
31842 "SH",
31843 "SI",
31844 "SJ",
31845 "SK",
31846 "SL",
31847 "SM",
31848 "SN",
31849 "SO",
31850 "SR",
31851 "SS",
31852 "ST",
31853 "SV",
31854 "SX",
31855 "SY",
31856 "SZ",
31857 "TC",
31858 "TD",
31859 "TF",
31860 "TG",
31861 "TH",
31862 "TJ",
31863 "TK",
31864 "TL",
31865 "TM",
31866 "TN",
31867 "TO",
31868 "TR",
31869 "TT",
31870 "TV",
31871 "TW",
31872 "TZ",
31873 "UA",
31874 "UG",
31875 "UM",
31876 "US",
31877 "UY",
31878 "UZ",
31879 "VA",
31880 "VC",
31881 "VE",
31882 "VG",
31883 "VI",
31884 "VN",
31885 "VU",
31886 "WF",
31887 "WS",
31888 "YE",
31889 "YT",
31890 "ZA",
31891 "ZM",
31892 "ZW"
31893 ])
31894 ),
31895 Schema.Null
31896 ]).annotate({ "description": "ISO 3166-1 Alpha-2 country codes of the provider datacenter locations" })
31897 ),
31898 "headquarters": Schema.optionalKey(
31899 Schema.Union([
31900 Schema.Literal("AD"),
31901 Schema.Literal("AE"),
31902 Schema.Literal("AF"),
31903 Schema.Literal("AG"),
31904 Schema.Literal("AI"),
31905 Schema.Literal("AL"),
31906 Schema.Literal("AM"),
31907 Schema.Literal("AO"),
31908 Schema.Literal("AQ"),
31909 Schema.Literal("AR"),
31910 Schema.Literal("AS"),
31911 Schema.Literal("AT"),
31912 Schema.Literal("AU"),
31913 Schema.Literal("AW"),
31914 Schema.Literal("AX"),
31915 Schema.Literal("AZ"),
31916 Schema.Literal("BA"),
31917 Schema.Literal("BB"),
31918 Schema.Literal("BD"),
31919 Schema.Literal("BE"),
31920 Schema.Literal("BF"),
31921 Schema.Literal("BG"),
31922 Schema.Literal("BH"),
31923 Schema.Literal("BI"),
31924 Schema.Literal("BJ"),
31925 Schema.Literal("BL"),
31926 Schema.Literal("BM"),
31927 Schema.Literal("BN"),
31928 Schema.Literal("BO"),
31929 Schema.Literal("BQ"),
31930 Schema.Literal("BR"),
31931 Schema.Literal("BS"),
31932 Schema.Literal("BT"),
31933 Schema.Literal("BV"),
31934 Schema.Literal("BW"),
31935 Schema.Literal("BY"),
31936 Schema.Literal("BZ"),
31937 Schema.Literal("CA"),
31938 Schema.Literal("CC"),
31939 Schema.Literal("CD"),
31940 Schema.Literal("CF"),
31941 Schema.Literal("CG"),
31942 Schema.Literal("CH"),
31943 Schema.Literal("CI"),
31944 Schema.Literal("CK"),
31945 Schema.Literal("CL"),
31946 Schema.Literal("CM"),
31947 Schema.Literal("CN"),
31948 Schema.Literal("CO"),
31949 Schema.Literal("CR"),
31950 Schema.Literal("CU"),
31951 Schema.Literal("CV"),
31952 Schema.Literal("CW"),
31953 Schema.Literal("CX"),
31954 Schema.Literal("CY"),
31955 Schema.Literal("CZ"),
31956 Schema.Literal("DE"),
31957 Schema.Literal("DJ"),
31958 Schema.Literal("DK"),
31959 Schema.Literal("DM"),
31960 Schema.Literal("DO"),
31961 Schema.Literal("DZ"),
31962 Schema.Literal("EC"),
31963 Schema.Literal("EE"),
31964 Schema.Literal("EG"),
31965 Schema.Literal("EH"),
31966 Schema.Literal("ER"),
31967 Schema.Literal("ES"),
31968 Schema.Literal("ET"),
31969 Schema.Literal("FI"),
31970 Schema.Literal("FJ"),
31971 Schema.Literal("FK"),
31972 Schema.Literal("FM"),
31973 Schema.Literal("FO"),
31974 Schema.Literal("FR"),
31975 Schema.Literal("GA"),
31976 Schema.Literal("GB"),
31977 Schema.Literal("GD"),
31978 Schema.Literal("GE"),
31979 Schema.Literal("GF"),
31980 Schema.Literal("GG"),
31981 Schema.Literal("GH"),
31982 Schema.Literal("GI"),
31983 Schema.Literal("GL"),
31984 Schema.Literal("GM"),
31985 Schema.Literal("GN"),
31986 Schema.Literal("GP"),
31987 Schema.Literal("GQ"),
31988 Schema.Literal("GR"),
31989 Schema.Literal("GS"),
31990 Schema.Literal("GT"),
31991 Schema.Literal("GU"),
31992 Schema.Literal("GW"),
31993 Schema.Literal("GY"),
31994 Schema.Literal("HK"),
31995 Schema.Literal("HM"),
31996 Schema.Literal("HN"),
31997 Schema.Literal("HR"),
31998 Schema.Literal("HT"),
31999 Schema.Literal("HU"),
32000 Schema.Literal("ID"),
32001 Schema.Literal("IE"),
32002 Schema.Literal("IL"),
32003 Schema.Literal("IM"),
32004 Schema.Literal("IN"),
32005 Schema.Literal("IO"),
32006 Schema.Literal("IQ"),
32007 Schema.Literal("IR"),
32008 Schema.Literal("IS"),
32009 Schema.Literal("IT"),
32010 Schema.Literal("JE"),
32011 Schema.Literal("JM"),
32012 Schema.Literal("JO"),
32013 Schema.Literal("JP"),
32014 Schema.Literal("KE"),
32015 Schema.Literal("KG"),
32016 Schema.Literal("KH"),
32017 Schema.Literal("KI"),
32018 Schema.Literal("KM"),
32019 Schema.Literal("KN"),
32020 Schema.Literal("KP"),
32021 Schema.Literal("KR"),
32022 Schema.Literal("KW"),
32023 Schema.Literal("KY"),
32024 Schema.Literal("KZ"),
32025 Schema.Literal("LA"),
32026 Schema.Literal("LB"),
32027 Schema.Literal("LC"),
32028 Schema.Literal("LI"),
32029 Schema.Literal("LK"),
32030 Schema.Literal("LR"),
32031 Schema.Literal("LS"),
32032 Schema.Literal("LT"),
32033 Schema.Literal("LU"),
32034 Schema.Literal("LV"),
32035 Schema.Literal("LY"),
32036 Schema.Literal("MA"),
32037 Schema.Literal("MC"),
32038 Schema.Literal("MD"),
32039 Schema.Literal("ME"),
32040 Schema.Literal("MF"),
32041 Schema.Literal("MG"),
32042 Schema.Literal("MH"),
32043 Schema.Literal("MK"),
32044 Schema.Literal("ML"),
32045 Schema.Literal("MM"),
32046 Schema.Literal("MN"),
32047 Schema.Literal("MO"),
32048 Schema.Literal("MP"),
32049 Schema.Literal("MQ"),
32050 Schema.Literal("MR"),
32051 Schema.Literal("MS"),
32052 Schema.Literal("MT"),
32053 Schema.Literal("MU"),
32054 Schema.Literal("MV"),
32055 Schema.Literal("MW"),
32056 Schema.Literal("MX"),
32057 Schema.Literal("MY"),
32058 Schema.Literal("MZ"),
32059 Schema.Literal("NA"),
32060 Schema.Literal("NC"),
32061 Schema.Literal("NE"),
32062 Schema.Literal("NF"),
32063 Schema.Literal("NG"),
32064 Schema.Literal("NI"),
32065 Schema.Literal("NL"),
32066 Schema.Literal("NO"),
32067 Schema.Literal("NP"),
32068 Schema.Literal("NR"),
32069 Schema.Literal("NU"),
32070 Schema.Literal("NZ"),
32071 Schema.Literal("OM"),
32072 Schema.Literal("PA"),
32073 Schema.Literal("PE"),
32074 Schema.Literal("PF"),
32075 Schema.Literal("PG"),
32076 Schema.Literal("PH"),
32077 Schema.Literal("PK"),
32078 Schema.Literal("PL"),
32079 Schema.Literal("PM"),
32080 Schema.Literal("PN"),
32081 Schema.Literal("PR"),
32082 Schema.Literal("PS"),
32083 Schema.Literal("PT"),
32084 Schema.Literal("PW"),
32085 Schema.Literal("PY"),
32086 Schema.Literal("QA"),
32087 Schema.Literal("RE"),
32088 Schema.Literal("RO"),
32089 Schema.Literal("RS"),
32090 Schema.Literal("RU"),
32091 Schema.Literal("RW"),
32092 Schema.Literal("SA"),
32093 Schema.Literal("SB"),
32094 Schema.Literal("SC"),
32095 Schema.Literal("SD"),
32096 Schema.Literal("SE"),
32097 Schema.Literal("SG"),
32098 Schema.Literal("SH"),
32099 Schema.Literal("SI"),
32100 Schema.Literal("SJ"),
32101 Schema.Literal("SK"),
32102 Schema.Literal("SL"),
32103 Schema.Literal("SM"),
32104 Schema.Literal("SN"),
32105 Schema.Literal("SO"),
32106 Schema.Literal("SR"),
32107 Schema.Literal("SS"),
32108 Schema.Literal("ST"),
32109 Schema.Literal("SV"),
32110 Schema.Literal("SX"),
32111 Schema.Literal("SY"),
32112 Schema.Literal("SZ"),
32113 Schema.Literal("TC"),
32114 Schema.Literal("TD"),
32115 Schema.Literal("TF"),
32116 Schema.Literal("TG"),
32117 Schema.Literal("TH"),
32118 Schema.Literal("TJ"),
32119 Schema.Literal("TK"),
32120 Schema.Literal("TL"),
32121 Schema.Literal("TM"),
32122 Schema.Literal("TN"),
32123 Schema.Literal("TO"),
32124 Schema.Literal("TR"),
32125 Schema.Literal("TT"),
32126 Schema.Literal("TV"),
32127 Schema.Literal("TW"),
32128 Schema.Literal("TZ"),
32129 Schema.Literal("UA"),
32130 Schema.Literal("UG"),
32131 Schema.Literal("UM"),
32132 Schema.Literal("US"),
32133 Schema.Literal("UY"),
32134 Schema.Literal("UZ"),
32135 Schema.Literal("VA"),
32136 Schema.Literal("VC"),
32137 Schema.Literal("VE"),
32138 Schema.Literal("VG"),
32139 Schema.Literal("VI"),
32140 Schema.Literal("VN"),
32141 Schema.Literal("VU"),
32142 Schema.Literal("WF"),
32143 Schema.Literal("WS"),
32144 Schema.Literal("YE"),
32145 Schema.Literal("YT"),
32146 Schema.Literal("ZA"),
32147 Schema.Literal("ZM"),
32148 Schema.Literal("ZW"),
32149 Schema.Null
32150 ]).annotate({ "description": "ISO 3166-1 Alpha-2 country code of the provider headquarters" })
32151 ),
32152 "name": Schema.String.annotate({ "description": "Display name of the provider" }),
32153 "privacy_policy_url": Schema.Union([Schema.String, Schema.Null]).annotate({
32154 "description": "URL to the provider's privacy policy"
32155 }),
32156 "slug": Schema.String.annotate({ "description": "URL-friendly identifier for the provider" }),
32157 "status_page_url": Schema.optionalKey(
32158 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "URL to the provider's status page" })
32159 ),
32160 "terms_of_service_url": Schema.optionalKey(
32161 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "URL to the provider's terms of service" })
32162 )
32163 }))
32164})
32165export type ListProviders500 = InternalServerResponse
32166export const ListProviders500 = InternalServerResponse
32167export type CreateRerankParams = {
32168 readonly "HTTP-Referer"?: string
32169 readonly "X-OpenRouter-Title"?: string
32170 readonly "X-OpenRouter-Categories"?: string
32171}
32172export const CreateRerankParams = Schema.Struct({
32173 "HTTP-Referer": Schema.optionalKey(Schema.String),
32174 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32175 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32176})
32177export type CreateRerankRequestJson = {
32178 readonly "documents": ReadonlyArray<string | { readonly "image"?: string; readonly "text"?: string }>
32179 readonly "model": string
32180 readonly "provider"?: ProviderPreferences
32181 readonly "query": string
32182 readonly "top_n"?: number
32183}
32184export const CreateRerankRequestJson = Schema.Struct({
32185 "documents": Schema.Array(
32186 Schema.Union([
32187 Schema.String,
32188 Schema.Struct({
32189 "image": Schema.optionalKey(
32190 Schema.String.annotate({
32191 "description":
32192 "An image associated with the document, as a remote URL (http/https) or a base64-encoded data URI (data:image/...)."
32193 })
32194 ),
32195 "text": Schema.optionalKey(Schema.String.annotate({ "description": "The document text" }))
32196 }).annotate({
32197 "description":
32198 "A structured document with optional text and/or image content. At least one of `text` or `image` must be provided."
32199 })
32200 ]).annotate({
32201 "description":
32202 "A document to rerank. Either a plain string, or a structured object with optional `text` and/or `image`."
32203 })
32204 ).annotate({
32205 "description":
32206 "The list of documents to rerank. Documents may be plain strings, or structured objects with `text` and/or `image` for multimodal models."
32207 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })),
32208 "model": Schema.String.annotate({ "description": "The rerank model to use" }),
32209 "provider": Schema.optionalKey(
32210 Schema.suspend((): Schema.Codec<ProviderPreferences> => ProviderPreferences).annotate({
32211 "description": "Provider routing preferences for the request."
32212 })
32213 ),
32214 "query": Schema.String.annotate({ "description": "The search query to rerank documents against" }),
32215 "top_n": Schema.optionalKey(
32216 Schema.Number.annotate({ "description": "Number of most relevant documents to return" }).check(
32217 Schema.isInt().annotate({ "expected": "an integer" })
32218 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" }))
32219 )
32220}).annotate({ "description": "Rerank request input" })
32221export type CreateRerank200 = {
32222 readonly "id"?: string
32223 readonly "model": string
32224 readonly "provider"?: string
32225 readonly "results": ReadonlyArray<
32226 {
32227 readonly "document": { readonly "image"?: string; readonly "text"?: string }
32228 readonly "index": number
32229 readonly "relevance_score": number
32230 }
32231 >
32232 readonly "usage"?: { readonly "cost"?: number; readonly "search_units"?: number; readonly "total_tokens"?: number }
32233}
32234export const CreateRerank200 = Schema.Struct({
32235 "id": Schema.optionalKey(
32236 Schema.String.annotate({ "description": "Unique identifier for the rerank response (ORID format)" })
32237 ),
32238 "model": Schema.String.annotate({ "description": "The model used for reranking" }),
32239 "provider": Schema.optionalKey(
32240 Schema.String.annotate({ "description": "The provider that served the rerank request" })
32241 ),
32242 "results": Schema.Array(
32243 Schema.Struct({
32244 "document": Schema.Struct({
32245 "image": Schema.optionalKey(
32246 Schema.String.annotate({ "description": "The image (URL or data URI) from the original document" })
32247 ),
32248 "text": Schema.optionalKey(Schema.String.annotate({ "description": "The document text" }))
32249 }).annotate({ "description": "The document object echoing the original input (text and/or image)" }),
32250 "index": Schema.Number.annotate({ "description": "Index of the document in the original input list" }).check(
32251 Schema.isInt().annotate({ "expected": "an integer" })
32252 ),
32253 "relevance_score": Schema.Number.annotate({
32254 "description": "Relevance score of the document to the query",
32255 "format": "double"
32256 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
32257 }).annotate({ "description": "A single rerank result" })
32258 ).annotate({ "description": "List of rerank results sorted by relevance" }),
32259 "usage": Schema.optionalKey(
32260 Schema.Struct({
32261 "cost": Schema.optionalKey(
32262 Schema.Number.annotate({ "description": "Cost of the request in credits", "format": "double" }).check(
32263 Schema.isFinite().annotate({ "expected": "a finite number" })
32264 )
32265 ),
32266 "search_units": Schema.optionalKey(
32267 Schema.Number.annotate({ "description": "Number of search units consumed (Cohere billing)" }).check(
32268 Schema.isInt().annotate({ "expected": "an integer" })
32269 )
32270 ),
32271 "total_tokens": Schema.optionalKey(
32272 Schema.Number.annotate({ "description": "Total number of tokens used" }).check(
32273 Schema.isInt().annotate({ "expected": "an integer" })
32274 )
32275 )
32276 }).annotate({ "description": "Usage statistics" })
32277 )
32278}).annotate({ "description": "Rerank response containing ranked results" })
32279export type CreateRerank200Sse = string
32280export const CreateRerank200Sse = Schema.String.annotate({
32281 "description": "Not used for rerank - rerank does not support streaming"
32282})
32283export type CreateRerank400 = BadRequestResponse
32284export const CreateRerank400 = BadRequestResponse
32285export type CreateRerank401 = UnauthorizedResponse
32286export const CreateRerank401 = UnauthorizedResponse
32287export type CreateRerank402 = PaymentRequiredResponse
32288export const CreateRerank402 = PaymentRequiredResponse
32289export type CreateRerank404 = NotFoundResponse
32290export const CreateRerank404 = NotFoundResponse
32291export type CreateRerank429 = TooManyRequestsResponse
32292export const CreateRerank429 = TooManyRequestsResponse
32293export type CreateRerank500 = InternalServerResponse
32294export const CreateRerank500 = InternalServerResponse
32295export type CreateRerank502 = BadGatewayResponse
32296export const CreateRerank502 = BadGatewayResponse
32297export type CreateRerank503 = ServiceUnavailableResponse
32298export const CreateRerank503 = ServiceUnavailableResponse
32299export type CreateRerank524 = EdgeNetworkTimeoutResponse
32300export const CreateRerank524 = EdgeNetworkTimeoutResponse
32301export type CreateRerank529 = ProviderOverloadedResponse
32302export const CreateRerank529 = ProviderOverloadedResponse
32303export type CreateResponsesParams = {
32304 readonly "HTTP-Referer"?: string
32305 readonly "X-OpenRouter-Title"?: string
32306 readonly "X-OpenRouter-Categories"?: string
32307 readonly "X-OpenRouter-Metadata"?: MetadataLevel
32308}
32309export const CreateResponsesParams = Schema.Struct({
32310 "HTTP-Referer": Schema.optionalKey(Schema.String),
32311 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32312 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
32313 "X-OpenRouter-Metadata": Schema.optionalKey(MetadataLevel)
32314})
32315export type CreateResponsesRequestJson = ResponsesRequest
32316export const CreateResponsesRequestJson = ResponsesRequest
32317export type CreateResponses200 = OpenResponsesResult
32318export const CreateResponses200 = OpenResponsesResult
32319export type CreateResponses200Sse = ResponsesStreamingResponse
32320export const CreateResponses200Sse: Schema.Schema<CreateResponses200Sse> = ResponsesStreamingResponse
32321export type CreateResponses400 = BadRequestResponse
32322export const CreateResponses400 = BadRequestResponse
32323export type CreateResponses401 = UnauthorizedResponse
32324export const CreateResponses401 = UnauthorizedResponse
32325export type CreateResponses402 = PaymentRequiredResponse
32326export const CreateResponses402 = PaymentRequiredResponse
32327export type CreateResponses403 = ForbiddenResponse
32328export const CreateResponses403 = ForbiddenResponse
32329export type CreateResponses404 = NotFoundResponse
32330export const CreateResponses404 = NotFoundResponse
32331export type CreateResponses408 = RequestTimeoutResponse
32332export const CreateResponses408 = RequestTimeoutResponse
32333export type CreateResponses413 = PayloadTooLargeResponse
32334export const CreateResponses413 = PayloadTooLargeResponse
32335export type CreateResponses422 = UnprocessableEntityResponse
32336export const CreateResponses422 = UnprocessableEntityResponse
32337export type CreateResponses429 = TooManyRequestsResponse
32338export const CreateResponses429 = TooManyRequestsResponse
32339export type CreateResponses500 = InternalServerResponse
32340export const CreateResponses500 = InternalServerResponse
32341export type CreateResponses502 = BadGatewayResponse
32342export const CreateResponses502 = BadGatewayResponse
32343export type CreateResponses503 = ServiceUnavailableResponse
32344export const CreateResponses503 = ServiceUnavailableResponse
32345export type CreateResponses524 = EdgeNetworkTimeoutResponse
32346export const CreateResponses524 = EdgeNetworkTimeoutResponse
32347export type CreateResponses529 = ProviderOverloadedResponse
32348export const CreateResponses529 = ProviderOverloadedResponse
32349export type CreateVideosParams = {
32350 readonly "HTTP-Referer"?: string
32351 readonly "X-OpenRouter-Title"?: string
32352 readonly "X-OpenRouter-Categories"?: string
32353}
32354export const CreateVideosParams = Schema.Struct({
32355 "HTTP-Referer": Schema.optionalKey(Schema.String),
32356 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32357 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32358})
32359export type CreateVideosRequestJson = VideoGenerationRequest
32360export const CreateVideosRequestJson = VideoGenerationRequest
32361export type CreateVideos202 = VideoGenerationResponse
32362export const CreateVideos202 = VideoGenerationResponse
32363export type CreateVideos400 = BadRequestResponse
32364export const CreateVideos400 = BadRequestResponse
32365export type CreateVideos401 = UnauthorizedResponse
32366export const CreateVideos401 = UnauthorizedResponse
32367export type CreateVideos402 = PaymentRequiredResponse
32368export const CreateVideos402 = PaymentRequiredResponse
32369export type CreateVideos404 = NotFoundResponse
32370export const CreateVideos404 = NotFoundResponse
32371export type CreateVideos429 = TooManyRequestsResponse
32372export const CreateVideos429 = TooManyRequestsResponse
32373export type CreateVideos500 = InternalServerResponse
32374export const CreateVideos500 = InternalServerResponse
32375export type GetVideosParams = {
32376 readonly "HTTP-Referer"?: string
32377 readonly "X-OpenRouter-Title"?: string
32378 readonly "X-OpenRouter-Categories"?: string
32379}
32380export const GetVideosParams = Schema.Struct({
32381 "HTTP-Referer": Schema.optionalKey(Schema.String),
32382 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32383 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32384})
32385export type GetVideos200 = VideoGenerationResponse
32386export const GetVideos200 = VideoGenerationResponse
32387export type GetVideos401 = UnauthorizedResponse
32388export const GetVideos401 = UnauthorizedResponse
32389export type GetVideos404 = NotFoundResponse
32390export const GetVideos404 = NotFoundResponse
32391export type GetVideos500 = InternalServerResponse
32392export const GetVideos500 = InternalServerResponse
32393export type ListVideosContentParams = {
32394 readonly "HTTP-Referer"?: string
32395 readonly "X-OpenRouter-Title"?: string
32396 readonly "X-OpenRouter-Categories"?: string
32397 readonly "index"?: number | null
32398}
32399export const ListVideosContentParams = Schema.Struct({
32400 "HTTP-Referer": Schema.optionalKey(Schema.String),
32401 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32402 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
32403 "index": Schema.optionalKey(
32404 Schema.Union([
32405 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
32406 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
32407 ),
32408 Schema.Null
32409 ])
32410 )
32411})
32412export type ListVideosContent400 = BadRequestResponse
32413export const ListVideosContent400 = BadRequestResponse
32414export type ListVideosContent401 = UnauthorizedResponse
32415export const ListVideosContent401 = UnauthorizedResponse
32416export type ListVideosContent404 = NotFoundResponse
32417export const ListVideosContent404 = NotFoundResponse
32418export type ListVideosContent500 = InternalServerResponse
32419export const ListVideosContent500 = InternalServerResponse
32420export type ListVideosContent502 = BadGatewayResponse
32421export const ListVideosContent502 = BadGatewayResponse
32422export type ListVideosModelsParams = {
32423 readonly "HTTP-Referer"?: string
32424 readonly "X-OpenRouter-Title"?: string
32425 readonly "X-OpenRouter-Categories"?: string
32426}
32427export const ListVideosModelsParams = Schema.Struct({
32428 "HTTP-Referer": Schema.optionalKey(Schema.String),
32429 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32430 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32431})
32432export type ListVideosModels200 = VideoModelsListResponse
32433export const ListVideosModels200 = VideoModelsListResponse
32434export type ListVideosModels400 = BadRequestResponse
32435export const ListVideosModels400 = BadRequestResponse
32436export type ListVideosModels500 = InternalServerResponse
32437export const ListVideosModels500 = InternalServerResponse
32438export type ListWorkspacesParams = {
32439 readonly "HTTP-Referer"?: string
32440 readonly "X-OpenRouter-Title"?: string
32441 readonly "X-OpenRouter-Categories"?: string
32442 readonly "offset"?: number | null
32443 readonly "limit"?: number
32444}
32445export const ListWorkspacesParams = Schema.Struct({
32446 "HTTP-Referer": Schema.optionalKey(Schema.String),
32447 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32448 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
32449 "offset": Schema.optionalKey(
32450 Schema.Union([
32451 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
32452 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
32453 ),
32454 Schema.Null
32455 ]).annotate({ "description": "Number of records to skip for pagination" })
32456 ),
32457 "limit": Schema.optionalKey(
32458 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
32459 Schema.isInt().annotate({ "expected": "an integer" })
32460 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
32461 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
32462 )
32463 )
32464})
32465export type ListWorkspaces200 = ListWorkspacesResponse
32466export const ListWorkspaces200 = ListWorkspacesResponse
32467export type ListWorkspaces401 = UnauthorizedResponse
32468export const ListWorkspaces401 = UnauthorizedResponse
32469export type ListWorkspaces500 = InternalServerResponse
32470export const ListWorkspaces500 = InternalServerResponse
32471export type CreateWorkspaceParams = {
32472 readonly "HTTP-Referer"?: string
32473 readonly "X-OpenRouter-Title"?: string
32474 readonly "X-OpenRouter-Categories"?: string
32475}
32476export const CreateWorkspaceParams = Schema.Struct({
32477 "HTTP-Referer": Schema.optionalKey(Schema.String),
32478 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32479 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32480})
32481export type CreateWorkspaceRequestJson = CreateWorkspaceRequest
32482export const CreateWorkspaceRequestJson = CreateWorkspaceRequest
32483export type CreateWorkspace201 = CreateWorkspaceResponse
32484export const CreateWorkspace201 = CreateWorkspaceResponse
32485export type CreateWorkspace400 = BadRequestResponse
32486export const CreateWorkspace400 = BadRequestResponse
32487export type CreateWorkspace401 = UnauthorizedResponse
32488export const CreateWorkspace401 = UnauthorizedResponse
32489export type CreateWorkspace403 = ForbiddenResponse
32490export const CreateWorkspace403 = ForbiddenResponse
32491export type CreateWorkspace500 = InternalServerResponse
32492export const CreateWorkspace500 = InternalServerResponse
32493export type GetWorkspaceParams = {
32494 readonly "HTTP-Referer"?: string
32495 readonly "X-OpenRouter-Title"?: string
32496 readonly "X-OpenRouter-Categories"?: string
32497}
32498export const GetWorkspaceParams = Schema.Struct({
32499 "HTTP-Referer": Schema.optionalKey(Schema.String),
32500 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32501 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32502})
32503export type GetWorkspace200 = GetWorkspaceResponse
32504export const GetWorkspace200 = GetWorkspaceResponse
32505export type GetWorkspace401 = UnauthorizedResponse
32506export const GetWorkspace401 = UnauthorizedResponse
32507export type GetWorkspace404 = NotFoundResponse
32508export const GetWorkspace404 = NotFoundResponse
32509export type GetWorkspace500 = InternalServerResponse
32510export const GetWorkspace500 = InternalServerResponse
32511export type DeleteWorkspaceParams = {
32512 readonly "HTTP-Referer"?: string
32513 readonly "X-OpenRouter-Title"?: string
32514 readonly "X-OpenRouter-Categories"?: string
32515}
32516export const DeleteWorkspaceParams = Schema.Struct({
32517 "HTTP-Referer": Schema.optionalKey(Schema.String),
32518 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32519 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32520})
32521export type DeleteWorkspace200 = DeleteWorkspaceResponse
32522export const DeleteWorkspace200 = DeleteWorkspaceResponse
32523export type DeleteWorkspace400 = BadRequestResponse
32524export const DeleteWorkspace400 = BadRequestResponse
32525export type DeleteWorkspace401 = UnauthorizedResponse
32526export const DeleteWorkspace401 = UnauthorizedResponse
32527export type DeleteWorkspace403 = ForbiddenResponse
32528export const DeleteWorkspace403 = ForbiddenResponse
32529export type DeleteWorkspace404 = NotFoundResponse
32530export const DeleteWorkspace404 = NotFoundResponse
32531export type DeleteWorkspace500 = InternalServerResponse
32532export const DeleteWorkspace500 = InternalServerResponse
32533export type UpdateWorkspaceParams = {
32534 readonly "HTTP-Referer"?: string
32535 readonly "X-OpenRouter-Title"?: string
32536 readonly "X-OpenRouter-Categories"?: string
32537}
32538export const UpdateWorkspaceParams = Schema.Struct({
32539 "HTTP-Referer": Schema.optionalKey(Schema.String),
32540 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32541 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32542})
32543export type UpdateWorkspaceRequestJson = UpdateWorkspaceRequest
32544export const UpdateWorkspaceRequestJson = UpdateWorkspaceRequest
32545export type UpdateWorkspace200 = UpdateWorkspaceResponse
32546export const UpdateWorkspace200 = UpdateWorkspaceResponse
32547export type UpdateWorkspace400 = BadRequestResponse
32548export const UpdateWorkspace400 = BadRequestResponse
32549export type UpdateWorkspace401 = UnauthorizedResponse
32550export const UpdateWorkspace401 = UnauthorizedResponse
32551export type UpdateWorkspace403 = ForbiddenResponse
32552export const UpdateWorkspace403 = ForbiddenResponse
32553export type UpdateWorkspace404 = NotFoundResponse
32554export const UpdateWorkspace404 = NotFoundResponse
32555export type UpdateWorkspace500 = InternalServerResponse
32556export const UpdateWorkspace500 = InternalServerResponse
32557export type ListWorkspaceBudgetsParams = {
32558 readonly "HTTP-Referer"?: string
32559 readonly "X-OpenRouter-Title"?: string
32560 readonly "X-OpenRouter-Categories"?: string
32561}
32562export const ListWorkspaceBudgetsParams = Schema.Struct({
32563 "HTTP-Referer": Schema.optionalKey(Schema.String),
32564 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32565 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32566})
32567export type ListWorkspaceBudgets200 = ListWorkspaceBudgetsResponse
32568export const ListWorkspaceBudgets200 = ListWorkspaceBudgetsResponse
32569export type ListWorkspaceBudgets401 = UnauthorizedResponse
32570export const ListWorkspaceBudgets401 = UnauthorizedResponse
32571export type ListWorkspaceBudgets404 = NotFoundResponse
32572export const ListWorkspaceBudgets404 = NotFoundResponse
32573export type ListWorkspaceBudgets500 = InternalServerResponse
32574export const ListWorkspaceBudgets500 = InternalServerResponse
32575export type UpsertWorkspaceBudgetParams = {
32576 readonly "HTTP-Referer"?: string
32577 readonly "X-OpenRouter-Title"?: string
32578 readonly "X-OpenRouter-Categories"?: string
32579}
32580export const UpsertWorkspaceBudgetParams = Schema.Struct({
32581 "HTTP-Referer": Schema.optionalKey(Schema.String),
32582 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32583 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32584})
32585export type UpsertWorkspaceBudgetRequestJson = UpsertWorkspaceBudgetRequest
32586export const UpsertWorkspaceBudgetRequestJson = UpsertWorkspaceBudgetRequest
32587export type UpsertWorkspaceBudget200 = UpsertWorkspaceBudgetResponse
32588export const UpsertWorkspaceBudget200 = UpsertWorkspaceBudgetResponse
32589export type UpsertWorkspaceBudget400 = BadRequestResponse
32590export const UpsertWorkspaceBudget400 = BadRequestResponse
32591export type UpsertWorkspaceBudget401 = UnauthorizedResponse
32592export const UpsertWorkspaceBudget401 = UnauthorizedResponse
32593export type UpsertWorkspaceBudget404 = NotFoundResponse
32594export const UpsertWorkspaceBudget404 = NotFoundResponse
32595export type UpsertWorkspaceBudget500 = InternalServerResponse
32596export const UpsertWorkspaceBudget500 = InternalServerResponse
32597export type DeleteWorkspaceBudgetParams = {
32598 readonly "HTTP-Referer"?: string
32599 readonly "X-OpenRouter-Title"?: string
32600 readonly "X-OpenRouter-Categories"?: string
32601}
32602export const DeleteWorkspaceBudgetParams = Schema.Struct({
32603 "HTTP-Referer": Schema.optionalKey(Schema.String),
32604 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32605 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32606})
32607export type DeleteWorkspaceBudget200 = DeleteWorkspaceBudgetResponse
32608export const DeleteWorkspaceBudget200 = DeleteWorkspaceBudgetResponse
32609export type DeleteWorkspaceBudget401 = UnauthorizedResponse
32610export const DeleteWorkspaceBudget401 = UnauthorizedResponse
32611export type DeleteWorkspaceBudget404 = NotFoundResponse
32612export const DeleteWorkspaceBudget404 = NotFoundResponse
32613export type DeleteWorkspaceBudget500 = InternalServerResponse
32614export const DeleteWorkspaceBudget500 = InternalServerResponse
32615export type ListWorkspaceMembersParams = {
32616 readonly "HTTP-Referer"?: string
32617 readonly "X-OpenRouter-Title"?: string
32618 readonly "X-OpenRouter-Categories"?: string
32619 readonly "offset"?: number | null
32620 readonly "limit"?: number
32621}
32622export const ListWorkspaceMembersParams = Schema.Struct({
32623 "HTTP-Referer": Schema.optionalKey(Schema.String),
32624 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32625 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String),
32626 "offset": Schema.optionalKey(
32627 Schema.Union([
32628 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
32629 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
32630 ),
32631 Schema.Null
32632 ]).annotate({ "description": "Number of records to skip for pagination" })
32633 ),
32634 "limit": Schema.optionalKey(
32635 Schema.Number.annotate({ "description": "Maximum number of records to return (max 100)" }).check(
32636 Schema.isInt().annotate({ "expected": "an integer" })
32637 ).check(Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })).check(
32638 Schema.isLessThanOrEqualTo(100).annotate({ "expected": "a value less than or equal to 100" })
32639 )
32640 )
32641})
32642export type ListWorkspaceMembers200 = ListWorkspaceMembersResponse
32643export const ListWorkspaceMembers200 = ListWorkspaceMembersResponse
32644export type ListWorkspaceMembers401 = UnauthorizedResponse
32645export const ListWorkspaceMembers401 = UnauthorizedResponse
32646export type ListWorkspaceMembers403 = ForbiddenResponse
32647export const ListWorkspaceMembers403 = ForbiddenResponse
32648export type ListWorkspaceMembers404 = NotFoundResponse
32649export const ListWorkspaceMembers404 = NotFoundResponse
32650export type ListWorkspaceMembers500 = InternalServerResponse
32651export const ListWorkspaceMembers500 = InternalServerResponse
32652export type BulkAddWorkspaceMembersParams = {
32653 readonly "HTTP-Referer"?: string
32654 readonly "X-OpenRouter-Title"?: string
32655 readonly "X-OpenRouter-Categories"?: string
32656}
32657export const BulkAddWorkspaceMembersParams = Schema.Struct({
32658 "HTTP-Referer": Schema.optionalKey(Schema.String),
32659 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32660 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32661})
32662export type BulkAddWorkspaceMembersRequestJson = BulkAddWorkspaceMembersRequest
32663export const BulkAddWorkspaceMembersRequestJson = BulkAddWorkspaceMembersRequest
32664export type BulkAddWorkspaceMembers200 = BulkAddWorkspaceMembersResponse
32665export const BulkAddWorkspaceMembers200 = BulkAddWorkspaceMembersResponse
32666export type BulkAddWorkspaceMembers400 = BadRequestResponse
32667export const BulkAddWorkspaceMembers400 = BadRequestResponse
32668export type BulkAddWorkspaceMembers401 = UnauthorizedResponse
32669export const BulkAddWorkspaceMembers401 = UnauthorizedResponse
32670export type BulkAddWorkspaceMembers403 = ForbiddenResponse
32671export const BulkAddWorkspaceMembers403 = ForbiddenResponse
32672export type BulkAddWorkspaceMembers404 = NotFoundResponse
32673export const BulkAddWorkspaceMembers404 = NotFoundResponse
32674export type BulkAddWorkspaceMembers500 = InternalServerResponse
32675export const BulkAddWorkspaceMembers500 = InternalServerResponse
32676export type BulkRemoveWorkspaceMembersParams = {
32677 readonly "HTTP-Referer"?: string
32678 readonly "X-OpenRouter-Title"?: string
32679 readonly "X-OpenRouter-Categories"?: string
32680}
32681export const BulkRemoveWorkspaceMembersParams = Schema.Struct({
32682 "HTTP-Referer": Schema.optionalKey(Schema.String),
32683 "X-OpenRouter-Title": Schema.optionalKey(Schema.String),
32684 "X-OpenRouter-Categories": Schema.optionalKey(Schema.String)
32685})
32686export type BulkRemoveWorkspaceMembersRequestJson = BulkRemoveWorkspaceMembersRequest
32687export const BulkRemoveWorkspaceMembersRequestJson = BulkRemoveWorkspaceMembersRequest
32688export type BulkRemoveWorkspaceMembers200 = BulkRemoveWorkspaceMembersResponse
32689export const BulkRemoveWorkspaceMembers200 = BulkRemoveWorkspaceMembersResponse
32690export type BulkRemoveWorkspaceMembers400 = BadRequestResponse
32691export const BulkRemoveWorkspaceMembers400 = BadRequestResponse
32692export type BulkRemoveWorkspaceMembers401 = UnauthorizedResponse
32693export const BulkRemoveWorkspaceMembers401 = UnauthorizedResponse
32694export type BulkRemoveWorkspaceMembers403 = ForbiddenResponse
32695export const BulkRemoveWorkspaceMembers403 = ForbiddenResponse
32696export type BulkRemoveWorkspaceMembers404 = NotFoundResponse
32697export const BulkRemoveWorkspaceMembers404 = NotFoundResponse
32698export type BulkRemoveWorkspaceMembers500 = InternalServerResponse
32699export const BulkRemoveWorkspaceMembers500 = InternalServerResponse
32700
32701export interface OperationConfig {
32702 /**
32703 * Whether or not the response should be included in the value returned from
32704 * an operation.
32705 *
32706 * If set to `true`, a tuple of `[A, HttpClientResponse]` will be returned,
32707 * where `A` is the success type of the operation.
32708 *
32709 * If set to `false`, only the success type of the operation will be returned.
32710 */
32711 readonly includeResponse?: boolean | undefined
32712}
32713
32714/**
32715 * A utility type which optionally includes the response in the return result
32716 * of an operation based upon the value of the `includeResponse` configuration
32717 * option.
32718 */
32719export type WithOptionalResponse<A, Config extends OperationConfig> = Config extends {
32720 readonly includeResponse: true
32721} ? [A, HttpClientResponse.HttpClientResponse] :
32722 A
32723
32724export const make = (
32725 httpClient: HttpClient.HttpClient,
32726 options: {
32727 readonly transformClient?: ((client: HttpClient.HttpClient) => Effect.Effect<HttpClient.HttpClient>) | undefined
32728 } = {}
32729): OpenRouterClient => {
32730 const unexpectedStatus = (response: HttpClientResponse.HttpClientResponse) =>
32731 Effect.flatMap(
32732 Effect.orElseSucceed(response.json, () => "Unexpected status code"),
32733 (description) =>
32734 Effect.fail(
32735 new HttpClientError.HttpClientError({
32736 reason: new HttpClientError.StatusCodeError({
32737 request: response.request,
32738 response,
32739 description: typeof description === "string" ? description : JSON.stringify(description)
32740 })
32741 })
32742 )
32743 )
32744 const withResponse = <Config extends OperationConfig>(config: Config | undefined) =>
32745 (
32746 f: (response: HttpClientResponse.HttpClientResponse) => Effect.Effect<any, any>
32747 ): (request: HttpClientRequest.HttpClientRequest) => Effect.Effect<any, any> => {
32748 const withOptionalResponse = (
32749 config?.includeResponse
32750 ? (response: HttpClientResponse.HttpClientResponse) => Effect.map(f(response), (a) => [a, response])
32751 : (response: HttpClientResponse.HttpClientResponse) => f(response)
32752 ) as any
32753 return options?.transformClient
32754 ? (request) =>
32755 Effect.flatMap(
32756 Effect.flatMap(options.transformClient!(httpClient), (client) => client.execute(request)),
32757 withOptionalResponse
32758 )
32759 : (request) => Effect.flatMap(httpClient.execute(request), withOptionalResponse)
32760 }
32761 const sseRequest = <
32762 Type,
32763 DecodingServices
32764 >(
32765 schema: Schema.ConstraintDecoder<Type, DecodingServices>
32766 ) =>
32767 (
32768 request: HttpClientRequest.HttpClientRequest
32769 ): Stream.Stream<
32770 { readonly event: string; readonly id: string | undefined; readonly data: Type },
32771 HttpClientError.HttpClientError | SchemaError | Sse.Retry | Sse.SseError,
32772 DecodingServices
32773 > =>
32774 HttpClient.filterStatusOk(httpClient).execute(request).pipe(
32775 Effect.map((response) => response.stream),
32776 Stream.unwrap,
32777 Stream.decodeText(),
32778 Stream.pipeThroughChannel(Sse.decodeDataSchema(schema))
32779 )
32780 const binaryRequest = (
32781 request: HttpClientRequest.HttpClientRequest
32782 ): Stream.Stream<Uint8Array, HttpClientError.HttpClientError> =>
32783 HttpClient.filterStatusOk(httpClient).execute(request).pipe(
32784 Effect.map((response) => response.stream),
32785 Stream.unwrap
32786 )
32787 const decodeSuccess =
32788 <Schema extends Schema.Constraint>(schema: Schema) => (response: HttpClientResponse.HttpClientResponse) =>
32789 HttpClientResponse.schemaBodyJson(schema)(response)
32790 const decodeError =
32791 <const Tag extends string, Schema extends Schema.Constraint>(tag: Tag, schema: Schema) =>
32792 (response: HttpClientResponse.HttpClientResponse) =>
32793 Effect.flatMap(
32794 HttpClientResponse.schemaBodyJson(schema)(response),
32795 (cause) => Effect.fail(OpenRouterClientError(tag, cause, response))
32796 )
32797 return {
32798 httpClient,
32799 "getUserActivity": (options) =>
32800 HttpClientRequest.get(`/activity`).pipe(
32801 HttpClientRequest.setUrlParams({
32802 "date": options?.params?.["date"] as any,
32803 "api_key_hash": options?.params?.["api_key_hash"] as any,
32804 "user_id": options?.params?.["user_id"] as any
32805 }),
32806 HttpClientRequest.setHeaders({
32807 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
32808 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
32809 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
32810 }),
32811 withResponse(options?.config)(HttpClientResponse.matchStatus({
32812 "2xx": decodeSuccess(GetUserActivity200),
32813 "400": decodeError("GetUserActivity400", GetUserActivity400),
32814 "401": decodeError("GetUserActivity401", GetUserActivity401),
32815 "403": decodeError("GetUserActivity403", GetUserActivity403),
32816 "404": decodeError("GetUserActivity404", GetUserActivity404),
32817 "500": decodeError("GetUserActivity500", GetUserActivity500),
32818 orElse: unexpectedStatus
32819 }))
32820 ),
32821 "getAnalyticsMeta": (options) =>
32822 HttpClientRequest.get(`/analytics/meta`).pipe(
32823 HttpClientRequest.setHeaders({
32824 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
32825 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
32826 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
32827 }),
32828 withResponse(options?.config)(HttpClientResponse.matchStatus({
32829 "2xx": decodeSuccess(GetAnalyticsMeta200),
32830 "401": decodeError("GetAnalyticsMeta401", GetAnalyticsMeta401),
32831 "403": decodeError("GetAnalyticsMeta403", GetAnalyticsMeta403),
32832 "500": decodeError("GetAnalyticsMeta500", GetAnalyticsMeta500),
32833 orElse: unexpectedStatus
32834 }))
32835 ),
32836 "queryAnalytics": (options) =>
32837 HttpClientRequest.post(`/analytics/query`).pipe(
32838 HttpClientRequest.setHeaders({
32839 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
32840 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
32841 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
32842 }),
32843 HttpClientRequest.bodyJsonUnsafe(options.payload),
32844 withResponse(options.config)(HttpClientResponse.matchStatus({
32845 "2xx": decodeSuccess(QueryAnalytics200),
32846 "400": decodeError("QueryAnalytics400", QueryAnalytics400),
32847 "401": decodeError("QueryAnalytics401", QueryAnalytics401),
32848 "403": decodeError("QueryAnalytics403", QueryAnalytics403),
32849 "408": decodeError("QueryAnalytics408", QueryAnalytics408),
32850 "500": decodeError("QueryAnalytics500", QueryAnalytics500),
32851 orElse: unexpectedStatus
32852 }))
32853 ),
32854 "createAudioSpeech": (options) =>
32855 HttpClientRequest.post(`/audio/speech`).pipe(
32856 HttpClientRequest.setHeaders({
32857 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
32858 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
32859 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
32860 }),
32861 HttpClientRequest.bodyJsonUnsafe(options.payload),
32862 withResponse(options.config)(HttpClientResponse.matchStatus({
32863 "400": decodeError("CreateAudioSpeech400", CreateAudioSpeech400),
32864 "401": decodeError("CreateAudioSpeech401", CreateAudioSpeech401),
32865 "402": decodeError("CreateAudioSpeech402", CreateAudioSpeech402),
32866 "404": decodeError("CreateAudioSpeech404", CreateAudioSpeech404),
32867 "429": decodeError("CreateAudioSpeech429", CreateAudioSpeech429),
32868 "500": decodeError("CreateAudioSpeech500", CreateAudioSpeech500),
32869 "502": decodeError("CreateAudioSpeech502", CreateAudioSpeech502),
32870 "503": decodeError("CreateAudioSpeech503", CreateAudioSpeech503),
32871 "524": decodeError("CreateAudioSpeech524", CreateAudioSpeech524),
32872 "529": decodeError("CreateAudioSpeech529", CreateAudioSpeech529),
32873 orElse: unexpectedStatus
32874 }))
32875 ),
32876 "createAudioTranscriptions": (options) =>
32877 HttpClientRequest.post(`/audio/transcriptions`).pipe(
32878 HttpClientRequest.setHeaders({
32879 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
32880 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
32881 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
32882 }),
32883 HttpClientRequest.bodyJsonUnsafe(options.payload),
32884 withResponse(options.config)(HttpClientResponse.matchStatus({
32885 "2xx": decodeSuccess(CreateAudioTranscriptions200),
32886 "400": decodeError("CreateAudioTranscriptions400", CreateAudioTranscriptions400),
32887 "401": decodeError("CreateAudioTranscriptions401", CreateAudioTranscriptions401),
32888 "402": decodeError("CreateAudioTranscriptions402", CreateAudioTranscriptions402),
32889 "404": decodeError("CreateAudioTranscriptions404", CreateAudioTranscriptions404),
32890 "429": decodeError("CreateAudioTranscriptions429", CreateAudioTranscriptions429),
32891 "500": decodeError("CreateAudioTranscriptions500", CreateAudioTranscriptions500),
32892 "502": decodeError("CreateAudioTranscriptions502", CreateAudioTranscriptions502),
32893 "503": decodeError("CreateAudioTranscriptions503", CreateAudioTranscriptions503),
32894 "524": decodeError("CreateAudioTranscriptions524", CreateAudioTranscriptions524),
32895 "529": decodeError("CreateAudioTranscriptions529", CreateAudioTranscriptions529),
32896 orElse: unexpectedStatus
32897 }))
32898 ),
32899 "exchangeAuthCodeForAPIKey": (options) =>
32900 HttpClientRequest.post(`/auth/keys`).pipe(
32901 HttpClientRequest.setHeaders({
32902 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
32903 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
32904 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
32905 }),
32906 HttpClientRequest.bodyJsonUnsafe(options.payload),
32907 withResponse(options.config)(HttpClientResponse.matchStatus({
32908 "2xx": decodeSuccess(ExchangeAuthCodeForAPIKey200),
32909 "400": decodeError("ExchangeAuthCodeForAPIKey400", ExchangeAuthCodeForAPIKey400),
32910 "403": decodeError("ExchangeAuthCodeForAPIKey403", ExchangeAuthCodeForAPIKey403),
32911 "500": decodeError("ExchangeAuthCodeForAPIKey500", ExchangeAuthCodeForAPIKey500),
32912 orElse: unexpectedStatus
32913 }))
32914 ),
32915 "createAuthKeysCode": (options) =>
32916 HttpClientRequest.post(`/auth/keys/code`).pipe(
32917 HttpClientRequest.setHeaders({
32918 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
32919 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
32920 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
32921 }),
32922 HttpClientRequest.bodyJsonUnsafe(options.payload),
32923 withResponse(options.config)(HttpClientResponse.matchStatus({
32924 "2xx": decodeSuccess(CreateAuthKeysCode200),
32925 "400": decodeError("CreateAuthKeysCode400", CreateAuthKeysCode400),
32926 "401": decodeError("CreateAuthKeysCode401", CreateAuthKeysCode401),
32927 "403": decodeError("CreateAuthKeysCode403", CreateAuthKeysCode403),
32928 "409": decodeError("CreateAuthKeysCode409", CreateAuthKeysCode409),
32929 "500": decodeError("CreateAuthKeysCode500", CreateAuthKeysCode500),
32930 orElse: unexpectedStatus
32931 }))
32932 ),
32933 "getBenchmarks": (options) =>
32934 HttpClientRequest.get(`/benchmarks`).pipe(
32935 HttpClientRequest.setUrlParams({
32936 "source": options?.params?.["source"] as any,
32937 "task_type": options?.params?.["task_type"] as any,
32938 "arena": options?.params?.["arena"] as any,
32939 "category": options?.params?.["category"] as any,
32940 "max_results": options?.params?.["max_results"] as any
32941 }),
32942 HttpClientRequest.setHeaders({
32943 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
32944 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
32945 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
32946 }),
32947 withResponse(options?.config)(HttpClientResponse.matchStatus({
32948 "2xx": decodeSuccess(GetBenchmarks200),
32949 "400": decodeError("GetBenchmarks400", GetBenchmarks400),
32950 "401": decodeError("GetBenchmarks401", GetBenchmarks401),
32951 "429": decodeError("GetBenchmarks429", GetBenchmarks429),
32952 "500": decodeError("GetBenchmarks500", GetBenchmarks500),
32953 orElse: unexpectedStatus
32954 }))
32955 ),
32956 "listBYOKKeys": (options) =>
32957 HttpClientRequest.get(`/byok`).pipe(
32958 HttpClientRequest.setUrlParams({
32959 "offset": options?.params?.["offset"] as any,
32960 "limit": options?.params?.["limit"] as any,
32961 "workspace_id": options?.params?.["workspace_id"] as any,
32962 "provider": options?.params?.["provider"] as any
32963 }),
32964 HttpClientRequest.setHeaders({
32965 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
32966 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
32967 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
32968 }),
32969 withResponse(options?.config)(HttpClientResponse.matchStatus({
32970 "2xx": decodeSuccess(ListBYOKKeys200),
32971 "400": decodeError("ListBYOKKeys400", ListBYOKKeys400),
32972 "401": decodeError("ListBYOKKeys401", ListBYOKKeys401),
32973 "500": decodeError("ListBYOKKeys500", ListBYOKKeys500),
32974 orElse: unexpectedStatus
32975 }))
32976 ),
32977 "createBYOKKey": (options) =>
32978 HttpClientRequest.post(`/byok`).pipe(
32979 HttpClientRequest.setHeaders({
32980 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
32981 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
32982 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
32983 }),
32984 HttpClientRequest.bodyJsonUnsafe(options.payload),
32985 withResponse(options.config)(HttpClientResponse.matchStatus({
32986 "2xx": decodeSuccess(CreateBYOKKey201),
32987 "400": decodeError("CreateBYOKKey400", CreateBYOKKey400),
32988 "401": decodeError("CreateBYOKKey401", CreateBYOKKey401),
32989 "403": decodeError("CreateBYOKKey403", CreateBYOKKey403),
32990 "500": decodeError("CreateBYOKKey500", CreateBYOKKey500),
32991 orElse: unexpectedStatus
32992 }))
32993 ),
32994 "getBYOKKey": (id, options) =>
32995 HttpClientRequest.get(`/byok/${id}`).pipe(
32996 HttpClientRequest.setHeaders({
32997 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
32998 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
32999 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33000 }),
33001 withResponse(options?.config)(HttpClientResponse.matchStatus({
33002 "2xx": decodeSuccess(GetBYOKKey200),
33003 "401": decodeError("GetBYOKKey401", GetBYOKKey401),
33004 "404": decodeError("GetBYOKKey404", GetBYOKKey404),
33005 "500": decodeError("GetBYOKKey500", GetBYOKKey500),
33006 orElse: unexpectedStatus
33007 }))
33008 ),
33009 "deleteBYOKKey": (id, options) =>
33010 HttpClientRequest.delete(`/byok/${id}`).pipe(
33011 HttpClientRequest.setHeaders({
33012 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33013 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33014 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33015 }),
33016 withResponse(options?.config)(HttpClientResponse.matchStatus({
33017 "2xx": decodeSuccess(DeleteBYOKKey200),
33018 "401": decodeError("DeleteBYOKKey401", DeleteBYOKKey401),
33019 "404": decodeError("DeleteBYOKKey404", DeleteBYOKKey404),
33020 "500": decodeError("DeleteBYOKKey500", DeleteBYOKKey500),
33021 orElse: unexpectedStatus
33022 }))
33023 ),
33024 "updateBYOKKey": (id, options) =>
33025 HttpClientRequest.patch(`/byok/${id}`).pipe(
33026 HttpClientRequest.setHeaders({
33027 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33028 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33029 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33030 }),
33031 HttpClientRequest.bodyJsonUnsafe(options.payload),
33032 withResponse(options.config)(HttpClientResponse.matchStatus({
33033 "2xx": decodeSuccess(UpdateBYOKKey200),
33034 "400": decodeError("UpdateBYOKKey400", UpdateBYOKKey400),
33035 "401": decodeError("UpdateBYOKKey401", UpdateBYOKKey401),
33036 "404": decodeError("UpdateBYOKKey404", UpdateBYOKKey404),
33037 "500": decodeError("UpdateBYOKKey500", UpdateBYOKKey500),
33038 orElse: unexpectedStatus
33039 }))
33040 ),
33041 "sendChatCompletionRequest": (options) =>
33042 HttpClientRequest.post(`/chat/completions`).pipe(
33043 HttpClientRequest.setHeaders({
33044 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33045 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33046 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined,
33047 "X-OpenRouter-Metadata": options.params?.["X-OpenRouter-Metadata"] ?? undefined
33048 }),
33049 HttpClientRequest.bodyJsonUnsafe(options.payload),
33050 withResponse(options.config)(HttpClientResponse.matchStatus({
33051 "2xx": decodeSuccess(SendChatCompletionRequest200),
33052 "400": decodeError("SendChatCompletionRequest400", SendChatCompletionRequest400),
33053 "401": decodeError("SendChatCompletionRequest401", SendChatCompletionRequest401),
33054 "402": decodeError("SendChatCompletionRequest402", SendChatCompletionRequest402),
33055 "403": decodeError("SendChatCompletionRequest403", SendChatCompletionRequest403),
33056 "404": decodeError("SendChatCompletionRequest404", SendChatCompletionRequest404),
33057 "408": decodeError("SendChatCompletionRequest408", SendChatCompletionRequest408),
33058 "413": decodeError("SendChatCompletionRequest413", SendChatCompletionRequest413),
33059 "422": decodeError("SendChatCompletionRequest422", SendChatCompletionRequest422),
33060 "429": decodeError("SendChatCompletionRequest429", SendChatCompletionRequest429),
33061 "500": decodeError("SendChatCompletionRequest500", SendChatCompletionRequest500),
33062 "502": decodeError("SendChatCompletionRequest502", SendChatCompletionRequest502),
33063 "503": decodeError("SendChatCompletionRequest503", SendChatCompletionRequest503),
33064 "524": decodeError("SendChatCompletionRequest524", SendChatCompletionRequest524),
33065 "529": decodeError("SendChatCompletionRequest529", SendChatCompletionRequest529),
33066 orElse: unexpectedStatus
33067 }))
33068 ),
33069 "sendChatCompletionRequestSse": (options) =>
33070 HttpClientRequest.post(`/chat/completions`).pipe(
33071 HttpClientRequest.setHeaders({
33072 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33073 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33074 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined,
33075 "X-OpenRouter-Metadata": options.params?.["X-OpenRouter-Metadata"] ?? undefined
33076 }),
33077 HttpClientRequest.bodyJsonUnsafe(options.payload),
33078 sseRequest(SendChatCompletionRequest200Sse)
33079 ),
33080 "getTaskClassifications": (options) =>
33081 HttpClientRequest.get(`/classifications/task`).pipe(
33082 HttpClientRequest.setUrlParams({ "window": options?.params?.["window"] as any }),
33083 HttpClientRequest.setHeaders({
33084 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33085 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33086 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33087 }),
33088 withResponse(options?.config)(HttpClientResponse.matchStatus({
33089 "2xx": decodeSuccess(GetTaskClassifications200),
33090 "400": decodeError("GetTaskClassifications400", GetTaskClassifications400),
33091 "401": decodeError("GetTaskClassifications401", GetTaskClassifications401),
33092 "429": decodeError("GetTaskClassifications429", GetTaskClassifications429),
33093 "500": decodeError("GetTaskClassifications500", GetTaskClassifications500),
33094 orElse: unexpectedStatus
33095 }))
33096 ),
33097 "getCredits": (options) =>
33098 HttpClientRequest.get(`/credits`).pipe(
33099 HttpClientRequest.setHeaders({
33100 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33101 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33102 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33103 }),
33104 withResponse(options?.config)(HttpClientResponse.matchStatus({
33105 "2xx": decodeSuccess(GetCredits200),
33106 "401": decodeError("GetCredits401", GetCredits401),
33107 "403": decodeError("GetCredits403", GetCredits403),
33108 "500": decodeError("GetCredits500", GetCredits500),
33109 orElse: unexpectedStatus
33110 }))
33111 ),
33112 "createCoinbaseCharge": (options) =>
33113 HttpClientRequest.post(`/credits/coinbase`).pipe(
33114 HttpClientRequest.setHeaders({
33115 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33116 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33117 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33118 }),
33119 withResponse(options?.config)(HttpClientResponse.matchStatus({
33120 "410": decodeError("CreateCoinbaseCharge410", CreateCoinbaseCharge410),
33121 "200": () => Effect.void,
33122 orElse: unexpectedStatus
33123 }))
33124 ),
33125 "getAppRankings": (options) =>
33126 HttpClientRequest.get(`/datasets/app-rankings`).pipe(
33127 HttpClientRequest.setUrlParams({
33128 "category": options?.params?.["category"] as any,
33129 "subcategory": options?.params?.["subcategory"] as any,
33130 "sort": options?.params?.["sort"] as any,
33131 "start_date": options?.params?.["start_date"] as any,
33132 "end_date": options?.params?.["end_date"] as any,
33133 "limit": options?.params?.["limit"] as any,
33134 "offset": options?.params?.["offset"] as any
33135 }),
33136 HttpClientRequest.setHeaders({
33137 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33138 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33139 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33140 }),
33141 withResponse(options?.config)(HttpClientResponse.matchStatus({
33142 "2xx": decodeSuccess(GetAppRankings200),
33143 "400": decodeError("GetAppRankings400", GetAppRankings400),
33144 "401": decodeError("GetAppRankings401", GetAppRankings401),
33145 "429": decodeError("GetAppRankings429", GetAppRankings429),
33146 "500": decodeError("GetAppRankings500", GetAppRankings500),
33147 orElse: unexpectedStatus
33148 }))
33149 ),
33150 "getRankingsDaily": (options) =>
33151 HttpClientRequest.get(`/datasets/rankings-daily`).pipe(
33152 HttpClientRequest.setUrlParams({
33153 "start_date": options?.params?.["start_date"] as any,
33154 "end_date": options?.params?.["end_date"] as any,
33155 "period": options?.params?.["period"] as any,
33156 "modality": options?.params?.["modality"] as any,
33157 "context_bucket": options?.params?.["context_bucket"] as any,
33158 "category": options?.params?.["category"] as any,
33159 "language_type": options?.params?.["language_type"] as any
33160 }),
33161 HttpClientRequest.setHeaders({
33162 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33163 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33164 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33165 }),
33166 withResponse(options?.config)(HttpClientResponse.matchStatus({
33167 "2xx": decodeSuccess(GetRankingsDaily200),
33168 "400": decodeError("GetRankingsDaily400", GetRankingsDaily400),
33169 "401": decodeError("GetRankingsDaily401", GetRankingsDaily401),
33170 "429": decodeError("GetRankingsDaily429", GetRankingsDaily429),
33171 "500": decodeError("GetRankingsDaily500", GetRankingsDaily500),
33172 orElse: unexpectedStatus
33173 }))
33174 ),
33175 "createEmbeddings": (options) =>
33176 HttpClientRequest.post(`/embeddings`).pipe(
33177 HttpClientRequest.setHeaders({
33178 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33179 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33180 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33181 }),
33182 HttpClientRequest.bodyJsonUnsafe(options.payload),
33183 withResponse(options.config)(HttpClientResponse.matchStatus({
33184 "2xx": decodeSuccess(CreateEmbeddings200),
33185 "400": decodeError("CreateEmbeddings400", CreateEmbeddings400),
33186 "401": decodeError("CreateEmbeddings401", CreateEmbeddings401),
33187 "402": decodeError("CreateEmbeddings402", CreateEmbeddings402),
33188 "404": decodeError("CreateEmbeddings404", CreateEmbeddings404),
33189 "429": decodeError("CreateEmbeddings429", CreateEmbeddings429),
33190 "500": decodeError("CreateEmbeddings500", CreateEmbeddings500),
33191 "502": decodeError("CreateEmbeddings502", CreateEmbeddings502),
33192 "503": decodeError("CreateEmbeddings503", CreateEmbeddings503),
33193 "524": decodeError("CreateEmbeddings524", CreateEmbeddings524),
33194 "529": decodeError("CreateEmbeddings529", CreateEmbeddings529),
33195 orElse: unexpectedStatus
33196 }))
33197 ),
33198 "createEmbeddingsSse": (options) =>
33199 HttpClientRequest.post(`/embeddings`).pipe(
33200 HttpClientRequest.setHeaders({
33201 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33202 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33203 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33204 }),
33205 HttpClientRequest.bodyJsonUnsafe(options.payload),
33206 sseRequest(CreateEmbeddings200Sse)
33207 ),
33208 "listEmbeddingsModels": (options) =>
33209 HttpClientRequest.get(`/embeddings/models`).pipe(
33210 HttpClientRequest.setUrlParams({
33211 "offset": options?.params?.["offset"] as any,
33212 "limit": options?.params?.["limit"] as any
33213 }),
33214 HttpClientRequest.setHeaders({
33215 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33216 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33217 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33218 }),
33219 withResponse(options?.config)(HttpClientResponse.matchStatus({
33220 "2xx": decodeSuccess(ListEmbeddingsModels200),
33221 "400": decodeError("ListEmbeddingsModels400", ListEmbeddingsModels400),
33222 "500": decodeError("ListEmbeddingsModels500", ListEmbeddingsModels500),
33223 orElse: unexpectedStatus
33224 }))
33225 ),
33226 "listEndpointsZdr": (options) =>
33227 HttpClientRequest.get(`/endpoints/zdr`).pipe(
33228 HttpClientRequest.setHeaders({
33229 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33230 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33231 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33232 }),
33233 withResponse(options?.config)(HttpClientResponse.matchStatus({
33234 "2xx": decodeSuccess(ListEndpointsZdr200),
33235 "403": decodeError("ListEndpointsZdr403", ListEndpointsZdr403),
33236 "500": decodeError("ListEndpointsZdr500", ListEndpointsZdr500),
33237 orElse: unexpectedStatus
33238 }))
33239 ),
33240 "listFiles": (options) =>
33241 HttpClientRequest.get(`/files`).pipe(
33242 HttpClientRequest.setUrlParams({
33243 "limit": options?.params?.["limit"] as any,
33244 "cursor": options?.params?.["cursor"] as any,
33245 "workspace_id": options?.params?.["workspace_id"] as any
33246 }),
33247 HttpClientRequest.setHeaders({
33248 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33249 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33250 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33251 }),
33252 withResponse(options?.config)(HttpClientResponse.matchStatus({
33253 "2xx": decodeSuccess(ListFiles200),
33254 "400": decodeError("ListFiles400", ListFiles400),
33255 "401": decodeError("ListFiles401", ListFiles401),
33256 "429": decodeError("ListFiles429", ListFiles429),
33257 "500": decodeError("ListFiles500", ListFiles500),
33258 orElse: unexpectedStatus
33259 }))
33260 ),
33261 "uploadFile": (options) =>
33262 HttpClientRequest.post(`/files`).pipe(
33263 HttpClientRequest.setUrlParams({ "workspace_id": options.params?.["workspace_id"] as any }),
33264 HttpClientRequest.setHeaders({
33265 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33266 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33267 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33268 }),
33269 HttpClientRequest.bodyFormData(options.payload as any),
33270 withResponse(options.config)(HttpClientResponse.matchStatus({
33271 "2xx": decodeSuccess(UploadFile200),
33272 "400": decodeError("UploadFile400", UploadFile400),
33273 "401": decodeError("UploadFile401", UploadFile401),
33274 "403": decodeError("UploadFile403", UploadFile403),
33275 "413": decodeError("UploadFile413", UploadFile413),
33276 "429": decodeError("UploadFile429", UploadFile429),
33277 "500": decodeError("UploadFile500", UploadFile500),
33278 orElse: unexpectedStatus
33279 }))
33280 ),
33281 "getFileMetadata": (fileId, options) =>
33282 HttpClientRequest.get(`/files/${fileId}`).pipe(
33283 HttpClientRequest.setUrlParams({ "workspace_id": options?.params?.["workspace_id"] as any }),
33284 HttpClientRequest.setHeaders({
33285 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33286 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33287 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33288 }),
33289 withResponse(options?.config)(HttpClientResponse.matchStatus({
33290 "2xx": decodeSuccess(GetFileMetadata200),
33291 "401": decodeError("GetFileMetadata401", GetFileMetadata401),
33292 "404": decodeError("GetFileMetadata404", GetFileMetadata404),
33293 "429": decodeError("GetFileMetadata429", GetFileMetadata429),
33294 "500": decodeError("GetFileMetadata500", GetFileMetadata500),
33295 orElse: unexpectedStatus
33296 }))
33297 ),
33298 "deleteFile": (fileId, options) =>
33299 HttpClientRequest.delete(`/files/${fileId}`).pipe(
33300 HttpClientRequest.setUrlParams({ "workspace_id": options?.params?.["workspace_id"] as any }),
33301 HttpClientRequest.setHeaders({
33302 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33303 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33304 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33305 }),
33306 withResponse(options?.config)(HttpClientResponse.matchStatus({
33307 "2xx": decodeSuccess(DeleteFile200),
33308 "401": decodeError("DeleteFile401", DeleteFile401),
33309 "404": decodeError("DeleteFile404", DeleteFile404),
33310 "429": decodeError("DeleteFile429", DeleteFile429),
33311 "500": decodeError("DeleteFile500", DeleteFile500),
33312 orElse: unexpectedStatus
33313 }))
33314 ),
33315 "downloadFileContent": (fileId, options) =>
33316 HttpClientRequest.get(`/files/${fileId}/content`).pipe(
33317 HttpClientRequest.setUrlParams({ "workspace_id": options?.params?.["workspace_id"] as any }),
33318 HttpClientRequest.setHeaders({
33319 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33320 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33321 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33322 }),
33323 withResponse(options?.config)(HttpClientResponse.matchStatus({
33324 "400": decodeError("DownloadFileContent400", DownloadFileContent400),
33325 "401": decodeError("DownloadFileContent401", DownloadFileContent401),
33326 "404": decodeError("DownloadFileContent404", DownloadFileContent404),
33327 "429": decodeError("DownloadFileContent429", DownloadFileContent429),
33328 "500": decodeError("DownloadFileContent500", DownloadFileContent500),
33329 orElse: unexpectedStatus
33330 }))
33331 ),
33332 "downloadFileContentStream": (fileId, options) =>
33333 HttpClientRequest.get(`/files/${fileId}/content`).pipe(
33334 HttpClientRequest.setUrlParams({ "workspace_id": options?.params?.["workspace_id"] as any }),
33335 HttpClientRequest.setHeaders({
33336 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33337 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33338 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33339 }),
33340 binaryRequest
33341 ),
33342 "getGeneration": (options) =>
33343 HttpClientRequest.get(`/generation`).pipe(
33344 HttpClientRequest.setUrlParams({ "id": options.params["id"] as any }),
33345 HttpClientRequest.setHeaders({
33346 "HTTP-Referer": options.params["HTTP-Referer"] ?? undefined,
33347 "X-OpenRouter-Title": options.params["X-OpenRouter-Title"] ?? undefined,
33348 "X-OpenRouter-Categories": options.params["X-OpenRouter-Categories"] ?? undefined
33349 }),
33350 withResponse(options.config)(HttpClientResponse.matchStatus({
33351 "2xx": decodeSuccess(GetGeneration200),
33352 "401": decodeError("GetGeneration401", GetGeneration401),
33353 "402": decodeError("GetGeneration402", GetGeneration402),
33354 "404": decodeError("GetGeneration404", GetGeneration404),
33355 "429": decodeError("GetGeneration429", GetGeneration429),
33356 "500": decodeError("GetGeneration500", GetGeneration500),
33357 "502": decodeError("GetGeneration502", GetGeneration502),
33358 "524": decodeError("GetGeneration524", GetGeneration524),
33359 "529": decodeError("GetGeneration529", GetGeneration529),
33360 orElse: unexpectedStatus
33361 }))
33362 ),
33363 "listGenerationContent": (options) =>
33364 HttpClientRequest.get(`/generation/content`).pipe(
33365 HttpClientRequest.setUrlParams({ "id": options.params["id"] as any }),
33366 HttpClientRequest.setHeaders({
33367 "HTTP-Referer": options.params["HTTP-Referer"] ?? undefined,
33368 "X-OpenRouter-Title": options.params["X-OpenRouter-Title"] ?? undefined,
33369 "X-OpenRouter-Categories": options.params["X-OpenRouter-Categories"] ?? undefined
33370 }),
33371 withResponse(options.config)(HttpClientResponse.matchStatus({
33372 "2xx": decodeSuccess(ListGenerationContent200),
33373 "401": decodeError("ListGenerationContent401", ListGenerationContent401),
33374 "403": decodeError("ListGenerationContent403", ListGenerationContent403),
33375 "404": decodeError("ListGenerationContent404", ListGenerationContent404),
33376 "429": decodeError("ListGenerationContent429", ListGenerationContent429),
33377 "500": decodeError("ListGenerationContent500", ListGenerationContent500),
33378 "502": decodeError("ListGenerationContent502", ListGenerationContent502),
33379 "524": decodeError("ListGenerationContent524", ListGenerationContent524),
33380 "529": decodeError("ListGenerationContent529", ListGenerationContent529),
33381 orElse: unexpectedStatus
33382 }))
33383 ),
33384 "submitGenerationFeedback": (options) =>
33385 HttpClientRequest.post(`/generation/feedback`).pipe(
33386 HttpClientRequest.setHeaders({
33387 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33388 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33389 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33390 }),
33391 HttpClientRequest.bodyJsonUnsafe(options.payload),
33392 withResponse(options.config)(HttpClientResponse.matchStatus({
33393 "2xx": decodeSuccess(SubmitGenerationFeedback200),
33394 "400": decodeError("SubmitGenerationFeedback400", SubmitGenerationFeedback400),
33395 "401": decodeError("SubmitGenerationFeedback401", SubmitGenerationFeedback401),
33396 "404": decodeError("SubmitGenerationFeedback404", SubmitGenerationFeedback404),
33397 "429": decodeError("SubmitGenerationFeedback429", SubmitGenerationFeedback429),
33398 "500": decodeError("SubmitGenerationFeedback500", SubmitGenerationFeedback500),
33399 orElse: unexpectedStatus
33400 }))
33401 ),
33402 "listGuardrails": (options) =>
33403 HttpClientRequest.get(`/guardrails`).pipe(
33404 HttpClientRequest.setUrlParams({
33405 "offset": options?.params?.["offset"] as any,
33406 "limit": options?.params?.["limit"] as any,
33407 "workspace_id": options?.params?.["workspace_id"] as any
33408 }),
33409 HttpClientRequest.setHeaders({
33410 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33411 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33412 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33413 }),
33414 withResponse(options?.config)(HttpClientResponse.matchStatus({
33415 "2xx": decodeSuccess(ListGuardrails200),
33416 "400": decodeError("ListGuardrails400", ListGuardrails400),
33417 "401": decodeError("ListGuardrails401", ListGuardrails401),
33418 "500": decodeError("ListGuardrails500", ListGuardrails500),
33419 orElse: unexpectedStatus
33420 }))
33421 ),
33422 "createGuardrail": (options) =>
33423 HttpClientRequest.post(`/guardrails`).pipe(
33424 HttpClientRequest.setHeaders({
33425 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33426 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33427 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33428 }),
33429 HttpClientRequest.bodyJsonUnsafe(options.payload),
33430 withResponse(options.config)(HttpClientResponse.matchStatus({
33431 "2xx": decodeSuccess(CreateGuardrail201),
33432 "400": decodeError("CreateGuardrail400", CreateGuardrail400),
33433 "401": decodeError("CreateGuardrail401", CreateGuardrail401),
33434 "403": decodeError("CreateGuardrail403", CreateGuardrail403),
33435 "500": decodeError("CreateGuardrail500", CreateGuardrail500),
33436 orElse: unexpectedStatus
33437 }))
33438 ),
33439 "getGuardrail": (id, options) =>
33440 HttpClientRequest.get(`/guardrails/${id}`).pipe(
33441 HttpClientRequest.setHeaders({
33442 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33443 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33444 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33445 }),
33446 withResponse(options?.config)(HttpClientResponse.matchStatus({
33447 "2xx": decodeSuccess(GetGuardrail200),
33448 "401": decodeError("GetGuardrail401", GetGuardrail401),
33449 "404": decodeError("GetGuardrail404", GetGuardrail404),
33450 "500": decodeError("GetGuardrail500", GetGuardrail500),
33451 orElse: unexpectedStatus
33452 }))
33453 ),
33454 "deleteGuardrail": (id, options) =>
33455 HttpClientRequest.delete(`/guardrails/${id}`).pipe(
33456 HttpClientRequest.setHeaders({
33457 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33458 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33459 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33460 }),
33461 withResponse(options?.config)(HttpClientResponse.matchStatus({
33462 "2xx": decodeSuccess(DeleteGuardrail200),
33463 "401": decodeError("DeleteGuardrail401", DeleteGuardrail401),
33464 "404": decodeError("DeleteGuardrail404", DeleteGuardrail404),
33465 "500": decodeError("DeleteGuardrail500", DeleteGuardrail500),
33466 orElse: unexpectedStatus
33467 }))
33468 ),
33469 "updateGuardrail": (id, options) =>
33470 HttpClientRequest.patch(`/guardrails/${id}`).pipe(
33471 HttpClientRequest.setHeaders({
33472 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33473 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33474 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33475 }),
33476 HttpClientRequest.bodyJsonUnsafe(options.payload),
33477 withResponse(options.config)(HttpClientResponse.matchStatus({
33478 "2xx": decodeSuccess(UpdateGuardrail200),
33479 "400": decodeError("UpdateGuardrail400", UpdateGuardrail400),
33480 "401": decodeError("UpdateGuardrail401", UpdateGuardrail401),
33481 "404": decodeError("UpdateGuardrail404", UpdateGuardrail404),
33482 "500": decodeError("UpdateGuardrail500", UpdateGuardrail500),
33483 orElse: unexpectedStatus
33484 }))
33485 ),
33486 "listGuardrailKeyAssignments": (id, options) =>
33487 HttpClientRequest.get(`/guardrails/${id}/assignments/keys`).pipe(
33488 HttpClientRequest.setUrlParams({
33489 "offset": options?.params?.["offset"] as any,
33490 "limit": options?.params?.["limit"] as any
33491 }),
33492 HttpClientRequest.setHeaders({
33493 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33494 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33495 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33496 }),
33497 withResponse(options?.config)(HttpClientResponse.matchStatus({
33498 "2xx": decodeSuccess(ListGuardrailKeyAssignments200),
33499 "401": decodeError("ListGuardrailKeyAssignments401", ListGuardrailKeyAssignments401),
33500 "404": decodeError("ListGuardrailKeyAssignments404", ListGuardrailKeyAssignments404),
33501 "500": decodeError("ListGuardrailKeyAssignments500", ListGuardrailKeyAssignments500),
33502 orElse: unexpectedStatus
33503 }))
33504 ),
33505 "bulkAssignKeysToGuardrail": (id, options) =>
33506 HttpClientRequest.post(`/guardrails/${id}/assignments/keys`).pipe(
33507 HttpClientRequest.setHeaders({
33508 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33509 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33510 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33511 }),
33512 HttpClientRequest.bodyJsonUnsafe(options.payload),
33513 withResponse(options.config)(HttpClientResponse.matchStatus({
33514 "2xx": decodeSuccess(BulkAssignKeysToGuardrail200),
33515 "400": decodeError("BulkAssignKeysToGuardrail400", BulkAssignKeysToGuardrail400),
33516 "401": decodeError("BulkAssignKeysToGuardrail401", BulkAssignKeysToGuardrail401),
33517 "404": decodeError("BulkAssignKeysToGuardrail404", BulkAssignKeysToGuardrail404),
33518 "500": decodeError("BulkAssignKeysToGuardrail500", BulkAssignKeysToGuardrail500),
33519 orElse: unexpectedStatus
33520 }))
33521 ),
33522 "bulkUnassignKeysFromGuardrail": (id, options) =>
33523 HttpClientRequest.post(`/guardrails/${id}/assignments/keys/remove`).pipe(
33524 HttpClientRequest.setHeaders({
33525 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33526 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33527 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33528 }),
33529 HttpClientRequest.bodyJsonUnsafe(options.payload),
33530 withResponse(options.config)(HttpClientResponse.matchStatus({
33531 "2xx": decodeSuccess(BulkUnassignKeysFromGuardrail200),
33532 "400": decodeError("BulkUnassignKeysFromGuardrail400", BulkUnassignKeysFromGuardrail400),
33533 "401": decodeError("BulkUnassignKeysFromGuardrail401", BulkUnassignKeysFromGuardrail401),
33534 "404": decodeError("BulkUnassignKeysFromGuardrail404", BulkUnassignKeysFromGuardrail404),
33535 "500": decodeError("BulkUnassignKeysFromGuardrail500", BulkUnassignKeysFromGuardrail500),
33536 orElse: unexpectedStatus
33537 }))
33538 ),
33539 "listGuardrailMemberAssignments": (id, options) =>
33540 HttpClientRequest.get(`/guardrails/${id}/assignments/members`).pipe(
33541 HttpClientRequest.setUrlParams({
33542 "offset": options?.params?.["offset"] as any,
33543 "limit": options?.params?.["limit"] as any
33544 }),
33545 HttpClientRequest.setHeaders({
33546 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33547 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33548 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33549 }),
33550 withResponse(options?.config)(HttpClientResponse.matchStatus({
33551 "2xx": decodeSuccess(ListGuardrailMemberAssignments200),
33552 "401": decodeError("ListGuardrailMemberAssignments401", ListGuardrailMemberAssignments401),
33553 "404": decodeError("ListGuardrailMemberAssignments404", ListGuardrailMemberAssignments404),
33554 "500": decodeError("ListGuardrailMemberAssignments500", ListGuardrailMemberAssignments500),
33555 orElse: unexpectedStatus
33556 }))
33557 ),
33558 "bulkAssignMembersToGuardrail": (id, options) =>
33559 HttpClientRequest.post(`/guardrails/${id}/assignments/members`).pipe(
33560 HttpClientRequest.setHeaders({
33561 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33562 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33563 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33564 }),
33565 HttpClientRequest.bodyJsonUnsafe(options.payload),
33566 withResponse(options.config)(HttpClientResponse.matchStatus({
33567 "2xx": decodeSuccess(BulkAssignMembersToGuardrail200),
33568 "400": decodeError("BulkAssignMembersToGuardrail400", BulkAssignMembersToGuardrail400),
33569 "401": decodeError("BulkAssignMembersToGuardrail401", BulkAssignMembersToGuardrail401),
33570 "404": decodeError("BulkAssignMembersToGuardrail404", BulkAssignMembersToGuardrail404),
33571 "500": decodeError("BulkAssignMembersToGuardrail500", BulkAssignMembersToGuardrail500),
33572 orElse: unexpectedStatus
33573 }))
33574 ),
33575 "bulkUnassignMembersFromGuardrail": (id, options) =>
33576 HttpClientRequest.post(`/guardrails/${id}/assignments/members/remove`).pipe(
33577 HttpClientRequest.setHeaders({
33578 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33579 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33580 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33581 }),
33582 HttpClientRequest.bodyJsonUnsafe(options.payload),
33583 withResponse(options.config)(HttpClientResponse.matchStatus({
33584 "2xx": decodeSuccess(BulkUnassignMembersFromGuardrail200),
33585 "400": decodeError("BulkUnassignMembersFromGuardrail400", BulkUnassignMembersFromGuardrail400),
33586 "401": decodeError("BulkUnassignMembersFromGuardrail401", BulkUnassignMembersFromGuardrail401),
33587 "404": decodeError("BulkUnassignMembersFromGuardrail404", BulkUnassignMembersFromGuardrail404),
33588 "500": decodeError("BulkUnassignMembersFromGuardrail500", BulkUnassignMembersFromGuardrail500),
33589 orElse: unexpectedStatus
33590 }))
33591 ),
33592 "listKeyAssignments": (options) =>
33593 HttpClientRequest.get(`/guardrails/assignments/keys`).pipe(
33594 HttpClientRequest.setUrlParams({
33595 "offset": options?.params?.["offset"] as any,
33596 "limit": options?.params?.["limit"] as any
33597 }),
33598 HttpClientRequest.setHeaders({
33599 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33600 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33601 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33602 }),
33603 withResponse(options?.config)(HttpClientResponse.matchStatus({
33604 "2xx": decodeSuccess(ListKeyAssignments200),
33605 "401": decodeError("ListKeyAssignments401", ListKeyAssignments401),
33606 "500": decodeError("ListKeyAssignments500", ListKeyAssignments500),
33607 orElse: unexpectedStatus
33608 }))
33609 ),
33610 "listMemberAssignments": (options) =>
33611 HttpClientRequest.get(`/guardrails/assignments/members`).pipe(
33612 HttpClientRequest.setUrlParams({
33613 "offset": options?.params?.["offset"] as any,
33614 "limit": options?.params?.["limit"] as any
33615 }),
33616 HttpClientRequest.setHeaders({
33617 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33618 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33619 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33620 }),
33621 withResponse(options?.config)(HttpClientResponse.matchStatus({
33622 "2xx": decodeSuccess(ListMemberAssignments200),
33623 "401": decodeError("ListMemberAssignments401", ListMemberAssignments401),
33624 "500": decodeError("ListMemberAssignments500", ListMemberAssignments500),
33625 orElse: unexpectedStatus
33626 }))
33627 ),
33628 "createImages": (options) =>
33629 HttpClientRequest.post(`/images`).pipe(
33630 HttpClientRequest.setHeaders({
33631 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33632 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33633 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33634 }),
33635 HttpClientRequest.bodyJsonUnsafe(options.payload),
33636 withResponse(options.config)(HttpClientResponse.matchStatus({
33637 "2xx": decodeSuccess(CreateImages200),
33638 "400": decodeError("CreateImages400", CreateImages400),
33639 "401": decodeError("CreateImages401", CreateImages401),
33640 "402": decodeError("CreateImages402", CreateImages402),
33641 "403": decodeError("CreateImages403", CreateImages403),
33642 "404": decodeError("CreateImages404", CreateImages404),
33643 "413": decodeError("CreateImages413", CreateImages413),
33644 "429": decodeError("CreateImages429", CreateImages429),
33645 "500": decodeError("CreateImages500", CreateImages500),
33646 "502": decodeError("CreateImages502", CreateImages502),
33647 "524": decodeError("CreateImages524", CreateImages524),
33648 "529": decodeError("CreateImages529", CreateImages529),
33649 orElse: unexpectedStatus
33650 }))
33651 ),
33652 "createImagesSse": (options) =>
33653 HttpClientRequest.post(`/images`).pipe(
33654 HttpClientRequest.setHeaders({
33655 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33656 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33657 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33658 }),
33659 HttpClientRequest.bodyJsonUnsafe(options.payload),
33660 sseRequest(CreateImages200Sse)
33661 ),
33662 "listImageModels": (options) =>
33663 HttpClientRequest.get(`/images/models`).pipe(
33664 HttpClientRequest.setHeaders({
33665 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33666 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33667 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33668 }),
33669 withResponse(options?.config)(HttpClientResponse.matchStatus({
33670 "2xx": decodeSuccess(ListImageModels200),
33671 "500": decodeError("ListImageModels500", ListImageModels500),
33672 orElse: unexpectedStatus
33673 }))
33674 ),
33675 "listImageModelEndpoints": (author, slug, options) =>
33676 HttpClientRequest.get(`/images/models/${author}/${slug}/endpoints`).pipe(
33677 HttpClientRequest.setHeaders({
33678 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33679 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33680 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33681 }),
33682 withResponse(options?.config)(HttpClientResponse.matchStatus({
33683 "2xx": decodeSuccess(ListImageModelEndpoints200),
33684 "404": decodeError("ListImageModelEndpoints404", ListImageModelEndpoints404),
33685 "500": decodeError("ListImageModelEndpoints500", ListImageModelEndpoints500),
33686 orElse: unexpectedStatus
33687 }))
33688 ),
33689 "getCurrentKey": (options) =>
33690 HttpClientRequest.get(`/key`).pipe(
33691 HttpClientRequest.setHeaders({
33692 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33693 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33694 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33695 }),
33696 withResponse(options?.config)(HttpClientResponse.matchStatus({
33697 "2xx": decodeSuccess(GetCurrentKey200),
33698 "401": decodeError("GetCurrentKey401", GetCurrentKey401),
33699 "500": decodeError("GetCurrentKey500", GetCurrentKey500),
33700 orElse: unexpectedStatus
33701 }))
33702 ),
33703 "list": (options) =>
33704 HttpClientRequest.get(`/keys`).pipe(
33705 HttpClientRequest.setUrlParams({
33706 "include_disabled": options?.params?.["include_disabled"] as any,
33707 "offset": options?.params?.["offset"] as any,
33708 "workspace_id": options?.params?.["workspace_id"] as any
33709 }),
33710 HttpClientRequest.setHeaders({
33711 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33712 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33713 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33714 }),
33715 withResponse(options?.config)(HttpClientResponse.matchStatus({
33716 "2xx": decodeSuccess(List200),
33717 "400": decodeError("List400", List400),
33718 "401": decodeError("List401", List401),
33719 "429": decodeError("List429", List429),
33720 "500": decodeError("List500", List500),
33721 orElse: unexpectedStatus
33722 }))
33723 ),
33724 "createKeys": (options) =>
33725 HttpClientRequest.post(`/keys`).pipe(
33726 HttpClientRequest.setHeaders({
33727 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33728 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33729 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33730 }),
33731 HttpClientRequest.bodyJsonUnsafe(options.payload),
33732 withResponse(options.config)(HttpClientResponse.matchStatus({
33733 "2xx": decodeSuccess(CreateKeys201),
33734 "400": decodeError("CreateKeys400", CreateKeys400),
33735 "401": decodeError("CreateKeys401", CreateKeys401),
33736 "403": decodeError("CreateKeys403", CreateKeys403),
33737 "429": decodeError("CreateKeys429", CreateKeys429),
33738 "500": decodeError("CreateKeys500", CreateKeys500),
33739 orElse: unexpectedStatus
33740 }))
33741 ),
33742 "getKey": (hash, options) =>
33743 HttpClientRequest.get(`/keys/${hash}`).pipe(
33744 HttpClientRequest.setHeaders({
33745 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33746 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33747 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33748 }),
33749 withResponse(options?.config)(HttpClientResponse.matchStatus({
33750 "2xx": decodeSuccess(GetKey200),
33751 "401": decodeError("GetKey401", GetKey401),
33752 "404": decodeError("GetKey404", GetKey404),
33753 "429": decodeError("GetKey429", GetKey429),
33754 "500": decodeError("GetKey500", GetKey500),
33755 orElse: unexpectedStatus
33756 }))
33757 ),
33758 "deleteKeys": (hash, options) =>
33759 HttpClientRequest.delete(`/keys/${hash}`).pipe(
33760 HttpClientRequest.setHeaders({
33761 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33762 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33763 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33764 }),
33765 withResponse(options?.config)(HttpClientResponse.matchStatus({
33766 "2xx": decodeSuccess(DeleteKeys200),
33767 "401": decodeError("DeleteKeys401", DeleteKeys401),
33768 "404": decodeError("DeleteKeys404", DeleteKeys404),
33769 "429": decodeError("DeleteKeys429", DeleteKeys429),
33770 "500": decodeError("DeleteKeys500", DeleteKeys500),
33771 orElse: unexpectedStatus
33772 }))
33773 ),
33774 "updateKeys": (hash, options) =>
33775 HttpClientRequest.patch(`/keys/${hash}`).pipe(
33776 HttpClientRequest.setHeaders({
33777 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33778 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33779 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33780 }),
33781 HttpClientRequest.bodyJsonUnsafe(options.payload),
33782 withResponse(options.config)(HttpClientResponse.matchStatus({
33783 "2xx": decodeSuccess(UpdateKeys200),
33784 "400": decodeError("UpdateKeys400", UpdateKeys400),
33785 "401": decodeError("UpdateKeys401", UpdateKeys401),
33786 "404": decodeError("UpdateKeys404", UpdateKeys404),
33787 "429": decodeError("UpdateKeys429", UpdateKeys429),
33788 "500": decodeError("UpdateKeys500", UpdateKeys500),
33789 orElse: unexpectedStatus
33790 }))
33791 ),
33792 "createMessages": (options) =>
33793 HttpClientRequest.post(`/messages`).pipe(
33794 HttpClientRequest.setHeaders({
33795 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33796 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33797 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined,
33798 "X-OpenRouter-Metadata": options.params?.["X-OpenRouter-Metadata"] ?? undefined
33799 }),
33800 HttpClientRequest.bodyJsonUnsafe(options.payload),
33801 withResponse(options.config)(HttpClientResponse.matchStatus({
33802 "2xx": decodeSuccess(CreateMessages200),
33803 "400": decodeError("CreateMessages400", CreateMessages400),
33804 "401": decodeError("CreateMessages401", CreateMessages401),
33805 "403": decodeError("CreateMessages403", CreateMessages403),
33806 "404": decodeError("CreateMessages404", CreateMessages404),
33807 "429": decodeError("CreateMessages429", CreateMessages429),
33808 "500": decodeError("CreateMessages500", CreateMessages500),
33809 "503": decodeError("CreateMessages503", CreateMessages503),
33810 "529": decodeError("CreateMessages529", CreateMessages529),
33811 orElse: unexpectedStatus
33812 }))
33813 ),
33814 "createMessagesSse": (options) =>
33815 HttpClientRequest.post(`/messages`).pipe(
33816 HttpClientRequest.setHeaders({
33817 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33818 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33819 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined,
33820 "X-OpenRouter-Metadata": options.params?.["X-OpenRouter-Metadata"] ?? undefined
33821 }),
33822 HttpClientRequest.bodyJsonUnsafe(options.payload),
33823 sseRequest(CreateMessages200Sse)
33824 ),
33825 "getModel": (author, slug, options) =>
33826 HttpClientRequest.get(`/model/${author}/${slug}`).pipe(
33827 HttpClientRequest.setHeaders({
33828 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33829 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33830 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33831 }),
33832 withResponse(options?.config)(HttpClientResponse.matchStatus({
33833 "2xx": decodeSuccess(GetModel200),
33834 "403": decodeError("GetModel403", GetModel403),
33835 "404": decodeError("GetModel404", GetModel404),
33836 "500": decodeError("GetModel500", GetModel500),
33837 orElse: unexpectedStatus
33838 }))
33839 ),
33840 "getModels": (options) =>
33841 HttpClientRequest.get(`/models`).pipe(
33842 HttpClientRequest.setUrlParams({
33843 "offset": options?.params?.["offset"] as any,
33844 "limit": options?.params?.["limit"] as any,
33845 "category": options?.params?.["category"] as any,
33846 "supported_parameters": options?.params?.["supported_parameters"] as any,
33847 "output_modalities": options?.params?.["output_modalities"] as any,
33848 "sort": options?.params?.["sort"] as any,
33849 "q": options?.params?.["q"] as any,
33850 "input_modalities": options?.params?.["input_modalities"] as any,
33851 "context": options?.params?.["context"] as any,
33852 "min_price": options?.params?.["min_price"] as any,
33853 "max_price": options?.params?.["max_price"] as any,
33854 "arch": options?.params?.["arch"] as any,
33855 "model_authors": options?.params?.["model_authors"] as any,
33856 "providers": options?.params?.["providers"] as any,
33857 "distillable": options?.params?.["distillable"] as any,
33858 "zdr": options?.params?.["zdr"] as any,
33859 "region": options?.params?.["region"] as any,
33860 "min_output_price": options?.params?.["min_output_price"] as any,
33861 "max_output_price": options?.params?.["max_output_price"] as any,
33862 "min_age_days": options?.params?.["min_age_days"] as any,
33863 "max_age_days": options?.params?.["max_age_days"] as any,
33864 "min_intelligence_index": options?.params?.["min_intelligence_index"] as any,
33865 "max_intelligence_index": options?.params?.["max_intelligence_index"] as any,
33866 "min_coding_index": options?.params?.["min_coding_index"] as any,
33867 "max_coding_index": options?.params?.["max_coding_index"] as any,
33868 "min_agentic_index": options?.params?.["min_agentic_index"] as any,
33869 "max_agentic_index": options?.params?.["max_agentic_index"] as any,
33870 "min_tool_success_rate": options?.params?.["min_tool_success_rate"] as any,
33871 "max_tool_success_rate": options?.params?.["max_tool_success_rate"] as any
33872 }),
33873 HttpClientRequest.setHeaders({
33874 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33875 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33876 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33877 }),
33878 withResponse(options?.config)(HttpClientResponse.matchStatus({
33879 "2xx": decodeSuccess(GetModels200),
33880 "400": decodeError("GetModels400", GetModels400),
33881 "403": decodeError("GetModels403", GetModels403),
33882 "500": decodeError("GetModels500", GetModels500),
33883 orElse: unexpectedStatus
33884 }))
33885 ),
33886 "listEndpoints": (author, slug, options) =>
33887 HttpClientRequest.get(`/models/${author}/${slug}/endpoints`).pipe(
33888 HttpClientRequest.setHeaders({
33889 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33890 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33891 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33892 }),
33893 withResponse(options?.config)(HttpClientResponse.matchStatus({
33894 "2xx": decodeSuccess(ListEndpoints200),
33895 "403": decodeError("ListEndpoints403", ListEndpoints403),
33896 "404": decodeError("ListEndpoints404", ListEndpoints404),
33897 "500": decodeError("ListEndpoints500", ListEndpoints500),
33898 orElse: unexpectedStatus
33899 }))
33900 ),
33901 "listModelsCount": (options) =>
33902 HttpClientRequest.get(`/models/count`).pipe(
33903 HttpClientRequest.setUrlParams({ "output_modalities": options?.params?.["output_modalities"] as any }),
33904 HttpClientRequest.setHeaders({
33905 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33906 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33907 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33908 }),
33909 withResponse(options?.config)(HttpClientResponse.matchStatus({
33910 "2xx": decodeSuccess(ListModelsCount200),
33911 "400": decodeError("ListModelsCount400", ListModelsCount400),
33912 "403": decodeError("ListModelsCount403", ListModelsCount403),
33913 "500": decodeError("ListModelsCount500", ListModelsCount500),
33914 orElse: unexpectedStatus
33915 }))
33916 ),
33917 "listModelsUser": (options) =>
33918 HttpClientRequest.get(`/models/user`).pipe(
33919 HttpClientRequest.setUrlParams({
33920 "offset": options?.params?.["offset"] as any,
33921 "limit": options?.params?.["limit"] as any
33922 }),
33923 HttpClientRequest.setHeaders({
33924 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33925 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33926 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33927 }),
33928 withResponse(options?.config)(HttpClientResponse.matchStatus({
33929 "2xx": decodeSuccess(ListModelsUser200),
33930 "401": decodeError("ListModelsUser401", ListModelsUser401),
33931 "403": decodeError("ListModelsUser403", ListModelsUser403),
33932 "404": decodeError("ListModelsUser404", ListModelsUser404),
33933 "500": decodeError("ListModelsUser500", ListModelsUser500),
33934 orElse: unexpectedStatus
33935 }))
33936 ),
33937 "listObservabilityDestinations": (options) =>
33938 HttpClientRequest.get(`/observability/destinations`).pipe(
33939 HttpClientRequest.setUrlParams({
33940 "offset": options?.params?.["offset"] as any,
33941 "limit": options?.params?.["limit"] as any,
33942 "workspace_id": options?.params?.["workspace_id"] as any
33943 }),
33944 HttpClientRequest.setHeaders({
33945 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33946 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33947 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33948 }),
33949 withResponse(options?.config)(HttpClientResponse.matchStatus({
33950 "2xx": decodeSuccess(ListObservabilityDestinations200),
33951 "400": decodeError("ListObservabilityDestinations400", ListObservabilityDestinations400),
33952 "401": decodeError("ListObservabilityDestinations401", ListObservabilityDestinations401),
33953 "500": decodeError("ListObservabilityDestinations500", ListObservabilityDestinations500),
33954 orElse: unexpectedStatus
33955 }))
33956 ),
33957 "createObservabilityDestination": (options) =>
33958 HttpClientRequest.post(`/observability/destinations`).pipe(
33959 HttpClientRequest.setHeaders({
33960 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
33961 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
33962 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
33963 }),
33964 HttpClientRequest.bodyJsonUnsafe(options.payload),
33965 withResponse(options.config)(HttpClientResponse.matchStatus({
33966 "2xx": decodeSuccess(CreateObservabilityDestination201),
33967 "400": decodeError("CreateObservabilityDestination400", CreateObservabilityDestination400),
33968 "401": decodeError("CreateObservabilityDestination401", CreateObservabilityDestination401),
33969 "403": decodeError("CreateObservabilityDestination403", CreateObservabilityDestination403),
33970 "409": decodeError("CreateObservabilityDestination409", CreateObservabilityDestination409),
33971 "500": decodeError("CreateObservabilityDestination500", CreateObservabilityDestination500),
33972 orElse: unexpectedStatus
33973 }))
33974 ),
33975 "getObservabilityDestination": (id, options) =>
33976 HttpClientRequest.get(`/observability/destinations/${id}`).pipe(
33977 HttpClientRequest.setHeaders({
33978 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33979 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33980 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33981 }),
33982 withResponse(options?.config)(HttpClientResponse.matchStatus({
33983 "2xx": decodeSuccess(GetObservabilityDestination200),
33984 "401": decodeError("GetObservabilityDestination401", GetObservabilityDestination401),
33985 "404": decodeError("GetObservabilityDestination404", GetObservabilityDestination404),
33986 "500": decodeError("GetObservabilityDestination500", GetObservabilityDestination500),
33987 orElse: unexpectedStatus
33988 }))
33989 ),
33990 "deleteObservabilityDestination": (id, options) =>
33991 HttpClientRequest.delete(`/observability/destinations/${id}`).pipe(
33992 HttpClientRequest.setHeaders({
33993 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
33994 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
33995 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
33996 }),
33997 withResponse(options?.config)(HttpClientResponse.matchStatus({
33998 "2xx": decodeSuccess(DeleteObservabilityDestination200),
33999 "401": decodeError("DeleteObservabilityDestination401", DeleteObservabilityDestination401),
34000 "404": decodeError("DeleteObservabilityDestination404", DeleteObservabilityDestination404),
34001 "500": decodeError("DeleteObservabilityDestination500", DeleteObservabilityDestination500),
34002 orElse: unexpectedStatus
34003 }))
34004 ),
34005 "updateObservabilityDestination": (id, options) =>
34006 HttpClientRequest.patch(`/observability/destinations/${id}`).pipe(
34007 HttpClientRequest.setHeaders({
34008 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34009 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34010 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34011 }),
34012 HttpClientRequest.bodyJsonUnsafe(options.payload),
34013 withResponse(options.config)(HttpClientResponse.matchStatus({
34014 "2xx": decodeSuccess(UpdateObservabilityDestination200),
34015 "400": decodeError("UpdateObservabilityDestination400", UpdateObservabilityDestination400),
34016 "401": decodeError("UpdateObservabilityDestination401", UpdateObservabilityDestination401),
34017 "404": decodeError("UpdateObservabilityDestination404", UpdateObservabilityDestination404),
34018 "409": decodeError("UpdateObservabilityDestination409", UpdateObservabilityDestination409),
34019 "500": decodeError("UpdateObservabilityDestination500", UpdateObservabilityDestination500),
34020 orElse: unexpectedStatus
34021 }))
34022 ),
34023 "listOrganizationMembers": (options) =>
34024 HttpClientRequest.get(`/organization/members`).pipe(
34025 HttpClientRequest.setUrlParams({
34026 "offset": options?.params?.["offset"] as any,
34027 "limit": options?.params?.["limit"] as any
34028 }),
34029 HttpClientRequest.setHeaders({
34030 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34031 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34032 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34033 }),
34034 withResponse(options?.config)(HttpClientResponse.matchStatus({
34035 "2xx": decodeSuccess(ListOrganizationMembers200),
34036 "401": decodeError("ListOrganizationMembers401", ListOrganizationMembers401),
34037 "404": decodeError("ListOrganizationMembers404", ListOrganizationMembers404),
34038 "500": decodeError("ListOrganizationMembers500", ListOrganizationMembers500),
34039 orElse: unexpectedStatus
34040 }))
34041 ),
34042 "listPresets": (options) =>
34043 HttpClientRequest.get(`/presets`).pipe(
34044 HttpClientRequest.setUrlParams({
34045 "offset": options?.params?.["offset"] as any,
34046 "limit": options?.params?.["limit"] as any
34047 }),
34048 HttpClientRequest.setHeaders({
34049 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34050 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34051 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34052 }),
34053 withResponse(options?.config)(HttpClientResponse.matchStatus({
34054 "2xx": decodeSuccess(ListPresets200),
34055 "400": decodeError("ListPresets400", ListPresets400),
34056 "401": decodeError("ListPresets401", ListPresets401),
34057 "500": decodeError("ListPresets500", ListPresets500),
34058 orElse: unexpectedStatus
34059 }))
34060 ),
34061 "getPreset": (slug, options) =>
34062 HttpClientRequest.get(`/presets/${slug}`).pipe(
34063 HttpClientRequest.setHeaders({
34064 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34065 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34066 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34067 }),
34068 withResponse(options?.config)(HttpClientResponse.matchStatus({
34069 "2xx": decodeSuccess(GetPreset200),
34070 "400": decodeError("GetPreset400", GetPreset400),
34071 "401": decodeError("GetPreset401", GetPreset401),
34072 "404": decodeError("GetPreset404", GetPreset404),
34073 "500": decodeError("GetPreset500", GetPreset500),
34074 orElse: unexpectedStatus
34075 }))
34076 ),
34077 "createPresetsChatCompletions": (slug, options) =>
34078 HttpClientRequest.post(`/presets/${slug}/chat/completions`).pipe(
34079 HttpClientRequest.setHeaders({
34080 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34081 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34082 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34083 }),
34084 HttpClientRequest.bodyJsonUnsafe(options.payload),
34085 withResponse(options.config)(HttpClientResponse.matchStatus({
34086 "2xx": decodeSuccess(CreatePresetsChatCompletions200),
34087 "400": decodeError("CreatePresetsChatCompletions400", CreatePresetsChatCompletions400),
34088 "401": decodeError("CreatePresetsChatCompletions401", CreatePresetsChatCompletions401),
34089 "403": decodeError("CreatePresetsChatCompletions403", CreatePresetsChatCompletions403),
34090 "404": decodeError("CreatePresetsChatCompletions404", CreatePresetsChatCompletions404),
34091 "409": decodeError("CreatePresetsChatCompletions409", CreatePresetsChatCompletions409),
34092 "500": decodeError("CreatePresetsChatCompletions500", CreatePresetsChatCompletions500),
34093 orElse: unexpectedStatus
34094 }))
34095 ),
34096 "createPresetsMessages": (slug, options) =>
34097 HttpClientRequest.post(`/presets/${slug}/messages`).pipe(
34098 HttpClientRequest.setHeaders({
34099 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34100 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34101 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34102 }),
34103 HttpClientRequest.bodyJsonUnsafe(options.payload),
34104 withResponse(options.config)(HttpClientResponse.matchStatus({
34105 "2xx": decodeSuccess(CreatePresetsMessages200),
34106 "400": decodeError("CreatePresetsMessages400", CreatePresetsMessages400),
34107 "401": decodeError("CreatePresetsMessages401", CreatePresetsMessages401),
34108 "403": decodeError("CreatePresetsMessages403", CreatePresetsMessages403),
34109 "404": decodeError("CreatePresetsMessages404", CreatePresetsMessages404),
34110 "409": decodeError("CreatePresetsMessages409", CreatePresetsMessages409),
34111 "500": decodeError("CreatePresetsMessages500", CreatePresetsMessages500),
34112 orElse: unexpectedStatus
34113 }))
34114 ),
34115 "createPresetsResponses": (slug, options) =>
34116 HttpClientRequest.post(`/presets/${slug}/responses`).pipe(
34117 HttpClientRequest.setHeaders({
34118 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34119 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34120 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34121 }),
34122 HttpClientRequest.bodyJsonUnsafe(options.payload),
34123 withResponse(options.config)(HttpClientResponse.matchStatus({
34124 "2xx": decodeSuccess(CreatePresetsResponses200),
34125 "400": decodeError("CreatePresetsResponses400", CreatePresetsResponses400),
34126 "401": decodeError("CreatePresetsResponses401", CreatePresetsResponses401),
34127 "403": decodeError("CreatePresetsResponses403", CreatePresetsResponses403),
34128 "404": decodeError("CreatePresetsResponses404", CreatePresetsResponses404),
34129 "409": decodeError("CreatePresetsResponses409", CreatePresetsResponses409),
34130 "500": decodeError("CreatePresetsResponses500", CreatePresetsResponses500),
34131 orElse: unexpectedStatus
34132 }))
34133 ),
34134 "listPresetVersions": (slug, options) =>
34135 HttpClientRequest.get(`/presets/${slug}/versions`).pipe(
34136 HttpClientRequest.setUrlParams({
34137 "offset": options?.params?.["offset"] as any,
34138 "limit": options?.params?.["limit"] as any
34139 }),
34140 HttpClientRequest.setHeaders({
34141 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34142 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34143 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34144 }),
34145 withResponse(options?.config)(HttpClientResponse.matchStatus({
34146 "2xx": decodeSuccess(ListPresetVersions200),
34147 "400": decodeError("ListPresetVersions400", ListPresetVersions400),
34148 "401": decodeError("ListPresetVersions401", ListPresetVersions401),
34149 "404": decodeError("ListPresetVersions404", ListPresetVersions404),
34150 "500": decodeError("ListPresetVersions500", ListPresetVersions500),
34151 orElse: unexpectedStatus
34152 }))
34153 ),
34154 "getPresetVersion": (slug, version, options) =>
34155 HttpClientRequest.get(`/presets/${slug}/versions/${version}`).pipe(
34156 HttpClientRequest.setHeaders({
34157 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34158 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34159 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34160 }),
34161 withResponse(options?.config)(HttpClientResponse.matchStatus({
34162 "2xx": decodeSuccess(GetPresetVersion200),
34163 "400": decodeError("GetPresetVersion400", GetPresetVersion400),
34164 "401": decodeError("GetPresetVersion401", GetPresetVersion401),
34165 "404": decodeError("GetPresetVersion404", GetPresetVersion404),
34166 "500": decodeError("GetPresetVersion500", GetPresetVersion500),
34167 orElse: unexpectedStatus
34168 }))
34169 ),
34170 "listProviders": (options) =>
34171 HttpClientRequest.get(`/providers`).pipe(
34172 HttpClientRequest.setHeaders({
34173 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34174 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34175 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34176 }),
34177 withResponse(options?.config)(HttpClientResponse.matchStatus({
34178 "2xx": decodeSuccess(ListProviders200),
34179 "500": decodeError("ListProviders500", ListProviders500),
34180 orElse: unexpectedStatus
34181 }))
34182 ),
34183 "createRerank": (options) =>
34184 HttpClientRequest.post(`/rerank`).pipe(
34185 HttpClientRequest.setHeaders({
34186 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34187 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34188 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34189 }),
34190 HttpClientRequest.bodyJsonUnsafe(options.payload),
34191 withResponse(options.config)(HttpClientResponse.matchStatus({
34192 "2xx": decodeSuccess(CreateRerank200),
34193 "400": decodeError("CreateRerank400", CreateRerank400),
34194 "401": decodeError("CreateRerank401", CreateRerank401),
34195 "402": decodeError("CreateRerank402", CreateRerank402),
34196 "404": decodeError("CreateRerank404", CreateRerank404),
34197 "429": decodeError("CreateRerank429", CreateRerank429),
34198 "500": decodeError("CreateRerank500", CreateRerank500),
34199 "502": decodeError("CreateRerank502", CreateRerank502),
34200 "503": decodeError("CreateRerank503", CreateRerank503),
34201 "524": decodeError("CreateRerank524", CreateRerank524),
34202 "529": decodeError("CreateRerank529", CreateRerank529),
34203 orElse: unexpectedStatus
34204 }))
34205 ),
34206 "createRerankSse": (options) =>
34207 HttpClientRequest.post(`/rerank`).pipe(
34208 HttpClientRequest.setHeaders({
34209 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34210 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34211 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34212 }),
34213 HttpClientRequest.bodyJsonUnsafe(options.payload),
34214 sseRequest(CreateRerank200Sse)
34215 ),
34216 "createResponses": (options) =>
34217 HttpClientRequest.post(`/responses`).pipe(
34218 HttpClientRequest.setHeaders({
34219 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34220 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34221 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined,
34222 "X-OpenRouter-Metadata": options.params?.["X-OpenRouter-Metadata"] ?? undefined
34223 }),
34224 HttpClientRequest.bodyJsonUnsafe(options.payload),
34225 withResponse(options.config)(HttpClientResponse.matchStatus({
34226 "2xx": decodeSuccess(CreateResponses200),
34227 "400": decodeError("CreateResponses400", CreateResponses400),
34228 "401": decodeError("CreateResponses401", CreateResponses401),
34229 "402": decodeError("CreateResponses402", CreateResponses402),
34230 "403": decodeError("CreateResponses403", CreateResponses403),
34231 "404": decodeError("CreateResponses404", CreateResponses404),
34232 "408": decodeError("CreateResponses408", CreateResponses408),
34233 "413": decodeError("CreateResponses413", CreateResponses413),
34234 "422": decodeError("CreateResponses422", CreateResponses422),
34235 "429": decodeError("CreateResponses429", CreateResponses429),
34236 "500": decodeError("CreateResponses500", CreateResponses500),
34237 "502": decodeError("CreateResponses502", CreateResponses502),
34238 "503": decodeError("CreateResponses503", CreateResponses503),
34239 "524": decodeError("CreateResponses524", CreateResponses524),
34240 "529": decodeError("CreateResponses529", CreateResponses529),
34241 orElse: unexpectedStatus
34242 }))
34243 ),
34244 "createResponsesSse": (options) =>
34245 HttpClientRequest.post(`/responses`).pipe(
34246 HttpClientRequest.setHeaders({
34247 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34248 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34249 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined,
34250 "X-OpenRouter-Metadata": options.params?.["X-OpenRouter-Metadata"] ?? undefined
34251 }),
34252 HttpClientRequest.bodyJsonUnsafe(options.payload),
34253 sseRequest(CreateResponses200Sse)
34254 ),
34255 "createVideos": (options) =>
34256 HttpClientRequest.post(`/videos`).pipe(
34257 HttpClientRequest.setHeaders({
34258 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34259 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34260 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34261 }),
34262 HttpClientRequest.bodyJsonUnsafe(options.payload),
34263 withResponse(options.config)(HttpClientResponse.matchStatus({
34264 "2xx": decodeSuccess(CreateVideos202),
34265 "400": decodeError("CreateVideos400", CreateVideos400),
34266 "401": decodeError("CreateVideos401", CreateVideos401),
34267 "402": decodeError("CreateVideos402", CreateVideos402),
34268 "404": decodeError("CreateVideos404", CreateVideos404),
34269 "429": decodeError("CreateVideos429", CreateVideos429),
34270 "500": decodeError("CreateVideos500", CreateVideos500),
34271 orElse: unexpectedStatus
34272 }))
34273 ),
34274 "getVideos": (jobId, options) =>
34275 HttpClientRequest.get(`/videos/${jobId}`).pipe(
34276 HttpClientRequest.setHeaders({
34277 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34278 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34279 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34280 }),
34281 withResponse(options?.config)(HttpClientResponse.matchStatus({
34282 "2xx": decodeSuccess(GetVideos200),
34283 "401": decodeError("GetVideos401", GetVideos401),
34284 "404": decodeError("GetVideos404", GetVideos404),
34285 "500": decodeError("GetVideos500", GetVideos500),
34286 orElse: unexpectedStatus
34287 }))
34288 ),
34289 "listVideosContent": (jobId, options) =>
34290 HttpClientRequest.get(`/videos/${jobId}/content`).pipe(
34291 HttpClientRequest.setUrlParams({ "index": options?.params?.["index"] as any }),
34292 HttpClientRequest.setHeaders({
34293 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34294 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34295 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34296 }),
34297 withResponse(options?.config)(HttpClientResponse.matchStatus({
34298 "400": decodeError("ListVideosContent400", ListVideosContent400),
34299 "401": decodeError("ListVideosContent401", ListVideosContent401),
34300 "404": decodeError("ListVideosContent404", ListVideosContent404),
34301 "500": decodeError("ListVideosContent500", ListVideosContent500),
34302 "502": decodeError("ListVideosContent502", ListVideosContent502),
34303 orElse: unexpectedStatus
34304 }))
34305 ),
34306 "listVideosModels": (options) =>
34307 HttpClientRequest.get(`/videos/models`).pipe(
34308 HttpClientRequest.setHeaders({
34309 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34310 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34311 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34312 }),
34313 withResponse(options?.config)(HttpClientResponse.matchStatus({
34314 "2xx": decodeSuccess(ListVideosModels200),
34315 "400": decodeError("ListVideosModels400", ListVideosModels400),
34316 "500": decodeError("ListVideosModels500", ListVideosModels500),
34317 orElse: unexpectedStatus
34318 }))
34319 ),
34320 "listWorkspaces": (options) =>
34321 HttpClientRequest.get(`/workspaces`).pipe(
34322 HttpClientRequest.setUrlParams({
34323 "offset": options?.params?.["offset"] as any,
34324 "limit": options?.params?.["limit"] as any
34325 }),
34326 HttpClientRequest.setHeaders({
34327 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34328 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34329 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34330 }),
34331 withResponse(options?.config)(HttpClientResponse.matchStatus({
34332 "2xx": decodeSuccess(ListWorkspaces200),
34333 "401": decodeError("ListWorkspaces401", ListWorkspaces401),
34334 "500": decodeError("ListWorkspaces500", ListWorkspaces500),
34335 orElse: unexpectedStatus
34336 }))
34337 ),
34338 "createWorkspace": (options) =>
34339 HttpClientRequest.post(`/workspaces`).pipe(
34340 HttpClientRequest.setHeaders({
34341 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34342 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34343 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34344 }),
34345 HttpClientRequest.bodyJsonUnsafe(options.payload),
34346 withResponse(options.config)(HttpClientResponse.matchStatus({
34347 "2xx": decodeSuccess(CreateWorkspace201),
34348 "400": decodeError("CreateWorkspace400", CreateWorkspace400),
34349 "401": decodeError("CreateWorkspace401", CreateWorkspace401),
34350 "403": decodeError("CreateWorkspace403", CreateWorkspace403),
34351 "500": decodeError("CreateWorkspace500", CreateWorkspace500),
34352 orElse: unexpectedStatus
34353 }))
34354 ),
34355 "getWorkspace": (id, options) =>
34356 HttpClientRequest.get(`/workspaces/${id}`).pipe(
34357 HttpClientRequest.setHeaders({
34358 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34359 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34360 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34361 }),
34362 withResponse(options?.config)(HttpClientResponse.matchStatus({
34363 "2xx": decodeSuccess(GetWorkspace200),
34364 "401": decodeError("GetWorkspace401", GetWorkspace401),
34365 "404": decodeError("GetWorkspace404", GetWorkspace404),
34366 "500": decodeError("GetWorkspace500", GetWorkspace500),
34367 orElse: unexpectedStatus
34368 }))
34369 ),
34370 "deleteWorkspace": (id, options) =>
34371 HttpClientRequest.delete(`/workspaces/${id}`).pipe(
34372 HttpClientRequest.setHeaders({
34373 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34374 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34375 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34376 }),
34377 withResponse(options?.config)(HttpClientResponse.matchStatus({
34378 "2xx": decodeSuccess(DeleteWorkspace200),
34379 "400": decodeError("DeleteWorkspace400", DeleteWorkspace400),
34380 "401": decodeError("DeleteWorkspace401", DeleteWorkspace401),
34381 "403": decodeError("DeleteWorkspace403", DeleteWorkspace403),
34382 "404": decodeError("DeleteWorkspace404", DeleteWorkspace404),
34383 "500": decodeError("DeleteWorkspace500", DeleteWorkspace500),
34384 orElse: unexpectedStatus
34385 }))
34386 ),
34387 "updateWorkspace": (id, options) =>
34388 HttpClientRequest.patch(`/workspaces/${id}`).pipe(
34389 HttpClientRequest.setHeaders({
34390 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34391 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34392 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34393 }),
34394 HttpClientRequest.bodyJsonUnsafe(options.payload),
34395 withResponse(options.config)(HttpClientResponse.matchStatus({
34396 "2xx": decodeSuccess(UpdateWorkspace200),
34397 "400": decodeError("UpdateWorkspace400", UpdateWorkspace400),
34398 "401": decodeError("UpdateWorkspace401", UpdateWorkspace401),
34399 "403": decodeError("UpdateWorkspace403", UpdateWorkspace403),
34400 "404": decodeError("UpdateWorkspace404", UpdateWorkspace404),
34401 "500": decodeError("UpdateWorkspace500", UpdateWorkspace500),
34402 orElse: unexpectedStatus
34403 }))
34404 ),
34405 "listWorkspaceBudgets": (id, options) =>
34406 HttpClientRequest.get(`/workspaces/${id}/budgets`).pipe(
34407 HttpClientRequest.setHeaders({
34408 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34409 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34410 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34411 }),
34412 withResponse(options?.config)(HttpClientResponse.matchStatus({
34413 "2xx": decodeSuccess(ListWorkspaceBudgets200),
34414 "401": decodeError("ListWorkspaceBudgets401", ListWorkspaceBudgets401),
34415 "404": decodeError("ListWorkspaceBudgets404", ListWorkspaceBudgets404),
34416 "500": decodeError("ListWorkspaceBudgets500", ListWorkspaceBudgets500),
34417 orElse: unexpectedStatus
34418 }))
34419 ),
34420 "upsertWorkspaceBudget": (id, interval, options) =>
34421 HttpClientRequest.put(`/workspaces/${id}/budgets/${interval}`).pipe(
34422 HttpClientRequest.setHeaders({
34423 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34424 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34425 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34426 }),
34427 HttpClientRequest.bodyJsonUnsafe(options.payload),
34428 withResponse(options.config)(HttpClientResponse.matchStatus({
34429 "2xx": decodeSuccess(UpsertWorkspaceBudget200),
34430 "400": decodeError("UpsertWorkspaceBudget400", UpsertWorkspaceBudget400),
34431 "401": decodeError("UpsertWorkspaceBudget401", UpsertWorkspaceBudget401),
34432 "404": decodeError("UpsertWorkspaceBudget404", UpsertWorkspaceBudget404),
34433 "500": decodeError("UpsertWorkspaceBudget500", UpsertWorkspaceBudget500),
34434 orElse: unexpectedStatus
34435 }))
34436 ),
34437 "deleteWorkspaceBudget": (id, interval, options) =>
34438 HttpClientRequest.delete(`/workspaces/${id}/budgets/${interval}`).pipe(
34439 HttpClientRequest.setHeaders({
34440 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34441 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34442 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34443 }),
34444 withResponse(options?.config)(HttpClientResponse.matchStatus({
34445 "2xx": decodeSuccess(DeleteWorkspaceBudget200),
34446 "401": decodeError("DeleteWorkspaceBudget401", DeleteWorkspaceBudget401),
34447 "404": decodeError("DeleteWorkspaceBudget404", DeleteWorkspaceBudget404),
34448 "500": decodeError("DeleteWorkspaceBudget500", DeleteWorkspaceBudget500),
34449 orElse: unexpectedStatus
34450 }))
34451 ),
34452 "listWorkspaceMembers": (id, options) =>
34453 HttpClientRequest.get(`/workspaces/${id}/members`).pipe(
34454 HttpClientRequest.setUrlParams({
34455 "offset": options?.params?.["offset"] as any,
34456 "limit": options?.params?.["limit"] as any
34457 }),
34458 HttpClientRequest.setHeaders({
34459 "HTTP-Referer": options?.params?.["HTTP-Referer"] ?? undefined,
34460 "X-OpenRouter-Title": options?.params?.["X-OpenRouter-Title"] ?? undefined,
34461 "X-OpenRouter-Categories": options?.params?.["X-OpenRouter-Categories"] ?? undefined
34462 }),
34463 withResponse(options?.config)(HttpClientResponse.matchStatus({
34464 "2xx": decodeSuccess(ListWorkspaceMembers200),
34465 "401": decodeError("ListWorkspaceMembers401", ListWorkspaceMembers401),
34466 "403": decodeError("ListWorkspaceMembers403", ListWorkspaceMembers403),
34467 "404": decodeError("ListWorkspaceMembers404", ListWorkspaceMembers404),
34468 "500": decodeError("ListWorkspaceMembers500", ListWorkspaceMembers500),
34469 orElse: unexpectedStatus
34470 }))
34471 ),
34472 "bulkAddWorkspaceMembers": (id, options) =>
34473 HttpClientRequest.post(`/workspaces/${id}/members/add`).pipe(
34474 HttpClientRequest.setHeaders({
34475 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34476 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34477 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34478 }),
34479 HttpClientRequest.bodyJsonUnsafe(options.payload),
34480 withResponse(options.config)(HttpClientResponse.matchStatus({
34481 "2xx": decodeSuccess(BulkAddWorkspaceMembers200),
34482 "400": decodeError("BulkAddWorkspaceMembers400", BulkAddWorkspaceMembers400),
34483 "401": decodeError("BulkAddWorkspaceMembers401", BulkAddWorkspaceMembers401),
34484 "403": decodeError("BulkAddWorkspaceMembers403", BulkAddWorkspaceMembers403),
34485 "404": decodeError("BulkAddWorkspaceMembers404", BulkAddWorkspaceMembers404),
34486 "500": decodeError("BulkAddWorkspaceMembers500", BulkAddWorkspaceMembers500),
34487 orElse: unexpectedStatus
34488 }))
34489 ),
34490 "bulkRemoveWorkspaceMembers": (id, options) =>
34491 HttpClientRequest.post(`/workspaces/${id}/members/remove`).pipe(
34492 HttpClientRequest.setHeaders({
34493 "HTTP-Referer": options.params?.["HTTP-Referer"] ?? undefined,
34494 "X-OpenRouter-Title": options.params?.["X-OpenRouter-Title"] ?? undefined,
34495 "X-OpenRouter-Categories": options.params?.["X-OpenRouter-Categories"] ?? undefined
34496 }),
34497 HttpClientRequest.bodyJsonUnsafe(options.payload),
34498 withResponse(options.config)(HttpClientResponse.matchStatus({
34499 "2xx": decodeSuccess(BulkRemoveWorkspaceMembers200),
34500 "400": decodeError("BulkRemoveWorkspaceMembers400", BulkRemoveWorkspaceMembers400),
34501 "401": decodeError("BulkRemoveWorkspaceMembers401", BulkRemoveWorkspaceMembers401),
34502 "403": decodeError("BulkRemoveWorkspaceMembers403", BulkRemoveWorkspaceMembers403),
34503 "404": decodeError("BulkRemoveWorkspaceMembers404", BulkRemoveWorkspaceMembers404),
34504 "500": decodeError("BulkRemoveWorkspaceMembers500", BulkRemoveWorkspaceMembers500),
34505 orElse: unexpectedStatus
34506 }))
34507 )
34508 }
34509}
34510
34511export interface OpenRouterClient {
34512 readonly httpClient: HttpClient.HttpClient
34513 /**
34514 * Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Management key](/docs/guides/overview/auth/management-api-keys) required.
34515 */
34516 readonly "getUserActivity": <Config extends OperationConfig>(
34517 options: {
34518 readonly params?: typeof GetUserActivityParams.Encoded | undefined
34519 readonly config?: Config | undefined
34520 } | undefined
34521 ) => Effect.Effect<
34522 WithOptionalResponse<typeof GetUserActivity200.Type, Config>,
34523 | HttpClientError.HttpClientError
34524 | SchemaError
34525 | OpenRouterClientError<"GetUserActivity400", typeof GetUserActivity400.Type>
34526 | OpenRouterClientError<"GetUserActivity401", typeof GetUserActivity401.Type>
34527 | OpenRouterClientError<"GetUserActivity403", typeof GetUserActivity403.Type>
34528 | OpenRouterClientError<"GetUserActivity404", typeof GetUserActivity404.Type>
34529 | OpenRouterClientError<"GetUserActivity500", typeof GetUserActivity500.Type>
34530 >
34531 /**
34532 * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
34533 */
34534 readonly "getAnalyticsMeta": <Config extends OperationConfig>(
34535 options: {
34536 readonly params?: typeof GetAnalyticsMetaParams.Encoded | undefined
34537 readonly config?: Config | undefined
34538 } | undefined
34539 ) => Effect.Effect<
34540 WithOptionalResponse<typeof GetAnalyticsMeta200.Type, Config>,
34541 | HttpClientError.HttpClientError
34542 | SchemaError
34543 | OpenRouterClientError<"GetAnalyticsMeta401", typeof GetAnalyticsMeta401.Type>
34544 | OpenRouterClientError<"GetAnalyticsMeta403", typeof GetAnalyticsMeta403.Type>
34545 | OpenRouterClientError<"GetAnalyticsMeta500", typeof GetAnalyticsMeta500.Type>
34546 >
34547 /**
34548 * Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
34549 */
34550 readonly "queryAnalytics": <Config extends OperationConfig>(
34551 options: {
34552 readonly params?: typeof QueryAnalyticsParams.Encoded | undefined
34553 readonly payload: typeof QueryAnalyticsRequestJson.Encoded
34554 readonly config?: Config | undefined
34555 }
34556 ) => Effect.Effect<
34557 WithOptionalResponse<typeof QueryAnalytics200.Type, Config>,
34558 | HttpClientError.HttpClientError
34559 | SchemaError
34560 | OpenRouterClientError<"QueryAnalytics400", typeof QueryAnalytics400.Type>
34561 | OpenRouterClientError<"QueryAnalytics401", typeof QueryAnalytics401.Type>
34562 | OpenRouterClientError<"QueryAnalytics403", typeof QueryAnalytics403.Type>
34563 | OpenRouterClientError<"QueryAnalytics408", typeof QueryAnalytics408.Type>
34564 | OpenRouterClientError<"QueryAnalytics500", typeof QueryAnalytics500.Type>
34565 >
34566 /**
34567 * Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
34568 */
34569 readonly "createAudioSpeech": <Config extends OperationConfig>(
34570 options: {
34571 readonly params?: typeof CreateAudioSpeechParams.Encoded | undefined
34572 readonly payload: typeof CreateAudioSpeechRequestJson.Encoded
34573 readonly config?: Config | undefined
34574 }
34575 ) => Effect.Effect<
34576 WithOptionalResponse<void, Config>,
34577 | HttpClientError.HttpClientError
34578 | SchemaError
34579 | OpenRouterClientError<"CreateAudioSpeech400", typeof CreateAudioSpeech400.Type>
34580 | OpenRouterClientError<"CreateAudioSpeech401", typeof CreateAudioSpeech401.Type>
34581 | OpenRouterClientError<"CreateAudioSpeech402", typeof CreateAudioSpeech402.Type>
34582 | OpenRouterClientError<"CreateAudioSpeech404", typeof CreateAudioSpeech404.Type>
34583 | OpenRouterClientError<"CreateAudioSpeech429", typeof CreateAudioSpeech429.Type>
34584 | OpenRouterClientError<"CreateAudioSpeech500", typeof CreateAudioSpeech500.Type>
34585 | OpenRouterClientError<"CreateAudioSpeech502", typeof CreateAudioSpeech502.Type>
34586 | OpenRouterClientError<"CreateAudioSpeech503", typeof CreateAudioSpeech503.Type>
34587 | OpenRouterClientError<"CreateAudioSpeech524", typeof CreateAudioSpeech524.Type>
34588 | OpenRouterClientError<"CreateAudioSpeech529", typeof CreateAudioSpeech529.Type>
34589 >
34590 /**
34591 * Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
34592 */
34593 readonly "createAudioTranscriptions": <Config extends OperationConfig>(
34594 options: {
34595 readonly params?: typeof CreateAudioTranscriptionsParams.Encoded | undefined
34596 readonly payload: typeof CreateAudioTranscriptionsRequestJson.Encoded
34597 readonly config?: Config | undefined
34598 }
34599 ) => Effect.Effect<
34600 WithOptionalResponse<typeof CreateAudioTranscriptions200.Type, Config>,
34601 | HttpClientError.HttpClientError
34602 | SchemaError
34603 | OpenRouterClientError<"CreateAudioTranscriptions400", typeof CreateAudioTranscriptions400.Type>
34604 | OpenRouterClientError<"CreateAudioTranscriptions401", typeof CreateAudioTranscriptions401.Type>
34605 | OpenRouterClientError<"CreateAudioTranscriptions402", typeof CreateAudioTranscriptions402.Type>
34606 | OpenRouterClientError<"CreateAudioTranscriptions404", typeof CreateAudioTranscriptions404.Type>
34607 | OpenRouterClientError<"CreateAudioTranscriptions429", typeof CreateAudioTranscriptions429.Type>
34608 | OpenRouterClientError<"CreateAudioTranscriptions500", typeof CreateAudioTranscriptions500.Type>
34609 | OpenRouterClientError<"CreateAudioTranscriptions502", typeof CreateAudioTranscriptions502.Type>
34610 | OpenRouterClientError<"CreateAudioTranscriptions503", typeof CreateAudioTranscriptions503.Type>
34611 | OpenRouterClientError<"CreateAudioTranscriptions524", typeof CreateAudioTranscriptions524.Type>
34612 | OpenRouterClientError<"CreateAudioTranscriptions529", typeof CreateAudioTranscriptions529.Type>
34613 >
34614 /**
34615 * Exchange an authorization code from the PKCE flow for a user-controlled API key
34616 */
34617 readonly "exchangeAuthCodeForAPIKey": <Config extends OperationConfig>(
34618 options: {
34619 readonly params?: typeof ExchangeAuthCodeForAPIKeyParams.Encoded | undefined
34620 readonly payload: typeof ExchangeAuthCodeForAPIKeyRequestJson.Encoded
34621 readonly config?: Config | undefined
34622 }
34623 ) => Effect.Effect<
34624 WithOptionalResponse<typeof ExchangeAuthCodeForAPIKey200.Type, Config>,
34625 | HttpClientError.HttpClientError
34626 | SchemaError
34627 | OpenRouterClientError<"ExchangeAuthCodeForAPIKey400", typeof ExchangeAuthCodeForAPIKey400.Type>
34628 | OpenRouterClientError<"ExchangeAuthCodeForAPIKey403", typeof ExchangeAuthCodeForAPIKey403.Type>
34629 | OpenRouterClientError<"ExchangeAuthCodeForAPIKey500", typeof ExchangeAuthCodeForAPIKey500.Type>
34630 >
34631 /**
34632 * Create an authorization code for the PKCE flow to generate a user-controlled API key
34633 */
34634 readonly "createAuthKeysCode": <Config extends OperationConfig>(
34635 options: {
34636 readonly params?: typeof CreateAuthKeysCodeParams.Encoded | undefined
34637 readonly payload: typeof CreateAuthKeysCodeRequestJson.Encoded
34638 readonly config?: Config | undefined
34639 }
34640 ) => Effect.Effect<
34641 WithOptionalResponse<typeof CreateAuthKeysCode200.Type, Config>,
34642 | HttpClientError.HttpClientError
34643 | SchemaError
34644 | OpenRouterClientError<"CreateAuthKeysCode400", typeof CreateAuthKeysCode400.Type>
34645 | OpenRouterClientError<"CreateAuthKeysCode401", typeof CreateAuthKeysCode401.Type>
34646 | OpenRouterClientError<"CreateAuthKeysCode403", typeof CreateAuthKeysCode403.Type>
34647 | OpenRouterClientError<"CreateAuthKeysCode409", typeof CreateAuthKeysCode409.Type>
34648 | OpenRouterClientError<"CreateAuthKeysCode500", typeof CreateAuthKeysCode500.Type>
34649 >
34650 /**
34651 * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
34652 */
34653 readonly "getBenchmarks": <Config extends OperationConfig>(
34654 options:
34655 | { readonly params?: typeof GetBenchmarksParams.Encoded | undefined; readonly config?: Config | undefined }
34656 | undefined
34657 ) => Effect.Effect<
34658 WithOptionalResponse<typeof GetBenchmarks200.Type, Config>,
34659 | HttpClientError.HttpClientError
34660 | SchemaError
34661 | OpenRouterClientError<"GetBenchmarks400", typeof GetBenchmarks400.Type>
34662 | OpenRouterClientError<"GetBenchmarks401", typeof GetBenchmarks401.Type>
34663 | OpenRouterClientError<"GetBenchmarks429", typeof GetBenchmarks429.Type>
34664 | OpenRouterClientError<"GetBenchmarks500", typeof GetBenchmarks500.Type>
34665 >
34666 /**
34667 * List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
34668 */
34669 readonly "listBYOKKeys": <Config extends OperationConfig>(
34670 options:
34671 | { readonly params?: typeof ListBYOKKeysParams.Encoded | undefined; readonly config?: Config | undefined }
34672 | undefined
34673 ) => Effect.Effect<
34674 WithOptionalResponse<typeof ListBYOKKeys200.Type, Config>,
34675 | HttpClientError.HttpClientError
34676 | SchemaError
34677 | OpenRouterClientError<"ListBYOKKeys400", typeof ListBYOKKeys400.Type>
34678 | OpenRouterClientError<"ListBYOKKeys401", typeof ListBYOKKeys401.Type>
34679 | OpenRouterClientError<"ListBYOKKeys500", typeof ListBYOKKeys500.Type>
34680 >
34681 /**
34682 * Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. Treat the raw key as write-only; it is never returned after creation. [Management key](/docs/guides/overview/auth/management-api-keys) required.
34683 */
34684 readonly "createBYOKKey": <Config extends OperationConfig>(
34685 options: {
34686 readonly params?: typeof CreateBYOKKeyParams.Encoded | undefined
34687 readonly payload: typeof CreateBYOKKeyRequestJson.Encoded
34688 readonly config?: Config | undefined
34689 }
34690 ) => Effect.Effect<
34691 WithOptionalResponse<typeof CreateBYOKKey201.Type, Config>,
34692 | HttpClientError.HttpClientError
34693 | SchemaError
34694 | OpenRouterClientError<"CreateBYOKKey400", typeof CreateBYOKKey400.Type>
34695 | OpenRouterClientError<"CreateBYOKKey401", typeof CreateBYOKKey401.Type>
34696 | OpenRouterClientError<"CreateBYOKKey403", typeof CreateBYOKKey403.Type>
34697 | OpenRouterClientError<"CreateBYOKKey500", typeof CreateBYOKKey500.Type>
34698 >
34699 /**
34700 * Get a single bring-your-own-key (BYOK) provider credential by its `id`. [Management key](/docs/guides/overview/auth/management-api-keys) required.
34701 */
34702 readonly "getBYOKKey": <Config extends OperationConfig>(
34703 id: string,
34704 options:
34705 | { readonly params?: typeof GetBYOKKeyParams.Encoded | undefined; readonly config?: Config | undefined }
34706 | undefined
34707 ) => Effect.Effect<
34708 WithOptionalResponse<typeof GetBYOKKey200.Type, Config>,
34709 | HttpClientError.HttpClientError
34710 | SchemaError
34711 | OpenRouterClientError<"GetBYOKKey401", typeof GetBYOKKey401.Type>
34712 | OpenRouterClientError<"GetBYOKKey404", typeof GetBYOKKey404.Type>
34713 | OpenRouterClientError<"GetBYOKKey500", typeof GetBYOKKey500.Type>
34714 >
34715 /**
34716 * Delete (soft-delete) a bring-your-own-key (BYOK) provider credential by its `id`. The encrypted key material is wiped and the record is marked as deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
34717 */
34718 readonly "deleteBYOKKey": <Config extends OperationConfig>(
34719 id: string,
34720 options:
34721 | { readonly params?: typeof DeleteBYOKKeyParams.Encoded | undefined; readonly config?: Config | undefined }
34722 | undefined
34723 ) => Effect.Effect<
34724 WithOptionalResponse<typeof DeleteBYOKKey200.Type, Config>,
34725 | HttpClientError.HttpClientError
34726 | SchemaError
34727 | OpenRouterClientError<"DeleteBYOKKey401", typeof DeleteBYOKKey401.Type>
34728 | OpenRouterClientError<"DeleteBYOKKey404", typeof DeleteBYOKKey404.Type>
34729 | OpenRouterClientError<"DeleteBYOKKey500", typeof DeleteBYOKKey500.Type>
34730 >
34731 /**
34732 * Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). [Management key](/docs/guides/overview/auth/management-api-keys) required.
34733 */
34734 readonly "updateBYOKKey": <Config extends OperationConfig>(
34735 id: string,
34736 options: {
34737 readonly params?: typeof UpdateBYOKKeyParams.Encoded | undefined
34738 readonly payload: typeof UpdateBYOKKeyRequestJson.Encoded
34739 readonly config?: Config | undefined
34740 }
34741 ) => Effect.Effect<
34742 WithOptionalResponse<typeof UpdateBYOKKey200.Type, Config>,
34743 | HttpClientError.HttpClientError
34744 | SchemaError
34745 | OpenRouterClientError<"UpdateBYOKKey400", typeof UpdateBYOKKey400.Type>
34746 | OpenRouterClientError<"UpdateBYOKKey401", typeof UpdateBYOKKey401.Type>
34747 | OpenRouterClientError<"UpdateBYOKKey404", typeof UpdateBYOKKey404.Type>
34748 | OpenRouterClientError<"UpdateBYOKKey500", typeof UpdateBYOKKey500.Type>
34749 >
34750 /**
34751 * Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
34752 */
34753 readonly "sendChatCompletionRequest": <Config extends OperationConfig>(
34754 options: {
34755 readonly params?: typeof SendChatCompletionRequestParams.Encoded | undefined
34756 readonly payload: typeof SendChatCompletionRequestRequestJson.Encoded
34757 readonly config?: Config | undefined
34758 }
34759 ) => Effect.Effect<
34760 WithOptionalResponse<typeof SendChatCompletionRequest200.Type, Config>,
34761 | HttpClientError.HttpClientError
34762 | SchemaError
34763 | OpenRouterClientError<"SendChatCompletionRequest400", typeof SendChatCompletionRequest400.Type>
34764 | OpenRouterClientError<"SendChatCompletionRequest401", typeof SendChatCompletionRequest401.Type>
34765 | OpenRouterClientError<"SendChatCompletionRequest402", typeof SendChatCompletionRequest402.Type>
34766 | OpenRouterClientError<"SendChatCompletionRequest403", typeof SendChatCompletionRequest403.Type>
34767 | OpenRouterClientError<"SendChatCompletionRequest404", typeof SendChatCompletionRequest404.Type>
34768 | OpenRouterClientError<"SendChatCompletionRequest408", typeof SendChatCompletionRequest408.Type>
34769 | OpenRouterClientError<"SendChatCompletionRequest413", typeof SendChatCompletionRequest413.Type>
34770 | OpenRouterClientError<"SendChatCompletionRequest422", typeof SendChatCompletionRequest422.Type>
34771 | OpenRouterClientError<"SendChatCompletionRequest429", typeof SendChatCompletionRequest429.Type>
34772 | OpenRouterClientError<"SendChatCompletionRequest500", typeof SendChatCompletionRequest500.Type>
34773 | OpenRouterClientError<"SendChatCompletionRequest502", typeof SendChatCompletionRequest502.Type>
34774 | OpenRouterClientError<"SendChatCompletionRequest503", typeof SendChatCompletionRequest503.Type>
34775 | OpenRouterClientError<"SendChatCompletionRequest524", typeof SendChatCompletionRequest524.Type>
34776 | OpenRouterClientError<"SendChatCompletionRequest529", typeof SendChatCompletionRequest529.Type>
34777 >
34778 /**
34779 * Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
34780 */
34781 readonly "sendChatCompletionRequestSse": (
34782 options: {
34783 readonly params?: typeof SendChatCompletionRequestParams.Encoded | undefined
34784 readonly payload: typeof SendChatCompletionRequestRequestJson.Encoded
34785 }
34786 ) => Stream.Stream<
34787 {
34788 readonly event: string
34789 readonly id: string | undefined
34790 readonly data: typeof SendChatCompletionRequest200Sse.Type
34791 },
34792 HttpClientError.HttpClientError | SchemaError | Sse.Retry | Sse.SseError,
34793 typeof SendChatCompletionRequest200Sse.DecodingServices
34794 >
34795 /**
34796 * Returns the market-share breakdown of OpenRouter traffic by task classification
34797 * (e.g. code generation, web search, summarization) over a trailing time window.
34798 *
34799 * Each classification reports its share of classified sampled requests (`usage_share`)
34800 * and classified sampled token volume (`token_share`) as fractions between 0 and 1.
34801 * The unclassified `other` bucket is excluded. Absolute volumes are not exposed
34802 * because the underlying data is sampled.
34803 *
34804 * Each classification also includes a `models` array listing the top models by
34805 * request volume within that classification, with their within-tag usage and token shares.
34806 *
34807 * Classifications are grouped into macro-categories (Code, Data, Agent, General)
34808 * with aggregate shares provided for each.
34809 *
34810 * Authenticate with any valid OpenRouter API key (same key used for inference).
34811 * Rate-limited to 30 requests/minute per key and 500 requests/day per account.
34812 *
34813 * When republishing or quoting this data, cite as:
34814 * "Source: OpenRouter (openrouter.ai/rankings), as of {as_of}."
34815 */
34816 readonly "getTaskClassifications": <Config extends OperationConfig>(
34817 options: {
34818 readonly params?: typeof GetTaskClassificationsParams.Encoded | undefined
34819 readonly config?: Config | undefined
34820 } | undefined
34821 ) => Effect.Effect<
34822 WithOptionalResponse<typeof GetTaskClassifications200.Type, Config>,
34823 | HttpClientError.HttpClientError
34824 | SchemaError
34825 | OpenRouterClientError<"GetTaskClassifications400", typeof GetTaskClassifications400.Type>
34826 | OpenRouterClientError<"GetTaskClassifications401", typeof GetTaskClassifications401.Type>
34827 | OpenRouterClientError<"GetTaskClassifications429", typeof GetTaskClassifications429.Type>
34828 | OpenRouterClientError<"GetTaskClassifications500", typeof GetTaskClassifications500.Type>
34829 >
34830 /**
34831 * Get total credits purchased and used for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
34832 */
34833 readonly "getCredits": <Config extends OperationConfig>(
34834 options:
34835 | { readonly params?: typeof GetCreditsParams.Encoded | undefined; readonly config?: Config | undefined }
34836 | undefined
34837 ) => Effect.Effect<
34838 WithOptionalResponse<typeof GetCredits200.Type, Config>,
34839 | HttpClientError.HttpClientError
34840 | SchemaError
34841 | OpenRouterClientError<"GetCredits401", typeof GetCredits401.Type>
34842 | OpenRouterClientError<"GetCredits403", typeof GetCredits403.Type>
34843 | OpenRouterClientError<"GetCredits500", typeof GetCredits500.Type>
34844 >
34845 /**
34846 * Deprecated. The Coinbase APIs used by this endpoint have been deprecated, so Coinbase Commerce charges have been removed. Use the web credits purchase flow instead.
34847 */
34848 readonly "createCoinbaseCharge": <Config extends OperationConfig>(
34849 options: {
34850 readonly params?: typeof CreateCoinbaseChargeParams.Encoded | undefined
34851 readonly config?: Config | undefined
34852 } | undefined
34853 ) => Effect.Effect<
34854 WithOptionalResponse<void, Config>,
34855 | HttpClientError.HttpClientError
34856 | SchemaError
34857 | OpenRouterClientError<"CreateCoinbaseCharge410", typeof CreateCoinbaseCharge410.Type>
34858 >
34859 /**
34860 * Returns the top public apps on OpenRouter ranked by token usage inside the requested
34861 * date window, matching the public apps marketplace on openrouter.ai/apps. Token totals
34862 * are `prompt_tokens + completion_tokens`; hidden and private apps are excluded and
34863 * traffic from related app aliases is merged into the canonical visible app.
34864 *
34865 * `sort=popular` (default) ranks by total token volume inside the window.
34866 * `sort=trending` ranks by absolute excess token growth: window volume minus the average
34867 * volume of the three equal-length periods immediately preceding the window. Apps with
34868 * no excess growth are omitted, so `trending` may return fewer than `limit` rows.
34869 *
34870 * Filter with `category` (marketplace category group, e.g. `coding`) or `subcategory`
34871 * (e.g. `cli-agent`). Ranks are re-numbered 1..N after filtering. Page with `offset` —
34872 * `rank` stays absolute, so the first row of `offset=50` is `rank: 51`.
34873 *
34874 * Authenticate with any valid OpenRouter API key (same key used for inference).
34875 * Rate-limited to 30 requests/minute per key and 500 requests/day per account.
34876 *
34877 * When republishing or quoting this dataset, OpenRouter must be cited as:
34878 * "Source: OpenRouter (openrouter.ai/apps), as of {as_of}."
34879 *
34880 * Token counts come from each upstream provider's own tokenizer, so a token attributed
34881 * to one app is not directly comparable to a token attributed to another app whose
34882 * traffic flows through a different provider.
34883 */
34884 readonly "getAppRankings": <Config extends OperationConfig>(
34885 options:
34886 | { readonly params?: typeof GetAppRankingsParams.Encoded | undefined; readonly config?: Config | undefined }
34887 | undefined
34888 ) => Effect.Effect<
34889 WithOptionalResponse<typeof GetAppRankings200.Type, Config>,
34890 | HttpClientError.HttpClientError
34891 | SchemaError
34892 | OpenRouterClientError<"GetAppRankings400", typeof GetAppRankings400.Type>
34893 | OpenRouterClientError<"GetAppRankings401", typeof GetAppRankings401.Type>
34894 | OpenRouterClientError<"GetAppRankings429", typeof GetAppRankings429.Type>
34895 | OpenRouterClientError<"GetAppRankings500", typeof GetAppRankings500.Type>
34896 >
34897 /**
34898 * Returns the top 50 public models per day by total token usage on OpenRouter, plus a
34899 * single aggregated `other` row per day that sums every model outside that top 50.
34900 * Token totals are `prompt_tokens + completion_tokens`, matching the public rankings
34901 * chart on openrouter.ai/rankings.
34902 *
34903 * Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the
34904 * reserved permaslug `other` and is always returned last within its date, so callers
34905 * can compute `top-50 traffic / total daily traffic` without a second request.
34906 *
34907 * Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time
34908 * grain. `modality` and `context_bucket` narrow the exact dataset by output/input
34909 * modality (or tool-calling activity) and request context length. `category` and
34910 * `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are
34911 * weekly-grain estimates — they cannot be combined with each other or with the exact
34912 * filters, and reject `period=day` with a 400.
34913 *
34914 * Authenticate with any valid OpenRouter API key (same key used for inference).
34915 * Rate-limited to 30 requests/minute per key and 500 requests/day per account.
34916 *
34917 * When republishing or quoting this dataset, OpenRouter must be cited as:
34918 * "Source: OpenRouter (openrouter.ai/rankings), as of {as_of}."
34919 *
34920 * Token counts come from each upstream provider's own tokenizer (Anthropic counts
34921 * are as reported by Anthropic, OpenAI counts are as reported by OpenAI, etc.), so
34922 * a token in one row is not directly comparable to a token in another row from a
34923 * different provider.
34924 */
34925 readonly "getRankingsDaily": <Config extends OperationConfig>(
34926 options: {
34927 readonly params?: typeof GetRankingsDailyParams.Encoded | undefined
34928 readonly config?: Config | undefined
34929 } | undefined
34930 ) => Effect.Effect<
34931 WithOptionalResponse<typeof GetRankingsDaily200.Type, Config>,
34932 | HttpClientError.HttpClientError
34933 | SchemaError
34934 | OpenRouterClientError<"GetRankingsDaily400", typeof GetRankingsDaily400.Type>
34935 | OpenRouterClientError<"GetRankingsDaily401", typeof GetRankingsDaily401.Type>
34936 | OpenRouterClientError<"GetRankingsDaily429", typeof GetRankingsDaily429.Type>
34937 | OpenRouterClientError<"GetRankingsDaily500", typeof GetRankingsDaily500.Type>
34938 >
34939 /**
34940 * Submits an embedding request to the embeddings router
34941 */
34942 readonly "createEmbeddings": <Config extends OperationConfig>(
34943 options: {
34944 readonly params?: typeof CreateEmbeddingsParams.Encoded | undefined
34945 readonly payload: typeof CreateEmbeddingsRequestJson.Encoded
34946 readonly config?: Config | undefined
34947 }
34948 ) => Effect.Effect<
34949 WithOptionalResponse<typeof CreateEmbeddings200.Type, Config>,
34950 | HttpClientError.HttpClientError
34951 | SchemaError
34952 | OpenRouterClientError<"CreateEmbeddings400", typeof CreateEmbeddings400.Type>
34953 | OpenRouterClientError<"CreateEmbeddings401", typeof CreateEmbeddings401.Type>
34954 | OpenRouterClientError<"CreateEmbeddings402", typeof CreateEmbeddings402.Type>
34955 | OpenRouterClientError<"CreateEmbeddings404", typeof CreateEmbeddings404.Type>
34956 | OpenRouterClientError<"CreateEmbeddings429", typeof CreateEmbeddings429.Type>
34957 | OpenRouterClientError<"CreateEmbeddings500", typeof CreateEmbeddings500.Type>
34958 | OpenRouterClientError<"CreateEmbeddings502", typeof CreateEmbeddings502.Type>
34959 | OpenRouterClientError<"CreateEmbeddings503", typeof CreateEmbeddings503.Type>
34960 | OpenRouterClientError<"CreateEmbeddings524", typeof CreateEmbeddings524.Type>
34961 | OpenRouterClientError<"CreateEmbeddings529", typeof CreateEmbeddings529.Type>
34962 >
34963 /**
34964 * Submits an embedding request to the embeddings router
34965 */
34966 readonly "createEmbeddingsSse": (
34967 options: {
34968 readonly params?: typeof CreateEmbeddingsParams.Encoded | undefined
34969 readonly payload: typeof CreateEmbeddingsRequestJson.Encoded
34970 }
34971 ) => Stream.Stream<
34972 { readonly event: string; readonly id: string | undefined; readonly data: typeof CreateEmbeddings200Sse.Type },
34973 HttpClientError.HttpClientError | SchemaError | Sse.Retry | Sse.SseError,
34974 typeof CreateEmbeddings200Sse.DecodingServices
34975 >
34976 /**
34977 * Returns a list of all available embeddings models and their properties
34978 */
34979 readonly "listEmbeddingsModels": <Config extends OperationConfig>(
34980 options: {
34981 readonly params?: typeof ListEmbeddingsModelsParams.Encoded | undefined
34982 readonly config?: Config | undefined
34983 } | undefined
34984 ) => Effect.Effect<
34985 WithOptionalResponse<typeof ListEmbeddingsModels200.Type, Config>,
34986 | HttpClientError.HttpClientError
34987 | SchemaError
34988 | OpenRouterClientError<"ListEmbeddingsModels400", typeof ListEmbeddingsModels400.Type>
34989 | OpenRouterClientError<"ListEmbeddingsModels500", typeof ListEmbeddingsModels500.Type>
34990 >
34991 /**
34992 * Preview the impact of ZDR on the available endpoints
34993 */
34994 readonly "listEndpointsZdr": <Config extends OperationConfig>(
34995 options: {
34996 readonly params?: typeof ListEndpointsZdrParams.Encoded | undefined
34997 readonly config?: Config | undefined
34998 } | undefined
34999 ) => Effect.Effect<
35000 WithOptionalResponse<typeof ListEndpointsZdr200.Type, Config>,
35001 | HttpClientError.HttpClientError
35002 | SchemaError
35003 | OpenRouterClientError<"ListEndpointsZdr403", typeof ListEndpointsZdr403.Type>
35004 | OpenRouterClientError<"ListEndpointsZdr500", typeof ListEndpointsZdr500.Type>
35005 >
35006 /**
35007 * Lists files belonging to the workspace of the authenticating API key.
35008 */
35009 readonly "listFiles": <Config extends OperationConfig>(
35010 options:
35011 | { readonly params?: typeof ListFilesParams.Encoded | undefined; readonly config?: Config | undefined }
35012 | undefined
35013 ) => Effect.Effect<
35014 WithOptionalResponse<typeof ListFiles200.Type, Config>,
35015 | HttpClientError.HttpClientError
35016 | SchemaError
35017 | OpenRouterClientError<"ListFiles400", typeof ListFiles400.Type>
35018 | OpenRouterClientError<"ListFiles401", typeof ListFiles401.Type>
35019 | OpenRouterClientError<"ListFiles429", typeof ListFiles429.Type>
35020 | OpenRouterClientError<"ListFiles500", typeof ListFiles500.Type>
35021 >
35022 /**
35023 * Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB.
35024 */
35025 readonly "uploadFile": <Config extends OperationConfig>(
35026 options: {
35027 readonly params?: typeof UploadFileParams.Encoded | undefined
35028 readonly payload: typeof UploadFileRequestFormData.Encoded
35029 readonly config?: Config | undefined
35030 }
35031 ) => Effect.Effect<
35032 WithOptionalResponse<typeof UploadFile200.Type, Config>,
35033 | HttpClientError.HttpClientError
35034 | SchemaError
35035 | OpenRouterClientError<"UploadFile400", typeof UploadFile400.Type>
35036 | OpenRouterClientError<"UploadFile401", typeof UploadFile401.Type>
35037 | OpenRouterClientError<"UploadFile403", typeof UploadFile403.Type>
35038 | OpenRouterClientError<"UploadFile413", typeof UploadFile413.Type>
35039 | OpenRouterClientError<"UploadFile429", typeof UploadFile429.Type>
35040 | OpenRouterClientError<"UploadFile500", typeof UploadFile500.Type>
35041 >
35042 /**
35043 * Retrieves metadata for a single file owned by the requesting workspace.
35044 */
35045 readonly "getFileMetadata": <Config extends OperationConfig>(
35046 fileId: string,
35047 options: {
35048 readonly params?: typeof GetFileMetadataParams.Encoded | undefined
35049 readonly config?: Config | undefined
35050 } | undefined
35051 ) => Effect.Effect<
35052 WithOptionalResponse<typeof GetFileMetadata200.Type, Config>,
35053 | HttpClientError.HttpClientError
35054 | SchemaError
35055 | OpenRouterClientError<"GetFileMetadata401", typeof GetFileMetadata401.Type>
35056 | OpenRouterClientError<"GetFileMetadata404", typeof GetFileMetadata404.Type>
35057 | OpenRouterClientError<"GetFileMetadata429", typeof GetFileMetadata429.Type>
35058 | OpenRouterClientError<"GetFileMetadata500", typeof GetFileMetadata500.Type>
35059 >
35060 /**
35061 * Deletes a file owned by the requesting workspace. Deletion is irreversible.
35062 */
35063 readonly "deleteFile": <Config extends OperationConfig>(
35064 fileId: string,
35065 options:
35066 | { readonly params?: typeof DeleteFileParams.Encoded | undefined; readonly config?: Config | undefined }
35067 | undefined
35068 ) => Effect.Effect<
35069 WithOptionalResponse<typeof DeleteFile200.Type, Config>,
35070 | HttpClientError.HttpClientError
35071 | SchemaError
35072 | OpenRouterClientError<"DeleteFile401", typeof DeleteFile401.Type>
35073 | OpenRouterClientError<"DeleteFile404", typeof DeleteFile404.Type>
35074 | OpenRouterClientError<"DeleteFile429", typeof DeleteFile429.Type>
35075 | OpenRouterClientError<"DeleteFile500", typeof DeleteFile500.Type>
35076 >
35077 /**
35078 * Downloads the raw bytes of a file. Only files created server-side are downloadable; uploaded files return 400.
35079 */
35080 readonly "downloadFileContent": <Config extends OperationConfig>(
35081 fileId: string,
35082 options: {
35083 readonly params?: typeof DownloadFileContentParams.Encoded | undefined
35084 readonly config?: Config | undefined
35085 } | undefined
35086 ) => Effect.Effect<
35087 WithOptionalResponse<void, Config>,
35088 | HttpClientError.HttpClientError
35089 | SchemaError
35090 | OpenRouterClientError<"DownloadFileContent400", typeof DownloadFileContent400.Type>
35091 | OpenRouterClientError<"DownloadFileContent401", typeof DownloadFileContent401.Type>
35092 | OpenRouterClientError<"DownloadFileContent404", typeof DownloadFileContent404.Type>
35093 | OpenRouterClientError<"DownloadFileContent429", typeof DownloadFileContent429.Type>
35094 | OpenRouterClientError<"DownloadFileContent500", typeof DownloadFileContent500.Type>
35095 >
35096 /**
35097 * Downloads the raw bytes of a file. Only files created server-side are downloadable; uploaded files return 400.
35098 */
35099 readonly "downloadFileContentStream": (
35100 fileId: string,
35101 options: { readonly params?: typeof DownloadFileContentParams.Encoded | undefined } | undefined
35102 ) => Stream.Stream<Uint8Array, HttpClientError.HttpClientError>
35103 /**
35104 * Get request & usage metadata for a generation
35105 */
35106 readonly "getGeneration": <Config extends OperationConfig>(
35107 options: { readonly params: typeof GetGenerationParams.Encoded; readonly config?: Config | undefined }
35108 ) => Effect.Effect<
35109 WithOptionalResponse<typeof GetGeneration200.Type, Config>,
35110 | HttpClientError.HttpClientError
35111 | SchemaError
35112 | OpenRouterClientError<"GetGeneration401", typeof GetGeneration401.Type>
35113 | OpenRouterClientError<"GetGeneration402", typeof GetGeneration402.Type>
35114 | OpenRouterClientError<"GetGeneration404", typeof GetGeneration404.Type>
35115 | OpenRouterClientError<"GetGeneration429", typeof GetGeneration429.Type>
35116 | OpenRouterClientError<"GetGeneration500", typeof GetGeneration500.Type>
35117 | OpenRouterClientError<"GetGeneration502", typeof GetGeneration502.Type>
35118 | OpenRouterClientError<"GetGeneration524", typeof GetGeneration524.Type>
35119 | OpenRouterClientError<"GetGeneration529", typeof GetGeneration529.Type>
35120 >
35121 /**
35122 * Get stored prompt and completion content for a generation
35123 */
35124 readonly "listGenerationContent": <Config extends OperationConfig>(
35125 options: { readonly params: typeof ListGenerationContentParams.Encoded; readonly config?: Config | undefined }
35126 ) => Effect.Effect<
35127 WithOptionalResponse<typeof ListGenerationContent200.Type, Config>,
35128 | HttpClientError.HttpClientError
35129 | SchemaError
35130 | OpenRouterClientError<"ListGenerationContent401", typeof ListGenerationContent401.Type>
35131 | OpenRouterClientError<"ListGenerationContent403", typeof ListGenerationContent403.Type>
35132 | OpenRouterClientError<"ListGenerationContent404", typeof ListGenerationContent404.Type>
35133 | OpenRouterClientError<"ListGenerationContent429", typeof ListGenerationContent429.Type>
35134 | OpenRouterClientError<"ListGenerationContent500", typeof ListGenerationContent500.Type>
35135 | OpenRouterClientError<"ListGenerationContent502", typeof ListGenerationContent502.Type>
35136 | OpenRouterClientError<"ListGenerationContent524", typeof ListGenerationContent524.Type>
35137 | OpenRouterClientError<"ListGenerationContent529", typeof ListGenerationContent529.Type>
35138 >
35139 /**
35140 * Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35141 */
35142 readonly "submitGenerationFeedback": <Config extends OperationConfig>(
35143 options: {
35144 readonly params?: typeof SubmitGenerationFeedbackParams.Encoded | undefined
35145 readonly payload: typeof SubmitGenerationFeedbackRequestJson.Encoded
35146 readonly config?: Config | undefined
35147 }
35148 ) => Effect.Effect<
35149 WithOptionalResponse<typeof SubmitGenerationFeedback200.Type, Config>,
35150 | HttpClientError.HttpClientError
35151 | SchemaError
35152 | OpenRouterClientError<"SubmitGenerationFeedback400", typeof SubmitGenerationFeedback400.Type>
35153 | OpenRouterClientError<"SubmitGenerationFeedback401", typeof SubmitGenerationFeedback401.Type>
35154 | OpenRouterClientError<"SubmitGenerationFeedback404", typeof SubmitGenerationFeedback404.Type>
35155 | OpenRouterClientError<"SubmitGenerationFeedback429", typeof SubmitGenerationFeedback429.Type>
35156 | OpenRouterClientError<"SubmitGenerationFeedback500", typeof SubmitGenerationFeedback500.Type>
35157 >
35158 /**
35159 * List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35160 */
35161 readonly "listGuardrails": <Config extends OperationConfig>(
35162 options:
35163 | { readonly params?: typeof ListGuardrailsParams.Encoded | undefined; readonly config?: Config | undefined }
35164 | undefined
35165 ) => Effect.Effect<
35166 WithOptionalResponse<typeof ListGuardrails200.Type, Config>,
35167 | HttpClientError.HttpClientError
35168 | SchemaError
35169 | OpenRouterClientError<"ListGuardrails400", typeof ListGuardrails400.Type>
35170 | OpenRouterClientError<"ListGuardrails401", typeof ListGuardrails401.Type>
35171 | OpenRouterClientError<"ListGuardrails500", typeof ListGuardrails500.Type>
35172 >
35173 /**
35174 * Create a new guardrail for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35175 */
35176 readonly "createGuardrail": <Config extends OperationConfig>(
35177 options: {
35178 readonly params?: typeof CreateGuardrailParams.Encoded | undefined
35179 readonly payload: typeof CreateGuardrailRequestJson.Encoded
35180 readonly config?: Config | undefined
35181 }
35182 ) => Effect.Effect<
35183 WithOptionalResponse<typeof CreateGuardrail201.Type, Config>,
35184 | HttpClientError.HttpClientError
35185 | SchemaError
35186 | OpenRouterClientError<"CreateGuardrail400", typeof CreateGuardrail400.Type>
35187 | OpenRouterClientError<"CreateGuardrail401", typeof CreateGuardrail401.Type>
35188 | OpenRouterClientError<"CreateGuardrail403", typeof CreateGuardrail403.Type>
35189 | OpenRouterClientError<"CreateGuardrail500", typeof CreateGuardrail500.Type>
35190 >
35191 /**
35192 * Get a single guardrail by ID. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35193 */
35194 readonly "getGuardrail": <Config extends OperationConfig>(
35195 id: string,
35196 options:
35197 | { readonly params?: typeof GetGuardrailParams.Encoded | undefined; readonly config?: Config | undefined }
35198 | undefined
35199 ) => Effect.Effect<
35200 WithOptionalResponse<typeof GetGuardrail200.Type, Config>,
35201 | HttpClientError.HttpClientError
35202 | SchemaError
35203 | OpenRouterClientError<"GetGuardrail401", typeof GetGuardrail401.Type>
35204 | OpenRouterClientError<"GetGuardrail404", typeof GetGuardrail404.Type>
35205 | OpenRouterClientError<"GetGuardrail500", typeof GetGuardrail500.Type>
35206 >
35207 /**
35208 * Delete an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35209 */
35210 readonly "deleteGuardrail": <Config extends OperationConfig>(
35211 id: string,
35212 options: {
35213 readonly params?: typeof DeleteGuardrailParams.Encoded | undefined
35214 readonly config?: Config | undefined
35215 } | undefined
35216 ) => Effect.Effect<
35217 WithOptionalResponse<typeof DeleteGuardrail200.Type, Config>,
35218 | HttpClientError.HttpClientError
35219 | SchemaError
35220 | OpenRouterClientError<"DeleteGuardrail401", typeof DeleteGuardrail401.Type>
35221 | OpenRouterClientError<"DeleteGuardrail404", typeof DeleteGuardrail404.Type>
35222 | OpenRouterClientError<"DeleteGuardrail500", typeof DeleteGuardrail500.Type>
35223 >
35224 /**
35225 * Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35226 */
35227 readonly "updateGuardrail": <Config extends OperationConfig>(
35228 id: string,
35229 options: {
35230 readonly params?: typeof UpdateGuardrailParams.Encoded | undefined
35231 readonly payload: typeof UpdateGuardrailRequestJson.Encoded
35232 readonly config?: Config | undefined
35233 }
35234 ) => Effect.Effect<
35235 WithOptionalResponse<typeof UpdateGuardrail200.Type, Config>,
35236 | HttpClientError.HttpClientError
35237 | SchemaError
35238 | OpenRouterClientError<"UpdateGuardrail400", typeof UpdateGuardrail400.Type>
35239 | OpenRouterClientError<"UpdateGuardrail401", typeof UpdateGuardrail401.Type>
35240 | OpenRouterClientError<"UpdateGuardrail404", typeof UpdateGuardrail404.Type>
35241 | OpenRouterClientError<"UpdateGuardrail500", typeof UpdateGuardrail500.Type>
35242 >
35243 /**
35244 * List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35245 */
35246 readonly "listGuardrailKeyAssignments": <Config extends OperationConfig>(
35247 id: string,
35248 options: {
35249 readonly params?: typeof ListGuardrailKeyAssignmentsParams.Encoded | undefined
35250 readonly config?: Config | undefined
35251 } | undefined
35252 ) => Effect.Effect<
35253 WithOptionalResponse<typeof ListGuardrailKeyAssignments200.Type, Config>,
35254 | HttpClientError.HttpClientError
35255 | SchemaError
35256 | OpenRouterClientError<"ListGuardrailKeyAssignments401", typeof ListGuardrailKeyAssignments401.Type>
35257 | OpenRouterClientError<"ListGuardrailKeyAssignments404", typeof ListGuardrailKeyAssignments404.Type>
35258 | OpenRouterClientError<"ListGuardrailKeyAssignments500", typeof ListGuardrailKeyAssignments500.Type>
35259 >
35260 /**
35261 * Assign multiple API keys to a specific guardrail. A key may hold at most one guardrail; assigning replaces any existing assignment. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35262 */
35263 readonly "bulkAssignKeysToGuardrail": <Config extends OperationConfig>(
35264 id: string,
35265 options: {
35266 readonly params?: typeof BulkAssignKeysToGuardrailParams.Encoded | undefined
35267 readonly payload: typeof BulkAssignKeysToGuardrailRequestJson.Encoded
35268 readonly config?: Config | undefined
35269 }
35270 ) => Effect.Effect<
35271 WithOptionalResponse<typeof BulkAssignKeysToGuardrail200.Type, Config>,
35272 | HttpClientError.HttpClientError
35273 | SchemaError
35274 | OpenRouterClientError<"BulkAssignKeysToGuardrail400", typeof BulkAssignKeysToGuardrail400.Type>
35275 | OpenRouterClientError<"BulkAssignKeysToGuardrail401", typeof BulkAssignKeysToGuardrail401.Type>
35276 | OpenRouterClientError<"BulkAssignKeysToGuardrail404", typeof BulkAssignKeysToGuardrail404.Type>
35277 | OpenRouterClientError<"BulkAssignKeysToGuardrail500", typeof BulkAssignKeysToGuardrail500.Type>
35278 >
35279 /**
35280 * Unassign multiple API keys from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35281 */
35282 readonly "bulkUnassignKeysFromGuardrail": <Config extends OperationConfig>(
35283 id: string,
35284 options: {
35285 readonly params?: typeof BulkUnassignKeysFromGuardrailParams.Encoded | undefined
35286 readonly payload: typeof BulkUnassignKeysFromGuardrailRequestJson.Encoded
35287 readonly config?: Config | undefined
35288 }
35289 ) => Effect.Effect<
35290 WithOptionalResponse<typeof BulkUnassignKeysFromGuardrail200.Type, Config>,
35291 | HttpClientError.HttpClientError
35292 | SchemaError
35293 | OpenRouterClientError<"BulkUnassignKeysFromGuardrail400", typeof BulkUnassignKeysFromGuardrail400.Type>
35294 | OpenRouterClientError<"BulkUnassignKeysFromGuardrail401", typeof BulkUnassignKeysFromGuardrail401.Type>
35295 | OpenRouterClientError<"BulkUnassignKeysFromGuardrail404", typeof BulkUnassignKeysFromGuardrail404.Type>
35296 | OpenRouterClientError<"BulkUnassignKeysFromGuardrail500", typeof BulkUnassignKeysFromGuardrail500.Type>
35297 >
35298 /**
35299 * List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35300 */
35301 readonly "listGuardrailMemberAssignments": <Config extends OperationConfig>(
35302 id: string,
35303 options: {
35304 readonly params?: typeof ListGuardrailMemberAssignmentsParams.Encoded | undefined
35305 readonly config?: Config | undefined
35306 } | undefined
35307 ) => Effect.Effect<
35308 WithOptionalResponse<typeof ListGuardrailMemberAssignments200.Type, Config>,
35309 | HttpClientError.HttpClientError
35310 | SchemaError
35311 | OpenRouterClientError<"ListGuardrailMemberAssignments401", typeof ListGuardrailMemberAssignments401.Type>
35312 | OpenRouterClientError<"ListGuardrailMemberAssignments404", typeof ListGuardrailMemberAssignments404.Type>
35313 | OpenRouterClientError<"ListGuardrailMemberAssignments500", typeof ListGuardrailMemberAssignments500.Type>
35314 >
35315 /**
35316 * Assign multiple organization members to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35317 */
35318 readonly "bulkAssignMembersToGuardrail": <Config extends OperationConfig>(
35319 id: string,
35320 options: {
35321 readonly params?: typeof BulkAssignMembersToGuardrailParams.Encoded | undefined
35322 readonly payload: typeof BulkAssignMembersToGuardrailRequestJson.Encoded
35323 readonly config?: Config | undefined
35324 }
35325 ) => Effect.Effect<
35326 WithOptionalResponse<typeof BulkAssignMembersToGuardrail200.Type, Config>,
35327 | HttpClientError.HttpClientError
35328 | SchemaError
35329 | OpenRouterClientError<"BulkAssignMembersToGuardrail400", typeof BulkAssignMembersToGuardrail400.Type>
35330 | OpenRouterClientError<"BulkAssignMembersToGuardrail401", typeof BulkAssignMembersToGuardrail401.Type>
35331 | OpenRouterClientError<"BulkAssignMembersToGuardrail404", typeof BulkAssignMembersToGuardrail404.Type>
35332 | OpenRouterClientError<"BulkAssignMembersToGuardrail500", typeof BulkAssignMembersToGuardrail500.Type>
35333 >
35334 /**
35335 * Unassign multiple organization members from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35336 */
35337 readonly "bulkUnassignMembersFromGuardrail": <Config extends OperationConfig>(
35338 id: string,
35339 options: {
35340 readonly params?: typeof BulkUnassignMembersFromGuardrailParams.Encoded | undefined
35341 readonly payload: typeof BulkUnassignMembersFromGuardrailRequestJson.Encoded
35342 readonly config?: Config | undefined
35343 }
35344 ) => Effect.Effect<
35345 WithOptionalResponse<typeof BulkUnassignMembersFromGuardrail200.Type, Config>,
35346 | HttpClientError.HttpClientError
35347 | SchemaError
35348 | OpenRouterClientError<"BulkUnassignMembersFromGuardrail400", typeof BulkUnassignMembersFromGuardrail400.Type>
35349 | OpenRouterClientError<"BulkUnassignMembersFromGuardrail401", typeof BulkUnassignMembersFromGuardrail401.Type>
35350 | OpenRouterClientError<"BulkUnassignMembersFromGuardrail404", typeof BulkUnassignMembersFromGuardrail404.Type>
35351 | OpenRouterClientError<"BulkUnassignMembersFromGuardrail500", typeof BulkUnassignMembersFromGuardrail500.Type>
35352 >
35353 /**
35354 * List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35355 */
35356 readonly "listKeyAssignments": <Config extends OperationConfig>(
35357 options: {
35358 readonly params?: typeof ListKeyAssignmentsParams.Encoded | undefined
35359 readonly config?: Config | undefined
35360 } | undefined
35361 ) => Effect.Effect<
35362 WithOptionalResponse<typeof ListKeyAssignments200.Type, Config>,
35363 | HttpClientError.HttpClientError
35364 | SchemaError
35365 | OpenRouterClientError<"ListKeyAssignments401", typeof ListKeyAssignments401.Type>
35366 | OpenRouterClientError<"ListKeyAssignments500", typeof ListKeyAssignments500.Type>
35367 >
35368 /**
35369 * List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35370 */
35371 readonly "listMemberAssignments": <Config extends OperationConfig>(
35372 options: {
35373 readonly params?: typeof ListMemberAssignmentsParams.Encoded | undefined
35374 readonly config?: Config | undefined
35375 } | undefined
35376 ) => Effect.Effect<
35377 WithOptionalResponse<typeof ListMemberAssignments200.Type, Config>,
35378 | HttpClientError.HttpClientError
35379 | SchemaError
35380 | OpenRouterClientError<"ListMemberAssignments401", typeof ListMemberAssignments401.Type>
35381 | OpenRouterClientError<"ListMemberAssignments500", typeof ListMemberAssignments500.Type>
35382 >
35383 /**
35384 * Generates an image from a text prompt via the image generation router
35385 */
35386 readonly "createImages": <Config extends OperationConfig>(
35387 options: {
35388 readonly params?: typeof CreateImagesParams.Encoded | undefined
35389 readonly payload: typeof CreateImagesRequestJson.Encoded
35390 readonly config?: Config | undefined
35391 }
35392 ) => Effect.Effect<
35393 WithOptionalResponse<typeof CreateImages200.Type, Config>,
35394 | HttpClientError.HttpClientError
35395 | SchemaError
35396 | OpenRouterClientError<"CreateImages400", typeof CreateImages400.Type>
35397 | OpenRouterClientError<"CreateImages401", typeof CreateImages401.Type>
35398 | OpenRouterClientError<"CreateImages402", typeof CreateImages402.Type>
35399 | OpenRouterClientError<"CreateImages403", typeof CreateImages403.Type>
35400 | OpenRouterClientError<"CreateImages404", typeof CreateImages404.Type>
35401 | OpenRouterClientError<"CreateImages413", typeof CreateImages413.Type>
35402 | OpenRouterClientError<"CreateImages429", typeof CreateImages429.Type>
35403 | OpenRouterClientError<"CreateImages500", typeof CreateImages500.Type>
35404 | OpenRouterClientError<"CreateImages502", typeof CreateImages502.Type>
35405 | OpenRouterClientError<"CreateImages524", typeof CreateImages524.Type>
35406 | OpenRouterClientError<"CreateImages529", typeof CreateImages529.Type>
35407 >
35408 /**
35409 * Generates an image from a text prompt via the image generation router
35410 */
35411 readonly "createImagesSse": (
35412 options: {
35413 readonly params?: typeof CreateImagesParams.Encoded | undefined
35414 readonly payload: typeof CreateImagesRequestJson.Encoded
35415 }
35416 ) => Stream.Stream<
35417 { readonly event: string; readonly id: string | undefined; readonly data: typeof CreateImages200Sse.Type },
35418 HttpClientError.HttpClientError | SchemaError | Sse.Retry | Sse.SseError,
35419 typeof CreateImages200Sse.DecodingServices
35420 >
35421 /**
35422 * Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records.
35423 */
35424 readonly "listImageModels": <Config extends OperationConfig>(
35425 options: {
35426 readonly params?: typeof ListImageModelsParams.Encoded | undefined
35427 readonly config?: Config | undefined
35428 } | undefined
35429 ) => Effect.Effect<
35430 WithOptionalResponse<typeof ListImageModels200.Type, Config>,
35431 | HttpClientError.HttpClientError
35432 | SchemaError
35433 | OpenRouterClientError<"ListImageModels500", typeof ListImageModels500.Type>
35434 >
35435 /**
35436 * Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist.
35437 */
35438 readonly "listImageModelEndpoints": <Config extends OperationConfig>(
35439 author: string,
35440 slug: string,
35441 options: {
35442 readonly params?: typeof ListImageModelEndpointsParams.Encoded | undefined
35443 readonly config?: Config | undefined
35444 } | undefined
35445 ) => Effect.Effect<
35446 WithOptionalResponse<typeof ListImageModelEndpoints200.Type, Config>,
35447 | HttpClientError.HttpClientError
35448 | SchemaError
35449 | OpenRouterClientError<"ListImageModelEndpoints404", typeof ListImageModelEndpoints404.Type>
35450 | OpenRouterClientError<"ListImageModelEndpoints500", typeof ListImageModelEndpoints500.Type>
35451 >
35452 /**
35453 * Get information on the API key associated with the current authentication session
35454 */
35455 readonly "getCurrentKey": <Config extends OperationConfig>(
35456 options:
35457 | { readonly params?: typeof GetCurrentKeyParams.Encoded | undefined; readonly config?: Config | undefined }
35458 | undefined
35459 ) => Effect.Effect<
35460 WithOptionalResponse<typeof GetCurrentKey200.Type, Config>,
35461 | HttpClientError.HttpClientError
35462 | SchemaError
35463 | OpenRouterClientError<"GetCurrentKey401", typeof GetCurrentKey401.Type>
35464 | OpenRouterClientError<"GetCurrentKey500", typeof GetCurrentKey500.Type>
35465 >
35466 /**
35467 * List all API keys for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35468 */
35469 readonly "list": <Config extends OperationConfig>(
35470 options:
35471 | { readonly params?: typeof ListParams.Encoded | undefined; readonly config?: Config | undefined }
35472 | undefined
35473 ) => Effect.Effect<
35474 WithOptionalResponse<typeof List200.Type, Config>,
35475 | HttpClientError.HttpClientError
35476 | SchemaError
35477 | OpenRouterClientError<"List400", typeof List400.Type>
35478 | OpenRouterClientError<"List401", typeof List401.Type>
35479 | OpenRouterClientError<"List429", typeof List429.Type>
35480 | OpenRouterClientError<"List500", typeof List500.Type>
35481 >
35482 /**
35483 * Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35484 */
35485 readonly "createKeys": <Config extends OperationConfig>(
35486 options: {
35487 readonly params?: typeof CreateKeysParams.Encoded | undefined
35488 readonly payload: typeof CreateKeysRequestJson.Encoded
35489 readonly config?: Config | undefined
35490 }
35491 ) => Effect.Effect<
35492 WithOptionalResponse<typeof CreateKeys201.Type, Config>,
35493 | HttpClientError.HttpClientError
35494 | SchemaError
35495 | OpenRouterClientError<"CreateKeys400", typeof CreateKeys400.Type>
35496 | OpenRouterClientError<"CreateKeys401", typeof CreateKeys401.Type>
35497 | OpenRouterClientError<"CreateKeys403", typeof CreateKeys403.Type>
35498 | OpenRouterClientError<"CreateKeys429", typeof CreateKeys429.Type>
35499 | OpenRouterClientError<"CreateKeys500", typeof CreateKeys500.Type>
35500 >
35501 /**
35502 * Get a single API key by hash. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35503 */
35504 readonly "getKey": <Config extends OperationConfig>(
35505 hash: string,
35506 options:
35507 | { readonly params?: typeof GetKeyParams.Encoded | undefined; readonly config?: Config | undefined }
35508 | undefined
35509 ) => Effect.Effect<
35510 WithOptionalResponse<typeof GetKey200.Type, Config>,
35511 | HttpClientError.HttpClientError
35512 | SchemaError
35513 | OpenRouterClientError<"GetKey401", typeof GetKey401.Type>
35514 | OpenRouterClientError<"GetKey404", typeof GetKey404.Type>
35515 | OpenRouterClientError<"GetKey429", typeof GetKey429.Type>
35516 | OpenRouterClientError<"GetKey500", typeof GetKey500.Type>
35517 >
35518 /**
35519 * Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35520 */
35521 readonly "deleteKeys": <Config extends OperationConfig>(
35522 hash: string,
35523 options:
35524 | { readonly params?: typeof DeleteKeysParams.Encoded | undefined; readonly config?: Config | undefined }
35525 | undefined
35526 ) => Effect.Effect<
35527 WithOptionalResponse<typeof DeleteKeys200.Type, Config>,
35528 | HttpClientError.HttpClientError
35529 | SchemaError
35530 | OpenRouterClientError<"DeleteKeys401", typeof DeleteKeys401.Type>
35531 | OpenRouterClientError<"DeleteKeys404", typeof DeleteKeys404.Type>
35532 | OpenRouterClientError<"DeleteKeys429", typeof DeleteKeys429.Type>
35533 | OpenRouterClientError<"DeleteKeys500", typeof DeleteKeys500.Type>
35534 >
35535 /**
35536 * Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35537 */
35538 readonly "updateKeys": <Config extends OperationConfig>(
35539 hash: string,
35540 options: {
35541 readonly params?: typeof UpdateKeysParams.Encoded | undefined
35542 readonly payload: typeof UpdateKeysRequestJson.Encoded
35543 readonly config?: Config | undefined
35544 }
35545 ) => Effect.Effect<
35546 WithOptionalResponse<typeof UpdateKeys200.Type, Config>,
35547 | HttpClientError.HttpClientError
35548 | SchemaError
35549 | OpenRouterClientError<"UpdateKeys400", typeof UpdateKeys400.Type>
35550 | OpenRouterClientError<"UpdateKeys401", typeof UpdateKeys401.Type>
35551 | OpenRouterClientError<"UpdateKeys404", typeof UpdateKeys404.Type>
35552 | OpenRouterClientError<"UpdateKeys429", typeof UpdateKeys429.Type>
35553 | OpenRouterClientError<"UpdateKeys500", typeof UpdateKeys500.Type>
35554 >
35555 /**
35556 * Creates a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended thinking.
35557 */
35558 readonly "createMessages": <Config extends OperationConfig>(
35559 options: {
35560 readonly params?: typeof CreateMessagesParams.Encoded | undefined
35561 readonly payload: typeof CreateMessagesRequestJson.Encoded
35562 readonly config?: Config | undefined
35563 }
35564 ) => Effect.Effect<
35565 WithOptionalResponse<typeof CreateMessages200.Type, Config>,
35566 | HttpClientError.HttpClientError
35567 | SchemaError
35568 | OpenRouterClientError<"CreateMessages400", typeof CreateMessages400.Type>
35569 | OpenRouterClientError<"CreateMessages401", typeof CreateMessages401.Type>
35570 | OpenRouterClientError<"CreateMessages403", typeof CreateMessages403.Type>
35571 | OpenRouterClientError<"CreateMessages404", typeof CreateMessages404.Type>
35572 | OpenRouterClientError<"CreateMessages429", typeof CreateMessages429.Type>
35573 | OpenRouterClientError<"CreateMessages500", typeof CreateMessages500.Type>
35574 | OpenRouterClientError<"CreateMessages503", typeof CreateMessages503.Type>
35575 | OpenRouterClientError<"CreateMessages529", typeof CreateMessages529.Type>
35576 >
35577 /**
35578 * Creates a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended thinking.
35579 */
35580 readonly "createMessagesSse": (
35581 options: {
35582 readonly params?: typeof CreateMessagesParams.Encoded | undefined
35583 readonly payload: typeof CreateMessagesRequestJson.Encoded
35584 }
35585 ) => Stream.Stream<
35586 { readonly event: string; readonly id: string | undefined; readonly data: typeof CreateMessages200Sse.Type },
35587 HttpClientError.HttpClientError | SchemaError | Sse.Retry | Sse.SseError,
35588 typeof CreateMessages200Sse.DecodingServices
35589 >
35590 /**
35591 * Returns full details for a single model identified by its author and slug (e.g. openai/gpt-4). Supports variant suffixes (e.g. openai/gpt-4:free) and resolves known slug aliases.
35592 */
35593 readonly "getModel": <Config extends OperationConfig>(
35594 author: string,
35595 slug: string,
35596 options:
35597 | { readonly params?: typeof GetModelParams.Encoded | undefined; readonly config?: Config | undefined }
35598 | undefined
35599 ) => Effect.Effect<
35600 WithOptionalResponse<typeof GetModel200.Type, Config>,
35601 | HttpClientError.HttpClientError
35602 | SchemaError
35603 | OpenRouterClientError<"GetModel403", typeof GetModel403.Type>
35604 | OpenRouterClientError<"GetModel404", typeof GetModel404.Type>
35605 | OpenRouterClientError<"GetModel500", typeof GetModel500.Type>
35606 >
35607 /**
35608 * List all models and their properties
35609 */
35610 readonly "getModels": <Config extends OperationConfig>(
35611 options:
35612 | { readonly params?: typeof GetModelsParams.Encoded | undefined; readonly config?: Config | undefined }
35613 | undefined
35614 ) => Effect.Effect<
35615 WithOptionalResponse<typeof GetModels200.Type, Config>,
35616 | HttpClientError.HttpClientError
35617 | SchemaError
35618 | OpenRouterClientError<"GetModels400", typeof GetModels400.Type>
35619 | OpenRouterClientError<"GetModels403", typeof GetModels403.Type>
35620 | OpenRouterClientError<"GetModels500", typeof GetModels500.Type>
35621 >
35622 /**
35623 * List all endpoints for a model
35624 */
35625 readonly "listEndpoints": <Config extends OperationConfig>(
35626 author: string,
35627 slug: string,
35628 options:
35629 | { readonly params?: typeof ListEndpointsParams.Encoded | undefined; readonly config?: Config | undefined }
35630 | undefined
35631 ) => Effect.Effect<
35632 WithOptionalResponse<typeof ListEndpoints200.Type, Config>,
35633 | HttpClientError.HttpClientError
35634 | SchemaError
35635 | OpenRouterClientError<"ListEndpoints403", typeof ListEndpoints403.Type>
35636 | OpenRouterClientError<"ListEndpoints404", typeof ListEndpoints404.Type>
35637 | OpenRouterClientError<"ListEndpoints500", typeof ListEndpoints500.Type>
35638 >
35639 /**
35640 * Get total count of available models
35641 */
35642 readonly "listModelsCount": <Config extends OperationConfig>(
35643 options: {
35644 readonly params?: typeof ListModelsCountParams.Encoded | undefined
35645 readonly config?: Config | undefined
35646 } | undefined
35647 ) => Effect.Effect<
35648 WithOptionalResponse<typeof ListModelsCount200.Type, Config>,
35649 | HttpClientError.HttpClientError
35650 | SchemaError
35651 | OpenRouterClientError<"ListModelsCount400", typeof ListModelsCount400.Type>
35652 | OpenRouterClientError<"ListModelsCount403", typeof ListModelsCount403.Type>
35653 | OpenRouterClientError<"ListModelsCount500", typeof ListModelsCount500.Type>
35654 >
35655 /**
35656 * List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing).
35657 */
35658 readonly "listModelsUser": <Config extends OperationConfig>(
35659 options:
35660 | { readonly params?: typeof ListModelsUserParams.Encoded | undefined; readonly config?: Config | undefined }
35661 | undefined
35662 ) => Effect.Effect<
35663 WithOptionalResponse<typeof ListModelsUser200.Type, Config>,
35664 | HttpClientError.HttpClientError
35665 | SchemaError
35666 | OpenRouterClientError<"ListModelsUser401", typeof ListModelsUser401.Type>
35667 | OpenRouterClientError<"ListModelsUser403", typeof ListModelsUser403.Type>
35668 | OpenRouterClientError<"ListModelsUser404", typeof ListModelsUser404.Type>
35669 | OpenRouterClientError<"ListModelsUser500", typeof ListModelsUser500.Type>
35670 >
35671 /**
35672 * List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35673 */
35674 readonly "listObservabilityDestinations": <Config extends OperationConfig>(
35675 options: {
35676 readonly params?: typeof ListObservabilityDestinationsParams.Encoded | undefined
35677 readonly config?: Config | undefined
35678 } | undefined
35679 ) => Effect.Effect<
35680 WithOptionalResponse<typeof ListObservabilityDestinations200.Type, Config>,
35681 | HttpClientError.HttpClientError
35682 | SchemaError
35683 | OpenRouterClientError<"ListObservabilityDestinations400", typeof ListObservabilityDestinations400.Type>
35684 | OpenRouterClientError<"ListObservabilityDestinations401", typeof ListObservabilityDestinations401.Type>
35685 | OpenRouterClientError<"ListObservabilityDestinations500", typeof ListObservabilityDestinations500.Type>
35686 >
35687 /**
35688 * Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35689 */
35690 readonly "createObservabilityDestination": <Config extends OperationConfig>(
35691 options: {
35692 readonly params?: typeof CreateObservabilityDestinationParams.Encoded | undefined
35693 readonly payload: typeof CreateObservabilityDestinationRequestJson.Encoded
35694 readonly config?: Config | undefined
35695 }
35696 ) => Effect.Effect<
35697 WithOptionalResponse<typeof CreateObservabilityDestination201.Type, Config>,
35698 | HttpClientError.HttpClientError
35699 | SchemaError
35700 | OpenRouterClientError<"CreateObservabilityDestination400", typeof CreateObservabilityDestination400.Type>
35701 | OpenRouterClientError<"CreateObservabilityDestination401", typeof CreateObservabilityDestination401.Type>
35702 | OpenRouterClientError<"CreateObservabilityDestination403", typeof CreateObservabilityDestination403.Type>
35703 | OpenRouterClientError<"CreateObservabilityDestination409", typeof CreateObservabilityDestination409.Type>
35704 | OpenRouterClientError<"CreateObservabilityDestination500", typeof CreateObservabilityDestination500.Type>
35705 >
35706 /**
35707 * Fetch a single observability destination by its UUID. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35708 */
35709 readonly "getObservabilityDestination": <Config extends OperationConfig>(
35710 id: string,
35711 options: {
35712 readonly params?: typeof GetObservabilityDestinationParams.Encoded | undefined
35713 readonly config?: Config | undefined
35714 } | undefined
35715 ) => Effect.Effect<
35716 WithOptionalResponse<typeof GetObservabilityDestination200.Type, Config>,
35717 | HttpClientError.HttpClientError
35718 | SchemaError
35719 | OpenRouterClientError<"GetObservabilityDestination401", typeof GetObservabilityDestination401.Type>
35720 | OpenRouterClientError<"GetObservabilityDestination404", typeof GetObservabilityDestination404.Type>
35721 | OpenRouterClientError<"GetObservabilityDestination500", typeof GetObservabilityDestination500.Type>
35722 >
35723 /**
35724 * Delete an existing observability destination. This performs a soft delete. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35725 */
35726 readonly "deleteObservabilityDestination": <Config extends OperationConfig>(
35727 id: string,
35728 options: {
35729 readonly params?: typeof DeleteObservabilityDestinationParams.Encoded | undefined
35730 readonly config?: Config | undefined
35731 } | undefined
35732 ) => Effect.Effect<
35733 WithOptionalResponse<typeof DeleteObservabilityDestination200.Type, Config>,
35734 | HttpClientError.HttpClientError
35735 | SchemaError
35736 | OpenRouterClientError<"DeleteObservabilityDestination401", typeof DeleteObservabilityDestination401.Type>
35737 | OpenRouterClientError<"DeleteObservabilityDestination404", typeof DeleteObservabilityDestination404.Type>
35738 | OpenRouterClientError<"DeleteObservabilityDestination500", typeof DeleteObservabilityDestination500.Type>
35739 >
35740 /**
35741 * Update an existing observability destination. Only the fields provided in the request body are updated. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35742 */
35743 readonly "updateObservabilityDestination": <Config extends OperationConfig>(
35744 id: string,
35745 options: {
35746 readonly params?: typeof UpdateObservabilityDestinationParams.Encoded | undefined
35747 readonly payload: typeof UpdateObservabilityDestinationRequestJson.Encoded
35748 readonly config?: Config | undefined
35749 }
35750 ) => Effect.Effect<
35751 WithOptionalResponse<typeof UpdateObservabilityDestination200.Type, Config>,
35752 | HttpClientError.HttpClientError
35753 | SchemaError
35754 | OpenRouterClientError<"UpdateObservabilityDestination400", typeof UpdateObservabilityDestination400.Type>
35755 | OpenRouterClientError<"UpdateObservabilityDestination401", typeof UpdateObservabilityDestination401.Type>
35756 | OpenRouterClientError<"UpdateObservabilityDestination404", typeof UpdateObservabilityDestination404.Type>
35757 | OpenRouterClientError<"UpdateObservabilityDestination409", typeof UpdateObservabilityDestination409.Type>
35758 | OpenRouterClientError<"UpdateObservabilityDestination500", typeof UpdateObservabilityDestination500.Type>
35759 >
35760 /**
35761 * List all members of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35762 */
35763 readonly "listOrganizationMembers": <Config extends OperationConfig>(
35764 options: {
35765 readonly params?: typeof ListOrganizationMembersParams.Encoded | undefined
35766 readonly config?: Config | undefined
35767 } | undefined
35768 ) => Effect.Effect<
35769 WithOptionalResponse<typeof ListOrganizationMembers200.Type, Config>,
35770 | HttpClientError.HttpClientError
35771 | SchemaError
35772 | OpenRouterClientError<"ListOrganizationMembers401", typeof ListOrganizationMembers401.Type>
35773 | OpenRouterClientError<"ListOrganizationMembers404", typeof ListOrganizationMembers404.Type>
35774 | OpenRouterClientError<"ListOrganizationMembers500", typeof ListOrganizationMembers500.Type>
35775 >
35776 /**
35777 * Lists all presets for the authenticated user, ordered by most recently updated first.
35778 */
35779 readonly "listPresets": <Config extends OperationConfig>(
35780 options:
35781 | { readonly params?: typeof ListPresetsParams.Encoded | undefined; readonly config?: Config | undefined }
35782 | undefined
35783 ) => Effect.Effect<
35784 WithOptionalResponse<typeof ListPresets200.Type, Config>,
35785 | HttpClientError.HttpClientError
35786 | SchemaError
35787 | OpenRouterClientError<"ListPresets400", typeof ListPresets400.Type>
35788 | OpenRouterClientError<"ListPresets401", typeof ListPresets401.Type>
35789 | OpenRouterClientError<"ListPresets500", typeof ListPresets500.Type>
35790 >
35791 /**
35792 * Retrieves a preset by its slug with its currently designated version inline.
35793 */
35794 readonly "getPreset": <Config extends OperationConfig>(
35795 slug: string,
35796 options:
35797 | { readonly params?: typeof GetPresetParams.Encoded | undefined; readonly config?: Config | undefined }
35798 | undefined
35799 ) => Effect.Effect<
35800 WithOptionalResponse<typeof GetPreset200.Type, Config>,
35801 | HttpClientError.HttpClientError
35802 | SchemaError
35803 | OpenRouterClientError<"GetPreset400", typeof GetPreset400.Type>
35804 | OpenRouterClientError<"GetPreset401", typeof GetPreset401.Type>
35805 | OpenRouterClientError<"GetPreset404", typeof GetPreset404.Type>
35806 | OpenRouterClientError<"GetPreset500", typeof GetPreset500.Type>
35807 >
35808 /**
35809 * Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored.
35810 */
35811 readonly "createPresetsChatCompletions": <Config extends OperationConfig>(
35812 slug: string,
35813 options: {
35814 readonly params?: typeof CreatePresetsChatCompletionsParams.Encoded | undefined
35815 readonly payload: typeof CreatePresetsChatCompletionsRequestJson.Encoded
35816 readonly config?: Config | undefined
35817 }
35818 ) => Effect.Effect<
35819 WithOptionalResponse<typeof CreatePresetsChatCompletions200.Type, Config>,
35820 | HttpClientError.HttpClientError
35821 | SchemaError
35822 | OpenRouterClientError<"CreatePresetsChatCompletions400", typeof CreatePresetsChatCompletions400.Type>
35823 | OpenRouterClientError<"CreatePresetsChatCompletions401", typeof CreatePresetsChatCompletions401.Type>
35824 | OpenRouterClientError<"CreatePresetsChatCompletions403", typeof CreatePresetsChatCompletions403.Type>
35825 | OpenRouterClientError<"CreatePresetsChatCompletions404", typeof CreatePresetsChatCompletions404.Type>
35826 | OpenRouterClientError<"CreatePresetsChatCompletions409", typeof CreatePresetsChatCompletions409.Type>
35827 | OpenRouterClientError<"CreatePresetsChatCompletions500", typeof CreatePresetsChatCompletions500.Type>
35828 >
35829 /**
35830 * Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored.
35831 */
35832 readonly "createPresetsMessages": <Config extends OperationConfig>(
35833 slug: string,
35834 options: {
35835 readonly params?: typeof CreatePresetsMessagesParams.Encoded | undefined
35836 readonly payload: typeof CreatePresetsMessagesRequestJson.Encoded
35837 readonly config?: Config | undefined
35838 }
35839 ) => Effect.Effect<
35840 WithOptionalResponse<typeof CreatePresetsMessages200.Type, Config>,
35841 | HttpClientError.HttpClientError
35842 | SchemaError
35843 | OpenRouterClientError<"CreatePresetsMessages400", typeof CreatePresetsMessages400.Type>
35844 | OpenRouterClientError<"CreatePresetsMessages401", typeof CreatePresetsMessages401.Type>
35845 | OpenRouterClientError<"CreatePresetsMessages403", typeof CreatePresetsMessages403.Type>
35846 | OpenRouterClientError<"CreatePresetsMessages404", typeof CreatePresetsMessages404.Type>
35847 | OpenRouterClientError<"CreatePresetsMessages409", typeof CreatePresetsMessages409.Type>
35848 | OpenRouterClientError<"CreatePresetsMessages500", typeof CreatePresetsMessages500.Type>
35849 >
35850 /**
35851 * Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored.
35852 */
35853 readonly "createPresetsResponses": <Config extends OperationConfig>(
35854 slug: string,
35855 options: {
35856 readonly params?: typeof CreatePresetsResponsesParams.Encoded | undefined
35857 readonly payload: typeof CreatePresetsResponsesRequestJson.Encoded
35858 readonly config?: Config | undefined
35859 }
35860 ) => Effect.Effect<
35861 WithOptionalResponse<typeof CreatePresetsResponses200.Type, Config>,
35862 | HttpClientError.HttpClientError
35863 | SchemaError
35864 | OpenRouterClientError<"CreatePresetsResponses400", typeof CreatePresetsResponses400.Type>
35865 | OpenRouterClientError<"CreatePresetsResponses401", typeof CreatePresetsResponses401.Type>
35866 | OpenRouterClientError<"CreatePresetsResponses403", typeof CreatePresetsResponses403.Type>
35867 | OpenRouterClientError<"CreatePresetsResponses404", typeof CreatePresetsResponses404.Type>
35868 | OpenRouterClientError<"CreatePresetsResponses409", typeof CreatePresetsResponses409.Type>
35869 | OpenRouterClientError<"CreatePresetsResponses500", typeof CreatePresetsResponses500.Type>
35870 >
35871 /**
35872 * Lists all versions of a preset, ordered by version number ascending (oldest first).
35873 */
35874 readonly "listPresetVersions": <Config extends OperationConfig>(
35875 slug: string,
35876 options: {
35877 readonly params?: typeof ListPresetVersionsParams.Encoded | undefined
35878 readonly config?: Config | undefined
35879 } | undefined
35880 ) => Effect.Effect<
35881 WithOptionalResponse<typeof ListPresetVersions200.Type, Config>,
35882 | HttpClientError.HttpClientError
35883 | SchemaError
35884 | OpenRouterClientError<"ListPresetVersions400", typeof ListPresetVersions400.Type>
35885 | OpenRouterClientError<"ListPresetVersions401", typeof ListPresetVersions401.Type>
35886 | OpenRouterClientError<"ListPresetVersions404", typeof ListPresetVersions404.Type>
35887 | OpenRouterClientError<"ListPresetVersions500", typeof ListPresetVersions500.Type>
35888 >
35889 /**
35890 * Retrieves a specific version of a preset by its slug and version number.
35891 */
35892 readonly "getPresetVersion": <Config extends OperationConfig>(
35893 slug: string,
35894 version: string,
35895 options: {
35896 readonly params?: typeof GetPresetVersionParams.Encoded | undefined
35897 readonly config?: Config | undefined
35898 } | undefined
35899 ) => Effect.Effect<
35900 WithOptionalResponse<typeof GetPresetVersion200.Type, Config>,
35901 | HttpClientError.HttpClientError
35902 | SchemaError
35903 | OpenRouterClientError<"GetPresetVersion400", typeof GetPresetVersion400.Type>
35904 | OpenRouterClientError<"GetPresetVersion401", typeof GetPresetVersion401.Type>
35905 | OpenRouterClientError<"GetPresetVersion404", typeof GetPresetVersion404.Type>
35906 | OpenRouterClientError<"GetPresetVersion500", typeof GetPresetVersion500.Type>
35907 >
35908 /**
35909 * List all providers
35910 */
35911 readonly "listProviders": <Config extends OperationConfig>(
35912 options:
35913 | { readonly params?: typeof ListProvidersParams.Encoded | undefined; readonly config?: Config | undefined }
35914 | undefined
35915 ) => Effect.Effect<
35916 WithOptionalResponse<typeof ListProviders200.Type, Config>,
35917 | HttpClientError.HttpClientError
35918 | SchemaError
35919 | OpenRouterClientError<"ListProviders500", typeof ListProviders500.Type>
35920 >
35921 /**
35922 * Submits a rerank request to the rerank router
35923 */
35924 readonly "createRerank": <Config extends OperationConfig>(
35925 options: {
35926 readonly params?: typeof CreateRerankParams.Encoded | undefined
35927 readonly payload: typeof CreateRerankRequestJson.Encoded
35928 readonly config?: Config | undefined
35929 }
35930 ) => Effect.Effect<
35931 WithOptionalResponse<typeof CreateRerank200.Type, Config>,
35932 | HttpClientError.HttpClientError
35933 | SchemaError
35934 | OpenRouterClientError<"CreateRerank400", typeof CreateRerank400.Type>
35935 | OpenRouterClientError<"CreateRerank401", typeof CreateRerank401.Type>
35936 | OpenRouterClientError<"CreateRerank402", typeof CreateRerank402.Type>
35937 | OpenRouterClientError<"CreateRerank404", typeof CreateRerank404.Type>
35938 | OpenRouterClientError<"CreateRerank429", typeof CreateRerank429.Type>
35939 | OpenRouterClientError<"CreateRerank500", typeof CreateRerank500.Type>
35940 | OpenRouterClientError<"CreateRerank502", typeof CreateRerank502.Type>
35941 | OpenRouterClientError<"CreateRerank503", typeof CreateRerank503.Type>
35942 | OpenRouterClientError<"CreateRerank524", typeof CreateRerank524.Type>
35943 | OpenRouterClientError<"CreateRerank529", typeof CreateRerank529.Type>
35944 >
35945 /**
35946 * Submits a rerank request to the rerank router
35947 */
35948 readonly "createRerankSse": (
35949 options: {
35950 readonly params?: typeof CreateRerankParams.Encoded | undefined
35951 readonly payload: typeof CreateRerankRequestJson.Encoded
35952 }
35953 ) => Stream.Stream<
35954 { readonly event: string; readonly id: string | undefined; readonly data: typeof CreateRerank200Sse.Type },
35955 HttpClientError.HttpClientError | SchemaError | Sse.Retry | Sse.SseError,
35956 typeof CreateRerank200Sse.DecodingServices
35957 >
35958 /**
35959 * Creates a streaming or non-streaming response using OpenResponses API format
35960 */
35961 readonly "createResponses": <Config extends OperationConfig>(
35962 options: {
35963 readonly params?: typeof CreateResponsesParams.Encoded | undefined
35964 readonly payload: typeof CreateResponsesRequestJson.Encoded
35965 readonly config?: Config | undefined
35966 }
35967 ) => Effect.Effect<
35968 WithOptionalResponse<typeof CreateResponses200.Type, Config>,
35969 | HttpClientError.HttpClientError
35970 | SchemaError
35971 | OpenRouterClientError<"CreateResponses400", typeof CreateResponses400.Type>
35972 | OpenRouterClientError<"CreateResponses401", typeof CreateResponses401.Type>
35973 | OpenRouterClientError<"CreateResponses402", typeof CreateResponses402.Type>
35974 | OpenRouterClientError<"CreateResponses403", typeof CreateResponses403.Type>
35975 | OpenRouterClientError<"CreateResponses404", typeof CreateResponses404.Type>
35976 | OpenRouterClientError<"CreateResponses408", typeof CreateResponses408.Type>
35977 | OpenRouterClientError<"CreateResponses413", typeof CreateResponses413.Type>
35978 | OpenRouterClientError<"CreateResponses422", typeof CreateResponses422.Type>
35979 | OpenRouterClientError<"CreateResponses429", typeof CreateResponses429.Type>
35980 | OpenRouterClientError<"CreateResponses500", typeof CreateResponses500.Type>
35981 | OpenRouterClientError<"CreateResponses502", typeof CreateResponses502.Type>
35982 | OpenRouterClientError<"CreateResponses503", typeof CreateResponses503.Type>
35983 | OpenRouterClientError<"CreateResponses524", typeof CreateResponses524.Type>
35984 | OpenRouterClientError<"CreateResponses529", typeof CreateResponses529.Type>
35985 >
35986 /**
35987 * Creates a streaming or non-streaming response using OpenResponses API format
35988 */
35989 readonly "createResponsesSse": (
35990 options: {
35991 readonly params?: typeof CreateResponsesParams.Encoded | undefined
35992 readonly payload: typeof CreateResponsesRequestJson.Encoded
35993 }
35994 ) => Stream.Stream<
35995 { readonly event: string; readonly id: string | undefined; readonly data: typeof CreateResponses200Sse.Type },
35996 HttpClientError.HttpClientError | SchemaError | Sse.Retry | Sse.SseError,
35997 typeof CreateResponses200Sse.DecodingServices
35998 >
35999 /**
36000 * Submits a video generation request and returns a polling URL to check status
36001 */
36002 readonly "createVideos": <Config extends OperationConfig>(
36003 options: {
36004 readonly params?: typeof CreateVideosParams.Encoded | undefined
36005 readonly payload: typeof CreateVideosRequestJson.Encoded
36006 readonly config?: Config | undefined
36007 }
36008 ) => Effect.Effect<
36009 WithOptionalResponse<typeof CreateVideos202.Type, Config>,
36010 | HttpClientError.HttpClientError
36011 | SchemaError
36012 | OpenRouterClientError<"CreateVideos400", typeof CreateVideos400.Type>
36013 | OpenRouterClientError<"CreateVideos401", typeof CreateVideos401.Type>
36014 | OpenRouterClientError<"CreateVideos402", typeof CreateVideos402.Type>
36015 | OpenRouterClientError<"CreateVideos404", typeof CreateVideos404.Type>
36016 | OpenRouterClientError<"CreateVideos429", typeof CreateVideos429.Type>
36017 | OpenRouterClientError<"CreateVideos500", typeof CreateVideos500.Type>
36018 >
36019 /**
36020 * Returns job status and content URLs when completed
36021 */
36022 readonly "getVideos": <Config extends OperationConfig>(
36023 jobId: string,
36024 options:
36025 | { readonly params?: typeof GetVideosParams.Encoded | undefined; readonly config?: Config | undefined }
36026 | undefined
36027 ) => Effect.Effect<
36028 WithOptionalResponse<typeof GetVideos200.Type, Config>,
36029 | HttpClientError.HttpClientError
36030 | SchemaError
36031 | OpenRouterClientError<"GetVideos401", typeof GetVideos401.Type>
36032 | OpenRouterClientError<"GetVideos404", typeof GetVideos404.Type>
36033 | OpenRouterClientError<"GetVideos500", typeof GetVideos500.Type>
36034 >
36035 /**
36036 * Streams the generated video content from the upstream provider
36037 */
36038 readonly "listVideosContent": <Config extends OperationConfig>(
36039 jobId: string,
36040 options: {
36041 readonly params?: typeof ListVideosContentParams.Encoded | undefined
36042 readonly config?: Config | undefined
36043 } | undefined
36044 ) => Effect.Effect<
36045 WithOptionalResponse<void, Config>,
36046 | HttpClientError.HttpClientError
36047 | SchemaError
36048 | OpenRouterClientError<"ListVideosContent400", typeof ListVideosContent400.Type>
36049 | OpenRouterClientError<"ListVideosContent401", typeof ListVideosContent401.Type>
36050 | OpenRouterClientError<"ListVideosContent404", typeof ListVideosContent404.Type>
36051 | OpenRouterClientError<"ListVideosContent500", typeof ListVideosContent500.Type>
36052 | OpenRouterClientError<"ListVideosContent502", typeof ListVideosContent502.Type>
36053 >
36054 /**
36055 * Returns a list of all available video generation models and their properties
36056 */
36057 readonly "listVideosModels": <Config extends OperationConfig>(
36058 options: {
36059 readonly params?: typeof ListVideosModelsParams.Encoded | undefined
36060 readonly config?: Config | undefined
36061 } | undefined
36062 ) => Effect.Effect<
36063 WithOptionalResponse<typeof ListVideosModels200.Type, Config>,
36064 | HttpClientError.HttpClientError
36065 | SchemaError
36066 | OpenRouterClientError<"ListVideosModels400", typeof ListVideosModels400.Type>
36067 | OpenRouterClientError<"ListVideosModels500", typeof ListVideosModels500.Type>
36068 >
36069 /**
36070 * List all workspaces for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36071 */
36072 readonly "listWorkspaces": <Config extends OperationConfig>(
36073 options:
36074 | { readonly params?: typeof ListWorkspacesParams.Encoded | undefined; readonly config?: Config | undefined }
36075 | undefined
36076 ) => Effect.Effect<
36077 WithOptionalResponse<typeof ListWorkspaces200.Type, Config>,
36078 | HttpClientError.HttpClientError
36079 | SchemaError
36080 | OpenRouterClientError<"ListWorkspaces401", typeof ListWorkspaces401.Type>
36081 | OpenRouterClientError<"ListWorkspaces500", typeof ListWorkspaces500.Type>
36082 >
36083 /**
36084 * Create a new workspace for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36085 */
36086 readonly "createWorkspace": <Config extends OperationConfig>(
36087 options: {
36088 readonly params?: typeof CreateWorkspaceParams.Encoded | undefined
36089 readonly payload: typeof CreateWorkspaceRequestJson.Encoded
36090 readonly config?: Config | undefined
36091 }
36092 ) => Effect.Effect<
36093 WithOptionalResponse<typeof CreateWorkspace201.Type, Config>,
36094 | HttpClientError.HttpClientError
36095 | SchemaError
36096 | OpenRouterClientError<"CreateWorkspace400", typeof CreateWorkspace400.Type>
36097 | OpenRouterClientError<"CreateWorkspace401", typeof CreateWorkspace401.Type>
36098 | OpenRouterClientError<"CreateWorkspace403", typeof CreateWorkspace403.Type>
36099 | OpenRouterClientError<"CreateWorkspace500", typeof CreateWorkspace500.Type>
36100 >
36101 /**
36102 * Get a single workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36103 */
36104 readonly "getWorkspace": <Config extends OperationConfig>(
36105 id: string,
36106 options:
36107 | { readonly params?: typeof GetWorkspaceParams.Encoded | undefined; readonly config?: Config | undefined }
36108 | undefined
36109 ) => Effect.Effect<
36110 WithOptionalResponse<typeof GetWorkspace200.Type, Config>,
36111 | HttpClientError.HttpClientError
36112 | SchemaError
36113 | OpenRouterClientError<"GetWorkspace401", typeof GetWorkspace401.Type>
36114 | OpenRouterClientError<"GetWorkspace404", typeof GetWorkspace404.Type>
36115 | OpenRouterClientError<"GetWorkspace500", typeof GetWorkspace500.Type>
36116 >
36117 /**
36118 * Delete an existing workspace. The default workspace cannot be deleted. Workspaces with active API keys cannot be deleted; remove the keys first. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36119 */
36120 readonly "deleteWorkspace": <Config extends OperationConfig>(
36121 id: string,
36122 options: {
36123 readonly params?: typeof DeleteWorkspaceParams.Encoded | undefined
36124 readonly config?: Config | undefined
36125 } | undefined
36126 ) => Effect.Effect<
36127 WithOptionalResponse<typeof DeleteWorkspace200.Type, Config>,
36128 | HttpClientError.HttpClientError
36129 | SchemaError
36130 | OpenRouterClientError<"DeleteWorkspace400", typeof DeleteWorkspace400.Type>
36131 | OpenRouterClientError<"DeleteWorkspace401", typeof DeleteWorkspace401.Type>
36132 | OpenRouterClientError<"DeleteWorkspace403", typeof DeleteWorkspace403.Type>
36133 | OpenRouterClientError<"DeleteWorkspace404", typeof DeleteWorkspace404.Type>
36134 | OpenRouterClientError<"DeleteWorkspace500", typeof DeleteWorkspace500.Type>
36135 >
36136 /**
36137 * Update an existing workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36138 */
36139 readonly "updateWorkspace": <Config extends OperationConfig>(
36140 id: string,
36141 options: {
36142 readonly params?: typeof UpdateWorkspaceParams.Encoded | undefined
36143 readonly payload: typeof UpdateWorkspaceRequestJson.Encoded
36144 readonly config?: Config | undefined
36145 }
36146 ) => Effect.Effect<
36147 WithOptionalResponse<typeof UpdateWorkspace200.Type, Config>,
36148 | HttpClientError.HttpClientError
36149 | SchemaError
36150 | OpenRouterClientError<"UpdateWorkspace400", typeof UpdateWorkspace400.Type>
36151 | OpenRouterClientError<"UpdateWorkspace401", typeof UpdateWorkspace401.Type>
36152 | OpenRouterClientError<"UpdateWorkspace403", typeof UpdateWorkspace403.Type>
36153 | OpenRouterClientError<"UpdateWorkspace404", typeof UpdateWorkspace404.Type>
36154 | OpenRouterClientError<"UpdateWorkspace500", typeof UpdateWorkspace500.Type>
36155 >
36156 /**
36157 * List all budgets configured for a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36158 */
36159 readonly "listWorkspaceBudgets": <Config extends OperationConfig>(
36160 id: string,
36161 options: {
36162 readonly params?: typeof ListWorkspaceBudgetsParams.Encoded | undefined
36163 readonly config?: Config | undefined
36164 } | undefined
36165 ) => Effect.Effect<
36166 WithOptionalResponse<typeof ListWorkspaceBudgets200.Type, Config>,
36167 | HttpClientError.HttpClientError
36168 | SchemaError
36169 | OpenRouterClientError<"ListWorkspaceBudgets401", typeof ListWorkspaceBudgets401.Type>
36170 | OpenRouterClientError<"ListWorkspaceBudgets404", typeof ListWorkspaceBudgets404.Type>
36171 | OpenRouterClientError<"ListWorkspaceBudgets500", typeof ListWorkspaceBudgets500.Type>
36172 >
36173 /**
36174 * Create or update the budget for a given interval. Budget limits must strictly decrease as the interval narrows (lifetime > monthly > weekly > daily). [Management key](/docs/guides/overview/auth/management-api-keys) required.
36175 */
36176 readonly "upsertWorkspaceBudget": <Config extends OperationConfig>(
36177 id: string,
36178 interval: string,
36179 options: {
36180 readonly params?: typeof UpsertWorkspaceBudgetParams.Encoded | undefined
36181 readonly payload: typeof UpsertWorkspaceBudgetRequestJson.Encoded
36182 readonly config?: Config | undefined
36183 }
36184 ) => Effect.Effect<
36185 WithOptionalResponse<typeof UpsertWorkspaceBudget200.Type, Config>,
36186 | HttpClientError.HttpClientError
36187 | SchemaError
36188 | OpenRouterClientError<"UpsertWorkspaceBudget400", typeof UpsertWorkspaceBudget400.Type>
36189 | OpenRouterClientError<"UpsertWorkspaceBudget401", typeof UpsertWorkspaceBudget401.Type>
36190 | OpenRouterClientError<"UpsertWorkspaceBudget404", typeof UpsertWorkspaceBudget404.Type>
36191 | OpenRouterClientError<"UpsertWorkspaceBudget500", typeof UpsertWorkspaceBudget500.Type>
36192 >
36193 /**
36194 * Remove the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36195 */
36196 readonly "deleteWorkspaceBudget": <Config extends OperationConfig>(
36197 id: string,
36198 interval: string,
36199 options: {
36200 readonly params?: typeof DeleteWorkspaceBudgetParams.Encoded | undefined
36201 readonly config?: Config | undefined
36202 } | undefined
36203 ) => Effect.Effect<
36204 WithOptionalResponse<typeof DeleteWorkspaceBudget200.Type, Config>,
36205 | HttpClientError.HttpClientError
36206 | SchemaError
36207 | OpenRouterClientError<"DeleteWorkspaceBudget401", typeof DeleteWorkspaceBudget401.Type>
36208 | OpenRouterClientError<"DeleteWorkspaceBudget404", typeof DeleteWorkspaceBudget404.Type>
36209 | OpenRouterClientError<"DeleteWorkspaceBudget500", typeof DeleteWorkspaceBudget500.Type>
36210 >
36211 /**
36212 * List all members of a workspace. Returns paginated results. For the default workspace, returns all organization members (implicit membership). [Management key](/docs/guides/overview/auth/management-api-keys) required.
36213 */
36214 readonly "listWorkspaceMembers": <Config extends OperationConfig>(
36215 id: string,
36216 options: {
36217 readonly params?: typeof ListWorkspaceMembersParams.Encoded | undefined
36218 readonly config?: Config | undefined
36219 } | undefined
36220 ) => Effect.Effect<
36221 WithOptionalResponse<typeof ListWorkspaceMembers200.Type, Config>,
36222 | HttpClientError.HttpClientError
36223 | SchemaError
36224 | OpenRouterClientError<"ListWorkspaceMembers401", typeof ListWorkspaceMembers401.Type>
36225 | OpenRouterClientError<"ListWorkspaceMembers403", typeof ListWorkspaceMembers403.Type>
36226 | OpenRouterClientError<"ListWorkspaceMembers404", typeof ListWorkspaceMembers404.Type>
36227 | OpenRouterClientError<"ListWorkspaceMembers500", typeof ListWorkspaceMembers500.Type>
36228 >
36229 /**
36230 * Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36231 */
36232 readonly "bulkAddWorkspaceMembers": <Config extends OperationConfig>(
36233 id: string,
36234 options: {
36235 readonly params?: typeof BulkAddWorkspaceMembersParams.Encoded | undefined
36236 readonly payload: typeof BulkAddWorkspaceMembersRequestJson.Encoded
36237 readonly config?: Config | undefined
36238 }
36239 ) => Effect.Effect<
36240 WithOptionalResponse<typeof BulkAddWorkspaceMembers200.Type, Config>,
36241 | HttpClientError.HttpClientError
36242 | SchemaError
36243 | OpenRouterClientError<"BulkAddWorkspaceMembers400", typeof BulkAddWorkspaceMembers400.Type>
36244 | OpenRouterClientError<"BulkAddWorkspaceMembers401", typeof BulkAddWorkspaceMembers401.Type>
36245 | OpenRouterClientError<"BulkAddWorkspaceMembers403", typeof BulkAddWorkspaceMembers403.Type>
36246 | OpenRouterClientError<"BulkAddWorkspaceMembers404", typeof BulkAddWorkspaceMembers404.Type>
36247 | OpenRouterClientError<"BulkAddWorkspaceMembers500", typeof BulkAddWorkspaceMembers500.Type>
36248 >
36249 /**
36250 * Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36251 */
36252 readonly "bulkRemoveWorkspaceMembers": <Config extends OperationConfig>(
36253 id: string,
36254 options: {
36255 readonly params?: typeof BulkRemoveWorkspaceMembersParams.Encoded | undefined
36256 readonly payload: typeof BulkRemoveWorkspaceMembersRequestJson.Encoded
36257 readonly config?: Config | undefined
36258 }
36259 ) => Effect.Effect<
36260 WithOptionalResponse<typeof BulkRemoveWorkspaceMembers200.Type, Config>,
36261 | HttpClientError.HttpClientError
36262 | SchemaError
36263 | OpenRouterClientError<"BulkRemoveWorkspaceMembers400", typeof BulkRemoveWorkspaceMembers400.Type>
36264 | OpenRouterClientError<"BulkRemoveWorkspaceMembers401", typeof BulkRemoveWorkspaceMembers401.Type>
36265 | OpenRouterClientError<"BulkRemoveWorkspaceMembers403", typeof BulkRemoveWorkspaceMembers403.Type>
36266 | OpenRouterClientError<"BulkRemoveWorkspaceMembers404", typeof BulkRemoveWorkspaceMembers404.Type>
36267 | OpenRouterClientError<"BulkRemoveWorkspaceMembers500", typeof BulkRemoveWorkspaceMembers500.Type>
36268 >
36269}
36270
36271export interface OpenRouterClientError<Tag extends string, E> {
36272 readonly _tag: Tag
36273 readonly request: HttpClientRequest.HttpClientRequest
36274 readonly response: HttpClientResponse.HttpClientResponse
36275 readonly cause: E
36276}
36277
36278class OpenRouterClientErrorImpl extends Data.Error<{
36279 _tag: string
36280 cause: any
36281 request: HttpClientRequest.HttpClientRequest
36282 response: HttpClientResponse.HttpClientResponse
36283}> {}
36284
36285export const OpenRouterClientError = <Tag extends string, E>(
36286 tag: Tag,
36287 cause: E,
36288 response: HttpClientResponse.HttpClientResponse
36289): OpenRouterClientError<Tag, E> =>
36290 new OpenRouterClientErrorImpl({
36291 _tag: tag,
36292 cause,
36293 response,
36294 request: response.request
36295 }) as any