The best way to control Claude Code, Codex and more from any computer or phone
Large file — syntax highlighting disabled.
| 1 | /** |
| 2 | * @stability unstable |
| 3 | * @since 1.0.0 |
| 4 | */ |
| 5 | |
| 6 | import * as Data from "effect/Data" |
| 7 | import * as Effect from "effect/Effect" |
| 8 | import * as Sse from "effect/encoding/Sse" |
| 9 | import * as HttpClient from "effect/http/HttpClient" |
| 10 | import * as HttpClientError from "effect/http/HttpClientError" |
| 11 | import * as HttpClientRequest from "effect/http/HttpClientRequest" |
| 12 | import * as HttpClientResponse from "effect/http/HttpClientResponse" |
| 13 | import type { SchemaError } from "effect/Schema" |
| 14 | import * as Schema from "effect/Schema" |
| 15 | import * as Stream from "effect/Stream" |
| 16 | // non-recursive definitions |
| 17 | export type AABenchmarkEntry = { |
| 18 | readonly "agentic_index": number | null |
| 19 | readonly "coding_index": number | null |
| 20 | readonly "intelligence_index": number | null |
| 21 | } |
| 22 | export 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" }) |
| 36 | export 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 | } |
| 49 | export 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" }) |
| 74 | export type AdvisorNestedTool = { readonly "parameters"?: {}; readonly "type": string } |
| 75 | export 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 | }) |
| 83 | export type AdvisorReasoning = { |
| 84 | readonly "effort"?: "max" | "xhigh" | "high" | "medium" | "low" | "minimal" | "none" |
| 85 | readonly "max_tokens"?: number |
| 86 | } |
| 87 | export 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 | }) |
| 103 | export type AnthropicAdvisorToolResult = { |
| 104 | readonly "content": {} |
| 105 | readonly "tool_use_id": string |
| 106 | readonly "type": "advisor_tool_result" |
| 107 | } |
| 108 | export 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" }) |
| 113 | export type AnthropicAllowedCallers = ReadonlyArray<"direct" | "code_execution_20250825" | "code_execution_20260120"> |
| 114 | export const AnthropicAllowedCallers = Schema.Array( |
| 115 | Schema.Literals(["direct", "code_execution_20250825", "code_execution_20260120"]) |
| 116 | ).annotate({ "identifier": "AnthropicAllowedCallers" }) |
| 117 | export type AnthropicBase64PdfSource = { |
| 118 | readonly "data": string |
| 119 | readonly "media_type": "application/pdf" |
| 120 | readonly "type": "base64" |
| 121 | } |
| 122 | export const AnthropicBase64PdfSource = Schema.Struct({ |
| 123 | "data": Schema.String, |
| 124 | "media_type": Schema.Literal("application/pdf"), |
| 125 | "type": Schema.Literal("base64") |
| 126 | }).annotate({ "identifier": "AnthropicBase64PdfSource" }) |
| 127 | export type AnthropicBashCodeExecutionOutput = { |
| 128 | readonly "file_id": string |
| 129 | readonly "type": "bash_code_execution_output" |
| 130 | } |
| 131 | export const AnthropicBashCodeExecutionOutput = Schema.Struct({ |
| 132 | "file_id": Schema.String, |
| 133 | "type": Schema.Literal("bash_code_execution_output") |
| 134 | }).annotate({ "identifier": "AnthropicBashCodeExecutionOutput" }) |
| 135 | export 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 | } |
| 144 | export 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" }) |
| 154 | export type AnthropicCacheControlTtl = "5m" | "1h" |
| 155 | export const AnthropicCacheControlTtl = Schema.Literals(["5m", "1h"]).annotate({ |
| 156 | "identifier": "AnthropicCacheControlTtl" |
| 157 | }) |
| 158 | export type Objects_ = { |
| 159 | readonly "ephemeral_1h_input_tokens": number |
| 160 | readonly "ephemeral_5m_input_tokens": number |
| 161 | readonly [x: string]: Schema.Json |
| 162 | } |
| 163 | export 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 | ) |
| 170 | export 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 | } |
| 179 | export 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" }) |
| 188 | export 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 | } |
| 196 | export 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" }) |
| 204 | export 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 | } |
| 213 | export 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" }) |
| 222 | export 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 | } |
| 230 | export 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" }) |
| 238 | export 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 | } |
| 247 | export 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" }) |
| 256 | export 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 | } |
| 264 | export 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" }) |
| 272 | export type Objects_1 = { readonly "enabled": boolean; readonly [x: string]: Schema.Json } |
| 273 | export const Objects_1 = Schema.StructWithRest(Schema.Struct({ "enabled": Schema.Boolean }), [ |
| 274 | Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })) |
| 275 | ]) |
| 276 | export 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 | } |
| 285 | export 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" }) |
| 294 | export 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 | } |
| 303 | export 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" }) |
| 312 | export 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 | } |
| 319 | export 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" }) |
| 326 | export 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 | } |
| 333 | export 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" }) |
| 340 | export type AnthropicCodeExecution20250825Caller = { |
| 341 | readonly "tool_id": string |
| 342 | readonly "type": "code_execution_20250825" |
| 343 | } |
| 344 | export const AnthropicCodeExecution20250825Caller = Schema.Struct({ |
| 345 | "tool_id": Schema.String, |
| 346 | "type": Schema.Literal("code_execution_20250825") |
| 347 | }).annotate({ "identifier": "AnthropicCodeExecution20250825Caller" }) |
| 348 | export type AnthropicCodeExecution20260120Caller = { |
| 349 | readonly "tool_id": string |
| 350 | readonly "type": "code_execution_20260120" |
| 351 | } |
| 352 | export const AnthropicCodeExecution20260120Caller = Schema.Struct({ |
| 353 | "tool_id": Schema.String, |
| 354 | "type": Schema.Literal("code_execution_20260120") |
| 355 | }).annotate({ "identifier": "AnthropicCodeExecution20260120Caller" }) |
| 356 | export type AnthropicCodeExecutionOutput = { readonly "file_id": string; readonly "type": "code_execution_output" } |
| 357 | export const AnthropicCodeExecutionOutput = Schema.Struct({ |
| 358 | "file_id": Schema.String, |
| 359 | "type": Schema.Literal("code_execution_output") |
| 360 | }).annotate({ "identifier": "AnthropicCodeExecutionOutput" }) |
| 361 | export type AnthropicCompactionBlock = { readonly "content": string | null; readonly "type": "compaction" } |
| 362 | export const AnthropicCompactionBlock = Schema.Struct({ |
| 363 | "content": Schema.Union([Schema.String, Schema.Null]), |
| 364 | "type": Schema.Literal("compaction") |
| 365 | }).annotate({ "identifier": "AnthropicCompactionBlock" }) |
| 366 | export type AnthropicContainer = { |
| 367 | readonly "expires_at": string |
| 368 | readonly "id": string |
| 369 | readonly [x: string]: Schema.Json |
| 370 | } | null |
| 371 | export 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" }) |
| 377 | export type AnthropicContainerUpload = { readonly "file_id": string; readonly "type": "container_upload" } |
| 378 | export const AnthropicContainerUpload = Schema.Struct({ |
| 379 | "file_id": Schema.String, |
| 380 | "type": Schema.Literal("container_upload") |
| 381 | }).annotate({ "identifier": "AnthropicContainerUpload" }) |
| 382 | export type AnthropicDirectCaller = { readonly "type": "direct" } |
| 383 | export const AnthropicDirectCaller = Schema.Struct({ "type": Schema.Literal("direct") }).annotate({ |
| 384 | "identifier": "AnthropicDirectCaller" |
| 385 | }) |
| 386 | export type AnthropicFileDocumentSource = { readonly "file_id": string; readonly "type": "file" } |
| 387 | export const AnthropicFileDocumentSource = Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("file") }) |
| 388 | .annotate({ "identifier": "AnthropicFileDocumentSource" }) |
| 389 | export type AnthropicImageMimeType = "image/jpeg" | "image/png" | "image/gif" | "image/webp" |
| 390 | export const AnthropicImageMimeType = Schema.Literals(["image/jpeg", "image/png", "image/gif", "image/webp"]).annotate({ |
| 391 | "identifier": "AnthropicImageMimeType" |
| 392 | }) |
| 393 | export type Objects_2 = { readonly "type": "input_tokens"; readonly "value": number; readonly [x: string]: Schema.Json } |
| 394 | export 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 | ) |
| 401 | export type AnthropicInputTokensTrigger = { readonly "type": "input_tokens"; readonly "value": number } |
| 402 | export 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" }) |
| 406 | export type Objects_3 = { |
| 407 | readonly "ephemeral_1h_input_tokens"?: number |
| 408 | readonly "ephemeral_5m_input_tokens"?: number |
| 409 | readonly [x: string]: Schema.Json |
| 410 | } |
| 411 | export 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 | ) |
| 422 | export type AnthropicOutputTokensDetails = |
| 423 | | { readonly "thinking_tokens": number; readonly [x: string]: Schema.Json } |
| 424 | | null |
| 425 | export 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" }) |
| 432 | export type AnthropicPlainTextSource = { |
| 433 | readonly "data": string |
| 434 | readonly "media_type": "text/plain" |
| 435 | readonly "type": "text" |
| 436 | } |
| 437 | export const AnthropicPlainTextSource = Schema.Struct({ |
| 438 | "data": Schema.String, |
| 439 | "media_type": Schema.Literal("text/plain"), |
| 440 | "type": Schema.Literal("text") |
| 441 | }).annotate({ "identifier": "AnthropicPlainTextSource" }) |
| 442 | export type AnthropicRedactedThinkingBlock = { readonly "data": string; readonly "type": "redacted_thinking" } |
| 443 | export const AnthropicRedactedThinkingBlock = Schema.Struct({ |
| 444 | "data": Schema.String, |
| 445 | "type": Schema.Literal("redacted_thinking") |
| 446 | }).annotate({ "identifier": "AnthropicRedactedThinkingBlock" }) |
| 447 | export 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 |
| 453 | export 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" }) |
| 464 | export type AnthropicServerToolErrorCode = |
| 465 | | "invalid_tool_input" |
| 466 | | "unavailable" |
| 467 | | "too_many_requests" |
| 468 | | "execution_time_exceeded" |
| 469 | export const AnthropicServerToolErrorCode = Schema.Literals([ |
| 470 | "invalid_tool_input", |
| 471 | "unavailable", |
| 472 | "too_many_requests", |
| 473 | "execution_time_exceeded" |
| 474 | ]).annotate({ "identifier": "AnthropicServerToolErrorCode" }) |
| 475 | export type AnthropicServerToolUsage = { |
| 476 | readonly "web_fetch_requests": number |
| 477 | readonly "web_search_requests": number |
| 478 | readonly [x: string]: Schema.Json |
| 479 | } | null |
| 480 | export 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" }) |
| 490 | export type AnthropicServiceTier = "standard" | "priority" | "batch" | null |
| 491 | export const AnthropicServiceTier = Schema.Union([ |
| 492 | Schema.Literal("standard"), |
| 493 | Schema.Literal("priority"), |
| 494 | Schema.Literal("batch"), |
| 495 | Schema.Null |
| 496 | ]).annotate({ "identifier": "AnthropicServiceTier" }) |
| 497 | export type AnthropicSpeed = "fast" | "standard" | null |
| 498 | export const AnthropicSpeed = Schema.Union([Schema.Literal("fast"), Schema.Literal("standard"), Schema.Null]).annotate({ |
| 499 | "identifier": "AnthropicSpeed" |
| 500 | }) |
| 501 | export type AnthropicTextEditorCodeExecutionCreateResult = { |
| 502 | readonly "is_file_update": boolean |
| 503 | readonly "type": "text_editor_code_execution_create_result" |
| 504 | } |
| 505 | export const AnthropicTextEditorCodeExecutionCreateResult = Schema.Struct({ |
| 506 | "is_file_update": Schema.Boolean, |
| 507 | "type": Schema.Literal("text_editor_code_execution_create_result") |
| 508 | }).annotate({ "identifier": "AnthropicTextEditorCodeExecutionCreateResult" }) |
| 509 | export 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 | } |
| 517 | export 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" }) |
| 525 | export 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 | } |
| 535 | export 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" }) |
| 546 | export 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 | } |
| 554 | export 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" }) |
| 565 | export type AnthropicThinkingBlock = { |
| 566 | readonly "signature": string |
| 567 | readonly "thinking": string |
| 568 | readonly "type": "thinking" |
| 569 | } |
| 570 | export const AnthropicThinkingBlock = Schema.Struct({ |
| 571 | "signature": Schema.String, |
| 572 | "thinking": Schema.String, |
| 573 | "type": Schema.Literal("thinking") |
| 574 | }).annotate({ "identifier": "AnthropicThinkingBlock" }) |
| 575 | export type AnthropicThinkingDisplay = "summarized" | "omitted" | null |
| 576 | export const AnthropicThinkingDisplay = Schema.Union([ |
| 577 | Schema.Literal("summarized"), |
| 578 | Schema.Literal("omitted"), |
| 579 | Schema.Null |
| 580 | ]).annotate({ "identifier": "AnthropicThinkingDisplay" }) |
| 581 | export type AnthropicThinkingTurns = { readonly "type": "thinking_turns"; readonly "value": number } |
| 582 | export 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" }) |
| 586 | export type AnthropicToolReference = { readonly "tool_name": string; readonly "type": "tool_reference" } |
| 587 | export const AnthropicToolReference = Schema.Struct({ |
| 588 | "tool_name": Schema.String, |
| 589 | "type": Schema.Literal("tool_reference") |
| 590 | }).annotate({ "identifier": "AnthropicToolReference" }) |
| 591 | export type AnthropicToolUsesKeep = { readonly "type": "tool_uses"; readonly "value": number } |
| 592 | export 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" }) |
| 596 | export type AnthropicToolUsesTrigger = { readonly "type": "tool_uses"; readonly "value": number } |
| 597 | export 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" }) |
| 601 | export type AnthropicUrlImageSource = { readonly "type": "url"; readonly "url": string } |
| 602 | export const AnthropicUrlImageSource = Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }).annotate({ |
| 603 | "identifier": "AnthropicUrlImageSource" |
| 604 | }) |
| 605 | export type AnthropicUrlPdfSource = { readonly "type": "url"; readonly "url": string } |
| 606 | export const AnthropicUrlPdfSource = Schema.Struct({ "type": Schema.Literal("url"), "url": Schema.String }).annotate({ |
| 607 | "identifier": "AnthropicUrlPdfSource" |
| 608 | }) |
| 609 | export 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 | } |
| 621 | export 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" }) |
| 634 | export 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 | } |
| 641 | export 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" }) |
| 648 | export 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 | } |
| 655 | export 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" }) |
| 662 | export 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 | } |
| 672 | export 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" }) |
| 683 | export 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 | } |
| 691 | export 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 | ) |
| 701 | export 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" |
| 729 | export 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 | }) |
| 761 | export 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 | } |
| 768 | export 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 | }) |
| 778 | export 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 | } |
| 785 | export 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 | }) |
| 795 | export 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 | } |
| 802 | export 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 | }) |
| 813 | export type ApplyPatchCallStatus = "in_progress" | "completed" |
| 814 | export const ApplyPatchCallStatus = Schema.Literals(["in_progress", "completed"]).annotate({ |
| 815 | "description": "Lifecycle state of an `apply_patch_call` output item.", |
| 816 | "identifier": "ApplyPatchCallStatus" |
| 817 | }) |
| 818 | export type ApplyPatchCreateFileOperation = { |
| 819 | readonly "diff": string |
| 820 | readonly "path": string |
| 821 | readonly "type": "create_file" |
| 822 | } |
| 823 | export 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 | }) |
| 832 | export type ApplyPatchDeleteFileOperation = { readonly "path": string; readonly "type": "delete_file" } |
| 833 | export 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 | }) |
| 841 | export type ApplyPatchEngineEnum = "auto" | "native" | "openrouter" |
| 842 | export 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 | }) |
| 847 | export type ApplyPatchServerTool = { readonly "type": "apply_patch" } |
| 848 | export const ApplyPatchServerTool = Schema.Struct({ "type": Schema.Literal("apply_patch") }).annotate({ |
| 849 | "description": "Apply patch tool configuration", |
| 850 | "identifier": "ApplyPatchServerTool" |
| 851 | }) |
| 852 | export type ApplyPatchUpdateFileOperation = { |
| 853 | readonly "diff": string |
| 854 | readonly "path": string |
| 855 | readonly "type": "update_file" |
| 856 | } |
| 857 | export 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 | }) |
| 866 | export 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 | } |
| 873 | export 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" }) |
| 889 | export 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 | } |
| 895 | export 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" }) |
| 917 | export 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 | } |
| 924 | export 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" }) |
| 952 | export type BadGatewayResponseErrorData = { |
| 953 | readonly "code": number |
| 954 | readonly "message": string |
| 955 | readonly "metadata"?: { readonly [x: string]: Schema.Json } | null |
| 956 | } |
| 957 | export 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" }) |
| 964 | export type BadRequestResponseErrorData = { |
| 965 | readonly "code": number |
| 966 | readonly "message": string |
| 967 | readonly "metadata"?: { readonly [x: string]: Schema.Json } | null |
| 968 | } |
| 969 | export 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" }) |
| 976 | export 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 | } |
| 983 | export 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 | }) |
| 994 | export 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 | } |
| 1001 | export 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 | }) |
| 1012 | export 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 | } |
| 1019 | export 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" }) |
| 1026 | export 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 | } |
| 1033 | export 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 | }) |
| 1043 | export 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 | } |
| 1051 | export 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 | }) |
| 1062 | export 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 | } |
| 1070 | export 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 | }) |
| 1081 | export 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 | } |
| 1089 | export 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 | }) |
| 1100 | export 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 | } |
| 1108 | export 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 | }) |
| 1119 | export 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 | } |
| 1127 | export 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 | }) |
| 1138 | export 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 | } |
| 1146 | export 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" }) |
| 1154 | export 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 | } |
| 1162 | export 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" }) |
| 1170 | export type BashServerToolEngine = "auto" | "native" | "openrouter" |
| 1171 | export 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 | }) |
| 1176 | export type BooleanCapability = { readonly "type": "boolean" } |
| 1177 | export 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 | }) |
| 1181 | export type BulkAddWorkspaceMembersRequest = { readonly "user_ids": ReadonlyArray<string> } |
| 1182 | export 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" }) |
| 1190 | export type BulkAssignKeysRequest = { readonly "key_hashes": ReadonlyArray<string> } |
| 1191 | export 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" }) |
| 1198 | export type BulkAssignKeysResponse = { readonly "assigned_count": number } |
| 1199 | export 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" }) |
| 1204 | export type BulkAssignMembersRequest = { readonly "member_user_ids": ReadonlyArray<string> } |
| 1205 | export 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" }) |
| 1212 | export type BulkAssignMembersResponse = { readonly "assigned_count": number } |
| 1213 | export 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" }) |
| 1218 | export type BulkRemoveWorkspaceMembersRequest = { readonly "user_ids": ReadonlyArray<string> } |
| 1219 | export 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" }) |
| 1225 | export type BulkRemoveWorkspaceMembersResponse = { readonly "removed_count": number } |
| 1226 | export 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" }) |
| 1231 | export type BulkUnassignKeysRequest = { readonly "key_hashes": ReadonlyArray<string> } |
| 1232 | export 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" }) |
| 1239 | export type BulkUnassignKeysResponse = { readonly "unassigned_count": number } |
| 1240 | export 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" }) |
| 1245 | export type BulkUnassignMembersRequest = { readonly "member_user_ids": ReadonlyArray<string> } |
| 1246 | export 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" }) |
| 1253 | export type BulkUnassignMembersResponse = { readonly "unassigned_count": number } |
| 1254 | export 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" }) |
| 1259 | export 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" |
| 1356 | export 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 | }) |
| 1458 | export type ChatAssistantImages = ReadonlyArray<{ readonly "image_url": { readonly "url": string } }> |
| 1459 | export 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" }) |
| 1466 | export type ChatAudioOutput = { |
| 1467 | readonly "data"?: string |
| 1468 | readonly "expires_at"?: number |
| 1469 | readonly "id"?: string |
| 1470 | readonly "transcript"?: string |
| 1471 | } |
| 1472 | export 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" }) |
| 1482 | export type ChatContentAudio = { |
| 1483 | readonly "input_audio": { readonly "data": string; readonly "format": string } |
| 1484 | readonly "type": "input_audio" |
| 1485 | } |
| 1486 | export 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 | }) |
| 1499 | export type ChatContentFile = { |
| 1500 | readonly "file": { readonly "file_data"?: string; readonly "file_id"?: string; readonly "filename"?: string } |
| 1501 | readonly "type": "file" |
| 1502 | } |
| 1503 | export 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" }) |
| 1513 | export type ChatContentImage = { |
| 1514 | readonly "image_url": { readonly "detail"?: "auto" | "low" | "high" | "original"; readonly "url": string } |
| 1515 | readonly "type": "image_url" |
| 1516 | } |
| 1517 | export 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" }) |
| 1529 | export type ChatContentVideoInput = { readonly "url": string } |
| 1530 | export 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" }) |
| 1533 | export type ChatDebugOptions = { readonly "echo_upstream_body"?: boolean } |
| 1534 | export 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 | }) |
| 1545 | export type ChatFinishReasonEnum = "tool_calls" | "stop" | "length" | "content_filter" | "error" | null |
| 1546 | export 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" }) |
| 1554 | export type ChatFormatGrammarConfig = { readonly "grammar": string; readonly "type": "grammar" } |
| 1555 | export 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" }) |
| 1559 | export type ChatFormatJsonObjectConfig = { readonly "type": "json_object" } |
| 1560 | export const ChatFormatJsonObjectConfig = Schema.Struct({ "type": Schema.Literal("json_object") }).annotate({ |
| 1561 | "description": "JSON object response format", |
| 1562 | "identifier": "ChatFormatJsonObjectConfig" |
| 1563 | }) |
| 1564 | export type ChatFormatPythonConfig = { readonly "type": "python" } |
| 1565 | export const ChatFormatPythonConfig = Schema.Struct({ "type": Schema.Literal("python") }).annotate({ |
| 1566 | "description": "Python code response format", |
| 1567 | "identifier": "ChatFormatPythonConfig" |
| 1568 | }) |
| 1569 | export type ChatFormatTextConfig = { readonly "type": "text" } |
| 1570 | export const ChatFormatTextConfig = Schema.Struct({ "type": Schema.Literal("text") }).annotate({ |
| 1571 | "description": "Default text response format", |
| 1572 | "identifier": "ChatFormatTextConfig" |
| 1573 | }) |
| 1574 | export type ChatJsonSchemaConfig = { |
| 1575 | readonly "description"?: string |
| 1576 | readonly "name": string |
| 1577 | readonly "schema"?: {} |
| 1578 | readonly "strict"?: boolean | null |
| 1579 | } |
| 1580 | export 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" }) |
| 1589 | export type ChatNamedToolChoice = { readonly "function": { readonly "name": string }; readonly "type": "function" } |
| 1590 | export 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" }) |
| 1594 | export type ChatReasoningSummaryVerbosityEnum = "auto" | "concise" | "detailed" | null |
| 1595 | export const ChatReasoningSummaryVerbosityEnum = Schema.Union([ |
| 1596 | Schema.Literal("auto"), |
| 1597 | Schema.Literal("concise"), |
| 1598 | Schema.Literal("detailed"), |
| 1599 | Schema.Null |
| 1600 | ]).annotate({ "identifier": "ChatReasoningSummaryVerbosityEnum" }) |
| 1601 | export type ChatServerToolChoice = { readonly "type": string } |
| 1602 | export 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 | }) |
| 1612 | export type Objects_6 = { readonly "include_usage"?: boolean; readonly [x: string]: Schema.Json } |
| 1613 | export 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 | ) |
| 1623 | export 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 | } |
| 1629 | export 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" }) |
| 1642 | export 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 | } |
| 1650 | export 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" }) |
| 1670 | export type ChatToolCall = { |
| 1671 | readonly "function": { readonly "arguments": string; readonly "name": string } |
| 1672 | readonly "id": string |
| 1673 | readonly "type": "function" |
| 1674 | } |
| 1675 | export 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" }) |
| 1683 | export 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 |
| 1690 | export 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" }) |
| 1714 | export 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 |
| 1721 | export 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" }) |
| 1750 | export 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 | } |
| 1758 | export 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" }) |
| 1777 | export type CodexLocalShellTool = { readonly "type": "local_shell" } |
| 1778 | export const CodexLocalShellTool = Schema.Struct({ "type": Schema.Literal("local_shell") }).annotate({ |
| 1779 | "description": "Local shell tool configuration", |
| 1780 | "identifier": "CodexLocalShellTool" |
| 1781 | }) |
| 1782 | export type CompactionItem = { |
| 1783 | readonly "encrypted_content": string |
| 1784 | readonly "id"?: string | null |
| 1785 | readonly "type": "compaction" |
| 1786 | } |
| 1787 | export 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" }) |
| 1792 | export type CompoundFilter = { readonly "filters": ReadonlyArray<{}>; readonly "type": "and" | "or" } |
| 1793 | export 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 | }) |
| 1800 | export 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 | } |
| 1806 | export 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" }) |
| 1812 | export type ConflictResponseErrorData = { |
| 1813 | readonly "code": number |
| 1814 | readonly "message": string |
| 1815 | readonly "metadata"?: { readonly [x: string]: Schema.Json } | null |
| 1816 | } |
| 1817 | export 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" }) |
| 1824 | export type ContainerAutoEnvironment = { readonly "type": "container_auto" } |
| 1825 | export const ContainerAutoEnvironment = Schema.Struct({ "type": Schema.Literal("container_auto") }).annotate({ |
| 1826 | "description": "An OpenRouter-managed, auto-provisioned ephemeral container.", |
| 1827 | "identifier": "ContainerAutoEnvironment" |
| 1828 | }) |
| 1829 | export type ContainerReferenceEnvironment = { readonly "container_id": string; readonly "type": "container_reference" } |
| 1830 | export 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 | }) |
| 1841 | export type ContentFilterAction = "redact" | "block" | "flag" |
| 1842 | export const ContentFilterAction = Schema.Literals(["redact", "block", "flag"]).annotate({ |
| 1843 | "description": "Action taken when the pattern matches", |
| 1844 | "identifier": "ContentFilterAction" |
| 1845 | }) |
| 1846 | export type ContentFilterBuiltinAction = "redact" | "block" | "flag" |
| 1847 | export const ContentFilterBuiltinAction = Schema.Literals(["redact", "block", "flag"]).annotate({ |
| 1848 | "description": "Action taken when the builtin filter triggers", |
| 1849 | "identifier": "ContentFilterBuiltinAction" |
| 1850 | }) |
| 1851 | export type ContentFilterBuiltinSlug = |
| 1852 | | "email" |
| 1853 | | "phone" |
| 1854 | | "ssn" |
| 1855 | | "credit-card" |
| 1856 | | "ip-address" |
| 1857 | | "person-name" |
| 1858 | | "address" |
| 1859 | | "regex-prompt-injection" |
| 1860 | export 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" }) |
| 1870 | export type ContentPartAudio = { readonly "audio_url": { readonly "url": string }; readonly "type": "audio_url" } |
| 1871 | export const ContentPartAudio = Schema.Struct({ |
| 1872 | "audio_url": Schema.Struct({ "url": Schema.String }), |
| 1873 | "type": Schema.Literal("audio_url") |
| 1874 | }).annotate({ "identifier": "ContentPartAudio" }) |
| 1875 | export type ContentPartImage = { readonly "image_url": { readonly "url": string }; readonly "type": "image_url" } |
| 1876 | export const ContentPartImage = Schema.Struct({ |
| 1877 | "image_url": Schema.Struct({ "url": Schema.String }), |
| 1878 | "type": Schema.Literal("image_url") |
| 1879 | }).annotate({ "identifier": "ContentPartImage" }) |
| 1880 | export type ContentPartVideo = { readonly "type": "video_url"; readonly "video_url": { readonly "url": string } } |
| 1881 | export const ContentPartVideo = Schema.Struct({ |
| 1882 | "type": Schema.Literal("video_url"), |
| 1883 | "video_url": Schema.Struct({ "url": Schema.String }) |
| 1884 | }).annotate({ "identifier": "ContentPartVideo" }) |
| 1885 | export type ContextCompactionItem = { |
| 1886 | readonly "encrypted_content"?: string | null |
| 1887 | readonly "id"?: string | null |
| 1888 | readonly "type": "context_compaction" |
| 1889 | } |
| 1890 | export 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 | }) |
| 1898 | export type ContextCompressionEngine = "middle-out" |
| 1899 | export const ContextCompressionEngine = Schema.Literal("middle-out").annotate({ |
| 1900 | "description": "The compression engine to use. Defaults to \"middle-out\".", |
| 1901 | "identifier": "ContextCompressionEngine" |
| 1902 | }) |
| 1903 | export 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 | } |
| 1909 | export 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 | ) |
| 1924 | export 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 | } |
| 1937 | export 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" }) |
| 1989 | export 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 | } |
| 1999 | export 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" }) |
| 2014 | export 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 | } |
| 2021 | export 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 | }) |
| 2032 | export 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 | } |
| 2039 | export 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 | }) |
| 2050 | export 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 | } |
| 2058 | export 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 | }) |
| 2074 | export type DABenchmarkEntry = { |
| 2075 | readonly "arena": string |
| 2076 | readonly "category": string |
| 2077 | readonly "elo": number |
| 2078 | readonly "rank": number |
| 2079 | readonly "win_rate": number |
| 2080 | } |
| 2081 | export 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 | }) |
| 2097 | export type DatetimeServerToolConfig = { readonly "timezone"?: string } |
| 2098 | export 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 | }) |
| 2106 | export 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 | } |
| 2118 | export 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 | }) |
| 2139 | export 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 |
| 2147 | export 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" }) |
| 2175 | export type DeleteBYOKKeyResponse = { readonly "deleted": true } |
| 2176 | export const DeleteBYOKKeyResponse = Schema.Struct({ |
| 2177 | "deleted": Schema.Literal(true).annotate({ "description": "Confirmation that the BYOK credential was deleted." }) |
| 2178 | }).annotate({ "identifier": "DeleteBYOKKeyResponse" }) |
| 2179 | export type DeleteGuardrailResponse = { readonly "deleted": true } |
| 2180 | export const DeleteGuardrailResponse = Schema.Struct({ |
| 2181 | "deleted": Schema.Literal(true).annotate({ "description": "Confirmation that the guardrail was deleted" }) |
| 2182 | }).annotate({ "identifier": "DeleteGuardrailResponse" }) |
| 2183 | export type DeleteObservabilityDestinationResponse = { readonly "deleted": true } |
| 2184 | export const DeleteObservabilityDestinationResponse = Schema.Struct({ |
| 2185 | "deleted": Schema.Literal(true).annotate({ "description": "Always `true` on success." }) |
| 2186 | }).annotate({ "identifier": "DeleteObservabilityDestinationResponse" }) |
| 2187 | export type DeleteWorkspaceBudgetResponse = { readonly "deleted": true } |
| 2188 | export 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" }) |
| 2193 | export type DeleteWorkspaceResponse = { readonly "deleted": true } |
| 2194 | export const DeleteWorkspaceResponse = Schema.Struct({ |
| 2195 | "deleted": Schema.Literal(true).annotate({ "description": "Confirmation that the workspace was deleted" }) |
| 2196 | }).annotate({ "identifier": "DeleteWorkspaceResponse" }) |
| 2197 | export type DeprecatedRoute = "fallback" | "sort" | null |
| 2198 | export 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 | ) |
| 2205 | export type EdgeNetworkTimeoutResponseErrorData = { |
| 2206 | readonly "code": number |
| 2207 | readonly "message": string |
| 2208 | readonly "metadata"?: { readonly [x: string]: Schema.Json } | null |
| 2209 | } |
| 2210 | export 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 | }) |
| 2220 | export type EndpointInfo = { readonly "model": string; readonly "provider": string; readonly "selected": boolean } |
| 2221 | export const EndpointInfo = Schema.Struct({ |
| 2222 | "model": Schema.String, |
| 2223 | "provider": Schema.String, |
| 2224 | "selected": Schema.Boolean |
| 2225 | }).annotate({ "identifier": "EndpointInfo" }) |
| 2226 | export type EndpointStatus = 0 | -1 | -2 | -3 | -5 | -10 |
| 2227 | export const EndpointStatus = Schema.Literals([0, -1, -2, -3, -5, -10]).annotate({ "identifier": "EndpointStatus" }) |
| 2228 | export type EnumCapability = { readonly "type": "enum"; readonly "values": ReadonlyArray<string> } |
| 2229 | export 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 | }) |
| 2234 | export 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 | } |
| 2241 | export 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" }) |
| 2248 | export type FileCitation = { |
| 2249 | readonly "file_id": string |
| 2250 | readonly "filename": string |
| 2251 | readonly "index": number |
| 2252 | readonly "type": "file_citation" |
| 2253 | } |
| 2254 | export 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" }) |
| 2260 | export type FileDeleteResponse = { readonly "id": string; readonly "type": "file_deleted" } |
| 2261 | export const FileDeleteResponse = Schema.Struct({ "id": Schema.String, "type": Schema.Literal("file_deleted") }) |
| 2262 | .annotate({ "description": "Confirmation that a file was deleted.", "identifier": "FileDeleteResponse" }) |
| 2263 | export 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 | } |
| 2272 | export 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" }) |
| 2281 | export type FilePath = { readonly "file_id": string; readonly "index": number; readonly "type": "file_path" } |
| 2282 | export 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" }) |
| 2287 | export type FilesServerToolConfig = {} |
| 2288 | export const FilesServerToolConfig = Schema.Struct({}).annotate({ |
| 2289 | "description": "Configuration for the openrouter:files server tool", |
| 2290 | "identifier": "FilesServerToolConfig" |
| 2291 | }) |
| 2292 | export type ForbiddenResponseErrorData = { |
| 2293 | readonly "code": number |
| 2294 | readonly "message": string |
| 2295 | readonly "metadata"?: { readonly [x: string]: Schema.Json } | null |
| 2296 | } |
| 2297 | export 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" }) |
| 2304 | export type FormatJsonObjectConfig = { readonly "type": "json_object" } |
| 2305 | export const FormatJsonObjectConfig = Schema.Struct({ "type": Schema.Literal("json_object") }).annotate({ |
| 2306 | "description": "JSON object response format", |
| 2307 | "identifier": "FormatJsonObjectConfig" |
| 2308 | }) |
| 2309 | export type FormatJsonSchemaConfig = { |
| 2310 | readonly "description"?: string |
| 2311 | readonly "name": string |
| 2312 | readonly "schema": {} |
| 2313 | readonly "strict"?: boolean | null |
| 2314 | readonly "type": "json_schema" |
| 2315 | } |
| 2316 | export 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" }) |
| 2323 | export type FormatTextConfig = { readonly "type": "text" } |
| 2324 | export const FormatTextConfig = Schema.Struct({ "type": Schema.Literal("text") }).annotate({ |
| 2325 | "description": "Plain text response format", |
| 2326 | "identifier": "FormatTextConfig" |
| 2327 | }) |
| 2328 | export type FrameImage = { |
| 2329 | readonly "image_url": { readonly "url": string } |
| 2330 | readonly "type": "image_url" |
| 2331 | readonly "frame_type": "first_frame" | "last_frame" |
| 2332 | } |
| 2333 | export 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" }) |
| 2340 | export 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 | } |
| 2347 | export 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 | }) |
| 2357 | export 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 | } |
| 2365 | export 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 | }) |
| 2376 | export 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 | } |
| 2383 | export 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" }) |
| 2393 | export type Arrays_1 = ReadonlyArray<string> |
| 2394 | export const Arrays_1 = Schema.Array(Schema.String) |
| 2395 | export type Arrays_2 = ReadonlyArray<string> |
| 2396 | export const Arrays_2 = Schema.Array(Schema.String) |
| 2397 | export type Arrays_3 = ReadonlyArray< |
| 2398 | { |
| 2399 | readonly "stances": ReadonlyArray<{ readonly "model": string; readonly "stance": string }> |
| 2400 | readonly "topic": string |
| 2401 | } |
| 2402 | > |
| 2403 | export 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 | ) |
| 2409 | export type Arrays_4 = ReadonlyArray<{ readonly "models": ReadonlyArray<string>; readonly "point": string }> |
| 2410 | export const Arrays_4 = Schema.Array(Schema.Struct({ "models": Schema.Array(Schema.String), "point": Schema.String })) |
| 2411 | export type Arrays_5 = ReadonlyArray<{ readonly "insight": string; readonly "model": string }> |
| 2412 | export const Arrays_5 = Schema.Array(Schema.Struct({ "insight": Schema.String, "model": Schema.String })) |
| 2413 | export 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 | } |
| 2420 | export 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 | }) |
| 2430 | export 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 | } |
| 2436 | export 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 | }) |
| 2445 | export 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 | } |
| 2451 | export 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 | }) |
| 2460 | export 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 | } |
| 2467 | export 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 | }) |
| 2477 | export 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 | } |
| 2485 | export 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 | }) |
| 2496 | export 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 | } |
| 2504 | export 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 | }) |
| 2515 | export 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 | } |
| 2524 | export 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" }) |
| 2533 | export 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 | } |
| 2541 | export 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 | }) |
| 2552 | export 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 | } |
| 2561 | export 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" }) |
| 2612 | export type Arrays_6 = ReadonlyArray<string> |
| 2613 | export 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 | ) |
| 2619 | export type Objects_9 = { |
| 2620 | readonly "effort"?: "max" | "xhigh" | "high" | "medium" | "low" | "minimal" | "none" |
| 2621 | readonly "max_tokens"?: number |
| 2622 | } |
| 2623 | export 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 | }) |
| 2639 | export type Arrays_7 = ReadonlyArray<{ readonly "parameters"?: {}; readonly "type": string }> |
| 2640 | export 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" })) |
| 2651 | export type FusionSource = { readonly "title": string; readonly "url": string } |
| 2652 | export 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" }) |
| 2658 | export 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 | } |
| 2662 | export 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" }) |
| 2674 | export type GoneResponseErrorData = { |
| 2675 | readonly "code": number |
| 2676 | readonly "message": string |
| 2677 | readonly "metadata"?: { readonly [x: string]: Schema.Json } | null |
| 2678 | } |
| 2679 | export 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" }) |
| 2686 | export type GuardrailInterval = "daily" | "weekly" | "monthly" | null |
| 2687 | export 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 | }) |
| 2696 | export type ImageConfig = {} |
| 2697 | export 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 | }) |
| 2702 | export 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 | } |
| 2708 | export 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" }) |
| 2714 | export 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 | } |
| 2720 | export 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" }) |
| 2726 | export 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 | } |
| 2732 | export 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" }) |
| 2738 | export 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 | } |
| 2746 | export 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 | }) |
| 2757 | export 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 | } |
| 2770 | export 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" }) |
| 2785 | export type ImageGenerationServerToolConfig = { readonly "model"?: string } |
| 2786 | export 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 | }) |
| 2798 | export type ImageGenerationStatus = "in_progress" | "completed" | "generating" | "failed" |
| 2799 | export const ImageGenerationStatus = Schema.Literals(["in_progress", "completed", "generating", "failed"]).annotate({ |
| 2800 | "identifier": "ImageGenerationStatus" |
| 2801 | }) |
| 2802 | export 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 |
| 2808 | export 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 | ]) |
| 2828 | export 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 |
| 2836 | export 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." }) |
| 2867 | export 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 |
| 2873 | export 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)" }) |
| 2899 | export type ImageGenPartialImageEvent = { |
| 2900 | readonly "b64_json": string |
| 2901 | readonly "partial_image_index": number |
| 2902 | readonly "type": "image_generation.partial_image" |
| 2903 | } |
| 2904 | export 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 | }) |
| 2914 | export 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 | } |
| 2923 | export 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 | }) |
| 2943 | export type ImageGenTextChunkEvent = { |
| 2944 | readonly "phase": "content" | "reasoning" | "draft" |
| 2945 | readonly "text": string |
| 2946 | readonly "type": "image_generation.text_chunk" |
| 2947 | } |
| 2948 | export 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 | }) |
| 2962 | export type ImageInputModality = "text" | "image" | "file" | "audio" | "video" |
| 2963 | export const ImageInputModality = Schema.Literals(["text", "image", "file", "audio", "video"]).annotate({ |
| 2964 | "identifier": "ImageInputModality" |
| 2965 | }) |
| 2966 | export type ImageOutputModality = |
| 2967 | | "text" |
| 2968 | | "image" |
| 2969 | | "embeddings" |
| 2970 | | "audio" |
| 2971 | | "video" |
| 2972 | | "rerank" |
| 2973 | | "speech" |
| 2974 | | "transcription" |
| 2975 | export const ImageOutputModality = Schema.Literals([ |
| 2976 | "text", |
| 2977 | "image", |
| 2978 | "embeddings", |
| 2979 | "audio", |
| 2980 | "video", |
| 2981 | "rerank", |
| 2982 | "speech", |
| 2983 | "transcription" |
| 2984 | ]).annotate({ "identifier": "ImageOutputModality" }) |
| 2985 | export 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 | } |
| 2991 | export 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" }) |
| 2999 | export type IncompleteDetails = { |
| 3000 | readonly "reason"?: "max_output_tokens" | "content_filter" |
| 3001 | readonly [x: string]: Schema.Json |
| 3002 | } | null |
| 3003 | export 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" }) |
| 3010 | export type InputAudio = { |
| 3011 | readonly "input_audio": { readonly "data": string; readonly "format": "mp3" | "wav" } |
| 3012 | readonly "type": "input_audio" |
| 3013 | } |
| 3014 | export 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" }) |
| 3018 | export 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 | } |
| 3025 | export 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" }) |
| 3032 | export type InputImage = { |
| 3033 | readonly "detail": "auto" | "high" | "low" | "original" |
| 3034 | readonly "image_url"?: string | null |
| 3035 | readonly "type": "input_image" |
| 3036 | } |
| 3037 | export 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" }) |
| 3042 | export type InputModality = "text" | "image" | "file" | "audio" | "video" |
| 3043 | export const InputModality = Schema.Literals(["text", "image", "file", "audio", "video"]).annotate({ |
| 3044 | "identifier": "InputModality" |
| 3045 | }) |
| 3046 | export type InputVideo = { readonly "type": "input_video"; readonly "video_url": string } |
| 3047 | export 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" }) |
| 3053 | export 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 |
| 3077 | export 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" }) |
| 3102 | export type InternalServerResponseErrorData = { |
| 3103 | readonly "code": number |
| 3104 | readonly "message": string |
| 3105 | readonly "metadata"?: { readonly [x: string]: Schema.Json } | null |
| 3106 | } |
| 3107 | export 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" }) |
| 3114 | export type ItemReferenceItem = { readonly "id": string; readonly "type": "item_reference" } |
| 3115 | export 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" }) |
| 3117 | export 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 | } |
| 3126 | export 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" }) |
| 3137 | export type Legacy_ChatContentVideoInput = { readonly "url": string } |
| 3138 | export 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" }) |
| 3141 | export 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 | } |
| 3148 | export 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" }) |
| 3155 | export 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 | } |
| 3162 | export 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" }) |
| 3169 | export 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 | } |
| 3178 | export 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" }) |
| 3187 | export 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 | } |
| 3201 | export 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" }) |
| 3215 | export 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 | } |
| 3244 | export 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" }) |
| 3285 | export 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 | } |
| 3293 | export 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" }) |
| 3303 | export type MessagesAdvisorToolResultBlock = { |
| 3304 | readonly "content": {} |
| 3305 | readonly "tool_use_id": string |
| 3306 | readonly "type": "advisor_tool_result" |
| 3307 | } |
| 3308 | export 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 | }) |
| 3317 | export type MessagesContentBlockStopEvent = { readonly "index": number; readonly "type": "content_block_stop" } |
| 3318 | export 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 | }) |
| 3325 | export type MessagesFallbackParam = { readonly "model": string } |
| 3326 | export 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 | }) |
| 3331 | export type Union_10 = |
| 3332 | | { readonly "schema": {}; readonly "type": "json_schema"; readonly [x: string]: Schema.Json } |
| 3333 | | null |
| 3334 | export 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 | }) |
| 3343 | export type Union_11 = { |
| 3344 | readonly "remaining"?: number | null |
| 3345 | readonly "total": number |
| 3346 | readonly "type": "tokens" |
| 3347 | readonly [x: string]: Schema.Json |
| 3348 | } | null |
| 3349 | export 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 | }) |
| 3372 | export type MessagesPingEvent = { readonly "type": "ping" } |
| 3373 | export const MessagesPingEvent = Schema.Struct({ "type": Schema.Literal("ping") }).annotate({ |
| 3374 | "description": "Keep-alive ping event", |
| 3375 | "identifier": "MessagesPingEvent" |
| 3376 | }) |
| 3377 | export type MetadataLevel = "disabled" | "enabled" |
| 3378 | export 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 | }) |
| 3382 | export 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" |
| 3403 | export 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" }) |
| 3425 | export type ModelLinks = { readonly "details": string } |
| 3426 | export 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" }) |
| 3429 | export type ModelName = string |
| 3430 | export const ModelName = Schema.String.annotate({ |
| 3431 | "description": "Model to use for completion", |
| 3432 | "identifier": "ModelName" |
| 3433 | }) |
| 3434 | export type ModelsCountResponse = { readonly "data": { readonly "count": number } } |
| 3435 | export 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" }) |
| 3442 | export type ModerationPlugin = { readonly "id": "moderation" } |
| 3443 | export const ModerationPlugin = Schema.Struct({ "id": Schema.Literal("moderation") }).annotate({ |
| 3444 | "identifier": "ModerationPlugin" |
| 3445 | }) |
| 3446 | export type MultimodalMedia = { readonly "data": string; readonly "format"?: string } |
| 3447 | export const MultimodalMedia = Schema.Struct({ "data": Schema.String, "format": Schema.optionalKey(Schema.String) }) |
| 3448 | .annotate({ "identifier": "MultimodalMedia" }) |
| 3449 | export 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 | } |
| 3459 | export 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" }) |
| 3475 | export type NotFoundResponseErrorData = { |
| 3476 | readonly "code": number |
| 3477 | readonly "message": string |
| 3478 | readonly "metadata"?: { readonly [x: string]: Schema.Json } | null |
| 3479 | } |
| 3480 | export 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" }) |
| 3487 | export 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 | } |
| 3522 | export 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" }) |
| 3559 | export 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 | } |
| 3567 | export 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" }) |
| 3579 | export 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 | } |
| 3585 | export 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" }) |
| 3591 | export 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 | } |
| 3597 | export 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" }) |
| 3603 | export 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 | } |
| 3609 | export 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" }) |
| 3615 | export 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 | } |
| 3623 | export 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" }) |
| 3631 | export type OpenAIResponsesRefusalContent = { readonly "refusal": string; readonly "type": "refusal" } |
| 3632 | export const OpenAIResponsesRefusalContent = Schema.Struct({ |
| 3633 | "refusal": Schema.String, |
| 3634 | "type": Schema.Literal("refusal") |
| 3635 | }).annotate({ "identifier": "OpenAIResponsesRefusalContent" }) |
| 3636 | export type OpenAIResponsesResponseStatus = |
| 3637 | | "completed" |
| 3638 | | "incomplete" |
| 3639 | | "in_progress" |
| 3640 | | "failed" |
| 3641 | | "cancelled" |
| 3642 | | "queued" |
| 3643 | export const OpenAIResponsesResponseStatus = Schema.Literals([ |
| 3644 | "completed", |
| 3645 | "incomplete", |
| 3646 | "in_progress", |
| 3647 | "failed", |
| 3648 | "cancelled", |
| 3649 | "queued" |
| 3650 | ]).annotate({ "identifier": "OpenAIResponsesResponseStatus" }) |
| 3651 | export 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 | } |
| 3657 | export 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" }) |
| 3663 | export type Objects_11 = { readonly "name": string; readonly "type": "function" } |
| 3664 | export const Objects_11 = Schema.Struct({ "name": Schema.String, "type": Schema.Literal("function") }) |
| 3665 | export type Objects_12 = { readonly "type": "web_search_preview_2025_03_11" | "web_search_preview" } |
| 3666 | export const Objects_12 = Schema.Struct({ |
| 3667 | "type": Schema.Literals(["web_search_preview_2025_03_11", "web_search_preview"]) |
| 3668 | }) |
| 3669 | export type Objects_13 = { readonly "type": "apply_patch" } |
| 3670 | export const Objects_13 = Schema.Struct({ "type": Schema.Literal("apply_patch") }) |
| 3671 | export type Objects_14 = { readonly "type": "shell" } |
| 3672 | export const Objects_14 = Schema.Struct({ "type": Schema.Literal("shell") }) |
| 3673 | export type OpenAIResponsesTruncation = "auto" | "disabled" | null |
| 3674 | export const OpenAIResponsesTruncation = Schema.Union([Schema.Literal("auto"), Schema.Literal("disabled"), Schema.Null]) |
| 3675 | .annotate({ "identifier": "OpenAIResponsesTruncation" }) |
| 3676 | export type Objects_15 = { readonly "cache_write_tokens"?: number | null; readonly "cached_tokens": number } |
| 3677 | export 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 | }) |
| 3683 | export type Objects_16 = { readonly "reasoning_tokens": number } |
| 3684 | export const Objects_16 = Schema.Struct({ |
| 3685 | "reasoning_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })) |
| 3686 | }) |
| 3687 | export 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 | } |
| 3693 | export 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" }) |
| 3699 | export 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 | } |
| 3705 | export 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" }) |
| 3711 | export type OpenResponsesTopLogprobs = { |
| 3712 | readonly "bytes"?: ReadonlyArray<number> |
| 3713 | readonly "logprob"?: number |
| 3714 | readonly "token"?: string |
| 3715 | } |
| 3716 | export 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" }) |
| 3723 | export type ORAnthropicStopReason = |
| 3724 | | "end_turn" |
| 3725 | | "max_tokens" |
| 3726 | | "stop_sequence" |
| 3727 | | "tool_use" |
| 3728 | | "pause_turn" |
| 3729 | | "refusal" |
| 3730 | | "compaction" |
| 3731 | | null |
| 3732 | export 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" }) |
| 3742 | export 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 | } |
| 3752 | export 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" }) |
| 3762 | export 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 | } |
| 3770 | export 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 | }) |
| 3786 | export 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 | } |
| 3795 | export 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" }) |
| 3808 | export 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 | } |
| 3816 | export 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" }) |
| 3828 | export 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 | } |
| 3837 | export 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" }) |
| 3850 | export type OutputModality = "text" | "image" | "embeddings" | "audio" | "video" | "rerank" | "speech" | "transcription" |
| 3851 | export const OutputModality = Schema.Literals([ |
| 3852 | "text", |
| 3853 | "image", |
| 3854 | "embeddings", |
| 3855 | "audio", |
| 3856 | "video", |
| 3857 | "rerank", |
| 3858 | "speech", |
| 3859 | "transcription" |
| 3860 | ]).annotate({ "identifier": "OutputModality" }) |
| 3861 | export type OutputModalityEnum = "text" | "image" |
| 3862 | export const OutputModalityEnum = Schema.Literals(["text", "image"]).annotate({ "identifier": "OutputModalityEnum" }) |
| 3863 | export 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" |
| 3890 | export 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" }) |
| 3918 | export 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 | } |
| 3925 | export 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" }) |
| 3957 | export type PayloadTooLargeResponseErrorData = { |
| 3958 | readonly "code": number |
| 3959 | readonly "message": string |
| 3960 | readonly "metadata"?: { readonly [x: string]: Schema.Json } | null |
| 3961 | } |
| 3962 | export 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 | }) |
| 3972 | export type PaymentRequiredResponseErrorData = { |
| 3973 | readonly "code": number |
| 3974 | readonly "message": string |
| 3975 | readonly "metadata"?: { readonly [x: string]: Schema.Json } | null |
| 3976 | } |
| 3977 | export 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 | }) |
| 3987 | export type PDFParserEngine = "mistral-ocr" | "native" | "cloudflare-ai" | "pdf-text" |
| 3988 | export 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 | }) |
| 3996 | export type PercentileLatencyCutoffs = { |
| 3997 | readonly "p50"?: number | null |
| 3998 | readonly "p75"?: number | null |
| 3999 | readonly "p90"?: number | null |
| 4000 | readonly "p99"?: number | null |
| 4001 | } |
| 4002 | export 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 | }) |
| 4023 | export 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 |
| 4030 | export 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 | }) |
| 4054 | export type PercentileThroughputCutoffs = { |
| 4055 | readonly "p50"?: number | null |
| 4056 | readonly "p75"?: number | null |
| 4057 | readonly "p90"?: number | null |
| 4058 | readonly "p99"?: number | null |
| 4059 | } |
| 4060 | export 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 | }) |
| 4082 | export type PerRequestLimits = { |
| 4083 | readonly "completion_tokens": number |
| 4084 | readonly "prompt_tokens": number |
| 4085 | readonly [x: string]: Schema.Json |
| 4086 | } | null |
| 4087 | export 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" }) |
| 4101 | export type PipelineStageType = "guardrail" | "plugin" | "server_tools" | "response_healing" | "context_compression" |
| 4102 | export 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 | }) |
| 4113 | export type PredictionContentText = { readonly "text": string; readonly "type": "text" } |
| 4114 | export 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 | }) |
| 4118 | export 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 |
| 4129 | export 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 | }) |
| 4148 | export type PresetStatus = "active" | "disabled" | "archived" |
| 4149 | export const PresetStatus = Schema.Literals(["active", "disabled", "archived"]).annotate({ |
| 4150 | "description": "The status of a preset.", |
| 4151 | "identifier": "PresetStatus" |
| 4152 | }) |
| 4153 | export 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 | } |
| 4161 | export 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 | ) |
| 4171 | export 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 | } |
| 4183 | export 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 | }) |
| 4230 | export type Objects_19 = { readonly "mode": "explicit"; readonly [x: string]: Schema.Json } |
| 4231 | export const Objects_19 = Schema.StructWithRest(Schema.Struct({ "mode": Schema.Literal("explicit") }), [ |
| 4232 | Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })) |
| 4233 | ]) |
| 4234 | export type Objects_20 = { |
| 4235 | readonly "mode": "explicit" |
| 4236 | readonly "ttl"?: string | null |
| 4237 | readonly [x: string]: Schema.Json |
| 4238 | } |
| 4239 | export 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 | ) |
| 4246 | export type PromptInjectionScanScope = "user_only" | "all_messages" |
| 4247 | export 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 | }) |
| 4252 | export 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" |
| 4352 | export 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" }) |
| 4453 | export type Objects_21 = {} |
| 4454 | export const Objects_21 = Schema.Struct({}) |
| 4455 | export type Objects_22 = {} |
| 4456 | export const Objects_22 = Schema.Struct({}) |
| 4457 | export type Objects_23 = {} |
| 4458 | export const Objects_23 = Schema.Struct({}) |
| 4459 | export type Objects_24 = {} |
| 4460 | export const Objects_24 = Schema.Struct({}) |
| 4461 | export type Objects_25 = {} |
| 4462 | export const Objects_25 = Schema.Struct({}) |
| 4463 | export type Objects_26 = {} |
| 4464 | export const Objects_26 = Schema.Struct({}) |
| 4465 | export type Objects_27 = {} |
| 4466 | export const Objects_27 = Schema.Struct({}) |
| 4467 | export type Objects_28 = {} |
| 4468 | export const Objects_28 = Schema.Struct({}) |
| 4469 | export type Objects_29 = {} |
| 4470 | export const Objects_29 = Schema.Struct({}) |
| 4471 | export type Objects_30 = {} |
| 4472 | export const Objects_30 = Schema.Struct({}) |
| 4473 | export type Objects_31 = {} |
| 4474 | export const Objects_31 = Schema.Struct({}) |
| 4475 | export type Objects_32 = {} |
| 4476 | export const Objects_32 = Schema.Struct({}) |
| 4477 | export type Objects_33 = {} |
| 4478 | export const Objects_33 = Schema.Struct({}) |
| 4479 | export type Objects_34 = {} |
| 4480 | export const Objects_34 = Schema.Struct({}) |
| 4481 | export type Objects_35 = {} |
| 4482 | export const Objects_35 = Schema.Struct({}) |
| 4483 | export type Objects_36 = {} |
| 4484 | export const Objects_36 = Schema.Struct({}) |
| 4485 | export type Objects_37 = {} |
| 4486 | export const Objects_37 = Schema.Struct({}) |
| 4487 | export type Objects_38 = {} |
| 4488 | export const Objects_38 = Schema.Struct({}) |
| 4489 | export type Objects_39 = {} |
| 4490 | export const Objects_39 = Schema.Struct({}) |
| 4491 | export type Objects_40 = {} |
| 4492 | export const Objects_40 = Schema.Struct({}) |
| 4493 | export type Objects_41 = {} |
| 4494 | export const Objects_41 = Schema.Struct({}) |
| 4495 | export type Objects_42 = {} |
| 4496 | export const Objects_42 = Schema.Struct({}) |
| 4497 | export type Objects_43 = {} |
| 4498 | export const Objects_43 = Schema.Struct({}) |
| 4499 | export type Objects_44 = {} |
| 4500 | export const Objects_44 = Schema.Struct({}) |
| 4501 | export type Objects_45 = {} |
| 4502 | export const Objects_45 = Schema.Struct({}) |
| 4503 | export type Objects_46 = {} |
| 4504 | export const Objects_46 = Schema.Struct({}) |
| 4505 | export type Objects_47 = {} |
| 4506 | export const Objects_47 = Schema.Struct({}) |
| 4507 | export type Objects_48 = {} |
| 4508 | export const Objects_48 = Schema.Struct({}) |
| 4509 | export type Objects_49 = {} |
| 4510 | export const Objects_49 = Schema.Struct({}) |
| 4511 | export type Objects_50 = {} |
| 4512 | export const Objects_50 = Schema.Struct({}) |
| 4513 | export type Objects_51 = {} |
| 4514 | export const Objects_51 = Schema.Struct({}) |
| 4515 | export type Objects_52 = {} |
| 4516 | export const Objects_52 = Schema.Struct({}) |
| 4517 | export type Objects_53 = {} |
| 4518 | export const Objects_53 = Schema.Struct({}) |
| 4519 | export type Objects_54 = {} |
| 4520 | export const Objects_54 = Schema.Struct({}) |
| 4521 | export type Objects_55 = {} |
| 4522 | export const Objects_55 = Schema.Struct({}) |
| 4523 | export type Objects_56 = {} |
| 4524 | export const Objects_56 = Schema.Struct({}) |
| 4525 | export type Objects_57 = {} |
| 4526 | export const Objects_57 = Schema.Struct({}) |
| 4527 | export type Objects_58 = {} |
| 4528 | export const Objects_58 = Schema.Struct({}) |
| 4529 | export type Objects_59 = {} |
| 4530 | export const Objects_59 = Schema.Struct({}) |
| 4531 | export type Objects_60 = {} |
| 4532 | export const Objects_60 = Schema.Struct({}) |
| 4533 | export type Objects_61 = {} |
| 4534 | export const Objects_61 = Schema.Struct({}) |
| 4535 | export type Objects_62 = {} |
| 4536 | export const Objects_62 = Schema.Struct({}) |
| 4537 | export type Objects_63 = {} |
| 4538 | export const Objects_63 = Schema.Struct({}) |
| 4539 | export type Objects_64 = {} |
| 4540 | export const Objects_64 = Schema.Struct({}) |
| 4541 | export type Objects_65 = {} |
| 4542 | export const Objects_65 = Schema.Struct({}) |
| 4543 | export type Objects_66 = {} |
| 4544 | export const Objects_66 = Schema.Struct({}) |
| 4545 | export type Objects_67 = {} |
| 4546 | export const Objects_67 = Schema.Struct({}) |
| 4547 | export type Objects_68 = {} |
| 4548 | export const Objects_68 = Schema.Struct({}) |
| 4549 | export type Objects_69 = {} |
| 4550 | export const Objects_69 = Schema.Struct({}) |
| 4551 | export type Objects_70 = {} |
| 4552 | export const Objects_70 = Schema.Struct({}) |
| 4553 | export type Objects_71 = {} |
| 4554 | export const Objects_71 = Schema.Struct({}) |
| 4555 | export type Objects_72 = {} |
| 4556 | export const Objects_72 = Schema.Struct({}) |
| 4557 | export type Objects_73 = {} |
| 4558 | export const Objects_73 = Schema.Struct({}) |
| 4559 | export type Objects_74 = {} |
| 4560 | export const Objects_74 = Schema.Struct({}) |
| 4561 | export type Objects_75 = {} |
| 4562 | export const Objects_75 = Schema.Struct({}) |
| 4563 | export type Objects_76 = {} |
| 4564 | export const Objects_76 = Schema.Struct({}) |
| 4565 | export type Objects_77 = {} |
| 4566 | export const Objects_77 = Schema.Struct({}) |
| 4567 | export type Objects_78 = {} |
| 4568 | export const Objects_78 = Schema.Struct({}) |
| 4569 | export type Objects_79 = {} |
| 4570 | export const Objects_79 = Schema.Struct({}) |
| 4571 | export type Objects_80 = {} |
| 4572 | export const Objects_80 = Schema.Struct({}) |
| 4573 | export type Objects_81 = {} |
| 4574 | export const Objects_81 = Schema.Struct({}) |
| 4575 | export type Objects_82 = {} |
| 4576 | export const Objects_82 = Schema.Struct({}) |
| 4577 | export type Objects_83 = {} |
| 4578 | export const Objects_83 = Schema.Struct({}) |
| 4579 | export type Objects_84 = {} |
| 4580 | export const Objects_84 = Schema.Struct({}) |
| 4581 | export type Objects_85 = {} |
| 4582 | export const Objects_85 = Schema.Struct({}) |
| 4583 | export type Objects_86 = {} |
| 4584 | export const Objects_86 = Schema.Struct({}) |
| 4585 | export type Objects_87 = {} |
| 4586 | export const Objects_87 = Schema.Struct({}) |
| 4587 | export type Objects_88 = {} |
| 4588 | export const Objects_88 = Schema.Struct({}) |
| 4589 | export type Objects_89 = {} |
| 4590 | export const Objects_89 = Schema.Struct({}) |
| 4591 | export type Objects_90 = {} |
| 4592 | export const Objects_90 = Schema.Struct({}) |
| 4593 | export type Objects_91 = {} |
| 4594 | export const Objects_91 = Schema.Struct({}) |
| 4595 | export type Objects_92 = {} |
| 4596 | export const Objects_92 = Schema.Struct({}) |
| 4597 | export type Objects_93 = {} |
| 4598 | export const Objects_93 = Schema.Struct({}) |
| 4599 | export type Objects_94 = {} |
| 4600 | export const Objects_94 = Schema.Struct({}) |
| 4601 | export type Objects_95 = {} |
| 4602 | export const Objects_95 = Schema.Struct({}) |
| 4603 | export type Objects_96 = {} |
| 4604 | export const Objects_96 = Schema.Struct({}) |
| 4605 | export type Objects_97 = {} |
| 4606 | export const Objects_97 = Schema.Struct({}) |
| 4607 | export type Objects_98 = {} |
| 4608 | export const Objects_98 = Schema.Struct({}) |
| 4609 | export type Objects_99 = {} |
| 4610 | export const Objects_99 = Schema.Struct({}) |
| 4611 | export type Objects_100 = {} |
| 4612 | export const Objects_100 = Schema.Struct({}) |
| 4613 | export type Objects_101 = {} |
| 4614 | export const Objects_101 = Schema.Struct({}) |
| 4615 | export type Objects_102 = {} |
| 4616 | export const Objects_102 = Schema.Struct({}) |
| 4617 | export type Objects_103 = {} |
| 4618 | export const Objects_103 = Schema.Struct({}) |
| 4619 | export type Objects_104 = {} |
| 4620 | export const Objects_104 = Schema.Struct({}) |
| 4621 | export type Objects_105 = {} |
| 4622 | export const Objects_105 = Schema.Struct({}) |
| 4623 | export type Objects_106 = {} |
| 4624 | export const Objects_106 = Schema.Struct({}) |
| 4625 | export type Objects_107 = {} |
| 4626 | export const Objects_107 = Schema.Struct({}) |
| 4627 | export type Objects_108 = {} |
| 4628 | export const Objects_108 = Schema.Struct({}) |
| 4629 | export type Objects_109 = {} |
| 4630 | export const Objects_109 = Schema.Struct({}) |
| 4631 | export type Objects_110 = {} |
| 4632 | export const Objects_110 = Schema.Struct({}) |
| 4633 | export type Objects_111 = {} |
| 4634 | export const Objects_111 = Schema.Struct({}) |
| 4635 | export type Objects_112 = {} |
| 4636 | export const Objects_112 = Schema.Struct({}) |
| 4637 | export type Objects_113 = {} |
| 4638 | export const Objects_113 = Schema.Struct({}) |
| 4639 | export type Objects_114 = {} |
| 4640 | export const Objects_114 = Schema.Struct({}) |
| 4641 | export type Objects_115 = {} |
| 4642 | export const Objects_115 = Schema.Struct({}) |
| 4643 | export type Objects_116 = {} |
| 4644 | export const Objects_116 = Schema.Struct({}) |
| 4645 | export type Objects_117 = {} |
| 4646 | export const Objects_117 = Schema.Struct({}) |
| 4647 | export type Objects_118 = {} |
| 4648 | export const Objects_118 = Schema.Struct({}) |
| 4649 | export type Objects_119 = {} |
| 4650 | export const Objects_119 = Schema.Struct({}) |
| 4651 | export type Objects_120 = {} |
| 4652 | export const Objects_120 = Schema.Struct({}) |
| 4653 | export type Objects_121 = {} |
| 4654 | export const Objects_121 = Schema.Struct({}) |
| 4655 | export type Objects_122 = {} |
| 4656 | export const Objects_122 = Schema.Struct({}) |
| 4657 | export type Objects_123 = {} |
| 4658 | export const Objects_123 = Schema.Struct({}) |
| 4659 | export type Objects_124 = {} |
| 4660 | export const Objects_124 = Schema.Struct({}) |
| 4661 | export type Objects_125 = {} |
| 4662 | export const Objects_125 = Schema.Struct({}) |
| 4663 | export type Objects_126 = {} |
| 4664 | export const Objects_126 = Schema.Struct({}) |
| 4665 | export type Objects_127 = {} |
| 4666 | export const Objects_127 = Schema.Struct({}) |
| 4667 | export type Objects_128 = {} |
| 4668 | export const Objects_128 = Schema.Struct({}) |
| 4669 | export type Objects_129 = {} |
| 4670 | export const Objects_129 = Schema.Struct({}) |
| 4671 | export type Objects_130 = {} |
| 4672 | export const Objects_130 = Schema.Struct({}) |
| 4673 | export type Objects_131 = {} |
| 4674 | export const Objects_131 = Schema.Struct({}) |
| 4675 | export type Objects_132 = {} |
| 4676 | export const Objects_132 = Schema.Struct({}) |
| 4677 | export type Objects_133 = {} |
| 4678 | export const Objects_133 = Schema.Struct({}) |
| 4679 | export type Objects_134 = {} |
| 4680 | export const Objects_134 = Schema.Struct({}) |
| 4681 | export type Objects_135 = {} |
| 4682 | export const Objects_135 = Schema.Struct({}) |
| 4683 | export type Objects_136 = {} |
| 4684 | export const Objects_136 = Schema.Struct({}) |
| 4685 | export type Objects_137 = {} |
| 4686 | export const Objects_137 = Schema.Struct({}) |
| 4687 | export type Objects_138 = {} |
| 4688 | export const Objects_138 = Schema.Struct({}) |
| 4689 | export type Objects_139 = {} |
| 4690 | export const Objects_139 = Schema.Struct({}) |
| 4691 | export type Objects_140 = {} |
| 4692 | export const Objects_140 = Schema.Struct({}) |
| 4693 | export type Objects_141 = {} |
| 4694 | export const Objects_141 = Schema.Struct({}) |
| 4695 | export type Objects_142 = {} |
| 4696 | export const Objects_142 = Schema.Struct({}) |
| 4697 | export type Objects_143 = {} |
| 4698 | export const Objects_143 = Schema.Struct({}) |
| 4699 | export type Objects_144 = {} |
| 4700 | export const Objects_144 = Schema.Struct({}) |
| 4701 | export type Objects_145 = {} |
| 4702 | export const Objects_145 = Schema.Struct({}) |
| 4703 | export type Objects_146 = {} |
| 4704 | export const Objects_146 = Schema.Struct({}) |
| 4705 | export type Objects_147 = {} |
| 4706 | export const Objects_147 = Schema.Struct({}) |
| 4707 | export type ProviderOverloadedResponseErrorData = { |
| 4708 | readonly "code": number |
| 4709 | readonly "message": string |
| 4710 | readonly "metadata"?: { readonly [x: string]: Schema.Json } | null |
| 4711 | } |
| 4712 | export 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 | }) |
| 4722 | export 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 | } |
| 4859 | export 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" }) |
Showing first 5,000 of 36,295 lines.
View raw