(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,721242,868179,e=>{"use strict";e.s(["X",0,"or-client-forwarded-ip","g",0,"sec-or-proxy-psk"],721242);var t=e.i(882844),o=e.i(635157);let n=o.z.boolean().optional().openapi({description:"Universal profile only, for searches the router answers through the `tool_search` wrapper; code-mode `search()` and a client-owned tool search list the matched tools alone. When true, each result also names up to 16 other deferred tools of every source a match came from, so a model that found one tool of an MCP server learns its neighbours without another search. Absent or false: results list the matched tools alone."}),i=o.z.boolean().optional().openapi({description:"Universal profile only, for searches the router answers through the `tool_search` wrapper. Unless false, a search that matches nothing also names the deferred sources this search covers (namespaces, MCP servers, and shared `_` prefixes; up to 40 names or 2,000 characters, with a count of any omitted) and tells the model that a source the search does not cover is unreachable through it in this request, so it can make a client tool call the task already needs (or a read-only one) and search again on a later turn instead of concluding the integration is missing. A hit gets the same guidance after its matches when, as a heuristic on the model's own words, the query's leading word has 3 to 64 characters, no query word names a searchable source, and the leading word is not among the words of the deferred tools' names (the union of every deferred tool name's tokens, whole and split as the search index splits names; a camel-case word counts when each of its parts is), with descriptions left out so a tool that merely mentions another product cannot mask it (`jira create issue` answered with another tracker's issue tools). Direct tools, including a client's built-in tools, are already in the tool list and are not named. False: a miss suggests other keywords and the closest names only."}),a=o.z.object({type:o.z.literal("regex"),max_results:(0,t.D)().min(1).max(100).default(5),siblings:n,miss_sources:i}).openapi("DeferredRegexSearch",{description:"Versioned safe-regex retrieval over supplied tool definitions.",example:{type:"regex",max_results:5}}),r=o.z.object({type:o.z.literal("bm25"),max_results:(0,t.D)().min(1).max(100).default(5),siblings:n,miss_sources:i,spread:o.z.boolean().optional().openapi({description:"Universal profile only, for keyword searches the router answers through the `tool_search` wrapper. When true, a result spreads across sources: of the 3 x limit best-scoring candidates, those scoring at least 60% of the best match take at most 2 slots per source (MCP server, namespace or shared `_` prefix; a tool with no source is never capped), and the remaining slots fill in score order, so a catalog with several systems for one job (web search, page extraction) shows one of each instead of the top system's siblings. Absent or false: results are the best matches in score order."})}).openapi("DeferredBm25Search",{description:"Deterministic BM25 retrieval over supplied tool definitions.",example:{type:"bm25",max_results:5}}),l=o.z.object({type:o.z.literal("custom"),tool_id:o.z.string().min(1),result_key:o.z.string().min(1),max_results:(0,t.D)().min(1).max(100).default(5)}).openapi("DeferredCustomSearch",{description:"Caller-executed search returning existing tool identities under result_key.",example:{type:"custom",tool_id:"search_catalog",result_key:"tool_names",max_results:5}}),s=o.z.object({protocol:o.z.literal("v1"),profile:o.z.enum(["portable","universal"]).openapi({description:"Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes (unless `min_deferred_tools` inlines a small catalog), and rebuilds the catalog from each request so tools can be added or removed mid-conversation."}),validation:o.z.literal("runtime").openapi({description:"Where tool-call arguments are checked against the original schema. Only `runtime` (in OpenRouter) is available in this release."}),interface:o.z.enum(["wrappers","code_mode"]).optional().openapi({description:"How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental."}),scope:o.z.enum(["all","mcp"]).optional().openapi({description:"Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental."}),min_deferred_tools:(0,t.D)().min(1).max(100).optional().openapi({description:"Universal profile only. When fewer tools than this would be deferred, the universal profile defers none of them and sends the client tools unchanged, so a harness with a handful of non-core tools and no MCP servers pays no search turn for them. Counted after the interface exclusions; ignored with a custom search, whose client decides what it loads. Absent: every wrappable tool in scope is deferred."}),hint:o.z.string().trim().min(1).max(2e3).optional().openapi({description:"Universal profile only. Caller text announced to the model with the deferred catalog before its first turn, for example which sources the task needs. Repeated only when it changes. Trimmed before the length bounds apply. Recorded in the `catalog_index` discovery record of the response, so it is replayed with the conversation."}),announce_catalog_changes:o.z.boolean().optional().openapi({description:"Universal profile only. When true, a catalog whose deferred tools changed between two of the model's own turns (a client that connects MCP servers while the model works) is re-announced before the next model turn, with the sources added, changed and removed since the previous index, or that no deferred tools remain. Applies when the router lists the catalog itself; a client whose own tool search was adopted lists its deferred tools itself and is not re-announced. The announcement shares the result budget of the turn and is skipped when it does not fit. Absent or false: the catalog index is announced on a user turn only."}),cascade_mode:o.z.enum(["keywords","native"]).optional().openapi({description:"How a universal `tool_search` query reaches the client's own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search documents `select:`, and the limit field is sent only when the model gave one, unless the client search requires it, in which case its documented default is sent. A tool the client sent with `defer_loading: true` that universal keeps direct is forwarded with that flag, so the provider loads it through the client search as it would without universal. Experimental."}),search:o.z.discriminatedUnion("type",[a,r,l]).openapi("DeferredToolsSearchStrategy",{description:"Router-local regex/BM25 or caller-owned custom search.",example:{type:"bm25",max_results:5},discriminator:{propertyName:"type",mapping:{regex:"#/components/schemas/DeferredRegexSearch",bm25:"#/components/schemas/DeferredBm25Search",custom:"#/components/schemas/DeferredCustomSearch"}}})}).openapi("DeferredToolsControl",{description:"Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation. The portable profile needs the catalog unchanged across a continuation; the universal profile accepts a changed catalog and, with `announce_catalog_changes`, tells the model about it.",example:{protocol:"v1",profile:"portable",validation:"runtime",search:{type:"bm25",max_results:5}}});e.s(["f",0,s],868179)},443567,223855,e=>{"use strict";e.i(480534).e.Fast,e.s(["H",0,{Completed:"completed",Incomplete:"incomplete",InProgress:"in_progress",Failed:"failed",Cancelled:"cancelled",Queued:"queued"},"b",0,{Auto:"auto",High:"high",Low:"low",Original:"original"},"z",0,{MaxOutputTokens:"max_output_tokens",ContentFilter:"content_filter"},"y",0,{Auto:"auto",Default:"default",Flex:"flex",Priority:"priority",Scale:"scale",Ultrafast:"ultrafast"},"S",0,{Auto:"auto",Disabled:"disabled"},"r",0,{Completed:"completed",Searching:"searching",InProgress:"in_progress",Failed:"failed",Incomplete:"incomplete"},"F",0,["in_progress","completed","incomplete"]],443567),e.i(882844);var t=e.i(635157);let o=t.z.enum(["in_progress","completed","generating","failed"]).openapi("ImageGenerationStatus",{example:"completed"}),n=t.z.object({type:t.z.literal("image_generation_call"),id:t.z.string(),result:t.z.string().nullable().default(null),status:o}).openapi("OutputItemImageGenerationCall",{example:{type:"image_generation_call",id:"imagegen-abc123",result:"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",status:"completed"}});e.s(["f",0,n],223855)},442617,e=>{"use strict";var t=e.i(882844),o=e.i(635157),n=e.i(577980),i=e.i(434),a=e.i(743245),r=e.i(868709),l=e.i(33689),s=e.i(494949),p=e.i(443567),c=e.i(223855);o.z.enum([p.y.Auto,p.y.Default,p.y.Flex,p.y.Scale,p.y.Priority,p.y.Ultrafast]).openapi("OpenAIResponsesServiceTier",{example:"auto",enum:[...Object.values(p.y),null]});let u=o.z.enum([p.S.Auto,p.S.Disabled]).openapi("OpenAIResponsesTruncation",{example:"auto",enum:[...Object.values(p.S),null]}),d=o.z.object({type:o.z.literal("approximate").optional(),city:o.z.string().nullish(),country:o.z.string().nullish(),region:o.z.string().nullish(),timezone:o.z.string().nullish()}).openapi("WebSearchUserLocation"),_=o.z.enum(a.f).openapi("SearchContextSizeEnum"),m={WebSearch:"web_search",WebSearchPreview:"web_search_preview",WebSearchPreview20250311:"web_search_preview_2025_03_11",WebSearch20250826:"web_search_2025_08_26"},h={Function:"function",ImageGeneration:"image_generation",WebSearch:m.WebSearch,WebSearchPreview:m.WebSearchPreview,WebSearch20250826:m.WebSearch20250826},z=o.z.object({type:o.z.literal(h.ImageGeneration),background:o.z.enum(["transparent","opaque","auto"]).optional(),input_fidelity:o.z.enum(["high","low"]).nullish().openapi({enum:["high","low",null]}),input_image_mask:o.z.object({image_url:o.z.string().optional(),file_id:o.z.string().optional()}).optional(),model:o.z.string().optional(),moderation:o.z.enum(["auto","low"]).optional(),output_compression:(0,t.D)().optional(),output_format:o.z.enum(["png","webp","jpeg"]).optional(),partial_images:(0,t.D)().optional(),quality:o.z.enum(["low","medium","high","auto"]).optional(),size:o.z.string().optional()}),g=o.z.object({type:o.z.literal(h.Function),name:o.z.string(),description:o.z.string().optional(),strict:o.z.boolean().optional().default(!0),defer_loading:o.z.boolean().optional(),allowed_callers:o.z.array(o.z.enum(["direct","programmatic"])).nullish(),output_schema:o.z.record(o.z.string(),o.z.unknown()).nullish(),parameters:o.z.looseObject({}).optional(),async:o.z.boolean().optional()}),b=o.z.object({type:o.z.union([o.z.literal(m.WebSearchPreview),o.z.literal(m.WebSearch20250826)]),search_context_size:_.optional(),user_location:d.nullish()}),y=o.z.object({type:o.z.union([o.z.literal(m.WebSearch),o.z.literal(m.WebSearch20250826)]),filters:o.z.object({allowed_domains:o.z.array(o.z.string()).nullish()}).nullish(),search_context_size:_.optional(),user_location:d.nullish()}),x=new Set(Object.values(h)),f=o.z.object({type:o.z.string().refine(e=>!x.has(e),{message:"Tool type is explicitly modeled and must match its strict schema"})}).passthrough();o.z.union([g,b,y,z,f]).openapi("OpenAIResponsesTool");let v=o.z.object({type:o.z.literal("mcp"),server_label:o.z.string(),name:o.z.string().nullish()}).openapi("ToolChoiceMcp",{description:"Forces a call to the named MCP server; `name` narrows it to one of its tools",example:{type:"mcp",server_label:"huggingface"}}),w=o.z.union([o.z.literal("auto"),o.z.literal("none"),o.z.literal("required"),o.z.object({type:o.z.literal("function"),name:o.z.string()}),o.z.object({type:o.z.union([o.z.literal(m.WebSearchPreview20250311),o.z.literal(m.WebSearchPreview)])}),o.z.object({type:o.z.literal("allowed_tools"),mode:o.z.union([o.z.literal("auto"),o.z.literal("required")]),tools:o.z.array(o.z.record(o.z.string(),o.z.unknown()))}).openapi("ToolChoiceAllowed",{description:"Constrains the model to a pre-defined set of allowed tools",example:{type:"allowed_tools",mode:"auto",tools:[{type:"function",name:"get_weather"}]}}),o.z.object({type:o.z.literal("apply_patch")}),o.z.object({type:o.z.literal("shell")}),v]).openapi("OpenAIResponsesToolChoice",{example:"auto"}),k=o.z.object({type:o.z.literal("file_citation"),file_id:o.z.string(),filename:o.z.string(),index:(0,t.D)()}).openapi("FileCitation",{example:{type:"file_citation",file_id:"file-abc123",filename:"research_paper.pdf",index:0}}),j=o.z.object({type:o.z.literal("url_citation"),url:o.z.string(),title:o.z.string(),start_index:(0,t.D)(),end_index:(0,t.D)(),content:o.z.string().optional()}).openapi("URLCitation",{example:{type:"url_citation",start_index:0,end_index:42,title:"OpenRouter Documentation",url:"https://openrouter.ai/docs",content:"OpenRouter provides a unified API for accessing LLMs from multiple providers."}}),A=j.extend({title:o.z.string().nullish(),start_index:(0,t.D)().nullish(),end_index:(0,t.D)().nullish()}).openapi("LooseURLCitation"),D=o.z.object({type:o.z.literal("file_path"),file_id:o.z.string(),index:(0,t.D)()}).openapi("FilePath",{example:{type:"file_path",file_id:"file-xyz789",index:0}}),C=o.z.union([k,j,D]).openapi("OpenAIResponsesAnnotation",{example:{type:"file_citation",file_id:"file-abc123",filename:"research_paper.pdf",index:0}}),R=o.z.object({token:o.z.string(),bytes:o.z.array((0,t.D)()),logprob:(0,t.$)()}),T=R.extend({top_logprobs:o.z.array(R)}),I=o.z.object({type:o.z.literal("output_text"),text:o.z.string(),annotations:o.z.array(C).optional(),logprobs:o.z.array(T).optional()}).openapi("ResponseOutputText",{example:{type:"output_text",text:"The capital of France is Paris.",annotations:[{type:"url_citation",start_index:0,end_index:42,title:"Paris - Wikipedia",url:"https://en.wikipedia.org/wiki/Paris"}]}}),q=o.z.object({type:o.z.literal("reasoning_text"),text:o.z.string()}).openapi("ReasoningTextContent",{example:{type:"reasoning_text",text:"Let me think step by step about this problem..."}}),S=o.z.object({ttl_12h_tokens:(0,t.D)().nullish(),ttl_30m_tokens:(0,t.D)().nullish()}),O=o.z.object({cached_tokens:(0,t.D)(),cache_write_tokens:(0,t.D)().nullish()}),E=o.z.object({...O.shape,cache_write_tokens_details:S.nullish()}),P=o.z.object({reasoning_tokens:(0,t.D)()}),U=o.z.object({input_tokens:(0,t.D)(),input_tokens_details:O,output_tokens:(0,t.D)(),output_tokens_details:P,total_tokens:(0,t.D)()}).openapi("OpenAIResponsesUsage",{example:{input_tokens:100,input_tokens_details:{cached_tokens:0},output_tokens:50,output_tokens_details:{reasoning_tokens:0},total_tokens:150}}),B=o.z.object({...U.shape,input_tokens_details:E}),F=o.z.object({type:o.z.literal("summary_text"),text:o.z.string()}).openapi("ReasoningSummaryText",{example:{type:"summary_text",text:"Analyzed the problem using first principles"}}),W=o.z.object({type:o.z.literal("reasoning"),id:o.z.string(),content:o.z.array(q).optional(),summary:o.z.array(F),encrypted_content:o.z.string().nullish(),status:o.z.union([o.z.literal(p.H.Completed),o.z.literal(p.H.Incomplete),o.z.literal(p.H.InProgress)]).optional()}).openapi("OutputItemReasoning",{example:{type:"reasoning",id:"reasoning-abc123",summary:[{type:"summary_text",text:"Analyzed the problem using first principles"}]}}),M=o.z.boolean().optional().openapi({description:"True when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.",example:!0}),N=o.z.object({type:o.z.literal("function_call"),id:o.z.string().optional(),name:o.z.string(),arguments:o.z.string(),call_id:o.z.string(),status:o.z.union([o.z.literal(p.H.Completed),o.z.literal(p.H.Incomplete),o.z.literal(p.H.InProgress)]).optional(),namespace:o.z.string().optional().openapi({description:"Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"}),async:M}).openapi("OutputItemFunctionCall",{example:{type:"function_call",id:"call-abc123",name:"get_weather",arguments:'{"location":"San Francisco","unit":"celsius"}',call_id:"call-abc123"}}),L=o.z.object({type:o.z.literal("custom_tool_call"),id:o.z.string().optional(),name:o.z.string(),input:o.z.string(),call_id:o.z.string(),status:o.z.enum(p.F).optional(),namespace:o.z.string().optional().openapi({description:"Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"}),async:M}).openapi("OutputItemCustomToolCall",{example:{type:"custom_tool_call",id:"ctc-abc123",name:"apply_patch",input:"*** Begin Patch\n*** End Patch",call_id:"call-abc123",status:"completed"}}),$=o.z.object({type:o.z.literal("computer_call"),id:o.z.string(),call_id:o.z.string(),status:o.z.enum(["completed","incomplete","in_progress"]),action:o.z.unknown(),pending_safety_checks:o.z.array(o.z.object({id:o.z.string(),code:o.z.string(),message:o.z.string()}))}),H=o.z.object({type:o.z.literal("refusal"),refusal:o.z.string()}).openapi("OpenAIResponsesRefusalContent",{example:{type:"refusal",refusal:"I'm sorry, I cannot assist with that request"}}),V=o.z.enum(p.H).openapi("OpenAIResponsesResponseStatus",{example:"completed"}),G=o.z.object({id:o.z.string(),role:o.z.literal("assistant"),type:o.z.literal("message"),status:o.z.union([o.z.literal(p.H.Completed),o.z.literal(p.H.Incomplete),o.z.literal(p.H.InProgress)]).optional(),content:o.z.array(o.z.union([I,H])),phase:o.z.union([o.z.literal("commentary"),o.z.literal("final_answer")]).nullish().openapi({description:"The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages."})}).openapi("OutputMessage",{example:{id:"msg-abc123",role:"assistant",type:"message",status:"completed",content:[{type:"output_text",text:"Hello! How can I help you today?"}]}}),J=o.z.enum(p.r).openapi("WebSearchStatus",{example:"completed"}),Z=o.z.object({type:o.z.literal("url"),url:o.z.string()}).openapi("WebSearchSource",{example:{type:"url",url:"https://example.com/article"}}),K=o.z.object({type:o.z.literal("search"),query:o.z.string(),queries:o.z.array(o.z.string()).optional(),sources:o.z.array(Z).optional()}),Q=o.z.object({type:o.z.literal("open_page"),url:o.z.string().nullish()}),X=o.z.object({type:o.z.literal("find_in_page"),pattern:o.z.string(),url:o.z.string()}),Y=o.z.object({type:o.z.literal("web_search_call"),id:o.z.string(),action:o.z.discriminatedUnion("type",[K,Q,X]).optional(),status:J}).passthrough().openapi("OutputItemWebSearchCall",{example:{type:"web_search_call",id:"search-abc123",action:{type:"search",query:"OpenAI API"},status:"completed"}}),ee=o.z.object({type:o.z.literal("file_search_call"),id:o.z.string(),queries:o.z.array(o.z.string()),status:J}).openapi("OutputItemFileSearchCall",{example:{type:"file_search_call",id:"filesearch-abc123",queries:["machine learning algorithms","neural networks"],status:"completed"}}),et=o.z.object({type:o.z.literal("create_file"),path:o.z.string(),diff:o.z.string()}).openapi("ApplyPatchCreateFileOperation",{description:"The `create_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing the new file contents.",example:{type:"create_file",path:"/src/main.ts",diff:'@@\n+console.log("hi");\n'}}),eo=o.z.object({type:o.z.literal("update_file"),path:o.z.string(),diff:o.z.string()}).openapi("ApplyPatchUpdateFileOperation",{description:"The `update_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing edits to an existing file.",example:{type:"update_file",path:"/src/main.ts",diff:'@@ function main() {\n+ console.log("hi");\n }'}}),en=o.z.object({type:o.z.literal("delete_file"),path:o.z.string()}).openapi("ApplyPatchDeleteFileOperation",{description:"The `delete_file` variant of an `apply_patch_call.operation`. Identifies the file to remove; no diff is required.",example:{type:"delete_file",path:"/src/main.ts"}}),ei=o.z.discriminatedUnion("type",[et,eo,en]),ea=o.z.object({type:o.z.literal("apply_patch_call"),id:o.z.string(),call_id:o.z.string(),operation:ei,status:o.z.enum(["in_progress","completed"]),created_by:o.z.string().optional()}).openapi("OutputItemApplyPatchCall",{example:{type:"apply_patch_call",id:"apc_abc123",call_id:"call_abc123",status:"completed",operation:{type:"update_file",path:"/src/main.ts",diff:'@@ function main() {\n+ console.log("hi");\n }'}}}),er=o.z.object({type:o.z.literal("code_interpreter_call"),id:o.z.string(),code:o.z.string().nullish(),container_id:o.z.string().optional(),outputs:o.z.array(s.f).nullish(),status:o.z.enum(["in_progress","completed","incomplete","interpreting","failed"])}).passthrough().openapi("OutputItemCodeInterpreterCall",{example:{type:"code_interpreter_call",id:"ci_abc123",code:'print("hello")',outputs:[{type:"logs",logs:"hello\n"}],status:"completed"}}),el=o.z.object({type:o.z.literal("mcp_list_tools"),id:o.z.string(),server_label:o.z.string(),tools:o.z.array(o.z.object({name:o.z.string(),description:o.z.string().nullish(),input_schema:o.z.record(o.z.string(),o.z.unknown()),annotations:o.z.unknown().nullish()})),error:o.z.string().nullish()}).openapi("OutputItemMcpListTools");(0,t.j)(el);let es=o.z.discriminatedUnion("type",[o.z.object({type:o.z.literal("mcp_protocol_error"),code:(0,t.D)(),message:o.z.string()}),o.z.object({type:o.z.literal("mcp_tool_execution_error"),content:o.z.unknown()}),o.z.object({type:o.z.literal("http_error"),code:(0,t.D)(),message:o.z.string()})]),ep=o.z.object({type:o.z.literal("mcp_call"),id:o.z.string(),server_label:o.z.string(),name:o.z.string(),arguments:o.z.string(),approval_request_id:o.z.string().nullish(),output:o.z.string().nullish(),error:o.z.union([o.z.string(),es]).nullish(),status:o.z.enum(["in_progress","completed","incomplete","calling","failed"]).optional()}).openapi("OutputItemMcpCall");(0,t.j)(ep);let ec=o.z.object({type:o.z.literal("mcp_approval_request"),id:o.z.string(),server_label:o.z.string(),name:o.z.string(),arguments:o.z.string()}).openapi("OutputItemMcpApprovalRequest"),eu=o.z.object({type:o.z.string()}).passthrough(),ed=o.z.array(eu).nullish(),e_=o.z.object({type:o.z.literal("compaction"),id:o.z.string(),encrypted_content:o.z.string(),created_by:o.z.string().optional()}).openapi("OutputItemCompaction",{example:{type:"compaction",id:"cmp_abc123",encrypted_content:"enc_abc123..."}}),em=o.z.discriminatedUnion("type",[G,W,N,L,Y,ee,c.f,ea,er,e_,el,ep,ec]),eh=o.z.enum(p.z).openapi("OpenAIResponsesIncompleteReason",{description:"The reason why the response is incomplete",example:p.z.MaxOutputTokens}),ez=o.z.object({reason:eh}).openapi("OpenAIResponsesIncompleteDetails",{description:"Details about why the response is incomplete",example:{reason:p.z.MaxOutputTokens}});n.A.Refusal,n.A.Refusal,n.A.Refusal,n.A.ContentPolicyViolation,i.f.Other,i.f.Bio,i.f.Cyber;let eg=o.z.object({code:o.z.enum({ServerError:"server_error",RateLimitExceeded:"rate_limit_exceeded",InvalidPrompt:"invalid_prompt",VectorStoreTimeout:"vector_store_timeout",InvalidImage:"invalid_image",InvalidImageFormat:"invalid_image_format",InvalidBase64Image:"invalid_base64_image",InvalidImageUrl:"invalid_image_url",ImageTooLarge:"image_too_large",ImageTooSmall:"image_too_small",ImageParseError:"image_parse_error",ImageContentPolicyViolation:"image_content_policy_violation",InvalidImageMode:"invalid_image_mode",ImageFileTooLarge:"image_file_too_large",UnsupportedImageMediaType:"unsupported_image_media_type",EmptyImageFile:"empty_image_file",FailedToDownloadImage:"failed_to_download_image",ImageFileNotFound:"image_file_not_found",BioPolicy:"bio_policy",CyberPolicy:"cyber_policy",MisalignmentPolicyViolation:"misalignment_policy_violation",DataResidencyMismatch:"data_residency_mismatch",FlexUnavailable:"flex_unavailable",PermissionDenied:"permission_denied"}),message:o.z.string()}).openapi("ResponsesErrorField",{description:"Error information returned from the API",example:{code:"rate_limit_exceeded",message:"Rate limit exceeded. Please try again later."}}),eb=o.z.object({code:o.z.string(),message:o.z.string().optional().catch(void 0),param:o.z.string().nullish().catch(void 0),type:o.z.string().nullish().catch(void 0)});o.z.object({error:eg,metadata:o.z.record(o.z.string(),o.z.string()).nullable()}),o.z.object({id:o.z.string(),created_at:(0,t.D)(),output_text:o.z.string().optional(),incomplete_details:ez.nullable(),model:o.z.string(),object:o.z.literal("response"),output:o.z.array(em),tool_choice:o.z.any().optional(),background:o.z.boolean().nullish(),conversation:o.z.any().nullish(),max_output_tokens:(0,t.D)().nullish(),previous_response_id:o.z.string().nullish(),prompt:o.z.any().nullish(),prompt_cache_key:o.z.string().nullish(),reasoning:l.f.nullish().catch(null),safety_identifier:o.z.string().nullish(),service_tier:o.z.string().nullish(),status:V.optional(),text:o.z.any().nullish(),truncation:u.nullish(),usage:B.nullish(),error:o.z.unknown().nullish(),instructions:o.z.unknown().nullish(),metadata:o.z.unknown().nullish(),parallel_tool_calls:o.z.unknown().nullish(),temperature:o.z.unknown().nullish(),tools:o.z.unknown().nullish(),top_p:o.z.unknown().nullish(),store:o.z.unknown().nullish(),access_programs:r.f.nullish().catch(null)}).openapi("OpenAIResponsesNonStreamResponse");let ey=o.z.object({token:o.z.string().optional(),logprob:(0,t.$)().optional()}).extend({bytes:o.z.array((0,t.D)()).optional()}).openapi("OpenResponsesTopLogprobs",{description:"Alternative token with its log probability",example:{token:"hello",logprob:-.5}}),ex=o.z.object({logprob:(0,t.$)(),token:o.z.string(),top_logprobs:o.z.array(ey).optional()}).extend({bytes:o.z.array((0,t.D)()).optional()}).openapi("OpenResponsesLogProbs",{description:"Log probability information for a token",example:{logprob:-.1,token:"world",top_logprobs:[{token:"hello",logprob:-.5}]}}),ef=o.z.object({type:o.z.literal("response.output_text.delta"),delta:o.z.string(),content_index:(0,t.D)(),item_id:o.z.string(),logprobs:o.z.array(ex),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesTextDeltaChunk"),ev=o.z.object({type:o.z.literal("response.output_text.done"),text:o.z.string(),content_index:(0,t.D)(),item_id:o.z.string(),logprobs:o.z.array(ex),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesTextDoneChunk"),ew=o.z.object({type:o.z.literal("response.completed"),response:o.z.object({usage:B.nullish(),service_tier:o.z.string().nullish(),reasoning:l.f.nullish().catch(null),access_programs:r.f.nullish().catch(null),output:ed}),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesCompletedChunk"),ek=o.z.object({type:o.z.literal("response.incomplete"),response:o.z.object({usage:B,service_tier:o.z.string().nullish(),reasoning:l.f.nullish().catch(null),access_programs:r.f.nullish().catch(null),output:ed,incomplete_details:ez.nullish()}),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesIncompleteChunk"),ej=o.z.object({type:o.z.literal("response.created"),response:o.z.object({id:o.z.string(),created_at:(0,t.D)(),model:o.z.string()}),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesCreatedChunk"),eA=o.z.object({type:o.z.literal("response.output_item.done"),output_index:(0,t.D)(),sequence_number:(0,t.D)(),item:em}).openapi("OpenAIResponsesOutputItemDone"),eD=o.z.object({type:o.z.literal("response.function_call_arguments.delta"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)(),delta:o.z.string()}).openapi("OpenAIResponsesFunctionCallArgumentsDelta"),eC=o.z.object({type:o.z.literal("response.mcp_call_arguments.delta"),item_id:o.z.string(),output_index:(0,t.D)(),delta:o.z.string(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesMcpCallArgumentsDelta"),eR=o.z.object({type:o.z.literal("response.mcp_call_arguments.done"),item_id:o.z.string(),output_index:(0,t.D)(),arguments:o.z.string(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesMcpCallArgumentsDone"),eT=o.z.object({type:o.z.literal("response.output_item.added"),output_index:(0,t.D)(),sequence_number:(0,t.D)(),item:em}).openapi("OpenAIResponsesOutputItemAdded"),eI=o.z.object({type:o.z.literal("response.output_text.annotation.added"),annotation:o.z.union([A,k,D])}).openapi("OpenAIResponsesAnnotationAdded"),eq=o.z.object({type:o.z.literal("response.reasoning_summary_text.delta"),item_id:o.z.string(),output_index:(0,t.D)(),summary_index:(0,t.D)(),sequence_number:(0,t.D)(),delta:o.z.string()}).openapi("OpenAIResponsesReasoningSummaryTextDelta"),eS=o.z.object({type:o.z.literal("response.reasoning_text.delta"),item_id:o.z.string(),output_index:(0,t.D)(),content_index:(0,t.D)(),sequence_number:(0,t.D)(),delta:o.z.string()}).openapi("OpenAIResponsesReasoningTextDelta"),eO=o.z.object({type:o.z.literal("response.web_search_call.completed"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesSearchCompleted",{example:{type:"response.web_search_call.completed",item_id:"ws_abc123",output_index:0,sequence_number:5}}),eE=o.z.object({type:o.z.literal("response.function_call_arguments.done"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)(),arguments:o.z.string()}).openapi("OpenAIResponsesFunctionCallArgumentsDone"),eP=o.z.object({type:o.z.literal("response.failed"),response:o.z.object({id:o.z.string(),status:o.z.literal("failed"),error:eb.nullable(),usage:B.nullish(),access_programs:r.f.nullish().catch(null)})}).openapi("OpenAIResponsesFailed"),eU=o.z.object({type:o.z.string().optional(),code:o.z.string().nullish(),message:o.z.string(),param:o.z.string().nullish(),headers:o.z.record(o.z.string(),o.z.string()).optional()}),eB=o.z.object({type:o.z.literal("error"),code:o.z.string().nullish(),message:o.z.string().optional(),param:o.z.string().nullish(),sequence_number:(0,t.D)(),error:eU.optional()}).openapi("OpenAIResponsesErrorEvent"),eF=o.z.object({type:o.z.literal("response.refusal.delta"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)(),delta:o.z.string(),content_index:(0,t.D)()}).openapi("OpenAIResponsesRefusalDelta"),eW=o.z.object({type:o.z.literal("response.refusal.done"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)(),refusal:o.z.string(),content_index:(0,t.D)()}).openapi("OpenAIResponsesRefusalDone"),eM=o.z.object({type:o.z.literal("response.file_search_call.in_progress"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesFileSearchCallInProgress"),eN=o.z.object({type:o.z.literal("response.file_search_call.searching"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesFileSearchCallSearching"),eL=o.z.object({type:o.z.literal("response.file_search_call.completed"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesFileSearchCallCompleted"),e$=o.z.object({type:o.z.literal("response.web_search_call.in_progress"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesWebSearchCallInProgress",{example:{type:"response.web_search_call.in_progress",item_id:"ws_abc123",output_index:0,sequence_number:1}}),eH=o.z.object({type:o.z.literal("response.web_search_call.searching"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesWebSearchCallSearching",{example:{type:"response.web_search_call.searching",item_id:"ws_abc123",output_index:0,sequence_number:2}}),eV=o.z.object({type:o.z.literal("response.code_interpreter_call.in_progress"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesCodeInterpreterCallInProgress",{example:{type:"response.code_interpreter_call.in_progress",item_id:"ci_abc123",output_index:0,sequence_number:1}}),eG=o.z.object({type:o.z.literal("response.code_interpreter_call.interpreting"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesCodeInterpreterCallInterpreting",{example:{type:"response.code_interpreter_call.interpreting",item_id:"ci_abc123",output_index:0,sequence_number:2}}),eJ=o.z.object({type:o.z.literal("response.code_interpreter_call.completed"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesCodeInterpreterCallCompleted",{example:{type:"response.code_interpreter_call.completed",item_id:"ci_abc123",output_index:0,sequence_number:3}}),eZ=o.z.object({type:o.z.literal("response.code_interpreter_call_code.delta"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)(),delta:o.z.string()}).openapi("OpenAIResponsesCodeInterpreterCallCodeDelta",{example:{type:"response.code_interpreter_call_code.delta",item_id:"ci_abc123",output_index:0,sequence_number:2,delta:'print("hello")'}}),eK=o.z.object({type:o.z.literal("response.code_interpreter_call_code.done"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)(),code:o.z.string()}).openapi("OpenAIResponsesCodeInterpreterCallCodeDone",{example:{type:"response.code_interpreter_call_code.done",item_id:"ci_abc123",output_index:0,sequence_number:3,code:'print("hello")'}}),eQ=o.z.object({type:o.z.literal("response.image_generation_call.in_progress"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesImageGenCallInProgress",{example:{type:"response.image_generation_call.in_progress",item_id:"ig_abc123",output_index:0,sequence_number:1}}),eX=o.z.object({type:o.z.literal("response.image_generation_call.generating"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesImageGenCallGenerating",{example:{type:"response.image_generation_call.generating",item_id:"ig_abc123",output_index:0,sequence_number:2}}),eY=o.z.object({type:o.z.literal("response.image_generation_call.partial_image"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)(),partial_image_b64:o.z.string(),partial_image_index:(0,t.D)()}).openapi("OpenAIResponsesImageGenCallPartialImage",{example:{type:"response.image_generation_call.partial_image",item_id:"ig_abc123",output_index:0,sequence_number:3,partial_image_b64:"iVBORw0KGgo...",partial_image_index:0}}),e0=o.z.object({type:o.z.literal("response.image_generation_call.completed"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)()}).openapi("OpenAIResponsesImageGenCallCompleted",{example:{type:"response.image_generation_call.completed",item_id:"ig_abc123",output_index:0,sequence_number:4}}),e1=o.z.object({type:o.z.literal("response.custom_tool_call_input.delta"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)(),delta:o.z.string()}).openapi("OpenAIResponsesCustomToolCallInputDelta"),e2=o.z.object({type:o.z.literal("response.custom_tool_call_input.done"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)(),input:o.z.string()}).openapi("OpenAIResponsesCustomToolCallInputDone"),e5=o.z.object({type:o.z.literal("response.apply_patch_call_operation_diff.delta"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)(),delta:o.z.string()}).openapi("OpenAIResponsesApplyPatchCallOperationDiffDelta",{description:"Incremental chunk of `operation.diff` for an `apply_patch_call` output item streamed by the upstream provider.",example:{type:"response.apply_patch_call_operation_diff.delta",item_id:"apc_abc123",output_index:0,sequence_number:5,delta:'+console.log("hi");\n'}}),e4=o.z.object({type:o.z.literal("response.apply_patch_call_operation_diff.done"),item_id:o.z.string(),output_index:(0,t.D)(),sequence_number:(0,t.D)(),diff:o.z.string()}).openapi("OpenAIResponsesApplyPatchCallOperationDiffDone",{description:"Emitted by the upstream provider when `operation.diff` streaming completes for an `apply_patch_call`.",example:{type:"response.apply_patch_call_operation_diff.done",item_id:"apc_abc123",output_index:0,sequence_number:12,diff:'@@\n+console.log("hi");\n'}}),e3=o.z.discriminatedUnion("type",[ef,ev,ew,ek,ej,eD,eT,eA,eI,eq,eS,eE,eC,eR,eO,eM,eN,eL,e$,eH,eV,eG,eJ,eZ,eK,eQ,eX,eY,e0,e1,e2,e5,e4,eP,eB,eF,eW]);(0,t.j)(e3),new Set(e3.options.map(e=>e.shape.type.value)),(0,t.j)(o.z.object({type:o.z.enum(["response.in_progress","response.reasoning_summary_part.added","response.reasoning_summary_part.done","response.reasoning_summary_text.done","response.reasoning_text.done","response.content_part.added","response.content_part.done","response.audio.delta","response.audio.done","response.audio.transcript.delta","response.audio.transcript.done","response.mcp_call.completed","response.mcp_call.failed","response.mcp_call.in_progress","response.mcp_list_tools.completed","response.mcp_list_tools.failed","response.mcp_list_tools.in_progress"])})),e.s(["f",0,M,"r",0,C,"Z",0,et,"O",0,en,"D",0,eo,"z",0,er,"B",0,eg,"u",0,$,"H",0,L,"n",0,ee,"K",0,N,"T",0,W,"U",0,em,"_",0,G,"k",0,I,"l",0,q,"I",0,H,"V",0,V,"q",0,_,"y",0,v,"w",0,w,"m",0,U,"$",0,Y,"a",0,m,"A",0,d])},127120,812690,130566,222286,870453,e=>{"use strict";var t,o=e.i(882844),n=e.i(635157),i=e.i(442617),a=e.i(141841),r=e.i(72916);let l="Rule: ",s=` Does this assistant message break the rule?`,p="threshold is between 0.01 and 1",c={Enforce:"enforce",Audit:"audit"},u=c.Audit,d="blocked",_={Content:"content",ToolCalls:"tool_calls",Refusal:"refusal",Images:"images",Audio:"audio"},m=n.z.object({rule:n.z.string().min(1).max(200).openapi({description:"Text that states what the reply must do or must not do."}),watch:n.z.array(n.z.enum(_)).min(1).max(Object.values(_).length).refine(e=>new Set(e).size===e.length,{message:"watch lists each field once"}).openapi({uniqueItems:!0,description:"Fields of the assistant message the rule applies to. The rule is evaluated on a message that has at least one of them and is not applicable to any other message."})}).strict().openapi("AlignmentRule",{example:{rule:"Never offer a discount.",watch:["content"]}}),h=n.z.object({id:n.z.literal(r.f.Alignment),rules:n.z.array(m).min(1).max(128).openapi({description:"Rules the reply must follow. Each rule is evaluated on its own.",example:[{rule:"Never offer a discount.",watch:["content"]},{rule:"Never call delete_file.",watch:["tool_calls"]}]}),threshold:(0,o.$)().min(.01,{message:p}).max(1,{message:p}).optional().openapi({description:"Probability at or above which a rule is broken, from 0.01 to 1. Default 0.7."}),max_retries:(0,o.D)().min(0).max(3).optional().openapi({description:"Provider calls made again after a blocked turn, in enforce mode. Default 1."}),instruct:n.z.boolean().optional().openapi({description:"Whether the rules are stated to the model in a system message on every provider call. Default true."}),mode:n.z.enum(c).optional().openapi({description:`\`${c.Enforce}\`: a turn that breaks a rule is withheld, retried, and finally returned as an error. \`${c.Audit}\`: every turn is evaluated and returned. Default \`${u}\`.`})}).strict().openapi("AlignmentPlugin",{description:"Beta. States the listed rules to the model and evaluates every turn against them; the configuration, metadata, and error shapes may change.",example:{id:"alignment",rules:[{rule:"Never offer a discount.",watch:["content"]}],mode:"audit"}}),z=n.z.object({applicable:n.z.boolean().openapi({description:"Whether the message has a field the rule watches. Only an applicable rule is evaluated."}),probability:(0,o.$)().min(0).max(1).nullable().openapi({description:"The evaluator's probability that the turn breaks the rule; null when the rule is not applicable."}),broken:n.z.boolean().openapi({description:"Whether probability is at or above the threshold. False when the rule is not applicable."})}).strict().refine(e=>e.applicable||null===e.probability&&!e.broken,{message:"a rule that is not applicable has no probability and is not broken"}).refine(e=>!e.applicable||null!==e.probability,{message:"an applicable rule has a probability"}).openapi("AlignmentRuleRecord"),g=n.z.object({call:(0,o.D)().min(1).openapi({description:"Number of the record, from 1. A record is one evaluated assistant message; a model call of a server-tool loop that produces several messages has one record per message, and a retry continues the numbering."})}),b=g.extend({outcome:n.z.literal("allowed"),rules:n.z.array(z).min(1).max(128).refine(e=>e.every(e=>!e.broken),{message:"an allowed turn has no broken rule"}).openapi({description:"One record per rule, in the order of `rules` in the request."})}).strict().openapi("AlignmentAllowedCallRecord"),y=g.extend({outcome:n.z.literal(d),rules:n.z.array(z).min(1).max(128).refine(e=>e.some(e=>e.broken),{message:"a blocked turn has at least one broken rule"}).openapi({description:"One record per rule, in the order of `rules` in the request."})}).strict().openapi("AlignmentBlockedCallRecord"),x=g.extend({outcome:n.z.literal("unavailable"),reason:n.z.enum({Cut:"cut",EvaluatorError:"evaluator_error",MalformedAnswer:"malformed_answer",TimeLimit:"time_limit"})}).strict().openapi("AlignmentUnavailableCallRecord"),f=n.z.discriminatedUnion("outcome",[b,y,x]).openapi("AlignmentCallRecord"),v=n.z.object({calls:n.z.array(f).refine(e=>e.every((e,t)=>e.call===t+1),{message:"call records are numbered consecutively from 1"}).openapi({description:"One record per evaluated assistant message of the request, in the order the messages were produced. Empty when no message of the request had content to evaluate."})}).strict().openapi("Alignment",{description:"Beta. The result of the alignment plugin for this request; the shape may change.",example:{calls:[{call:1,outcome:"allowed",rules:[{applicable:!0,probability:.04,broken:!1}]}]}}),w=n.z.object({id:n.z.string(),type:n.z.literal("function"),function:n.z.object({name:n.z.string(),arguments:n.z.string()}).strict()}).strict().openapi("AlignmentChatToolCall"),k=n.z.object({type:n.z.literal("image_url"),image_url:n.z.object({url:n.z.string().min(1)}).strict()}).strict().openapi("AlignmentChatImage"),j=n.z.object({id:n.z.string().min(1).optional().openapi({description:"The provider id of the audio."}),transcript:n.z.string().openapi({description:"The transcript of the audio."})}).strict().openapi("AlignmentChatAudio",{description:"The audio of the withheld message: its `id` and `transcript`. The plugin does not retain `data` or `expires_at`.",example:{id:"audio_abc123",transcript:"Sure, I can take 20% off your order."}}),A=n.z.object({role:n.z.literal("assistant"),content:n.z.string().nullable(),refusal:n.z.string().nullable(),tool_calls:n.z.array(w).optional(),images:n.z.array(k).optional(),audio:j.optional()}).strict().openapi("AlignmentChatRejected",{description:"The assistant message of the withheld turn, without reasoning. `audio` holds the id and transcript of the audio, without `data` or `expires_at`.",example:{role:"assistant",content:"Sure, I can take 20% off your order.",refusal:null}}),D=n.z.array(i.U).refine(e=>e.every(e=>"reasoning"!==e.type),{message:"a rejected object holds no reasoning item"}).openapi("AlignmentResponsesRejected",{description:"The output items of the withheld turn, without reasoning items. The client did not receive these items; their `id` values are assigned by the plugin (`msg_`, `fc_`, `ctc_`, `ig__`, or the provider item id of a native tool call) and differ from the ids the Responses API assigns to delivered items.",example:[{type:"message",id:"msg_1",status:"completed",role:"assistant",content:[{type:"output_text",text:"Sure, I can take 20% off your order.",annotations:[]}]}]}),C=n.z.union([A,D]).openapi("AlignmentRejected"),R=n.z.union([a.I,i.m]).openapi("AlignmentErrorUsage",{description:"Summed usage of every turn of the request. Present in a non-streaming error body; absent from a streaming error data event.",example:{prompt_tokens:168,completion_tokens:31,total_tokens:199}}),T={id:n.z.string().optional().openapi({description:"Generation id of the request."}),usage:R.optional(),user_id:n.z.string().nullish()},I=n.z.string().optional().openapi({description:"Canonical error type of the error, as on every error body.",example:"permission_denied"});n.z.object({...T,error:n.z.object({code:n.z.literal(403),message:n.z.string(),metadata:n.z.object({error_type:I,alignment:v.extend({rejected:C}).strict().refine(e=>e.calls.at(-1)?.outcome===d,{message:"the last call record is blocked"})})})}).openapi("AlignmentBlockedError");let q=n.z.object({name:n.z.string(),arguments:n.z.string(),namespace:n.z.string().optional()}).strict().openapi("AlignmentDescriptionToolCall"),S=n.z.discriminatedUnion("type",[n.z.object({type:n.z.literal("image")}).strict(),n.z.object({type:n.z.literal("audio"),transcript:n.z.string()}).strict()]).openapi("AlignmentDescriptionMedia");n.z.object({text:n.z.string().max(1e4),tool_calls:n.z.array(q).max(16).refine(e=>JSON.stringify(e).length<=4e3,{message:"tool calls serialize to at most 4000 characters"}),refusal:n.z.string().max(1e3),media:n.z.array(S).refine(e=>1e3>=e.reduce((e,t)=>e+("audio"===t.type?t.transcript.length:0),0),{message:"transcripts hold at most 1000 characters in total"})}).strict().openapi("AlignmentDescription");let O=n.z.object({role:n.z.literal("assistant"),content:n.z.string().min(1).max(1e4).nullable(),tool_calls:n.z.array(q).min(1).max(16).refine(e=>JSON.stringify(e).length<=4e3,{message:"tool calls serialize to at most 4000 characters"}).optional(),refusal:n.z.string().min(1).max(1e3).optional(),images:n.z.array(n.z.object({type:n.z.literal("image_url")}).strict()).min(1).optional(),audio:n.z.object({transcript:n.z.string().max(1e3)}).strict().optional()}).strict().openapi("AlignmentEvaluatorMessage");n.z.object({assistant_message:O}).strict().openapi("AlignmentEvaluatorState"),n.z.object({type:n.z.literal("noul"),instructions:n.z.string().max(l.length+200+s.length).refine(e=>e.startsWith(l)&&e.endsWith(s),{message:"instructions are the prefix, the rule, and the suffix"})}).strict().openapi("AlignmentEvaluatorQuestion"),e.s(["g",0,h,"w",0,C,"a",0,v],127120);var E=((t={}).MiddleOut="middle-out",t);let P=n.z.enum(E).openapi("ContextCompressionEngine",{description:"The compression engine to use for context compression.",example:"middle-out"}),U=n.z.object({id:n.z.literal(r.f.ContextCompression),enabled:n.z.boolean().optional().openapi({description:"Set to false to disable the context-compression plugin for this request. Defaults to true."}),engine:P.optional().openapi({description:'The compression engine to use. Defaults to "middle-out".'})}).openapi("ContextCompressionPlugin",{example:{id:"context-compression",enabled:!0,engine:"middle-out"}});e.s(["f",0,U],812690);var B=e.i(888626),F=e.i(74543),W=e.i(347508);let M=`Up to ${B.A} patterns, each at most ${B.t} characters, with ${B.Q} total characters across all patterns.`,N="A `~author/family-latest` alias matches every revision of that family.",L=n.z.strictObject({id:n.z.literal(r.f.JevRouter),cost_tier:W.p.optional().openapi({description:"Select low, medium, high, or a cost tier configured by the operator. Overrides the live-config tier and replaces the shared routing policy with that tier. Omit to use the live configuration. Model exclusions and the router kill switch still apply.",example:"medium"}),models:F.f.optional().openapi({description:`Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. "anthropic/*"), matched against the current pool; models outside the pool are ignored. ${N} ${M} When omitted or empty, every model in the pool is a candidate; when no pool model matches, the list is ignored and the whole pool is used (\`excluded_models\` still apply). When no entry matches any catalog model, for example a misspelled slug, the request fails with 404 instead. \`allowed_models\` is an alias; entries from both fields are combined.`,example:["anthropic/*","openai/gpt-5.6-sol"]}),allowed_models:F.f.optional().openapi({description:"Alias of `models`, matching the auto-router field name. Entries from both fields are combined.",example:["anthropic/*"]}),excluded_models:F.f.optional().openapi({description:`Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. "xiaomi/*"). ${N} ${M} Applied after \`models\`, so an excluded pattern always wins over an included one; when the lists leave no model the request can use, it fails with 404 rather than routing outside them.`,example:["openai/gpt-6-astra","xiaomi/*"]})}).openapi("JevRouterPlugin",{example:{id:"jev-router",models:["anthropic/*","openai/gpt-5.6-sol"],excluded_models:["openai/gpt-6-astra"]}});e.s(["f",0,L],130566);let $=n.z.object({id:n.z.literal(r.f.Moderation)}).openapi("ModerationPlugin",{example:{id:"moderation"}});e.s(["f",0,$],222286);let H=n.z.object({id:n.z.literal(r.f.ResponseHealing),enabled:n.z.boolean().optional().openapi({description:"Set to false to disable the response-healing plugin for this request. Defaults to true."})}).openapi("ResponseHealingPlugin",{example:{id:"response-healing",enabled:!0}});e.s(["f",0,H],870453)},393272,e=>{"use strict";e.i(882844);var t=e.i(635157),o=e.i(72916);let n={Capability:"capability",Stage:"stage",Auto:"auto",Random:"random",Composite:"composite",Passthrough:"passthrough"},i=t.z.enum([n.Capability,n.Stage,n.Auto,n.Random,n.Composite,n.Passthrough]),a=t.z.object({id:t.z.literal(o.f.SwitchyardRouter),algorithm:i.optional().openapi({description:'Routing algorithm for this request. "capability" calls a small judge model to rate how demanding the task is, then picks the efficient or capable candidate. "stage" reads the tool-result history (errors, repeated failures, edits landing) and calls the judge only when those signals are undecided. "auto" is "stage" without the judge call. "random" picks one candidate at random. "composite" keeps the tier chosen on the last human turn and re-evaluates tool turns with the stage signals. "passthrough" serves the eligible candidates in the order OpenRouter already ranked them, with no routing decision and no judge call. Omit this field to use the platform default, stage.'}),judge_model:t.z.string().min(1).optional().openapi({description:'The model that runs the judge call for the judge-backed algorithms ("capability", "stage", and "composite"). The model must support structured outputs and have a provider that your account and request settings allow. Otherwise, the request uses the platform default judge, google/gemini-3.5-flash-lite, or openai/gpt-4o-mini when the default does not fit either, and reports the reason in the routing metadata. The judge call is billed to you like any other request.',example:"openai/gpt-5.4-nano"})}).openapi("SwitchyardRouterPlugin",{example:{id:"switchyard-router",algorithm:"stage"}});e.s(["S",0,n,"i",0,i,"r",0,a])},743245,e=>{"use strict";var t,o=((t={}).Low="low",t.Medium="medium",t.High="high",t);e.s(["f",()=>o])},834336,397400,e=>{"use strict";var t=e.i(721242),o=e.i(427150),n=e.i(368174),i=e.i(882844),a=e.i(635157),r=e.i(868179),l=e.i(51214),s=e.i(72916),p=e.i(127120),c=e.i(429497),u=e.i(51889),d=e.i(787027),_=e.i(812690),m=e.i(818001),h=e.i(331194),z=e.i(130566),g=e.i(222286),b=e.i(634585),y=e.i(870453),x=e.i(393272);let f=a.z.object({id:a.z.literal(s.f.ToolFilter),enabled:a.z.boolean().optional().openapi({description:"Set to false to disable the tool-filter plugin for this request. Defaults to true."}),threshold:(0,i.$)().min(0).max(1).optional().openapi({description:"Minimum relevance probability (0 to 1) a tool needs to stay in the request. Defaults to 0.3."})}).openapi("ToolFilterPlugin",{"x-hidden":!0,description:"Internal-only. Asks Jev which of the request tools are relevant to the conversation and strips the rest before the model sees them.",example:{id:"tool-filter",threshold:.3}}),v=a.z.object({id:a.z.literal(s.f.WebFetch),allowed_domains:a.z.array(a.z.string()).optional().openapi({description:"Only fetch from these domains."}),blocked_domains:a.z.array(a.z.string()).optional().openapi({description:"Never fetch from these domains."}),max_uses:(0,i.D)().min(1).optional().openapi({description:"Maximum number of web fetches per request. Once exceeded, the tool returns an error."}),max_content_tokens:(0,i.D)().min(1).optional().openapi({description:"Maximum content length in approximate tokens. Content exceeding this limit is truncated."})}).openapi("WebFetchPlugin",{example:{id:"web-fetch",max_uses:10}});var w=e.i(632339),k=e.i(56629),j=e.i(895185),A=e.i(121817),D=e.i(751899);let C=a.z.enum(w.f).openapi("WebSearchEngine",{description:"The search engine to use for web search.",example:w.f.Exa}),R=a.z.object({id:a.z.literal(s.f.WebSearch),enabled:a.z.boolean().optional().openapi({description:"Set to false to disable the web-search plugin for this request. Defaults to true."}),max_results:(0,i.D)().optional(),search_prompt:a.z.string().optional(),engine:C.optional(),mode:j.f.optional(),include_domains:a.z.array(a.z.string()).optional().openapi({description:'A list of domains to restrict web search results to. Supports wildcards (e.g. "*.substack.com") and path filtering (e.g. "openai.com/blog").',example:["example.com","*.substack.com","openai.com/blog"]}),exclude_domains:a.z.array(a.z.string()).optional().openapi({description:'A list of domains to exclude from web search results. Supports wildcards (e.g. "*.substack.com") and path filtering (e.g. "openai.com/blog").',example:["example.com","*.substack.com","openai.com/blog"]}),user_location:A.f.optional().openapi({description:"Approximate user location for location-biased search results. Passed through to native providers that support it (e.g. Anthropic)."}),max_uses:(0,i.D)().optional().openapi({description:"Maximum number of times the model can invoke web search in a single turn. Passed through to native providers that support it (e.g. Anthropic)."}),x_search:D.f.optional()}).openapi("WebSearchPlugin",{example:{id:"web",enabled:!0,max_results:5}}),T=a.z.object({title:a.z.string().nullable(),url:a.z.string(),publishedDate:a.z.string().nullish(),author:a.z.string().nullish(),image:a.z.string().optional(),favicon:a.z.string().optional(),score:(0,i.$)().optional(),id:a.z.string(),text:a.z.string().optional(),highlights:a.z.array(a.z.string()).optional(),highlightScores:a.z.array((0,i.$)()).optional()});a.z.object({query:a.z.string(),useAutoprompt:a.z.boolean().optional(),type:a.z.enum(k.v).optional(),category:a.z.string().optional(),numResults:(0,i.D)().optional(),includeDomains:a.z.array(a.z.string()).optional(),excludeDomains:a.z.array(a.z.string()).optional(),startCrawlDate:a.z.string().datetime().optional(),endCrawlDate:a.z.string().datetime().optional(),startPublishedDate:a.z.string().datetime().optional(),endPublishedDate:a.z.string().datetime().optional(),includeText:a.z.array(a.z.string()).optional(),excludeText:a.z.array(a.z.string()).optional(),flags:a.z.array(a.z.string()).optional(),contents:a.z.object({text:a.z.object({maxCharacters:(0,i.D)().optional(),includeHtmlTags:a.z.boolean().optional()}).optional(),highlights:a.z.union([a.z.literal(!0),a.z.object({maxCharacters:(0,i.D)().optional(),maxTotalCharacters:(0,i.D)().optional(),query:a.z.string().optional(),dynamic:a.z.boolean().optional()})]).optional(),summary:a.z.object({query:a.z.string().optional()}).optional()}).optional()});let I=a.z.object({id:a.z.string(),status:a.z.enum(["success","error"]),error:a.z.object({tag:a.z.string().optional(),httpStatusCode:a.z.number().int().optional()}).optional()}),q=a.z.object({total:(0,i.$)().optional(),breakDown:a.z.array(a.z.object({search:(0,i.$)().optional(),contents:(0,i.$)().optional(),breakdown:a.z.record(a.z.string(),(0,i.$)()).optional()}).passthrough()).optional(),search:a.z.record(a.z.string(),(0,i.$)()).optional(),contents:a.z.record(a.z.string(),(0,i.$)()).optional()});a.z.object({results:a.z.array(T.passthrough()),autopromptString:a.z.string().optional(),resolvedSearchType:a.z.enum(["neural","keyword"]).optional().catch(void 0),statuses:a.z.array(I.passthrough()).optional(),requestId:a.z.string().optional(),searchTime:(0,i.$)().optional(),costDollars:q.optional()});let S=a.z.object({title:a.z.string(),description:a.z.string().optional(),url:a.z.string(),markdown:a.z.string().optional(),summary:a.z.string().optional(),highlights:a.z.union([a.z.string(),a.z.array(a.z.string())]).optional()});a.z.object({success:a.z.boolean(),data:a.z.object({web:a.z.array(S.passthrough()).optional(),images:a.z.array(a.z.unknown()).optional(),news:a.z.array(a.z.unknown()).optional()}),creditsUsed:(0,i.D)().optional()});let O=a.z.object({include_domains:a.z.array(a.z.string()).optional(),exclude_domains:a.z.array(a.z.string()).optional(),after_date:a.z.string().optional()}),E=a.z.object({source_policy:O.optional(),excerpt_settings:a.z.object({max_chars_per_result:(0,i.D)().optional()}).optional(),max_results:(0,i.D)().optional()});a.z.object({objective:a.z.string().optional(),search_queries:a.z.array(a.z.string()).min(1),max_chars_total:(0,i.D)().optional(),mode:a.z.enum(k.d),advanced_settings:E.optional()});let P=a.z.object({url:a.z.string(),title:a.z.string().nullish(),publish_date:a.z.string().nullish(),excerpts:a.z.array(a.z.string())});a.z.object({search_id:a.z.string(),session_id:a.z.string(),results:a.z.array(P.passthrough()),warnings:a.z.array(a.z.object({type:a.z.string().optional(),message:a.z.string().optional()}).passthrough()).nullish(),usage:a.z.array(a.z.object({name:a.z.string().optional(),count:(0,i.D)().optional()}).passthrough()).nullish()});let U=a.z.discriminatedUnion("id",[d.d,u.u,g.f,R,v,m.o,y.f,_.f,f,b.C,h.h,x.r,z.f,p.g,c.g]),B=a.z.array(U);e.s(["f",0,B],397400);var F=e.i(464228),W=e.i(368966),M=e.i(793585),N=e.i(960421),L=e.i(282823),$=e.i(478300);let H=a.z.object({stream_options:a.z.object({include_usage:a.z.boolean().default(!0).openapi({description:"Deprecated: This field has no effect. Full usage details are always included.",deprecated:!0})})}),V=a.z.object({usage:a.z.object({include:a.z.boolean().openapi({description:"Deprecated: This field has no effect. Full usage details are always included.",deprecated:!0})})}),G=a.z.enum(["fallback","sort"]).openapi("DeprecatedRoute",{deprecated:!0,description:'**DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none").',example:"fallback","x-speakeasy-deprecation-message":"Use providers.sort.partition instead.","x-speakeasy-ignore":!0,"x-fern-ignore":!0}).nullish();N.n.Max,N.n.XHigh,N.n.High,N.n.Medium,N.n.Low,N.n.Minimal,N.n.None;let J=N.n.Medium,Z="Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.",K=a.z.enum(N.n).describe("OpenAI-style reasoning effort setting"),Q=a.z.object({enabled:a.z.boolean().optional().describe("Enables reasoning with default settings. Only work for some models."),effort:K.nullish(),max_tokens:(0,i.D)().nullish().describe("non-OpenAI-style reasoning effort setting"),exclude:a.z.boolean().optional().default(!1),context:a.z.enum(N.f).nullish().describe(Z),mode:a.z.enum(N.u).nullish().describe("Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.")}),X=a.z.object({content:a.z.union([a.z.array(a.z.unknown().refine(n.f,"Content parts must be objects.")),a.z.string()]).nullish()}),Y=X.passthrough(),ee=a.z.object({deferred_tools:r.f.optional(),provider:M.f.strict().nullish().openapi("ProviderPreferences",{example:{allow_fallbacks:!0}}).describe("When multiple model providers are available, optionally indicate your routing preference."),plugins:B.optional().refine(e=>(e??[]).filter(e=>e.id===s.f.Alignment).length<=1,{message:"The alignment plugin can be configured at most once per request."}).describe("Plugins you want to enable for this request, including their settings."),route:G,user:a.z.string().max(256).optional().describe("A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters."),session_id:a.z.string().max(L.T).optional().openapi({description:"A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters."}),trace:$.f}),et=a.z.string().max(200).regex(/^[A-Za-z0-9~._:@+-]+(?:\/[A-Za-z0-9~._:@+-]+)+$/u),eo=a.z.union([et,a.z.object({model:et,provider:M.f.strict().nullish()}).strict()]),en=a.z.array(eo).max(10),ei=a.z.preprocess(e=>Array.isArray(e)&&e.length>10?void 0:e,en.nullish()).catch(void 0),ea=a.z.object({echo_upstream_body:a.z.boolean().describe("If true, includes the transformed upstream request body in a debug chunk at the start of the stream.").default(!1)});(0,i.j)(ea);let er=a.z.object({type:a.z.literal("content"),content:a.z.union([a.z.string(),a.z.array(l.d)])}).openapi("Prediction",{description:"Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.",example:{type:"content",content:"Expected response"}});a.z.object({temperature:(0,i.$)().nullish(),top_p:(0,i.$)().nullish(),prediction:er.nullish(),stream:i.Y.optional().default(!1),include_reasoning:a.z.boolean().optional().openapi("IncludeReasoning",{deprecated:!0,description:'**DEPRECATED** Whether to include reasoning (thinking tokens) in the response. Defaults to false. Text will appear in the "reasoning" field on each message prior to those containing "content".',"x-speakeasy-deprecation-message":"Use reasoning.enabled instead.",example:!1}),max_price:F.f.nullish().openapi("MaxPrice",{deprecated:!0,description:"The object specifying the maximum price you want to pay for this request.","x-speakeasy-deprecation-message":"Use provider.max_price instead.",example:{prompt:"0.001",completion:"0.002"}}),reasoning_effort:K.nullish(),reasoning:Q.nullish(),messages:a.z.array(X.strict()).nullish(),shadow_models:ei,debug:ea.optional()}).extend(H.partial().shape).extend(ee.partial().shape).extend(V.partial().shape).extend({messages:a.z.array(Y).superRefine(function(e,t){Array.isArray(e)&&e.forEach((e,i)=>{var r;(0,n.f)(e)&&(0,o.f)(e.configuration_update)&&("string"!=typeof e.role||"system"!==(r=e.role)&&"developer"!==r)&&t.addIssue({code:a.z.ZodIssueCode.custom,path:[i,"configuration_update"],message:`configuration_update is only supported on system and developer messages (found on message ${i} with role ${JSON.stringify(e.role)})`})})}).nullish()}).loose().superRefine(function(e,t){if(e.reasoning?.mode!==N.u.Pro)return;let n=e.messages?.findIndex(e=>(0,o.f)(e.configuration_update))??-1;-1!==n&&t.addIssue({code:a.z.ZodIssueCode.custom,path:["reasoning","mode"],message:`configuration_update is not supported with reasoning.mode "${N.u.Pro}" (found on message ${n})`})}).transform(({include_reasoning:e,reasoning_effort:t,reasoning:n,...i},r)=>{if((0,o.f)(t)&&(0,o.f)(n)&&(0,o.f)(n.effort)&&t!==n.effort)return r.addIssue({code:a.z.ZodIssueCode.custom,message:'"reasoning_effort" and "reasoning.effort" are both provided with conflicting values'}),a.z.NEVER;let l=t??n?.effort??null,s=n?.max_tokens??null,p=(0,o.f)(l),c=(0,o.f)(s);if(p&&c)return r.addIssue({code:a.z.ZodIssueCode.custom,message:'Only one of "reasoning.effort" and "reasoning.max_tokens" can be specified'}),a.z.NEVER;let u=(0,o.f)(n?.context)?{context:n.context}:{},d=(0,o.f)(n?.mode)?{mode:n.mode}:{},_=n?.enabled,m=("boolean"==typeof e?!e:n?.exclude??null)??!1;return!1===_?{...i,reasoning:{enabled:!1,effort:l===W.E.None?null:l??null,max_tokens:null,exclude:m,...u,...d}}:l===W.E.None?{...i,reasoning:{enabled:!1,effort:W.E.None,max_tokens:null,exclude:m,...u,...d}}:!0===_||p||c?{...i,reasoning:{enabled:!0,effort:c?null:l,max_tokens:s,exclude:m,...u,...d}}:{...i,reasoning:{enabled:_,effort:l,max_tokens:s,exclude:m,...u,...d}}});let el=a.z.object({name:a.z.string(),strict:a.z.boolean().optional(),schema:a.z.record(a.z.string(),a.z.any()),description:a.z.string().optional()}).openapi("OpenResponsesJSONSchemaConfig",{example:{name:"my_schema",strict:!0,schema:{type:"object",properties:{answer:{type:"string"}}}}});a.z.discriminatedUnion("type",[a.z.object({type:a.z.literal("json_schema"),json_schema:el}).openapi("OpenResponsesResponseFormatJSONSchema",{example:{type:"json_schema",json_schema:{name:"my_schema",strict:!0,schema:{type:"object",properties:{answer:{type:"string"}}}}}}),a.z.object({type:a.z.literal("json_object")}).openapi("OpenResponsesResponseFormatJSONObject",{example:{type:"json_object"}}),a.z.object({type:a.z.literal("text")}).openapi("OpenResponsesResponseFormatText",{example:{type:"text"}})]);let es="server-tools";a.z.object({"x-grok-req-id":a.z.string().optional(),"x-grok-conv-id":a.z.string().optional(),"x-stripe-customer-id":a.z.string().optional(),"x-metronome-customer":a.z.string().optional(),"x-metronome-metadata":a.z.string().optional(),"cf-ray":a.z.string().optional(),"cf-connecting-ipv6":a.z.string().optional(),"cf-connecting-ip":a.z.string().optional(),"cf-worker":a.z.string().optional(),[t.X]:a.z.string().optional(),[t.g]:a.z.string().optional(),"x-anthropic-beta":a.z.string().optional(),"anthropic-beta":a.z.string().optional(),"x-vertex-ai-llm-request-type":a.z.string().optional(),[L.w]:a.z.string().optional(),"user-agent":a.z.string().optional(),referer:a.z.string().optional(),"x-openrouter-callmodel":a.z.string().optional(),"x-simulate-mid-stream-error":a.z.string().optional(),"x-per-chunk-delay-ms":a.z.string().optional(),"x-initial-delay-ms":a.z.string().optional(),"x-is-upstream-sse":a.z.string().optional(),"x-text-generation-mode":a.z.string().optional(),"x-custom-text":a.z.string().optional(),"x-completion-tokens":a.z.string().optional(),"x-prompt-tokens":a.z.string().optional(),"x-reasoning-tokens":a.z.string().optional(),"x-fake-tool-calls":a.z.string().optional(),"x-fake-decision-block":a.z.string().optional(),"x-fake-safeguard-flag":a.z.string().optional(),"x-or-experiments-internal":a.z.string().optional(),"x-or-endpoint-id":a.z.string().optional(),"x-openrouter-web-search-engine":a.z.string().optional(),"x-openrouter-web-search-mode":a.z.string().optional(),"x-openrouter-web-fetch-engine":a.z.string().optional(),"x-openrouter-thinking-block-binding-default":a.z.string().optional(),"x-openrouter-skip-classification":a.z.string().optional(),"content-length":a.z.string().optional()}),e.s(["P",0,K,"V",0,Q,"s",0,J,"K",0,G,"f",0,Z,"q",0,"openrouter:fusion","h",0,es,"W",0,"nvidia:switchyard","p",0,function(e){return e===es||e?.startsWith(`${es}:`)===!0}],834336)},960421,e=>{"use strict";let t=e.i(368966).E;e.s(["f",0,{Auto:"auto",AllTurns:"all_turns",CurrentTurn:"current_turn"},"n",0,t,"u",0,{Standard:"standard",Pro:"pro"}])},868709,e=>{"use strict";e.i(882844);var t=e.i(635157);let o={Standard:"standard",DaybreakBlue:"daybreak_blue",DaybreakRed:"daybreak_red"};t.z.object({cyber:t.z.enum(o).optional()});let n=t.z.object({cyber:t.z.enum(o)});e.s(["f",0,n])},33689,494949,e=>{"use strict";var t=e.i(882844),o=e.i(635157),n=e.i(960421);let i=o.z.object({effort:o.z.enum(n.n).nullish().catch(null),summary:o.z.enum(["auto","concise","detailed"]).nullish().catch(null),context:o.z.enum(n.f).nullish().catch(null),mode:o.z.enum(n.u).nullish().catch(null)});e.s(["f",0,i],33689);let a=o.z.object({type:o.z.literal("logs"),logs:o.z.string()}).openapi("CodeInterpreterLogsOutput",{example:{type:"logs",logs:"hello\n"}}),r=o.z.object({type:o.z.literal("image"),url:o.z.string()}).openapi("CodeInterpreterImageOutput",{example:{type:"image",url:"https://example.com/plot.png"}}),l=o.z.object({type:o.z.literal("file"),id:o.z.string().optional(),filename:o.z.string().optional(),media_type:o.z.string().optional(),size_bytes:(0,t.D)().optional(),sha256:o.z.string().optional(),download_url:o.z.string().optional().openapi({description:"Provider-issued download URL for the generated file. Typically signed and time-limited (see `expires_at`); fetch promptly rather than persisting the URL."}),expires_at:o.z.string().optional().openapi({description:"When the `download_url` stops working, as an ISO 8601 timestamp. After this time the file must be regenerated."}),status:o.z.string().optional().openapi({description:"Provider-reported readiness of the generated file (e.g. `ready`). Values other than `ready` indicate the artifact may not be downloadable."}),error_code:o.z.string().nullish().openapi({description:"Provider error code when generating or persisting the file failed; null or absent on success."})}).openapi("CodeInterpreterFileOutput",{example:{type:"file",id:"file_abc123",filename:"summary.txt",download_url:"https://example.com/download/file_abc123"}}),s=o.z.discriminatedUnion("type",[a,r,l]);e.s(["f",0,s],494949)},141841,191545,381932,47525,e=>{"use strict";var t=e.i(625025),o=e.i(882844),n=e.i(635157);let i={Fast:"fast",Standard:"standard"},a=n.z.enum(Object.values({WebSearch:"web_search",WebFetch:"web_fetch",CodeExecution:"code_execution",BashCodeExecution:"bash_code_execution",TextEditorCodeExecution:"text_editor_code_execution",ToolSearchToolRegex:"tool_search_tool_regex",ToolSearchToolBm25:"tool_search_tool_bm25"})).openapi("AnthropicServerToolName",{example:"web_search"}),r=n.z.enum(i).openapi("AnthropicSpeed",{example:i.Standard});var l=e.i(708187);let s=n.z.object({type:n.z.literal("container_file_citation"),container_id:n.z.string(),file_id:n.z.string(),filename:n.z.string(),start_index:(0,o.D)(),end_index:(0,o.D)()});e.s(["f",0,s],191545);let p=n.z.object({turns:n.z.number().int().positive().describe("Upstream model calls the run made"),prompt_tokens:n.z.number().int().describe("Prompt tokens summed over every upstream call"),completion_tokens:n.z.number().int().describe("Completion tokens summed over every upstream call"),total_tokens:n.z.number().int().describe("Sum of the above two fields")});e.s(["f",0,p],381932),e.i(427150);var c=e.i(121817);let u=n.z.enum({FiveMinutes:"5m",OneHour:"1h"}).openapi("AnthropicCacheControlTtl",{example:"5m"}),d=n.z.object({type:n.z.literal("ephemeral"),ttl:u.optional()}).openapi("AnthropicCacheControlDirective",{description:"Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.",example:{type:"ephemeral"}}),_=n.z.object({cache_control:d.optional()});e.s(["i",0,d,"c",0,_],47525);let m=n.z.object({type:n.z.string(),classifier_context:n.z.record(n.z.string(),n.z.unknown()).optional()}).passthrough().openapi("AnthropicSafeguard",{description:"A server-side safeguard Anthropic evaluates alongside the completion",example:{type:"dangerous_tool_use",classifier_context:{v:1,permission_mode:"auto"}}});n.z.object({type:n.z.string(),status:n.z.object({type:n.z.string()}).passthrough()}).passthrough().openapi("AnthropicSafeguardResult",{description:"The outcome of a server-side safeguard, keyed by tool-use id where applicable",example:{type:"dangerous_tool_use",status:{type:"available",tool_uses:{toolu_01ABC:{type:"evaluated",outcome:"not_flagged"}}}}});let h=n.z.enum(["image/jpeg","image/png","image/gif","image/webp"]).openapi("AnthropicImageMimeType",{example:"image/jpeg"}),z=n.z.object({type:n.z.literal("base64"),media_type:h,data:n.z.string()}).openapi("AnthropicBase64ImageSource",{example:{type:"base64",media_type:"image/jpeg",data:"/9j/4AAQ..."}}),g=n.z.object({type:n.z.literal("url"),url:n.z.string()}).openapi("AnthropicUrlImageSource",{example:{type:"url",url:"https://example.com/image.jpg"}}),b=n.z.object({type:n.z.literal("base64"),media_type:n.z.literal("application/pdf"),data:n.z.string()}).openapi("AnthropicBase64PdfSource",{example:{type:"base64",media_type:"application/pdf",data:"JVBERi0x..."}}),y=n.z.object({type:n.z.literal("text"),media_type:n.z.literal("text/plain"),data:n.z.string()}).openapi("AnthropicPlainTextSource",{example:{type:"text",media_type:"text/plain",data:"Hello, world!"}}),x=n.z.object({type:n.z.literal("url"),url:n.z.string()}).openapi("AnthropicUrlPdfSource",{example:{type:"url",url:"https://example.com/document.pdf"}}),f=n.z.object({type:n.z.literal("file"),file_id:n.z.string()}).openapi("AnthropicFileDocumentSource",{example:{type:"file",file_id:"or_file_011CNha8iCJcU1wXNR6q4V8w"}}),v=n.z.object({enabled:n.z.boolean().optional()}),w=n.z.object({type:n.z.literal("char_location"),cited_text:n.z.string(),document_index:(0,o.D)(),document_title:n.z.string().nullable(),start_char_index:(0,o.D)(),end_char_index:(0,o.D)()}).openapi("AnthropicCitationCharLocationParam",{example:{type:"char_location",cited_text:"Example cited text",document_index:0,document_title:null,start_char_index:0,end_char_index:18}}),k=n.z.object({type:n.z.literal("page_location"),cited_text:n.z.string(),document_index:(0,o.D)(),document_title:n.z.string().nullable(),start_page_number:(0,o.D)(),end_page_number:(0,o.D)()}).openapi("AnthropicCitationPageLocationParam",{example:{type:"page_location",cited_text:"Example cited text",document_index:0,document_title:null,start_page_number:1,end_page_number:2}}),j=n.z.object({type:n.z.literal("content_block_location"),cited_text:n.z.string(),document_index:(0,o.D)(),document_title:n.z.string().nullable(),start_block_index:(0,o.D)(),end_block_index:(0,o.D)()}).openapi("AnthropicCitationContentBlockLocationParam",{example:{type:"content_block_location",cited_text:"Example cited text",document_index:0,document_title:null,start_block_index:0,end_block_index:1}}),A=n.z.object({type:n.z.literal("web_search_result_location"),cited_text:n.z.string(),encrypted_index:n.z.string(),title:n.z.string().nullable(),url:n.z.string()}).openapi("AnthropicCitationWebSearchResultLocationParam",{example:{type:"web_search_result_location",cited_text:"Example cited text",encrypted_index:"enc_idx_0",title:"Example Page",url:"https://example.com"}}),D=n.z.object({type:n.z.literal("search_result_location"),cited_text:n.z.string(),search_result_index:(0,o.D)(),source:n.z.string(),title:n.z.string().nullable(),start_block_index:(0,o.D)(),end_block_index:(0,o.D)()}).openapi("AnthropicCitationSearchResultLocationParam",{example:{type:"search_result_location",cited_text:"Example cited text",search_result_index:0,source:"example_source",title:"Example Result",start_block_index:0,end_block_index:1}}),C=n.z.discriminatedUnion("type",[w,k,j,A,D]),R=n.z.object({type:n.z.literal("text"),text:n.z.string(),citations:n.z.array(C).nullish()}).extend(_.shape).openapi("AnthropicTextBlockParam",{example:{type:"text",text:"Hello, world!"}}),T=n.z.object({type:n.z.literal("image"),source:n.z.discriminatedUnion("type",[z,g,f])}).extend(_.shape).openapi("AnthropicImageBlockParam",{example:{type:"image",source:{type:"base64",media_type:"image/jpeg",data:"/9j/4AAQ..."}}}),I=n.z.discriminatedUnion("type",[R,T]),q=n.z.object({type:n.z.literal("content"),content:n.z.union([n.z.string(),n.z.array(I)])}),S=n.z.object({type:n.z.literal("document"),source:n.z.discriminatedUnion("type",[b,y,q,x,f]),citations:v.nullish(),context:n.z.string().nullish(),title:n.z.string().nullish()}).extend(_.shape).openapi("AnthropicDocumentBlockParam",{example:{type:"document",source:{type:"text",media_type:"text/plain",data:"Hello, world!"}}}),O=n.z.object({type:n.z.literal("tool_use"),id:n.z.string(),name:n.z.string(),input:n.z.unknown()}).extend(_.shape),E=n.z.object({type:n.z.literal("thinking"),thinking:n.z.string(),signature:n.z.string()}),P=n.z.object({type:n.z.literal("redacted_thinking"),data:n.z.string()}),U=n.z.object({type:n.z.literal("server_tool_use"),id:n.z.string(),name:a,input:n.z.unknown()}).extend(_.shape),B=n.z.object({type:n.z.literal("server_tool_use"),id:n.z.string(),name:n.z.string(),input:n.z.unknown()}).extend(_.shape),F=n.z.object({type:n.z.literal("web_search_result"),encrypted_content:n.z.string(),title:n.z.string(),url:n.z.string(),page_age:n.z.string().nullish()}).openapi("AnthropicWebSearchResultBlockParam",{example:{type:"web_search_result",encrypted_content:"enc_content_0",title:"Example Page",url:"https://example.com"}}),W=n.z.object({type:n.z.literal("search_result"),source:n.z.string(),title:n.z.string(),content:n.z.array(R),citations:v.optional()}).extend(_.shape).openapi("AnthropicSearchResultBlockParam",{example:{type:"search_result",source:"example_source",title:"Example Result",content:[{type:"text",text:"Result content"}]}}),M=n.z.enum({invalid_tool_input:"invalid_tool_input",unavailable:"unavailable",max_uses_exceeded:"max_uses_exceeded",too_many_requests:"too_many_requests",query_too_long:"query_too_long",request_too_large:"request_too_large"}),N=n.z.object({type:n.z.literal("web_search_tool_result"),tool_use_id:n.z.string(),content:n.z.union([n.z.array(F),n.z.object({type:n.z.literal("web_search_tool_result_error"),error_code:M})])}).extend(_.shape),L=n.z.object({type:n.z.literal("tool_reference"),tool_name:n.z.string()}),$=n.z.object({type:n.z.literal("tool_result"),tool_use_id:n.z.string(),content:n.z.union([n.z.string(),n.z.array(n.z.union([R,T,L,W,S]))]).optional(),is_error:n.z.boolean().optional()}).extend(_.shape),H=n.z.object({type:n.z.literal("object"),properties:n.z.unknown().nullish(),required:n.z.array(n.z.string()).nullish()}).loose(),V=n.z.object({name:n.z.string(),description:n.z.string().optional(),input_schema:H,type:n.z.literal("custom").nullish(),defer_loading:n.z.boolean().optional(),strict:n.z.boolean().optional()}).extend(_.shape),G=n.z.object({type:n.z.literal("bash_20250124"),name:n.z.literal("bash")}).extend(_.shape),J=n.z.object({type:n.z.literal("text_editor_20250124"),name:n.z.literal("str_replace_editor")}).extend(_.shape),Z=n.z.object({...c.f.shape}).openapi("AnthropicWebSearchToolUserLocation",{example:{type:"approximate",city:"San Francisco",country:"US",region:"California",timezone:"America/Los_Angeles"}});function K(e){return Array.isArray(e)&&e.length>0}function Q(e){let o=K(e.allowed_domains),n=K(e.blocked_domains);return o&&n?(0,t.i)(e,["blocked_domains"]):(0,t.S)({...e,blocked_domains:n?e.blocked_domains:void 0,allowed_domains:o?e.allowed_domains:void 0})}let X=n.z.object({type:n.z.literal("web_search_20250305"),name:n.z.literal("web_search"),allowed_domains:n.z.array(n.z.string()).nullish(),blocked_domains:n.z.array(n.z.string()).nullish(),max_uses:(0,o.D)().nullish(),user_location:Z.nullish()}).extend(_.shape).transform(Q),Y=n.z.array(n.z.enum(["direct","code_execution_20250825","code_execution_20260120"])).openapi("AnthropicAllowedCallers",{example:["direct"]}),ee=n.z.object({type:n.z.literal("web_search_20260209"),name:n.z.literal("web_search"),allowed_callers:Y.optional(),allowed_domains:n.z.array(n.z.string()).nullish(),blocked_domains:n.z.array(n.z.string()).nullish(),max_uses:(0,o.D)().nullish(),user_location:Z.nullish()}).extend(_.shape).transform(Q);n.z.object({type:n.z.literal("advisor_20260301"),name:n.z.literal("advisor"),model:n.z.string(),allowed_callers:Y.optional(),caching:d.nullish(),defer_loading:n.z.boolean().optional(),max_uses:(0,o.D)().optional()}).extend(_.shape),n.z.object({type:n.z.enum(["tool_search_tool_bm25_20251119","tool_search_tool_bm25"]),name:n.z.literal("tool_search_tool_bm25"),allowed_callers:Y.optional(),defer_loading:n.z.boolean().optional(),strict:n.z.boolean().optional()}).extend(_.shape).openapi("AnthropicToolSearchToolBm25"),n.z.object({type:n.z.enum(["tool_search_tool_regex_20251119","tool_search_tool_regex"]),name:n.z.literal("tool_search_tool_regex"),allowed_callers:Y.optional(),defer_loading:n.z.boolean().optional(),strict:n.z.boolean().optional()}).extend(_.shape).openapi("AnthropicToolSearchToolRegex");let et=n.z.discriminatedUnion("type",[V.extend({type:n.z.literal("custom").optional()}),G,J,X,ee]).openapi("AnthropicToolUnion",{description:"An Anthropic tool definition: a client-defined tool with a JSON Schema `input_schema`, or a server tool (bash, text editor, web search).",example:{name:"get_weather",description:"Get the current weather for a city.",input_schema:{type:"object",properties:{city:{type:"string"}},required:["city"]}}}),eo=n.z.discriminatedUnion("type",[n.z.object({type:n.z.literal("tool_reference"),name:n.z.string()}),n.z.object({type:n.z.literal("mcp_tool_reference"),name:n.z.string(),server_name:n.z.string()}),n.z.object({type:n.z.literal("mcp_toolset_reference"),server_name:n.z.string()})]),en=n.z.object({type:n.z.literal("tool_definition"),definition:et}),ei=n.z.discriminatedUnion("type",[...eo.options,en]),ea=n.z.object({type:n.z.literal("tool_addition"),tool:ei}).extend(_.shape).openapi("MessagesToolAdditionBlock",{description:'Adds a tool mid-conversation without invalidating the prompt cache: either a previously deferred tool (declared in `tools` with `defer_loading: true`, referenced by name) or a full inline `tool_definition`. Only valid in `role: "system"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8.',example:{type:"tool_addition",tool:{type:"tool_reference",name:"get_forecast"}}}),er=n.z.object({type:n.z.literal("tool_removal"),tool:eo}).extend(_.shape).openapi("MessagesToolRemovalBlock",{description:'Removes a tool from the conversation mid-conversation without invalidating the prompt cache. Only valid in `role: "system"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8.',example:{type:"tool_removal",tool:{type:"tool_reference",name:"get_weather"}}}),el=n.z.object({type:n.z.literal("compaction"),content:n.z.string().nullable(),encrypted_content:n.z.string().nullish()}).extend(_.shape),es=n.z.object({type:n.z.literal("advisor_tool_result"),tool_use_id:n.z.string(),content:n.z.record(n.z.string(),n.z.unknown())}).openapi("MessagesAdvisorToolResultBlock",{description:"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.",example:{type:"advisor_tool_result",tool_use_id:"srvtoolu_01abc",content:{text:"Advisor response text",type:"advisor_result"}}}),ep=n.z.object({type:n.z.literal("openrouter_shell_tool_result"),tool_use_id:n.z.string(),content:n.z.record(n.z.string(),n.z.unknown()),files:n.z.array(s).optional().openapi({description:"Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API."}),container_id:n.z.string().optional().openapi({description:"The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed."})}).openapi("MessagesShellToolResultBlock",{description:"Output of an `openrouter:shell` call from a prior assistant turn. Accepted on replay and dropped before the provider request — Anthropic has no equivalent block.",example:{type:"openrouter_shell_tool_result",tool_use_id:"srvtoolu_01abc",content:{output:[{stdout:"README.md\n",stderr:"",outcome:{type:"exit",exit_code:0}}]}}}),ec=n.z.object({type:n.z.literal("openrouter_bash_tool_result"),tool_use_id:n.z.string(),content:n.z.record(n.z.string(),n.z.unknown()),files:n.z.array(s).optional().openapi({description:"Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API."}),container_id:n.z.string().optional().openapi({description:"The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed."})}).openapi("MessagesBashToolResultBlock",{description:"Output of a sandbox-executed `openrouter:bash` call from a prior assistant turn. Accepted on replay and dropped before the provider request — Anthropic has no equivalent block.",example:{type:"openrouter_bash_tool_result",tool_use_id:"srvtoolu_01abc",content:{command:"ls",stdout:"README.md\n",stderr:"",exitCode:0}}}),eu=[R,T,S,O,$,E,P,U,N,W],ed=n.z.discriminatedUnion("type",[...eu]),e_=n.z.discriminatedUnion("type",[R,T,S,O,$,E,P,B,N,W,el,es,ea,er,ep,ec,n.z.object({type:n.z.literal("openrouter_tool_search_result"),tool_use_id:n.z.string(),content:n.z.record(n.z.string(),n.z.unknown())}).openapi("ORAnthropicToolSearchResultParam",{description:"Router-owned deferred discovery result for continuation.",example:{type:"openrouter_tool_search_result",tool_use_id:"search",content:{matches:[]}}})]),em=n.z.enum(["low","medium","high","xhigh","max"]).openapi("AnthropicOutputEffort",{example:"high"}),eh=n.z.enum(["next_user_message","never"]).openapi("AnthropicSystemClearAt",{example:"next_user_message"}),ez=n.z.object({effort:em.nullish()}).strict().openapi("AnthropicMessageOutputConfig",{example:{effort:"low"}}),eg=n.z.object({role:n.z.enum(["user","assistant","system"]),content:n.z.union([n.z.string(),n.z.array(ed)])}),eb=n.z.object({role:n.z.enum(["user","assistant","system"]),content:n.z.union([n.z.string(),n.z.array(e_)]),clear_at:eh.nullish(),output_config:ez.nullish()}),ey=n.z.object({type:n.z.literal("auto"),disable_parallel_tool_use:n.z.boolean().optional()}),ex=n.z.object({type:n.z.literal("any"),disable_parallel_tool_use:n.z.boolean().optional()}),ef=n.z.object({type:n.z.literal("none")}),ev=n.z.object({type:n.z.literal("tool"),name:n.z.string(),disable_parallel_tool_use:n.z.boolean().optional()}),ew=n.z.discriminatedUnion("type",[ey,ex,ef,ev]),ek=n.z.enum(["summarized","omitted","updates"]).openapi("AnthropicThinkingDisplay",{example:"summarized"}),ej=n.z.enum(["error","drop_block"]),eA=n.z.object({prefix_mismatch_behavior:ej.nullish(),mismatch_behavior:ej.nullish().openapi({description:"Deprecated: legacy alias of prefix_mismatch_behavior. Send only one of the two.",deprecated:!0})}).strict().superRefine((e,t)=>{void 0!==e.prefix_mismatch_behavior&&void 0!==e.mismatch_behavior&&t.addIssue({code:n.z.ZodIssueCode.custom,message:"cannot set both block_binding.prefix_mismatch_behavior and block_binding.mismatch_behavior; send only block_binding.prefix_mismatch_behavior"})}).transform(({mismatch_behavior:e,...t})=>void 0===e?t:{prefix_mismatch_behavior:e}).openapi("AnthropicThinkingBlockBinding",{example:{prefix_mismatch_behavior:"drop_block"}}),eD=n.z.object({type:n.z.literal("enabled"),budget_tokens:(0,o.D)(),display:ek.nullish(),block_binding:eA.nullish()}),eC=n.z.object({type:n.z.literal("disabled")}),eR=n.z.object({type:n.z.literal("adaptive"),display:ek.nullish(),block_binding:eA.nullish()}),eT=n.z.object({type:n.z.literal("between_tools")}).strict(),eI=n.z.discriminatedUnion("type",[eD,eC,eR,eT]),eq=n.z.object({user_id:n.z.string().nullish()}),eS=n.z.object({type:n.z.literal("json_schema"),schema:n.z.record(n.z.string(),n.z.unknown())}),eO=n.z.object({effort:em.nullish(),format:eS.nullish()}),eE=n.z.object({type:n.z.literal("input_tokens"),value:(0,o.D)()}).openapi("AnthropicInputTokensTrigger",{example:{type:"input_tokens",value:1e5}}),eP=eE.extend({value:(0,o.D)().min(5e4,{message:"trigger.value must be at least 50000"})}),eU=n.z.object({type:n.z.literal("tool_uses"),value:(0,o.D)()}).openapi("AnthropicToolUsesTrigger",{example:{type:"tool_uses",value:10}}),eB=n.z.object({type:n.z.literal("input_tokens"),value:(0,o.D)()}).openapi("AnthropicInputTokensClearAtLeast",{example:{type:"input_tokens",value:5e4}}),eF=n.z.object({type:n.z.literal("thinking_turns"),value:(0,o.D)()}).openapi("AnthropicThinkingTurns",{example:{type:"thinking_turns",value:3}}),eW=n.z.object({type:n.z.literal("all")}),eM=n.z.object({type:n.z.literal("tool_uses"),value:(0,o.D)()}).openapi("AnthropicToolUsesKeep",{example:{type:"tool_uses",value:5}}),eN=n.z.object({type:n.z.literal("clear_tool_uses_20250919"),clear_at_least:eB.nullish(),clear_tool_inputs:n.z.union([n.z.boolean(),n.z.array(n.z.string())]).nullish(),exclude_tools:n.z.array(n.z.string()).nullish(),keep:eM.optional(),trigger:n.z.discriminatedUnion("type",[eE,eU]).optional()}),eL=n.z.object({type:n.z.literal("clear_thinking_20251015"),keep:n.z.union([eF,eW,n.z.literal("all")]).optional()}),e$=n.z.object({type:n.z.literal("compact_20260112"),instructions:n.z.string().nullish(),pause_after_compaction:n.z.boolean().optional(),trigger:eP.nullish()}),eH=n.z.discriminatedUnion("type",[eN,eL,e$]),eV=n.z.object({edits:n.z.array(eH).optional()}),eG={model:n.z.string(),max_tokens:(0,o.D)(),system:n.z.union([n.z.string(),n.z.array(R)]).optional(),metadata:eq.optional(),stop_sequences:n.z.array(n.z.string()).optional(),temperature:(0,o.$)().optional(),top_p:(0,o.$)().optional(),top_k:(0,o.D)().optional(),tools:n.z.array(et).optional(),tool_choice:ew.optional(),thinking:eI.optional(),service_tier:n.z.string().optional(),output_config:eO.optional(),cache_control:d.optional()},eJ=n.z.object(eG).extend({messages:n.z.array(eb)}).extend({stream:n.z.boolean().optional(),context_management:eV.nullish(),safeguards:n.z.array(m).nullish()}),eZ=n.z.object({...eG,messages:n.z.array(eg)});eJ.extend({stream:n.z.literal(!1).optional()}),eZ.extend({stream:n.z.literal(!1).optional()}),eZ.extend({stream:n.z.literal(!0)});let eK=n.z.object({type:n.z.literal("char_location"),cited_text:n.z.string(),document_index:(0,o.D)(),document_title:n.z.string().nullable(),start_char_index:(0,o.D)(),end_char_index:(0,o.D)(),file_id:n.z.string().nullable()}).openapi("AnthropicCitationCharLocation",{example:{type:"char_location",cited_text:"Example cited text",document_index:0,document_title:null,start_char_index:0,end_char_index:18,file_id:null}}),eQ=n.z.object({type:n.z.literal("page_location"),cited_text:n.z.string(),document_index:(0,o.D)(),document_title:n.z.string().nullable(),start_page_number:(0,o.D)(),end_page_number:(0,o.D)(),file_id:n.z.string().nullable()}).openapi("AnthropicCitationPageLocation",{example:{type:"page_location",cited_text:"Example cited text",document_index:0,document_title:null,start_page_number:1,end_page_number:2,file_id:null}}),eX=n.z.object({type:n.z.literal("content_block_location"),cited_text:n.z.string(),document_index:(0,o.D)(),document_title:n.z.string().nullable(),start_block_index:(0,o.D)(),end_block_index:(0,o.D)(),file_id:n.z.string().nullable()}).openapi("AnthropicCitationContentBlockLocation",{example:{type:"content_block_location",cited_text:"Example cited text",document_index:0,document_title:null,start_block_index:0,end_block_index:1,file_id:null}}),eY=n.z.object({type:n.z.literal("web_search_result_location"),cited_text:n.z.string(),encrypted_index:n.z.string(),title:n.z.string().nullable(),url:n.z.string()}).openapi("AnthropicCitationWebSearchResultLocation",{example:{type:"web_search_result_location",cited_text:"Example cited text",encrypted_index:"enc_idx_0",title:"Example Page",url:"https://example.com"}}),e0=n.z.object({type:n.z.literal("search_result_location"),cited_text:n.z.string(),search_result_index:(0,o.D)(),source:n.z.string(),title:n.z.string().nullable(),start_block_index:(0,o.D)(),end_block_index:(0,o.D)()}).openapi("AnthropicCitationSearchResultLocation",{example:{type:"search_result_location",cited_text:"Example cited text",search_result_index:0,source:"example_source",title:"Example Result",start_block_index:0,end_block_index:1}}),e1=n.z.discriminatedUnion("type",[eK,eQ,eX,eY,e0]).openapi("AnthropicTextCitation",{example:{type:"char_location",cited_text:"Example text",document_index:0,document_title:null,start_char_index:0,end_char_index:10,file_id:null},discriminator:{propertyName:"type",mapping:{char_location:"#/components/schemas/AnthropicCitationCharLocation",page_location:"#/components/schemas/AnthropicCitationPageLocation",content_block_location:"#/components/schemas/AnthropicCitationContentBlockLocation",web_search_result_location:"#/components/schemas/AnthropicCitationWebSearchResultLocation",search_result_location:"#/components/schemas/AnthropicCitationSearchResultLocation"}}}),e2=n.z.object({type:n.z.literal("text"),text:n.z.string(),citations:n.z.array(e1).nullable()}).openapi("AnthropicTextBlock",{example:{type:"text",text:"Hello, world!",citations:null}}),e5=n.z.object({type:n.z.literal("direct")}).openapi("AnthropicDirectCaller",{example:{type:"direct"}}),e4=n.z.object({type:n.z.literal("code_execution_20250825"),tool_id:n.z.string()}).openapi("AnthropicCodeExecution20250825Caller",{example:{type:"code_execution_20250825",tool_id:"toolu_01abc"}}),e3=n.z.object({type:n.z.literal("code_execution_20260120"),tool_id:n.z.string()}).openapi("AnthropicCodeExecution20260120Caller",{example:{type:"code_execution_20260120",tool_id:"toolu_01abc"}}),e8=n.z.discriminatedUnion("type",[e5,e4,e3]).openapi("AnthropicCaller",{example:{type:"direct"},discriminator:{propertyName:"type",mapping:{direct:"#/components/schemas/AnthropicDirectCaller",code_execution_20250825:"#/components/schemas/AnthropicCodeExecution20250825Caller",code_execution_20260120:"#/components/schemas/AnthropicCodeExecution20260120Caller"}}}),e6=n.z.object({type:n.z.literal("tool_use"),id:n.z.string(),caller:e8,name:n.z.string(),input:n.z.unknown()}).openapi("AnthropicToolUseBlock",{example:{type:"tool_use",id:"toolu_01abc",caller:{type:"direct"},name:"get_weather",input:{location:"San Francisco"}}}),e9=n.z.object({type:n.z.literal("thinking"),thinking:n.z.string(),signature:n.z.string()}).openapi("AnthropicThinkingBlock",{example:{type:"thinking",thinking:"Let me think about this...",signature:"sig_abc123"}}),e7=n.z.object({type:n.z.literal("redacted_thinking"),data:n.z.string()}).openapi("AnthropicRedactedThinkingBlock",{example:{type:"redacted_thinking",data:"cmVkYWN0ZWQ="}}),te=e8.nullable().openapi("ORAnthropicNullableCaller"),tt=n.z.object({type:n.z.literal("server_tool_use"),id:n.z.string(),caller:te.optional(),name:n.z.string(),input:n.z.unknown()}).openapi("ORAnthropicServerToolUseBlock",{example:{type:"server_tool_use",id:"srvtoolu_01abc",caller:{type:"direct"},name:"advisor",input:{}}}),to=n.z.object({type:n.z.literal("web_search_result"),encrypted_content:n.z.string(),page_age:n.z.string().nullable(),title:n.z.string(),url:n.z.string()}).openapi("AnthropicWebSearchResult",{example:{type:"web_search_result",encrypted_content:"enc_content_0",page_age:null,title:"Example Page",url:"https://example.com"}}),tn=n.z.enum({invalid_tool_input:"invalid_tool_input",unavailable:"unavailable",max_uses_exceeded:"max_uses_exceeded",too_many_requests:"too_many_requests",query_too_long:"query_too_long",request_too_large:"request_too_large"}),ti=n.z.object({type:n.z.literal("web_search_tool_result_error"),error_code:tn}).openapi("AnthropicWebSearchToolResultError",{example:{type:"web_search_tool_result_error",error_code:"unavailable"}}),ta=n.z.object({type:n.z.literal("web_search_tool_result"),caller:e8,tool_use_id:n.z.string(),content:n.z.union([n.z.array(to),ti])}).openapi("AnthropicWebSearchToolResult",{example:{type:"web_search_tool_result",caller:{type:"direct"},tool_use_id:"srvtoolu_01abc",content:[]}}),tr=n.z.object({enabled:n.z.boolean()}).openapi("AnthropicCitationsConfig",{example:{enabled:!0}}),tl=n.z.object({citations:tr.nullable().default(null),source:n.z.union([b,y]),title:n.z.string().nullable(),type:n.z.literal("document")}).openapi("AnthropicDocumentBlock",{example:{citations:null,source:{data:"Hello, world!",media_type:"text/plain",type:"text"},title:null,type:"document"}}),ts=n.z.enum({content_too_large:"content_too_large",invalid_tool_input:"invalid_tool_input",url_too_long:"url_too_long",url_not_allowed:"url_not_allowed",url_not_in_prior_context:"url_not_in_prior_context",url_not_accessible:"url_not_accessible",unsupported_content_type:"unsupported_content_type",too_many_requests:"too_many_requests",max_uses_exceeded:"max_uses_exceeded",unavailable:"unavailable"}),tp=n.z.object({type:n.z.literal("web_fetch_tool_result_error"),error_code:ts}).openapi("AnthropicWebFetchToolResultError",{example:{type:"web_fetch_tool_result_error",error_code:"unavailable"}}),tc=n.z.object({content:tl,retrieved_at:n.z.string().nullable(),type:n.z.literal("web_fetch_result"),url:n.z.string()}).openapi("AnthropicWebFetchBlock",{example:{content:{type:"document",citations:null,source:{data:"",media_type:"text/plain",type:"text"},title:null},retrieved_at:null,type:"web_fetch_result",url:"https://example.com"}}),tu=n.z.object({type:n.z.literal("web_fetch_tool_result"),caller:e8,content:n.z.discriminatedUnion("type",[tp,tc]).openapi("AnthropicWebFetchContent",{example:{type:"web_fetch_result",content:{type:"document",citations:null,source:{data:"",media_type:"text/plain",type:"text"},title:null},retrieved_at:null,url:"https://example.com"},discriminator:{propertyName:"type",mapping:{web_fetch_tool_result_error:"#/components/schemas/AnthropicWebFetchToolResultError",web_fetch_result:"#/components/schemas/AnthropicWebFetchBlock"}}}),tool_use_id:n.z.string()}).openapi("AnthropicWebFetchToolResult",{example:{type:"web_fetch_tool_result",caller:{type:"direct"},content:{type:"web_fetch_result",content:{type:"document",citations:null,source:{data:"",media_type:"text/plain",type:"text"},title:null},retrieved_at:null,url:"https://example.com"},tool_use_id:"srvtoolu_01abc"}}),td=n.z.object({file_id:n.z.string(),type:n.z.literal("code_execution_output")}).openapi("AnthropicCodeExecutionOutput",{example:{file_id:"file_01abc",type:"code_execution_output"}}),t_=n.z.enum(["invalid_tool_input","unavailable","too_many_requests","execution_time_exceeded"]).openapi("AnthropicServerToolErrorCode",{example:"unavailable"}),tm=n.z.object({error_code:t_,type:n.z.literal("code_execution_tool_result_error")}).openapi("AnthropicCodeExecutionToolResultError",{example:{error_code:"unavailable",type:"code_execution_tool_result_error"}}),th=n.z.object({content:n.z.array(td),return_code:(0,o.D)(),stderr:n.z.string(),stdout:n.z.string(),type:n.z.literal("code_execution_result")}).openapi("AnthropicCodeExecutionResult",{example:{content:[],return_code:0,stderr:"",stdout:"Hello",type:"code_execution_result"}}),tz=n.z.object({content:n.z.array(td),encrypted_stdout:n.z.string(),return_code:(0,o.D)(),stderr:n.z.string(),type:n.z.literal("encrypted_code_execution_result")}).openapi("AnthropicEncryptedCodeExecutionResult",{example:{content:[],encrypted_stdout:"enc_stdout",return_code:0,stderr:"",type:"encrypted_code_execution_result"}}),tg=n.z.object({type:n.z.literal("code_execution_tool_result"),content:n.z.discriminatedUnion("type",[tm,th,tz]).openapi("AnthropicCodeExecutionContent",{example:{type:"code_execution_result",content:[],return_code:0,stderr:"",stdout:"Hello"},discriminator:{propertyName:"type",mapping:{code_execution_tool_result_error:"#/components/schemas/AnthropicCodeExecutionToolResultError",code_execution_result:"#/components/schemas/AnthropicCodeExecutionResult",encrypted_code_execution_result:"#/components/schemas/AnthropicEncryptedCodeExecutionResult"}}}),tool_use_id:n.z.string()}).openapi("AnthropicCodeExecutionToolResult",{example:{type:"code_execution_tool_result",content:{type:"code_execution_result",content:[],return_code:0,stderr:"",stdout:"Hello"},tool_use_id:"srvtoolu_01abc"}}),tb=n.z.object({file_id:n.z.string(),type:n.z.literal("bash_code_execution_output")}).openapi("AnthropicBashCodeExecutionOutput",{example:{file_id:"file_01abc",type:"bash_code_execution_output"}}),ty=n.z.object({error_code:n.z.enum(["invalid_tool_input","unavailable","too_many_requests","execution_time_exceeded","output_file_too_large"]),type:n.z.literal("bash_code_execution_tool_result_error")}).openapi("AnthropicBashCodeExecutionToolResultError",{example:{error_code:"unavailable",type:"bash_code_execution_tool_result_error"}}),tx=n.z.object({content:n.z.array(tb),return_code:(0,o.D)(),stderr:n.z.string(),stdout:n.z.string(),type:n.z.literal("bash_code_execution_result")}).openapi("AnthropicBashCodeExecutionResult",{example:{content:[],return_code:0,stderr:"",stdout:"Hello",type:"bash_code_execution_result"}}),tf=n.z.object({type:n.z.literal("bash_code_execution_tool_result"),content:n.z.discriminatedUnion("type",[ty,tx]).openapi("AnthropicBashCodeExecutionContent",{example:{type:"bash_code_execution_result",content:[],return_code:0,stderr:"",stdout:"Hello"},discriminator:{propertyName:"type",mapping:{bash_code_execution_tool_result_error:"#/components/schemas/AnthropicBashCodeExecutionToolResultError",bash_code_execution_result:"#/components/schemas/AnthropicBashCodeExecutionResult"}}}),tool_use_id:n.z.string()}).openapi("AnthropicBashCodeExecutionToolResult",{example:{type:"bash_code_execution_tool_result",content:{type:"bash_code_execution_result",content:[],return_code:0,stderr:"",stdout:"Hello"},tool_use_id:"srvtoolu_01abc"}}),tv=n.z.object({error_code:n.z.enum(["invalid_tool_input","unavailable","too_many_requests","execution_time_exceeded","file_not_found"]),error_message:n.z.string().nullable(),type:n.z.literal("text_editor_code_execution_tool_result_error")}).openapi("AnthropicTextEditorCodeExecutionToolResultError",{example:{error_code:"unavailable",error_message:null,type:"text_editor_code_execution_tool_result_error"}}),tw=n.z.object({content:n.z.string(),file_type:n.z.enum(["text","image","pdf"]),num_lines:(0,o.D)().nullable(),start_line:(0,o.D)().nullable(),total_lines:(0,o.D)().nullable(),type:n.z.literal("text_editor_code_execution_view_result")}).openapi("AnthropicTextEditorCodeExecutionViewResult",{example:{content:"file content",file_type:"text",num_lines:10,start_line:1,total_lines:10,type:"text_editor_code_execution_view_result"}}),tk=n.z.object({is_file_update:n.z.boolean(),type:n.z.literal("text_editor_code_execution_create_result")}).openapi("AnthropicTextEditorCodeExecutionCreateResult",{example:{is_file_update:!1,type:"text_editor_code_execution_create_result"}}),tj=n.z.object({lines:n.z.array(n.z.string()).nullable(),new_lines:(0,o.D)().nullable(),new_start:(0,o.D)().nullable(),old_lines:(0,o.D)().nullable(),old_start:(0,o.D)().nullable(),type:n.z.literal("text_editor_code_execution_str_replace_result")}).openapi("AnthropicTextEditorCodeExecutionStrReplaceResult",{example:{lines:null,new_lines:null,new_start:null,old_lines:null,old_start:null,type:"text_editor_code_execution_str_replace_result"}}),tA=n.z.object({type:n.z.literal("text_editor_code_execution_tool_result"),content:n.z.discriminatedUnion("type",[tv,tw,tk,tj]).openapi("AnthropicTextEditorCodeExecutionContent",{example:{type:"text_editor_code_execution_view_result",content:"file content",file_type:"text",num_lines:10,start_line:1,total_lines:10},discriminator:{propertyName:"type",mapping:{text_editor_code_execution_tool_result_error:"#/components/schemas/AnthropicTextEditorCodeExecutionToolResultError",text_editor_code_execution_view_result:"#/components/schemas/AnthropicTextEditorCodeExecutionViewResult",text_editor_code_execution_create_result:"#/components/schemas/AnthropicTextEditorCodeExecutionCreateResult",text_editor_code_execution_str_replace_result:"#/components/schemas/AnthropicTextEditorCodeExecutionStrReplaceResult"}}}),tool_use_id:n.z.string()}).openapi("AnthropicTextEditorCodeExecutionToolResult",{example:{type:"text_editor_code_execution_tool_result",content:{type:"text_editor_code_execution_view_result",content:"file content",file_type:"text",num_lines:10,start_line:1,total_lines:10},tool_use_id:"srvtoolu_01abc"}}),tD=n.z.object({tool_name:n.z.string(),type:n.z.literal("tool_reference")}).openapi("AnthropicToolReference",{example:{tool_name:"my_tool",type:"tool_reference"}}),tC=n.z.object({error_code:t_,error_message:n.z.string().nullable(),type:n.z.literal("tool_search_tool_result_error")}).openapi("AnthropicToolSearchResultError",{example:{error_code:"unavailable",error_message:null,type:"tool_search_tool_result_error"}}),tR=n.z.object({tool_references:n.z.array(tD),type:n.z.literal("tool_search_tool_search_result")}).openapi("AnthropicToolSearchResult",{example:{tool_references:[{tool_name:"my_tool",type:"tool_reference"}],type:"tool_search_tool_search_result"}}),tT=n.z.object({type:n.z.literal("tool_search_tool_result"),content:n.z.discriminatedUnion("type",[tC,tR]).openapi("AnthropicToolSearchContent",{example:{type:"tool_search_tool_search_result",tool_references:[{tool_name:"my_tool",type:"tool_reference"}]},discriminator:{propertyName:"type",mapping:{tool_search_tool_result_error:"#/components/schemas/AnthropicToolSearchResultError",tool_search_tool_search_result:"#/components/schemas/AnthropicToolSearchResult"}}}),tool_use_id:n.z.string()}).openapi("AnthropicToolSearchToolResult",{example:{type:"tool_search_tool_result",content:{type:"tool_search_tool_search_result",tool_references:[{tool_name:"my_tool",type:"tool_reference"}]},tool_use_id:"srvtoolu_01abc"}}),tI=n.z.object({type:n.z.literal("container_upload"),file_id:n.z.string()}).openapi("AnthropicContainerUpload",{example:{type:"container_upload",file_id:"file_01abc"}}),tq=n.z.object({type:n.z.literal("advisor_tool_result"),tool_use_id:n.z.string(),content:n.z.record(n.z.string(),n.z.unknown())}).openapi("AnthropicAdvisorToolResult",{example:{type:"advisor_tool_result",tool_use_id:"srvtoolu_01abc",content:{text:"Advisor response text",type:"advisor_result"}}}),tS=n.z.object({type:n.z.literal("openrouter_shell_tool_result"),tool_use_id:n.z.string(),content:n.z.record(n.z.string(),n.z.unknown()),files:n.z.array(s).optional().openapi({description:"Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API."}),container_id:n.z.string().optional().openapi({description:"The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed."})}).openapi("ORAnthropicShellToolResult",{description:"Output of an `openrouter:shell` call executed in the OpenRouter sandbox",example:{type:"openrouter_shell_tool_result",tool_use_id:"srvtoolu_01abc",content:{output:[{stdout:"README.md\n",stderr:"",outcome:{type:"exit",exit_code:0}}]}}}),tO=n.z.object({type:n.z.literal("openrouter_bash_tool_result"),tool_use_id:n.z.string(),content:n.z.record(n.z.string(),n.z.unknown()),files:n.z.array(s).optional().openapi({description:"Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API."}),container_id:n.z.string().optional().openapi({description:"The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed."})}).openapi("ORAnthropicBashToolResult",{description:"Output of an `openrouter:bash` call executed in the OpenRouter sandbox (`engine: 'openrouter'`)",example:{type:"openrouter_bash_tool_result",tool_use_id:"srvtoolu_01abc",content:{command:"ls",stdout:"README.md\n",stderr:"",exitCode:0}}}),tE=n.z.object({type:n.z.literal("compaction"),content:n.z.string().nullable(),encrypted_content:n.z.string().nullish()}).openapi("AnthropicCompactionBlock",{example:{type:"compaction",content:"Compacted summary of conversation."}}),tP=n.z.object({skill_id:n.z.string(),type:n.z.enum(["anthropic","custom"]),version:n.z.string()}).openapi("AnthropicContainerSkill",{example:{skill_id:"pdf",type:"anthropic",version:"latest"}}),tU=n.z.object({id:n.z.string(),expires_at:n.z.string(),skills:n.z.array(tP).nullable().default(null)}).openapi("AnthropicContainer",{example:{id:"ctr_01abc",expires_at:"2026-04-08T00:00:00Z",skills:null}}),tB=n.z.object({type:n.z.literal("openrouter_tool_search_result"),tool_use_id:n.z.string(),content:n.z.record(n.z.string(),n.z.unknown())}).openapi("ORAnthropicToolSearchResult",{description:"Router-owned deferred discovery result containing original selected tool definitions.",example:{type:"openrouter_tool_search_result",tool_use_id:"search",content:{matches:[]}}}),tF=n.z.discriminatedUnion("type",[e2,e6,e9,e7,tt,ta,tu,tg,tf,tA,tT,tI,tE,tq,tS,tO,tB]).openapi("ORAnthropicContentBlock",{example:{type:"text",text:"Hello, world!",citations:null},discriminator:{propertyName:"type",mapping:{text:"#/components/schemas/AnthropicTextBlock",tool_use:"#/components/schemas/AnthropicToolUseBlock",thinking:"#/components/schemas/AnthropicThinkingBlock",redacted_thinking:"#/components/schemas/AnthropicRedactedThinkingBlock",server_tool_use:"#/components/schemas/ORAnthropicServerToolUseBlock",web_search_tool_result:"#/components/schemas/AnthropicWebSearchToolResult",web_fetch_tool_result:"#/components/schemas/AnthropicWebFetchToolResult",code_execution_tool_result:"#/components/schemas/AnthropicCodeExecutionToolResult",bash_code_execution_tool_result:"#/components/schemas/AnthropicBashCodeExecutionToolResult",text_editor_code_execution_tool_result:"#/components/schemas/AnthropicTextEditorCodeExecutionToolResult",tool_search_tool_result:"#/components/schemas/AnthropicToolSearchToolResult",container_upload:"#/components/schemas/AnthropicContainerUpload",compaction:"#/components/schemas/AnthropicCompactionBlock",advisor_tool_result:"#/components/schemas/AnthropicAdvisorToolResult",openrouter_shell_tool_result:"#/components/schemas/ORAnthropicShellToolResult",openrouter_bash_tool_result:"#/components/schemas/ORAnthropicBashToolResult",openrouter_tool_search_result:"#/components/schemas/ORAnthropicToolSearchResult"}}}),tW=n.z.object({ephemeral_5m_input_tokens:(0,o.D)(),ephemeral_1h_input_tokens:(0,o.D)()}).openapi("AnthropicCacheCreation",{example:{ephemeral_5m_input_tokens:100,ephemeral_1h_input_tokens:0}}),tM=n.z.object({web_search_requests:(0,o.D)(),web_fetch_requests:(0,o.D)()}).openapi("AnthropicServerToolUsage",{example:{web_search_requests:1,web_fetch_requests:0}}),tN=n.z.object({ephemeral_5m_input_tokens:(0,o.D)().default(0),ephemeral_1h_input_tokens:(0,o.D)().default(0)}).openapi("AnthropicIterationCacheCreation",{example:{ephemeral_5m_input_tokens:0,ephemeral_1h_input_tokens:0}}),tL=n.z.object({input_tokens:(0,o.D)().default(0),output_tokens:(0,o.D)().default(0),cache_creation_input_tokens:(0,o.D)().default(0),cache_read_input_tokens:(0,o.D)().default(0),cache_creation:tN.nullable().default(null)}).openapi("AnthropicBaseUsageIteration",{example:{input_tokens:100,output_tokens:50,cache_creation_input_tokens:0,cache_read_input_tokens:0,cache_creation:null}}),t$=tL.extend({type:n.z.literal("compaction")}).openapi("AnthropicCompactionUsageIteration",{example:{type:"compaction",input_tokens:50,output_tokens:25,cache_creation_input_tokens:0,cache_read_input_tokens:0,cache_creation:null}}),tH=tL.extend({type:n.z.literal("message"),model:n.z.string().optional()}).openapi("AnthropicMessageUsageIteration",{example:{type:"message",input_tokens:100,output_tokens:50,cache_creation_input_tokens:0,cache_read_input_tokens:0,cache_creation:null}}),tV=tL.extend({type:n.z.literal("advisor_message"),model:n.z.string()}).openapi("AnthropicAdvisorMessageUsageIteration",{example:{type:"advisor_message",model:"claude-opus-4-6",input_tokens:823,output_tokens:1612,cache_creation_input_tokens:0,cache_read_input_tokens:0,cache_creation:null}}),tG=tL.extend({type:n.z.string()}).openapi("AnthropicUnknownUsageIteration",{example:{type:"unknown",input_tokens:100,output_tokens:50,cache_creation_input_tokens:0,cache_read_input_tokens:0,cache_creation:null}}),tJ=n.z.union([t$,tH,tV,tG]).openapi("AnthropicUsageIteration",{example:{type:"message",input_tokens:100,output_tokens:50,cache_creation_input_tokens:0,cache_read_input_tokens:0,cache_creation:null}}),tZ=n.z.object({thinking_tokens:(0,o.D)()}).openapi("AnthropicOutputTokensDetails",{example:{thinking_tokens:0}}),tK=n.z.object({input_tokens:(0,o.D)(),output_tokens:(0,o.D)(),output_tokens_details:tZ.nullable(),cache_creation_input_tokens:(0,o.D)().nullable(),cache_read_input_tokens:(0,o.D)().nullable(),cache_creation:tW.nullable(),inference_geo:n.z.string().nullable(),server_tool_use:tM.nullable(),service_tier:n.z.enum(["standard","priority","batch"]).openapi("AnthropicServiceTier",{example:"standard",enum:["standard","priority","batch",null]}).nullable()}).openapi("AnthropicUsage",{example:{input_tokens:100,output_tokens:50,output_tokens_details:null,cache_creation_input_tokens:null,cache_read_input_tokens:null,cache_creation:null,inference_geo:null,server_tool_use:null,service_tier:"standard"}}).extend({speed:r.nullish(),iterations:n.z.array(tJ).optional()}),tQ=n.z.object({web_search_requests:(0,o.D)(),web_fetch_requests:(0,o.D)(),tool_calls_requested:(0,o.D)().optional(),tool_calls_executed:(0,o.D)().optional()}).openapi("ORAnthropicServerToolUsage",{example:{web_search_requests:0,web_fetch_requests:0,tool_calls_requested:1,tool_calls_executed:1}});tK.extend({server_tool_use:tQ.nullable(),service_tier:n.z.string().nullable(),cost:(0,o.$)().nullish(),is_byok:n.z.boolean().optional(),cost_details:l.f.nullish(),deferred_tools_details:p.optional()});let tX={EndTurn:"end_turn",MaxTokens:"max_tokens",ModelContextWindowExceeded:"model_context_window_exceeded",StopSequence:"stop_sequence",ToolUse:"tool_use",PauseTurn:"pause_turn",Refusal:"refusal"};n.z.enum(tX).openapi("AnthropicStopReason",{example:"end_turn",enum:[...Object.values(tX),null]});let tY={...tX,Compaction:"compaction"},t0=n.z.enum(tY).openapi("ORAnthropicStopReason",{example:"end_turn"}),t1=n.z.object({type:n.z.literal("refusal"),category:n.z.enum({Cyber:"cyber",Bio:"bio",FrontierLlm:"frontier_llm",ReasoningExtraction:"reasoning_extraction",GeneralHarms:"general_harms"}).nullable(),explanation:n.z.string().nullable()}).openapi("AnthropicRefusalStopDetails",{description:"Structured information about a refusal",example:{type:"refusal",category:"cyber",explanation:"The request was refused due to policy."}}),t2=n.z.object({type:n.z.string(),path:n.z.string().nullish(),reason:n.z.string().nullish()}).passthrough().openapi("AnthropicInputTransformation",{description:"A server-side transformation Anthropic applied to the request input",example:{type:"thinking_dropped",path:"messages.1.content.0",reason:"prefix_binding_mismatch"}});n.z.object({id:n.z.string(),type:n.z.literal("message"),role:n.z.literal("assistant"),container:tU.nullable(),content:n.z.array(tF),model:n.z.string(),stop_reason:t0.nullable(),stop_details:t1.nullable(),stop_sequence:n.z.string().nullable(),usage:tK,input_transformations:n.z.array(t2).nullish()});let t5=n.z.enum({InvalidRequestError:"invalid_request_error",AuthenticationError:"authentication_error",PermissionError:"permission_error",NotFoundError:"not_found_error",RateLimitError:"rate_limit_error",ApiError:"api_error",OverloadedError:"overloaded_error",BillingError:"billing_error",TimeoutError:"timeout_error"});n.z.object({type:n.z.literal("error"),error:n.z.object({type:t5,message:n.z.string()}),request_id:n.z.string().nullable()});let t4=n.z.object({cached_tokens:n.z.number().int().nullish().describe("Tokens cached by the endpoint."),cache_write_tokens:n.z.number().int().nullish().describe("Tokens written to cache. Only returned for models with explicit caching and cache write pricing."),audio_tokens:n.z.number().int().nullish().describe("Tokens used for input audio."),video_tokens:n.z.number().int().nullish().describe("Tokens used for input video."),file_tokens:n.z.number().int().nullish().describe("Tokens used for input files/documents.")}).describe("Breakdown of tokens used in the prompt."),t3=n.z.object({reasoning_tokens:n.z.number().int().nullish().describe("Tokens generated by the model for reasoning."),image_tokens:n.z.number().int().nullish().describe("Tokens generated by the model for image output."),audio_tokens:n.z.number().int().nullish().describe("Tokens generated by the model for audio output.")}),t8=n.z.object({cost:(0,o.$)().nullish().describe("Cost of the completion"),is_byok:n.z.boolean().optional().describe("Whether a request was made using a Bring Your Own Key configuration"),cost_details:l.f.nullish()}),t6=n.z.object({web_search_requests:n.z.number().int().nullish().describe("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."),tool_calls_requested:n.z.number().int().nullish().describe("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."),tool_calls_executed:n.z.number().int().nullish().describe("Number of OpenRouter server tool calls that executed and produced a result.")}).describe("Usage for server-side tool execution (e.g., web search)");n.z.object({web_search_requests:n.z.number().int().nonnegative().nullish(),web_fetch_requests:n.z.number().int().nonnegative().nullish(),code_execution_requests:n.z.number().int().nonnegative().nullish(),file_search_requests:n.z.number().int().nonnegative().nullish(),image_generation_requests:n.z.number().int().nonnegative().nullish()});let t9=n.z.object({turns:n.z.number().int().positive(),final:n.z.object({prompt_tokens:n.z.number().int(),completion_tokens:n.z.number().int(),total_tokens:n.z.number().int(),prompt_tokens_details:t4.nullish(),completion_tokens_details:t3.nullish()})}),t7=n.z.object({prompt_tokens:n.z.number().int().describe("Including images, input audio, and tools if any"),completion_tokens:n.z.number().int().describe("The tokens generated"),total_tokens:n.z.number().int().describe("Sum of the above two fields"),prompt_tokens_details:t4.nullish(),completion_tokens_details:t3.nullish(),server_tool_use:t6.nullish(),service_tier:n.z.string().nullish().describe("The service tier used by the upstream provider for this request"),speed:r.nullish(),iterations:n.z.array(tJ).nullish(),cache_creation:tW.nullish(),deferred_steps:t9.nullish().openapi({"x-hidden":!0})}).extend(t8.partial().shape);e.s(["I",0,t7,"b",0,t8,"e",0,t6],141841)}]); //# sourceMappingURL=2x14s_mgpy5hv.js.map