(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,855155,886988,e=>{"use strict";var t=e.i(368966),o=e.i(756247),i=e.i(497214),a=e.i(647204),n=e.i(882844),r=e.i(635157);let s=r.z.object({min:r.z.number().optional(),max:r.z.number().optional(),exclusiveMin:r.z.boolean().optional(),exclusiveMax:r.z.boolean().optional()});(0,n.j)(r.z.object({value:r.z.number().optional(),range:s}));var l=e.i(989487);class p{metadata;constructor(e){this.metadata=e}get description(){return"string"==typeof this.metadata?this.metadata:this.metadata.description}get video(){return"string"==typeof this.metadata?void 0:this.metadata.video}get name(){return this.metadata.name}get displayName(){return(0,l.j)(this.name)}toMarkdown(e){let t=[e?.includeName&&[`## ${this.displayName}`],e?.includeKey&&[`- Key: \`${this.name}\``],e?.includeExtra&&[...this.getExtraMarkdown(),!!this.video&&`- Explainer Video: [Watch](${this.video})`],[this.description]];return e?.isReverse&&(t=t.toReversed()),(0,i.e)(t.flat()).join("\n\n")}}class d extends p{metadata;get default(){return this.metadata.defaultValue}parseValue(e){return"number"==typeof e?e:this.metadata.defaultValue}constructor(e){super(e),this.metadata=e}getExtraMarkdown(){return(0,i.e)([`- Optional, **${this.metadata.type}**`,null!==this.metadata.defaultValue&&`- Default: **${this.metadata.defaultValue}**`])}}class u extends p{metadata;constructor(e){super(e),this.metadata=e}parseValue(e,t={withoutDefault:!1}){let o=function(e,t,{ignoredValues:o}={ignoredValues:new Set}){let i=Object.keys(e)[0],n=e[i];if(null==n||o.has(n))return(0,a.N)(void 0);if("number"!=typeof n||Number.isNaN(n)){var r;let e;return(0,a.Y)({kind:"not_a_number",message:`Expected ${i} to be a number, received ${(r=n,e=(0,a.$)(()=>JSON.stringify(r)),(0,a.C)(e)?e.data:"an unserializable value")}`})}let{min:s,max:l,exclusiveMin:p=!1,exclusiveMax:d=!1}=t;return void 0===s||(p?n>s:n>=s)?void 0===l||(d?ni)throw Error(`Min cannot be greater than max. Received ${o} > ${i}`);let r=void 0!==o?Math.max(o,e):e;return{value:void 0!==i?Math.min(i,r):r,range:t}}(e,{...this.metadata.range,...t})}get min(){return this.metadata.range.min}get max(){return this.metadata.range.max}getExtraMarkdown(){let e="integer"===this.metadata.type;return[(0,i.e)([`- Optional, **${this.metadata.type}**, ${function(e,t=!1){let{min:o,max:i}=e,a=t?o?.toFixed(0):o?.toFixed(1),n=t?i?.toFixed(0):i?.toFixed(1);return void 0!==o&&void 0!==i?`${a} to ${n}`:void 0!==o?`${a} or above`:void 0!==i?`${n} or below`:"any"}(this.metadata.range,e)}`,null!==this.metadata.defaultValue&&`- Default: ${e?this.metadata.defaultValue.toFixed(0):this.metadata.defaultValue.toFixed(1)}`]).join("\n\n")]}}class c extends p{metadata;get default(){return this.metadata.defaultValue}constructor(e){super(e),this.metadata=e}getExtraMarkdown(){return(0,i.e)([`- Optional, **${this.type}**`])}}class m extends c{type="map";parseValue(e){if(this.metadata.schema){let t=(0,n.C)(this.metadata.schema,e);if((0,a.C)(t))return t.data}return e??this.metadata.defaultValue}}class h extends c{type="array";parseValue(e){return"object"!=typeof e&&void 0!==e?[e]:Array.isArray(e)?e:this.metadata.defaultValue}}class f extends p{metadata;get default(){return this.metadata.defaultValue}parseValue(e){return"string"!=typeof e&&("object"!=typeof e||null===e||Array.isArray(e))?this.metadata.defaultValue:e}constructor(e){super(e),this.metadata=e}getExtraMarkdown(){return["- Optional, **string or object**"]}}class g extends p{metadata;get default(){return this.metadata.defaultValue}parseValue(e){return"boolean"==typeof e?e:this.metadata.defaultValue}constructor(e){super(e),this.metadata=e}getExtraMarkdown(){return(0,i.e)(["- Optional, **boolean**",null!==this.metadata.defaultValue&&`- Default: **${this.metadata.defaultValue}**`])}}class b extends p{metadata;get default(){return this.metadata.defaultValue}parseValue(e){return"string"==typeof e&&this.metadata.enumValues.includes(e)?e:this.metadata.defaultValue}constructor(e){super(e),this.metadata=e}getExtraMarkdown(){return(0,i.e)([`- Optional, **enum** (${this.metadata.enumValues.join(", ")})`,null!==this.metadata.defaultValue&&`- Default: **${this.metadata.defaultValue}**`])}}e.s(["Q",0,h,"_",0,g,"F",0,b,"$",0,m,"N",0,d,"c",0,u,"A",0,f],886988);let y=new u({name:o.f.MaxTokens,type:"integer",range:{min:1},defaultValue:null,ignoredValues:new Set([-1,0]),description:"This sets the upper limit for the number of tokens the model can generate in response. It won't produce more than this limit. The maximum value is the context length minus the prompt length."}),_=new u({name:o.f.MaxCompletionTokens,type:"integer",range:{min:1},defaultValue:null,ignoredValues:new Set([-1,0]),description:"This sets the upper limit for the number of tokens the model can generate in response. It won't produce more than this limit. The maximum value is the context length minus the prompt length."}),v=new u({name:o.f.Temperature,type:"float",range:{min:0,max:2},defaultValue:1,description:"This setting influences the variety in the model's responses. Lower values lead to more predictable and typical responses, while higher values encourage more diverse and less common responses. At 0, the model always gives the same response for a given input.",video:"https://youtu.be/ezgqHnWvua8"}),x=new u({name:o.f.TopP,type:"float",range:{min:0,max:1,exclusiveMin:!0},ignoredValues:new Set([0]),defaultValue:1,description:"This setting limits the model's choices to a percentage of likely tokens: only the top tokens whose probabilities add up to P. A lower value makes the model's responses more predictable, while the default setting allows for a full range of token choices. Think of it like a dynamic Top-K.",video:"https://youtu.be/wQP-im_HInk"}),w=new u({name:o.f.TopK,type:"integer",range:{min:0},ignoredValues:new Set([-1]),defaultValue:0,description:"This limits the model's choice of tokens at each step, making it choose from a smaller set. A value of 1 means the model will always pick the most likely next token, leading to predictable results. By default this setting is disabled, making the model to consider all choices.",video:"https://youtu.be/EbZv6-N8Xlk"}),z=new u({name:o.f.MinP,type:"float",range:{min:0,max:1},defaultValue:0,ignoredValues:new Set([0]),description:`Represents the minimum probability for a token to be considered, relative to the probability of the most likely token. (The value changes depending on the confidence level of the most probable token.) If your Min-P is set to 0.1, that means it will only allow for tokens that are at least 1/10th as probable as the best possible option.`}),k=new u({name:o.f.TopA,type:"float",range:{min:0,max:1},defaultValue:0,ignoredValues:new Set([0]),description:'Consider only the top tokens with "sufficiently high" probabilities based on the probability of the most likely token. Think of it like a dynamic Top-P. A lower Top-A value focuses the choices based on the highest probability token but with a narrower scope. A higher Top-A value does not necessarily affect the creativity of the output, but rather refines the filtering process based on the maximum probability.'}),S=new u({name:o.f.PresencePenalty,type:"float",range:{min:-2,max:2},defaultValue:0,description:"Adjusts how often the model repeats specific tokens already used in the input. Higher values make such repetition less likely, while negative values do the opposite. Token penalty does not scale with the number of occurrences. Negative values will encourage token reuse.",video:"https://youtu.be/MwHG5HL-P74"}),P=new u({name:o.f.FrequencyPenalty,type:"float",range:{min:-2,max:2},defaultValue:0,description:"This setting aims to control the repetition of tokens based on how often they appear in the input. It tries to use less frequently those tokens that appear more in the input, proportional to how frequently they occur. Token penalty scales with the number of occurrences. Negative values will encourage token reuse.",video:"https://youtu.be/p4gl6fqI0_w"}),A=new u({name:o.f.RepetitionPenalty,type:"float",range:{min:0,max:2,exclusiveMin:!0},defaultValue:1,ignoredValues:new Set([0]),description:"Helps to reduce the repetition of tokens from the input. A higher value makes the model less likely to repeat tokens, but too high a value can make the output less coherent (often with run-on sentences that lack small words). Token penalty scales based on original token's probability.",video:"https://youtu.be/LHjGAnLm3DM"}),T=new d({name:o.f.Seed,type:"integer",defaultValue:null,description:"If specified, the inferencing will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for some models."}),M=new m({name:o.f.LogitBias,defaultValue:null,description:"Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."}),C=new g({name:o.f.Logprobs,defaultValue:null,description:"Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned."}),O=new d({name:o.f.TopLogprobs,type:"integer",defaultValue:null,description:"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used."}),V=new m({name:o.f.Prediction,defaultValue:null,description:"Provides expected output content that capable models can use to reduce response latency when much of the completion is known in advance."}),j=new m({name:o.f.ResponseFormat,defaultValue:null,description:'Forces the model to produce specific output format. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON.\n\n **Note**: when using JSON mode, you should also instruct the model to produce JSON yourself via a system or user message.'}),D=new h({name:o.f.Stop,defaultValue:null,description:"Stop generation immediately if the model encounter any token specified in the stop array."}),F=new h({name:o.f.Tools,defaultValue:null,description:"Tool calling parameter, following OpenAI's tool calling request shape. For non-OpenAI providers, it will be transformed accordingly. [Click here to learn more about tool calling](/docs/guides/features/tool-calling)"}),R=new f({name:o.f.ToolChoice,defaultValue:null,description:'Controls which (if any) tool is called by the model. \'none\' means the model will not call any tool and instead generates a message. \'auto\' means the model can pick between generating a message or calling one or more tools. \'required\' means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool.'}),N=new g({name:o.f.StructuredOutputs,defaultValue:null,description:"If the model can return structured outputs using response_format json_schema."}),q=new g({name:o.f.IncludeReasoning,defaultValue:null,description:"Deprecated alias for reasoning.exclude. When true, reasoning tokens are returned in the response when supported by the model."}),I=new m({name:o.f.Reasoning,defaultValue:null,description:"Controls reasoning behavior for models that support thinking tokens, including whether reasoning is enabled, the reasoning effort, maximum reasoning tokens, and whether reasoning is excluded from the response."}),$=new b({name:o.f.ReasoningEffort,enumValues:Object.values(t.E),defaultValue:null,description:"OpenAI-style reasoning effort setting. Higher values allow the model to spend more tokens on internal reasoning when supported."}),U=new m({name:o.f.WebSearchOptions,defaultValue:null,description:"Configures native web search options for models and providers that support web-connected answers."}),E=new g({name:o.f.ParallelToolCalls,defaultValue:!0,description:"Whether to enable parallel function calling during tool use. If true, the model can call multiple functions simultaneously. If false, functions will be called sequentially. Only applies when tools are provided."}),W=new b({name:o.f.Verbosity,enumValues:["low","medium","high","xhigh","max"],defaultValue:null,description:"Constrains the verbosity of the model's response. Lower values produce more concise responses, while higher values produce more detailed and comprehensive responses. Introduced by OpenAI for the Responses API.\n\nFor Anthropic models, this parameter maps to `output_config.effort`. The 'xhigh' level is supported by Anthropic Claude 4.7 Opus and later models. The 'max' level is supported by Anthropic Claude 4.6 Opus and later models."}),L=[v,x,w,P,S,A,z,k],K=Object.fromEntries([...L,T,y,_,M,C,O,V,j,N,D,F,R,E,q,I,$,U,W].map(e=>[e.name,e]));e.s(["e",0,L,"y",0,P,"Y",0,y,"r",0,K,"h",0,S,"A",0,v,"R",0,x,"O",0,W],855155)},355140,e=>{"use strict";e.s(["q",0,300,"o",0,86400,"O",0,1,"C",0,2,"f",0,-2,"L",0,0,"y",0,1,"j",0,2,"t",0,-2,"b",0,"@","l",0,"preset/","p",0,2,"c",0,0,"D",0,4,"m",0,2,"a",0,0,"x",0,0,"_",0,20,"N",0,0,"Z",0,1,"R",0,0])},491301,e=>{"use strict";e.i(882844);let t=e.i(635157).z.string().trim().min(1).max(64).regex(/^[a-zA-Z0-9 _-]+$/);e.s(["T",0,64,"A",0,t,"K",0,function(e){let t=[],o=0,i=new Set;for(let[a,n]of e.entries()){let e=n.name?.trim();if(!e){++o>1&&t.push({kind:"multiple_unnamed",index:a});continue}if(i.has(e)){t.push({kind:"duplicate_name",index:a,name:e});continue}i.add(e)}return t}])},708187,e=>{"use strict";var t=e.i(882844);let o=e.i(635157).z.object({upstream_inference_cost:(0,t.$)().nullish(),upstream_inference_prompt_cost:(0,t.$)(),upstream_inference_completions_cost:(0,t.$)(),server_tool_cost:(0,t.$)().nullish().openapi({description:"Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. 0 when a metered server tool ran but settled at zero dollars; absent when no metered server tool ran."})}).openapi("CostDetails",{description:"Breakdown of upstream inference costs",example:{upstream_inference_cost:null,upstream_inference_prompt_cost:8e-4,upstream_inference_completions_cost:4e-4}});e.s(["f",0,o])},51214,e=>{"use strict";e.i(882844);var t=e.i(635157);let o=t.z.object({type:t.z.literal("text"),text:t.z.string()}).openapi("PredictionContentText",{description:"Text content part for a predicted output.",example:{type:"text",text:"Expected response"}}),i=t.z.object({type:t.z.literal("image_url"),image_url:t.z.object({url:t.z.string()})}).openapi("ContentPartImage",{example:{type:"image_url",image_url:{url:"https://example.com/image.png"}}});e.s(["i",0,i,"d",0,o])},956822,e=>{"use strict";e.i(882844);var t=e.i(635157);let o={...e.i(347508).v,XHigh:"xhigh",Max:"max"},i=t.z.enum(o),a=o.Medium,n=[o.Low,o.Medium,o.High,o.XHigh,o.Max];e.s(["o",0,n,"a",0,{low:{lower:0,upper:20},medium:{lower:20,upper:40},high:{lower:40,upper:60},xhigh:{lower:60,upper:80},max:{lower:80,upper:100}},"B",0,o,"g",0,i,"U",0,a])},787027,888626,74543,51889,e=>{"use strict";e.i(882844);var t=e.i(635157),o=e.i(72916),i=e.i(956822);e.s(["A",0,1024,"t",0,1024,"Q",0,65536],888626);let a=t.z.array(t.z.string().max(1024)).max(1024).refine(e=>65536>=e.reduce((e,t)=>e+t.length,0),{message:"Total model pattern length must be at most 65536 characters"});e.s(["f",0,a],74543);let n=t.z.object({id:t.z.literal(o.f.AutoBetaRouter),enabled:t.z.boolean().optional().openapi({description:"Set to false to disable the auto-beta-router plugin for this request. Defaults to true."}),allowed_models:a.optional().openapi({description:'List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.',example:["anthropic/*","openai/gpt-4o","google/*"]}),excluded_models:a.optional().openapi({description:'List of model patterns to exclude from auto-beta-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after allowed_models, so an excluded pattern always wins over an allowed one.',example:["openai/gpt-4o","meta-llama/*"]}),cost_quality_tradeoff:t.z.number().int().min(0).max(10).optional().openapi({description:"Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided.",example:9,deprecated:!0}),cost_tier:i.g.optional().openapi({description:"Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.",example:"low"})}).openapi("AutoBetaRouterPlugin",{example:{id:"auto-beta-router",enabled:!0,allowed_models:["anthropic/*","openai/*"],excluded_models:["openai/gpt-4o"],cost_tier:"low"}});e.s(["K",0,9,"u",0,n],51889);let r=t.z.object({id:t.z.literal(o.f.AutoRouter),enabled:t.z.boolean().optional().openapi({description:"Set to false to disable the auto-router plugin for this request. Defaults to true."}),allowed_models:a.optional().openapi({description:'List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.',example:["anthropic/*","openai/gpt-4o","google/*"]}),excluded_models:a.optional().openapi({description:'List of model patterns to exclude from auto-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after allowed_models, so an excluded pattern always wins over an allowed one.',example:["openai/gpt-4o","meta-llama/*"]}),cost_quality_tradeoff:t.z.number().int().min(0).max(10).optional().openapi({description:"Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided.",example:9,deprecated:!0}),cost_tier:i.g.optional().openapi({description:"Named cost/quality setting. Tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.",example:"low"}),pin_model:t.z.boolean().optional().openapi({description:"When true, reuses the model from the most recent assistant message's `model` attribute for subsequent turns. Defaults to false.",example:!1})}).openapi("AutoRouterPlugin",{example:{id:"auto-router",enabled:!0,allowed_models:["anthropic/*","openai/*"],excluded_models:["openai/gpt-4o"],cost_tier:"low",pin_model:!1}});e.s(["s",0,9,"d",0,r],787027)},818001,634585,e=>{"use strict";var t=e.i(882844),o=e.i(635157),i=e.i(72916),a=e.i(449964);let n="pdf-text",r=o.z.union([o.z.enum(a.f),o.z.literal(n)]).openapi("PDFParserEngine",{description:'The engine to use for parsing PDF files. "pdf-text" is deprecated and automatically redirected to "cloudflare-ai".',example:"cloudflare-ai"}),s=o.z.object({engine:r.optional()}).openapi("PDFParserOptions",{description:"Options for PDF parsing.",example:{engine:"cloudflare-ai"}}),l=o.z.object({id:o.z.literal(i.f.FileParser),enabled:o.z.boolean().optional().openapi({description:"Set to false to disable the file-parser plugin for this request. Defaults to true."}),pdf:s.optional()}).openapi("FileParserPlugin",{example:{id:"file-parser",enabled:!0,pdf:{engine:"cloudflare-ai"}}});e.s(["f",0,n,"o",0,l],818001);let p=o.z.object({id:o.z.literal(i.f.ParetoRouter),enabled:o.z.boolean().optional().openapi({description:"Set to false to disable the pareto-router plugin for this request. Defaults to true."}),min_coding_score:(0,t.$)().min(0).max(1).optional().openapi({description:"Minimum coding quality score between 0 and 1. Maps to internal quality tiers: >= 0.66 → high (top coding models), >= 0.33 → medium (strong modern flagships), < 0.33 → low (capable coders above the median). Omit to default to the highest tier (equivalent to >= 0.66). Not used when max_price is set (price-based selection takes over).",minimum:0,maximum:1,example:.8}),max_price:(0,t.$)().min(0).optional().openapi({description:"Maximum input price in USD per million tokens. When set, quality-tier selection (min_coding_score) is bypassed: the router computes the Pareto frontier over the top coding models and routes to the best-scoring frontier model priced at or below this cap, falling back through cheaper frontier models, then non-frontier models. Enforced against the price source given by price_source. Returns 404 when no candidate satisfies the cap.",minimum:0,example:5}),price_source:o.z.enum(["prompt","weighted_avg"]).optional().openapi({description:'Price source for the Pareto frontier cost axis and for enforcing max_price. "prompt" uses catalog list price (endpoint.pricing.prompt). "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to "prompt".'})}).openapi("ParetoRouterPlugin",{example:{id:"pareto-router",enabled:!0,max_price:5,price_source:"prompt"}});e.s(["Y",0,0,"C",0,p],634585)},35554,e=>{"use strict";var t=e.i(882844),o=e.i(635157),i=e.i(47525),a=e.i(485913),n=e.i(834336),r=e.i(948913);let s=(0,t.z)(o.z.string()).min(1).max(a.Z).optional().openapi({description:`Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then an analyst model summarizes the collective output into structured analysis JSON. Capped at ${a.Z} models to bound cost amplification. Defaults to the Quality preset from /labs/fusion.`,example:["~anthropic/claude-opus-latest","~openai/gpt-sol-latest","~google/gemini-pro-latest"]}),l=o.z.string().optional().openapi({description:"Slug of the analyst model that produces the structured analysis JSON. Defaults to the model used in the outer API request.",example:"~anthropic/claude-opus-latest"}),p=o.z.number().int().min(1).max(a.h).optional().openapi({description:`Maximum number of tool-calling steps each panelist (analysis model) and the analyst model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to ${a.P}. Capped at ${a.h}.`,example:12}),d=(0,t.D)().min(1).optional().openapi({description:`Maximum number of output tokens (including reasoning tokens) each panelist and the analyst model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. Defaults to ${a.b} when omitted.`,example:16384}),u=o.z.object({effort:n.P.optional().openapi({description:"Reasoning effort level for panelist and analyst inner calls."}),max_tokens:(0,t.D)().min(1).optional().openapi({description:"Maximum number of reasoning tokens each panelist and analyst model may use. Helps bound cost when models allocate too much budget to chain-of-thought."})}).optional().openapi({description:"Reasoning configuration forwarded to panelist and analyst inner calls. Use this to control reasoning effort and token budget for models that support extended thinking."}),c=(0,t.$)().min(0).max(2).optional().openapi({description:"Temperature forwarded to panelist inner calls. The analyst always runs at temperature 0 regardless of this value. When omitted, the provider's default applies.",example:.7}),m=i.i.optional(),h=o.z.object({type:o.z.string().openapi({description:'Server tool type identifier (e.g. "openrouter:web_search", "openrouter:web_fetch").'}),parameters:o.z.record(o.z.string(),o.z.unknown()).optional().openapi({description:"Optional configuration forwarded as the tool's `parameters` object."})}),f={analysis_models:s,model:l,max_tool_calls:p,max_completion_tokens:d,reasoning:u,temperature:c,cache_control:m,tools:o.z.array(h).max(a.a).optional().openapi({description:'Server tools available to panelist and analyst inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only).',example:[{type:"openrouter:web_search",parameters:{excluded_domains:["example.com"]}},{type:"openrouter:web_fetch"}]})},g=o.z.object(f).openapi("FusionServerToolConfig",{description:`Configuration for the ${r.d.OpenRouterFusion} server tool.`,example:{analysis_models:["~anthropic/claude-opus-latest","~openai/gpt-sol-latest","~google/gemini-pro-latest"]}}),b=o.z.object({model:o.z.string().openapi({description:"Slug of the analysis model that failed."}),error:o.z.string().openapi({description:"Error message describing why the model failed."}),status_code:o.z.number().int().optional().openapi({description:"HTTP status code from the upstream response, when available (e.g. 402, 429)."})});e.s(["y",0,f,"z",0,b,"G",0,g])},347508,e=>{"use strict";e.i(882844);let t=e.i(635157).z.string().regex(/^[a-z][a-z0-9_-]{0,31}$/);e.s(["v",0,{Low:"low",Medium:"medium",High:"high"},"p",0,t])},632339,e=>{"use strict";var t,o=((t={}).Native="native",t.Exa="exa",t.Firecrawl="firecrawl",t.Parallel="parallel",t.Perplexity="perplexity",t);e.s(["f",()=>o])},895185,e=>{"use strict";e.i(882844);var t=e.i(635157),o=e.i(56629);let i=t.z.enum(o.f).openapi("WebSearchMode",{description:"Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo, fast, basic (default), and advanced. Modes unsupported by the selected engine are ignored.",example:o.f.Auto});e.s(["f",0,i])},56629,e=>{"use strict";let t={Instant:"instant",Fast:"fast",Auto:"auto",DeepLite:"deep-lite",Deep:"deep",DeepReasoning:"deep-reasoning"},o={Turbo:"turbo",Fast:"fast",Basic:"basic",Advanced:"advanced"},i={...t,...o};e.s(["v",0,t,"d",0,o,"f",0,i])},121817,e=>{"use strict";e.i(882844);var t=e.i(635157);let o=t.z.object({type:t.z.literal("approximate"),city:t.z.string().nullish(),country:t.z.string().nullish(),region:t.z.string().nullish(),timezone:t.z.string().nullish()}).openapi("WebSearchUserLocation",{description:"Approximate user location for location-biased search results.",example:{type:"approximate",city:"San Francisco",region:"California",country:"US",timezone:"America/Los_Angeles"}});e.s(["f",0,o])},751899,e=>{"use strict";e.i(882844);var t=e.i(635157);let o=t.z.object({allowed_x_handles:t.z.array(t.z.string()).max(20).optional().openapi({description:"Only include posts from these X handles (max 20). Cannot be used with excluded_x_handles.",example:["OpenRouterAI"]}),excluded_x_handles:t.z.array(t.z.string()).max(20).optional().openapi({description:"Exclude posts from these X handles (max 20). Cannot be used with allowed_x_handles.",example:["spamaccount"]}),from_date:t.z.iso.date().optional().openapi({description:'Start of the post date range (ISO 8601 date, e.g. "2025-01-01").',example:"2025-01-01"}),to_date:t.z.iso.date().optional().openapi({description:'End of the post date range (ISO 8601 date, e.g. "2025-12-31").',example:"2025-12-31"}),enable_image_understanding:t.z.boolean().optional().openapi({description:"Analyze images attached to matching posts."}),enable_video_understanding:t.z.boolean().optional().openapi({description:"Analyze videos attached to matching posts."})}).strict().refine(e=>void 0===e.allowed_x_handles||void 0===e.excluded_x_handles,{message:"allowed_x_handles and excluded_x_handles are mutually exclusive"}).refine(e=>void 0===e.from_date||void 0===e.to_date||e.from_date<=e.to_date,{message:"to_date must not be earlier than from_date",path:["to_date"]}).openapi("XSearchOptions",{description:"Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.",example:{allowed_x_handles:["OpenRouterAI"],from_date:"2025-01-01"}});e.s(["f",0,o])},819076,e=>{"use strict";var t,o=((t={}).Int4="int4",t.Int8="int8",t.FloatingPoint4="fp4",t.MicroscalingFloatingPoint4="mxfp4",t.NvidiaFloatingPoint4="nvfp4",t.FloatingPoint6="fp6",t.FloatingPoint8="fp8",t.MicroscalingFloatingPoint8="mxfp8",t.FloatingPoint16="fp16",t.BrainFloating16="bf16",t.FloatingPoint32="fp32",t.Unknown="unknown",t);let i={int4:["int4"],int8:["int8"],fp4:["fp4","mxfp4","nvfp4"],mxfp4:["mxfp4"],nvfp4:["nvfp4"],fp6:["fp6"],fp8:["fp8","mxfp8"],mxfp8:["mxfp8"],fp16:["fp16"],bf16:["bf16"],fp32:["fp32"],unknown:["unknown"]};e.s(["v",()=>o,"k",0,function(e,t){return i[e].includes(t)}])},368966,e=>{"use strict";let t={Max:"max",XHigh:"xhigh",High:"high",Medium:"medium",Low:"low",Minimal:"minimal"},o={...t,None:"none"},i={ReasoningEffortNone:"reasoning_effort_none",ChatTemplateKwargs:"chat_template_kwargs",ThinkingDisabled:"thinking_disabled",ReasoningEnabledFalse:"reasoning_enabled_false"};e.s(["V",0,t,"K",0,i,"E",0,o,"x",0,{ContentString:"content-string",ReasoningContent:"reasoning-content",Reasoning:"reasoning",None:"none"}])},337004,e=>{"use strict";var t=e.i(882844),o=e.i(635157);let i=o.z.union([o.z.string(),(0,t.$)(),o.z.array(o.z.unknown())]);o.z.record(o.z.string(),i).optional().openapi("ImageConfig",{description:"Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details.",example:{aspect_ratio:"16:9",quality:"high"}});let a={aspect_ratio:o.z.string().optional(),image_size:o.z.string().optional(),quality:o.z.string().optional(),size:o.z.string().optional(),background:o.z.string().optional(),output_format:o.z.string().optional(),output_compression:(0,t.D)().optional(),moderation:o.z.string().optional(),font_inputs:o.z.array(o.z.unknown()).optional(),super_resolution_references:o.z.array(o.z.string()).optional(),scoring_prompt:o.z.string().optional(),scoring_rubric:o.z.array(o.z.unknown()).optional(),background_mode:o.z.string().optional(),background_hex_color:o.z.string().optional()};e.s(["J",0,["auto","transparent","opaque"],"W",0,["auto","low"],"I",0,100,"Z",0,0,"_",0,["png","webp","jpeg"],"g",0,["auto","low","medium","high"],"T",0,i,"s",0,a])},756247,e=>{"use strict";e.s(["f",0,{Temperature:"temperature",TopP:"top_p",TopK:"top_k",MinP:"min_p",TopA:"top_a",FrequencyPenalty:"frequency_penalty",PresencePenalty:"presence_penalty",RepetitionPenalty:"repetition_penalty",MaxTokens:"max_tokens",MaxCompletionTokens:"max_completion_tokens",LogitBias:"logit_bias",Logprobs:"logprobs",TopLogprobs:"top_logprobs",Prediction:"prediction",Seed:"seed",ResponseFormat:"response_format",StructuredOutputs:"structured_outputs",Stop:"stop",Tools:"tools",ToolChoice:"tool_choice",ParallelToolCalls:"parallel_tool_calls",IncludeReasoning:"include_reasoning",Reasoning:"reasoning",ReasoningEffort:"reasoning_effort",WebSearchOptions:"web_search_options",Verbosity:"verbosity"}])},793585,667172,464228,774076,e=>{"use strict";var t=e.i(988590),o=e.i(882844),i=e.i(635157),a=e.i(376904);let n=i.z.union([i.z.number(),i.z.string(),i.z.custom(e=>e instanceof a.f,{message:"Must be a BigNumber instance"})]);n.openapi("BigNumberUnion",{type:"string",description:"A number or string value representing a large number",example:1e3});let r=i.z.union([i.z.number().min(0),i.z.string().refine(e=>{let t=new a.f(e);return!t.isNaN()&&!t.isNegative()},{message:"Value must be a valid non-negative number"}),i.z.instanceof(a.f).refine(e=>!e.isNaN()&&!e.isNegative(),{message:"Value must be a valid non-negative number"})]).openapi("BigNumberUnionNonNegative",{type:"string",description:"A non-negative value in string format that is a large number",example:1e3});r.refine(e=>new a.f(e).gt(0),{message:"Value must be a valid positive number"}).openapi("BigNumberUnionPositive",{type:"string",description:"A positive value in string format that is a large number",example:1e3}),e.s(["A",0,r,"$",0,n],667172);let s=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];s.length;let l=i.z.array(i.z.enum(s)).min(1).refine(e=>new Set(e).size===e.length,{message:"utc_days must not repeat a weekday"}),p=i.z.object({min_prompt_tokens:(0,o.$)().optional().openapi({description:"Condition: the entry applies when the total prompt tokens of a request are strictly greater than this threshold"}),utc_start:(0,o.$)().optional().openapi({description:"Condition: inclusive start of a daily UTC time window as an HHMM clock number (e.g. 100 = 01:00, 1030 = 10:30). The entry applies while the current UTC time is inside the half-open window [utc_start, utc_end), which may wrap past midnight (utc_start > utc_end)."}),utc_end:(0,o.$)().optional().openapi({description:"Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00)"}),utc_days:l.optional().openapi({description:"Condition: UTC weekdays the entry applies on, evaluated at the request instant. Scopes the utc_start/utc_end window (or, without a window, the whole UTC day) to the listed days. Absent means every day."}),prompt:n.optional().openapi({description:"Overridden price in USD per token for prompt (input) processing",type:"string"}),completion:n.optional().openapi({description:"Overridden price in USD per token for completion (output) generation",type:"string"}),audio:n.optional().openapi({description:"Overridden price in USD per audio input token",type:"string"}),input_audio_cache:n.optional().openapi({description:"Overridden price in USD per cached audio input token",type:"string"}),input_cache_read:n.optional().openapi({description:"Overridden price in USD per cached input token (read)",type:"string"}),input_cache_write:n.optional().openapi({description:"Overridden price in USD per cache-write token",type:"string"}),input_cache_write_1h:n.optional().openapi({description:"Overridden price in USD per 1-hour cache-write token",type:"string"})}).openapi("PricingOverride",{description:"A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price.",example:{min_prompt_tokens:2e5,prompt:"0.000005",completion:"0.00002"}});i.z.object({prompt:n.openapi({description:"Price in USD per token for prompt (input) processing",type:"string"}),completion:n.openapi({description:"Price in USD per token for completion (output) generation",type:"string"}),request:n.optional().openapi({description:"Price in USD per request",type:"string"}),image:n.optional().openapi({description:"Price in USD per input image",type:"string"}),image_token:n.optional().openapi({description:"Price in USD per image token",type:"string"}),image_output:n.optional().openapi({description:"Price in USD per output image",type:"string"}),audio:n.optional().openapi({description:"Price in USD per audio input token",type:"string"}),audio_output:n.optional().openapi({description:"Price in USD per audio output token",type:"string"}),input_audio_cache:n.optional().openapi({description:"Price in USD per cached audio input token",type:"string"}),web_search:n.optional().openapi({description:"Price in USD per web search",type:"string"}),internal_reasoning:n.optional().openapi({description:"Price in USD per internal reasoning token",type:"string"}),input_cache_read:n.optional().openapi({description:"Price in USD per cached input token (read)",type:"string"}),input_cache_write:n.optional().openapi({description:"Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate.",type:"string"}),input_cache_write_1h:n.optional().openapi({description:"Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.",type:"string"}),discount:(0,o.$)().optional().openapi({description:"Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)"}),overrides:i.z.array(p).optional().openapi({description:"Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions."})});let d=i.z.object({prompt:n.openapi({description:"Maximum price in USD per million prompt tokens",type:"string"}),completion:n.openapi({description:"Maximum price in USD per million completion tokens",type:"string"}),image:n.optional().openapi({description:"Maximum price in USD per image",type:"string"}),audio:n.optional().openapi({description:"Maximum price in USD per audio unit",type:"string"}),request:n.optional().openapi({description:"Maximum price in USD per request",type:"string"})}).partial().optional();e.s(["f",0,d],464228);var u=e.i(983739),c=e.i(983335),m=e.i(819076),h=e.i(880315);let f=i.z.enum(c.H).openapi("ProviderName",{example:c.H.OpenAI});i.z.string().openapi("ProviderName",{enum:Object.values(c.H),example:c.H.OpenAI});let g=i.z.record(i.z.string(),i.z.unknown()),b=[...Object.values(c.G),...c.u],y=i.z.object(Object.fromEntries(b.map(e=>[e,g.optional()]))).partial().catchall(g),_=i.z.preprocess((e,t)=>{var o;if(!e||"object"!=typeof e||Array.isArray(e))return e;let a=Object.entries(e).flatMap(([e,t])=>{let o=function(e){let[t,...o]=e.split("/");if(void 0!==t&&void 0!==(0,c.c)(t))return[t.toLowerCase(),...o].join("/")}(e);return void 0===o?[]:[[o,t]]}),n=(o=a.map(([e])=>e)).find((e,t)=>o.indexOf(e)!==t);return void 0!==n?(t.addIssue({code:"custom",message:`Provider options key "${n}" is given more than once with different casing`}),i.z.NEVER):Object.fromEntries(a)},y).openapi("ProviderOptions",{description:"Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.",example:{openai:{max_tokens:1e3}}});e.s(["f",0,_],774076);let v=i.z.enum(["deny","allow"]).openapi("DataCollection",{example:"allow"}),x=i.z.enum(m.v).openapi("Quantization",{example:m.v.FloatingPoint16}),w=i.z.enum(u.f).openapi("ProviderSort",{description:"The provider sorting strategy (price, throughput, latency)",example:u.f.Price}),z=i.z.enum([h.f.Model,h.f.None]).openapi("SortPartition",{description:'Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model.',example:h.f.Model}),k=i.z.object({by:w.nullish().openapi({description:"The provider sorting strategy (price, throughput, latency)",example:u.f.Price,enum:[...Object.values(u.f),null]}),partition:z.nullish().openapi({description:'Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model.',example:h.f.Model,enum:[h.f.Model,h.f.None,null]})}).openapi("ProviderSortConfig",{description:"The provider sorting strategy (price, throughput, latency)",example:{by:u.f.Price,partition:h.f.Model}}),S=i.z.union([w,k]).openapi("ProviderSortUnion",{description:"The provider sorting strategy (price, throughput, latency)",example:u.f.Price}),P=i.z.array(i.z.union([f,i.z.string()])).openapi("ProviderIdArray",{description:"An array of provider identifiers (names or slugs).",example:["openai","anthropic"]}),A=i.z.preprocess(e=>Array.isArray(e)?e.map(e=>"string"==typeof e?(0,t.q)(e,c.H)?c.G[c.U[e]??e]:(0,c.A)(e)??e:e):e,P),T=i.z.object({p50:(0,o.$)().nullish().openapi({description:"Minimum p50 throughput (tokens/sec)"}),p75:(0,o.$)().nullish().openapi({description:"Minimum p75 throughput (tokens/sec)"}),p90:(0,o.$)().nullish().openapi({description:"Minimum p90 throughput (tokens/sec)"}),p99:(0,o.$)().nullish().openapi({description:"Minimum p99 throughput (tokens/sec)"})}).openapi("PercentileThroughputCutoffs",{description:"Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.",example:{p50:100,p90:50}}),M=i.z.object({p50:(0,o.$)().nullish().openapi({description:"Maximum p50 latency (seconds)"}),p75:(0,o.$)().nullish().openapi({description:"Maximum p75 latency (seconds)"}),p90:(0,o.$)().nullish().openapi({description:"Maximum p90 latency (seconds)"}),p99:(0,o.$)().nullish().openapi({description:"Maximum p99 latency (seconds)"})}).openapi("PercentileLatencyCutoffs",{description:"Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.",example:{p50:5,p90:10}}),C=i.z.union([(0,o.$)(),T]).nullish().openapi("PreferredMinThroughput",{description:"Preferred minimum throughput. Can be a number (applies to p50) or an object with percentile-specific cutoffs (p50, p75, p90, p99). All specified cutoffs must be met for an endpoint to be preferred.",example:100}),O=i.z.union([(0,o.$)(),M]).nullish().openapi("PreferredMaxLatency",{description:"Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs (p50, p75, p90, p99). All specified cutoffs must be met for an endpoint to be preferred.",example:5}),V=i.z.object({allow_fallbacks:i.z.boolean().nullish().describe(`Whether to allow backup providers to serve requests - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - false: use only the primary/custom provider, and return the upstream error if it's unavailable. `),require_parameters:i.z.boolean().nullish().describe("Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest."),data_collection:v.nullish().openapi({description:"Data collection setting. If no available model provider meets the requirement, your request will return an error.",example:"allow"}).describe("Data collection setting. If no available model provider meets the requirement, your request will return an error.\n- allow: (default) allow providers which store user data non-transiently and may train on it\n\n- deny: use only providers which do not collect user data."),zdr:i.z.boolean().nullish().openapi({description:"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.",example:!0}),enforce_distillable_text:i.z.boolean().nullish().openapi({description:"Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.",example:!0}),order:A.nullish().describe("An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."),only:A.nullish().describe("List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."),ignore:A.nullish().describe("List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."),quantizations:i.z.array(x).nullish().describe("A list of quantization levels to filter the provider by."),sort:S.nullish().describe('The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.'),max_price:d.describe("The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."),preferred_min_throughput:C.openapi({description:"Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.",example:100}).describe("Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."),preferred_max_latency:O.openapi({description:"Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.",example:5}).describe("Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."),options:_.optional()}).openapi("ProviderPreferences",{description:"Provider routing preferences for the request.",example:{allow_fallbacks:!0}});e.s(["f",0,V],793585)},282823,478300,e=>{"use strict";e.i(882844);var t=e.i(635157);let o=t.z.string().max(256).optional().openapi({description:"A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.",example:"session-1234"});e.s(["w",0,"x-session-id","T",0,256,"p",0,o],282823);let i=t.z.object({trace_id:t.z.string().optional(),trace_name:t.z.string().optional(),span_name:t.z.string().optional(),generation_name:t.z.string().optional(),parent_span_id:t.z.string().optional()}).passthrough().openapi("TraceConfig",{example:{trace_id:"trace-abc123",trace_name:"my-app-trace"}}).optional().describe("Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.");e.s(["f",0,i],478300)},276429,996116,980923,571639,66237,e=>{"use strict";e.i(882844);var t=e.i(635157);e.s(["T",0,40,"G",0,"sess_"],996116),e.s(["X",0,40,"P",0,16384],980923);let o=RegExp("^or_file_[0-9A-Za-z]+$");new TextEncoder;let i=t.z.enum(["copied","preexisting"]),a=t.z.object({fileId:t.z.string().regex(o),filename:t.z.string().min(1).max(255)}),n=t.z.array(a).max(20),r=a.extend({copyOutcome:i});t.z.array(r).max(20),e.s(["$",0,20,"X",0,n],571639);let s=/^[\w-]+$/;e.s(["f",0,s],66237);let l=t.z.array(t.z.string().min(1)).max(20).optional().openapi("ContainerFileIds",{description:"Workspace file ids (or_file_…) to attach into the container before the first command runs. Each file is copied to the container home as a writable copy named {last 8 characters of the file id}-{base filename} (a file stored as data/report.csv with id or_file_…NR6q4V8w attaches to ~/NR6q4V8w-report.csv), so same-named files never collide; the source document is never modified. Unknown, foreign, or malformed ids fail the request with a 400 before any command executes. Max 20 ids.",example:["or_file_011CNha8iCJcU1wXNR6q4V8w"]}),p=t.z.union([t.z.object({type:t.z.literal("disabled").openapi({description:"No outbound internet access."})}),t.z.object({type:t.z.literal("allowlist").openapi({description:"Outbound access restricted to the listed domains."}),allowed_domains:t.z.array(t.z.string().min(1).max(253).regex(/^(?![-.])(?!.*[-.]$)(?!.*(?:\.\.|\.-|-\.))(?!.*[^.]{64})[a-z0-9*.-]+$/,"Must be a lowercase hostname or * glob pattern (no scheme, path, or port)")).min(1).max(50).openapi({description:"Hostnames the container may reach over ports 80/443 (max 50). Entries are lowercase hostnames or glob patterns where * matches any run of characters (e.g. *.example.com). An exact hostname does not cover its subdomains — use a glob or list each hostname. pip needs both pypi.org and files.pythonhosted.org (or *.pythonhosted.org).",example:["pypi.org","files.pythonhosted.org"]})})]).openapi("ContainerNetworkPolicy",{description:'Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending a different policy to a warm container fails the request with a 409. Omitted: defaults to "disabled" (no outbound internet). For unrestricted egress, use an allowlist of ["*"].',example:{type:"allowlist",allowed_domains:["pypi.org","files.pythonhosted.org"]}}),d=t.z.object({type:t.z.literal("container_reference"),network_policy:p.optional(),container_id:t.z.string().min(1).max(40).regex(s).openapi({description:"Canonical container id to reuse (max 40 characters, letters/digits/underscores/hyphens). Any container_id previously returned by a bash or shell tool result works here and reattaches to the same container and files — including session-derived ids (sess_...) and generation-derived ids (gen_...). Note that a session-derived id is always sess_ + the sanitized session key, which is not necessarily the raw session id you sent. Using the same container_id from both the bash and shell tools shares the same files, with last-write-wins when both flush concurrently. A fresh name creates a new persistent container. Containers are always scoped to your account and workspace.",example:"sess_abc123"}),file_ids:l}).openapi("ContainerReferenceEnvironment",{description:"Reference to a container by its canonical id — a previously returned container_id or a fresh name to create a persistent container.",example:{type:"container_reference",container_id:"sess_abc123"}}),u=t.z.object({type:t.z.literal("container_auto"),network_policy:p.optional(),file_ids:l}).openapi("ContainerAutoEnvironment",{description:"An OpenRouter-managed, auto-provisioned ephemeral container.",example:{type:"container_auto"}});e.s(["$",0,u,"I",0,d],276429)},69474,e=>{"use strict";e.i(882844);var t=e.i(635157);let o={timezone:t.z.string().optional().openapi({description:'IANA timezone name (e.g. "America/New_York"). Defaults to UTC.',example:"America/New_York"})},i=t.z.object(o).openapi("DatetimeServerToolConfig",{description:"Configuration for the openrouter:datetime server tool",example:{timezone:"America/New_York"}});e.s(["q",0,o,"t",0,i])},24200,e=>{"use strict";e.i(882844);var t=e.i(635157),o=e.i(337004);let i={model:t.z.string().optional().openapi({description:'Which image generation model to use (e.g. "openai/gpt-image-2.6-flare"). Defaults to "openai/gpt-image-2.6-flare".',example:"openai/gpt-image-2.6-flare"})},a=t.z.object(i).catchall(o.T).openapi("ImageGenerationServerToolConfig",{description:"Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field.",example:{model:"openai/gpt-image-2.6-flare",quality:"high",aspect_ratio:"16:9"}});e.s(["Y",0,i,"K",0,a])},463826,e=>{"use strict";e.s(["J",0,100,"S",0,200,"T",0,5,"F",0,50,"W",0,1e5,"i",0,25])},453110,e=>{"use strict";var t=e.i(882844),o=e.i(635157);let i={max_results:(0,t.D)().min(1).max(20).optional().openapi({description:"Maximum number of models to return. Defaults to 5, max 20.",example:5})},a=o.z.object(i).openapi("SearchModelsServerToolConfig",{description:"Configuration for the openrouter:experimental__search_models server tool",example:{max_results:5}});e.s(["b",0,20,"Q",0,1,"F",0,i,"t",0,a])},114014,e=>{"use strict";var t=e.i(882844),o=e.i(635157),i=e.i(191545),a=e.i(980923),n=e.i(571639),r=e.i(276429),s=e.i(463826);let l=["auto","openrouter"],p=o.z.enum(l).optional().openapi("ShellServerToolEngine",{description:'Which shell engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) keeps the provider\'s native hosted shell when available (OpenAI); on other providers the call is routed to the OpenRouter sandbox.',example:"openrouter"}),d=o.z.discriminatedUnion("type",[r.$,r.I]).openapi("ShellServerToolEnvironment",{description:'Server-side execution environment for the shell tool. Only container-backed environments are supported; "local" shells are not.',example:{type:"container_auto"}}),u=o.z.object({environment:d.optional(),engine:p}).openapi("ShellServerToolConfig",{description:"Configuration for the openrouter:shell server tool",example:{engine:"openrouter",environment:{type:"container_auto"}}});o.z.object({commands:o.z.array(o.z.string().max(a.P)).min(1).max(s.J).openapi({description:"Shell commands to run, each in its own invocation, in order.",example:["ls -la","cat package.json"]}),timeout_ms:(0,t.D)().positive().optional().openapi({description:"Maximum execution time in milliseconds applied to each command.",example:3e4}),max_output_length:(0,t.D)().positive().optional().openapi({description:"Maximum characters returned per stream — stdout and stderr are each capped to this value, per command.",example:16384})}).openapi("ShellServerToolAction",{description:"Shell command batch to execute.",example:{commands:["echo hello"]}}),o.z.object({apiToolParams:u,_attachFiles:n.X.optional(),_shellExecCompleted:o.z.boolean().optional()});let c=o.z.discriminatedUnion("type",[o.z.object({type:o.z.literal("exit"),exit_code:(0,t.D)()}),o.z.object({type:o.z.literal("timeout")})]),m=o.z.object({stdout:o.z.string(),stderr:o.z.string(),outcome:c});o.z.object({output:o.z.array(m),files:o.z.array(i.f).optional(),container_id:o.z.string().optional()}),e.s(["F",0,l,"k",0,u,"S",0,m,"g",0,c])},37956,434648,e=>{"use strict";var t=e.i(882844),o=e.i(635157),i=e.i(491301),a=e.i(834336);let n=o.z.string().optional().openapi({description:"Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model.",example:"~anthropic/claude-haiku-latest"}),r=o.z.looseObject({type:o.z.string().refine(e=>"function"!==e,{message:"Function tools are not supported in the subagent's nested `tools`; only OpenRouter server tools (e.g. `openrouter:web_search`) can be nested."}),parameters:o.z.record(o.z.string(),o.z.unknown()).optional()}).openapi("SubagentNestedTool",{description:"A tool made available to the subagent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the worker has no way to execute them. The subagent tool may not list itself.",example:{type:"openrouter:web_search"}}),s=o.z.array(r).optional().openapi({description:"Tools the subagent may use while executing a delegated task. The subagent runs as an agentic sub-agent over these tools, then returns its outcome. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the subagent tool itself."}),l=o.z.string().optional().openapi({description:"System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own.",example:"You are a fast, focused worker. Complete the task exactly as described."}),p=o.z.number().int().min(1).max(25).optional().openapi({description:"Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Forwarded to the subagent call as `max_tool_calls`.",example:5}),d=(0,t.D)().min(1).optional().openapi({description:"Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies.",example:2048}),u=o.z.object({effort:a.P.optional().openapi({description:"Reasoning effort level for the subagent call."}),max_tokens:(0,t.D)().min(1).optional().openapi({description:"Maximum number of reasoning tokens the subagent may use. Forwarded to the subagent call as `reasoning.max_tokens`."})}).openapi("SubagentReasoning",{description:"Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking.",example:{effort:"low"}}).optional(),c=(0,t.$)().min(0).max(2).optional().openapi({description:"Sampling temperature forwarded to the subagent call. When omitted, the provider's default applies.",example:.7}),m=i.A.openapi({description:"Optional name for this subagent. The model sees one tool per named subagent (and one default for an unnamed entry). Names must be unique across subagent entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars.",example:"summarizer"}),h=o.z.boolean().optional().openapi({description:"EXPERIMENTAL — subject to change without notice. When true, the subagent inherits every client function defined in the request's top-level `tools` list. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`.",example:!0}),f=o.z.array(o.z.string().trim().min(1)).optional().openapi({description:"EXPERIMENTAL — subject to change without notice. Names of the top-level function tools that the subagent will inherit. Any tool that matches by name will be copied fully into the tools array of the subagent. When `inherit_functions` is `true`, this list does nothing, because every client function will be inherited by default. Names are trimmed before validation, so a whitespace-only name is rejected with a `400`. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`.",example:["lookup_order"]}),g={name:m.optional(),model:n,tools:s,inherit_functions:h,inherited_function_names:f,instructions:l,max_tool_calls:p,max_completion_tokens:d,reasoning:u,temperature:c},b=o.z.object(g).openapi("SubagentServerToolConfig",{description:"Configuration for one openrouter:subagent server tool entry.",example:{name:"summarizer",model:"~anthropic/claude-haiku-latest"}});e.s(["$",0,25,"E",0,b],37956),e.i(647204),e.i(427150);var y=e.i(337004);let _=["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],v=o.z.enum(_);(0,t.j)(v);let x=["1K","2K"],w=o.z.string().transform(e=>e.toUpperCase()).pipe(o.z.enum(x)),z=o.z.string().transform(e=>e.toLowerCase()).pipe(o.z.enum(y.J));o.z.object({aspect_ratio:v.optional(),image_size:w.optional(),background:z.optional()}).passthrough();let k=[...y.g,"xhigh","max"],S=["aspect_ratio","model","image_size","quality","size","background","output_format","output_compression","moderation"];function P(e){return S.some(t=>t===e)}let A={match:e=>"openai/gpt-5.2-image-1.5"===e||e.includes("gpt-image-1")||e.includes("gpt-5-image"),fields:["model","quality","aspect_ratio","size","background","output_format","output_compression","moderation"],optionValues:{aspect_ratio:_,quality:y.g,size:["1024x1024","1024x1536","1536x1024"],background:y.J,output_format:y._,moderation:y.W}},T=[{match:e=>e.includes("gpt-image-2.5")||e.includes("gpt-image-2.6"),fields:["model","quality","aspect_ratio","size","background","output_format","output_compression"],optionValues:{aspect_ratio:_,quality:k,size:["1024x1024","1024x1536","1536x1024"],background:y.J,output_format:y._}},{match:e=>e.includes("gpt-image-2")||e.includes("image-2"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:_,image_size:x}},A,{match:e=>e.includes("gemini-3.1-flash-image-preview"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:[..._,"1:4","1:8","4:1","8:1"],image_size:["0.5K","1K","2K","4K"]}},{match:e=>e.includes("gemini-3-pro-image-preview"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:_,image_size:["1K","2K","4K"]}},{match:e=>e.startsWith("google/")&&e.includes("image"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:_,image_size:["1K","2K"]}},{match:e=>e.includes("seedream"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:_,image_size:["2K","4K"]}},{match:e=>e.startsWith("sourceful/")&&e.includes("riverflow-v2")&&e.includes("pro"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:_,image_size:["1K","2K","4K"]}},{match:e=>e.startsWith("sourceful/")&&e.includes("riverflow-v2"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:_,image_size:["1K","2K"]}}],M=D(["model","aspect_ratio"],{aspect_ratio:_}),C={aspect_ratio:[...new Set([..._,"1:4","1:8","4:1","8:1"])],image_size:[...new Set(["0.5K","1K","2K","4K"])],quality:k,size:["1024x1024","1024x1536","1536x1024"],background:y.J,output_format:y._,moderation:y.W};function O(e){let t=function(e){if("string"!=typeof e)return;let t=e.trim();if(0!==t.length)return t.toLowerCase()}(e);if(void 0===t)return D(A.fields,A.optionValues);let o=T.find(e=>e.match(t));return o?D(o.fields,o.optionValues):M}function V(e,t){return O(t).optionValuesByField[e]}function j(e,t){for(let o of O(t).supportedFields)if(o===e)return!0;return!1}function D(e,t){return{supportedFields:new Set(e),optionValuesByField:t}}e.s(["I",0,function(e){return C[e]},"$",0,V,"y",0,j,"t",0,function(e,t,o){if(!P(e)||!j(e,o))return!1;let i=V(e,o);return void 0===i||"string"!=typeof t||i.some(e=>e===t)},"H",0,P],434648)},948913,e=>{"use strict";e.i(882844);var t=e.i(635157),o=e.i(898820);t.z.enum([o.Q.Responses,o.Q.ChatCompletions,o.Q.AnthropicMessages]),e.s(["m",0,"openrouter:","d",0,{OpenRouterAdvisor:"openrouter:advisor",OpenRouterApplyPatch:"openrouter:apply_patch",OpenRouterBash:"openrouter:bash",OpenRouterDatetime:"openrouter:datetime",OpenRouterFiles:"openrouter:files",OpenRouterFusion:"openrouter:fusion",OpenRouterImageGeneration:"openrouter:image_generation",OpenRouterMcp:"openrouter:mcp",OpenRouterSearchModels:"openrouter:experimental__search_models",OpenRouterShell:"openrouter:shell",OpenRouterSubagent:"openrouter:subagent",OpenRouterToolSearch:"openrouter:tool_search",OpenRouterWebFetch:"openrouter:web_fetch",OpenRouterWebSearch:"openrouter:web_search"},"N",0,{Provider:"provider",OpenRouter:"openrouter",Client:"client"}])},880315,e=>{"use strict";var t,o=((t={}).Model="model",t.None="none",t);e.s(["f",()=>o])},264678,e=>{"use strict";var t=e.i(348563),o=e.i(861907),i=e.i(647204),a=e.i(882844),n=e.i(485913),r=e.i(895185),s=e.i(743245),l=e.i(834336),p=e.i(337004),d=e.i(463826),u=e.i(453110),c=e.i(37956),m=e.i(685017),h=e.i(208218),f=e.i(28158),g=e.i(434648);let b={engine:"auto",mode:void 0,search_context_size:s.f.Medium,max_characters:void 0,max_results:void 0,max_uses:void 0,max_total_results:void 0,allowed_domains:[],excluded_domains:[],user_location:void 0},y={engine:"auto",max_uses:void 0,max_content_tokens:void 0,allowed_domains:[],blocked_domains:[]};function _(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e&&e.length>0):[]}function v(e,t){if("number"==typeof e&&Number.isInteger(e)&&!(et.max?t.max:e}function x(e,t){if(!("number"!=typeof e||Number.isNaN(e))&&!(et.max))return e}function w(e){return h.m.some(t=>t===e)}let z=(0,a.j)(p.T),k=(0,a.j)(r.f),S="openrouter";function P(e){let t=Array.isArray(e.analysis_models)?e.analysis_models.filter(e=>"string"==typeof e&&e.length>0).slice(0,n.Z):[],o=e.model;return{analysis_models:t.length>0?t:void 0,model:"string"==typeof o&&o.length>0?o:void 0,max_tool_calls:v(e.max_tool_calls,{min:1,max:n.h})}}function A(e){let t="string"==typeof e.effort?(0,a.C)(l.P,e.effort):void 0,o=t&&(0,i.C)(t)?t.data:void 0,n=v(e.max_tokens,{min:1});if(o||n)return{effort:o,max_tokens:n}}let T=["model","tools","instructions","max_tool_calls","max_completion_tokens","reasoning","temperature"];e.s(["V",0,S,"e",0,y,"N",0,b,"l",0,function(e,t){return(0,o.d)(e)&&"boolean"==typeof e.enabled?e.enabled:t},"g",0,function(e){return(0,o.d)(e)?(0,o.d)(e.parameters)?e.parameters:e:{}},"U",0,w,"p",0,function(e){return{...e,aspectRatio:void 0,outputFormat:void 0,outputCompression:void 0,aspect_ratio:e.aspect_ratio??(null===e.aspectRatio?void 0:e.aspectRatio),output_format:e.output_format??e.outputFormat,output_compression:e.output_compression??e.outputCompression}},"r",0,function(e){return"subagents"in e||!T.some(t=>void 0!==e[t])?e:{subagents:[e]}},"Z",0,function(e){return{...e,max_uses:e.max_uses??e.maxUses,max_content_tokens:e.max_content_tokens??e.maxContentTokens,allowed_domains:e.allowed_domains??e.allowedDomains,blocked_domains:e.blocked_domains??e.blockedDomains}},"C",0,function(e){let t=(0,o.d)(e.userLocation)?e.userLocation:e.user_location;return{...e,search_context_size:e.search_context_size??e.searchContextSize,max_results:e.max_results??e.maxResults,max_uses:e.max_uses??e.maxUses,max_total_results:e.max_total_results??e.maxTotalResults,allowed_domains:e.allowed_domains??e.allowedDomains,excluded_domains:e.excluded_domains??e.excludedDomains,user_location:t}},"f",0,function(e){return{advisors:function(e){if(!Array.isArray(e))return;let t=e.flatMap(e=>{let t,i;return(0,o.d)(e)&&(void 0===e.name||"string"==typeof e.name)?[{name:"string"==typeof e.name?e.name:void 0,...(t=e.model,i=e.instructions,{model:"string"==typeof t&&t.length>0?t:void 0,instructions:"string"==typeof i&&i.trim().length>0?i:void 0,forward_transcript:"boolean"==typeof e.forward_transcript?e.forward_transcript:void 0,stream:"boolean"==typeof e.stream?e.stream:void 0,max_completion_tokens:v(e.max_completion_tokens,{min:1}),reasoning:(0,o.d)(e.reasoning)?A(e.reasoning):void 0,temperature:x(e.temperature,{min:0,max:2})})}]:[]});return t.length>0?t:void 0}(e.advisors)}},"W",0,function(e){return{timezone:"string"==typeof e.timezone&&e.timezone.length>0?e.timezone:void 0}},"I",0,function(e){return{...P(e),max_completion_tokens:v(e.max_completion_tokens,{min:1}),reasoning:(0,o.d)(e.reasoning)?A(e.reasoning):void 0,temperature:x(e.temperature,{min:0,max:2})}},"a",0,P,"Q",0,function(e){return Object.fromEntries(Object.entries(e).filter(e=>{let[t,o]=e;return"model"===t?"string"==typeof o&&o.length>0:(0,g.H)(t)&&z(o)}))},"u",0,function(e){return{max_results:v(e.max_results,{min:u.Q,max:u.b})}},"t",0,function(e){return{engine:S}},"R",0,function(e){return{subagents:function(e){if(!Array.isArray(e))return;let t=e.flatMap(e=>{let t,i,a;return(0,o.d)(e)&&(void 0===e.name||"string"==typeof e.name)?[{name:"string"==typeof e.name?e.name:void 0,...(t=e.model,i=e.instructions,a=Array.isArray(e.tools)?e.tools.filter(e=>(0,o.d)(e)&&"string"==typeof e.type):void 0,{model:"string"==typeof t&&t.length>0?t:void 0,tools:a&&a.length>0?a:void 0,instructions:"string"==typeof i&&i.trim().length>0?i:void 0,max_tool_calls:v(e.max_tool_calls,{min:1,max:c.$}),max_completion_tokens:v(e.max_completion_tokens,{min:1}),reasoning:(0,o.d)(e.reasoning)?A(e.reasoning):void 0,temperature:x(e.temperature,{min:0,max:2})})}]:[]});return t.length>0?t:void 0}(e.subagents)}},"j",0,function(e){var t;return{engine:"string"==typeof e.engine&&(t=e.engine,m.k.some(e=>e===t))?e.engine:y.engine,max_uses:v(e.max_uses,{min:m.$}),max_content_tokens:v(e.max_content_tokens,{min:m.Q}),allowed_domains:_(e.allowed_domains),blocked_domains:_(e.blocked_domains)}},"S",0,function(e){var i;let a="string"==typeof e.engine&&w(e.engine)?e.engine:b.engine,n="string"==typeof e.search_context_size&&(i=e.search_context_size,h.E.some(e=>e===i))?e.search_context_size:b.search_context_size,r=k(e.mode)?e.mode:b.mode;return{engine:a,mode:void 0===r?void 0:(0,t.M)((0,f.f)(a),r),search_context_size:n,max_characters:v(e.max_characters,{min:h.u,max:d.W}),max_results:v(e.max_results,{min:h.H,max:d.i}),max_uses:v(e.max_uses,{min:h.y}),max_total_results:v(e.max_total_results,{min:h.F}),allowed_domains:_(e.allowed_domains),excluded_domains:_(e.excluded_domains),user_location:function(e){if(!(0,o.d)(e))return;let t={type:"approximate",city:"string"==typeof e.city&&e.city.length>0?e.city:void 0,region:"string"==typeof e.region&&e.region.length>0?e.region:void 0,country:"string"==typeof e.country&&e.country.length>0?e.country:void 0,timezone:"string"==typeof e.timezone&&e.timezone.length>0?e.timezone:void 0};if(t.city||t.region||t.country||t.timezone)return t}(e.user_location)}}])},391927,e=>{"use strict";var t=e.i(625025);function o(e){let o="string"==typeof e.name?e.name.trim():"";return(0,t.S)({name:o||void 0,model:e.model||void 0,instructions:e.instructions||void 0,forward_transcript:e.forward_transcript,stream:e.stream,max_completion_tokens:e.max_completion_tokens,reasoning:e.reasoning,temperature:e.temperature})}function i(e){let o="string"==typeof e.name?e.name.trim():"";return(0,t.S)({name:o||void 0,model:e.model||void 0,instructions:e.instructions||void 0,tools:Array.isArray(e.tools)&&e.tools.length>0?e.tools:void 0,max_tool_calls:e.max_tool_calls,max_completion_tokens:e.max_completion_tokens,reasoning:e.reasoning,temperature:e.temperature})}e.s(["C",0,function(e){return Object.keys(o(e)).length>0},"P",0,function(e){return Object.keys(i(e)).length>0},"D",0,function(e){return e?e.flatMap(e=>{let t=o(e);return 0===Object.keys(t).length?[]:[{type:"openrouter:advisor",parameters:t}]}):[]},"r",0,function(e){return e?e.flatMap(e=>{let t=i(e);return 0===Object.keys(t).length?[]:[{type:"openrouter:subagent",parameters:t}]}):[]}])},604638,e=>{"use strict";var t=e.i(348563),o=e.i(861907);e.i(882844);var i=e.i(635157),a=e.i(35554),n=e.i(771271),r=e.i(337004),s=e.i(69474),l=e.i(24200),p=e.i(453110),d=e.i(114014),u=e.i(685017),c=e.i(208218),m=e.i(28158),h=e.i(434648),f=e.i(264678);let g={advisors:i.z.array(i.z.looseObject({name:i.z.string().optional()})).optional()},b={subagents:i.z.array(i.z.looseObject({name:i.z.string().optional()})).optional()},y={engine:i.z.enum(d.F).optional()},_={exa:["engine","search_context_size","max_characters","max_results","max_uses","max_total_results","allowed_domains","excluded_domains"],firecrawl:["engine","max_results","max_uses","max_total_results","allowed_domains","excluded_domains"],parallel:["engine","search_context_size","max_characters","max_results","max_uses","max_total_results","allowed_domains","excluded_domains"],perplexity:["engine","search_context_size","max_characters","max_results","max_uses","max_total_results","allowed_domains","excluded_domains"]},v={[n.R.Anthropic]:["engine","max_uses","allowed_domains","excluded_domains","user_location"],[n.R.ClaudeOnAws]:["engine","max_uses","allowed_domains","excluded_domains","user_location"],[n.R.OpenAI]:["engine","allowed_domains"],[n.R.Azure]:["engine","allowed_domains"],[n.R.XAI]:["engine","allowed_domains","excluded_domains"],[n.R.Google]:["engine"],[n.R.GoogleAIStudio]:["engine"]};function x(e,o,i){var a,r;let s,l=(a=o.engine,r=i,"auto"===(s=a??"auto")||"native"===s?r?.supportsNativeWebSearch===!0&&void 0!==r.providerName?{kind:"native",providerName:r.providerName}:{kind:"sdk",engine:(0,m.f)(s)}:{kind:"sdk",engine:s});return"sdk"===l.kind?"mode"===e?void 0!==(0,t.J)(l.engine):_[l.engine].some(t=>t===e):(((0,n.Z)(l.providerName)?v[l.providerName]:void 0)??["engine"]).some(t=>t===e)}let w={...r.s,...l.Y},z={webSearch:{id:"webSearch",apiType:"openrouter:web_search",schemaShape:c.e,defaultParameters:f.N,enabledByDefault:!0,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:f.S,migrateLegacyParameters:f.C},webFetch:{id:"webFetch",apiType:"openrouter:web_fetch",schemaShape:u.K,defaultParameters:f.e,enabledByDefault:!0,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:f.j,migrateLegacyParameters:f.Z},imageGeneration:{id:"imageGeneration",apiType:"openrouter:image_generation",schemaShape:w,defaultParameters:{},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:f.Q,migrateLegacyParameters:f.p},datetime:{id:"datetime",apiType:"openrouter:datetime",schemaShape:s.q,defaultParameters:{timezone:void 0},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!0,sanitizeParameters:f.W},searchModels:{id:"searchModels",apiType:"openrouter:experimental__search_models",schemaShape:p.F,defaultParameters:{max_results:void 0},enabledByDefault:!1,isVisibleInChatroom:!1,isAvailableForFreeModels:!1,sanitizeParameters:f.u},fusion:{id:"fusion",apiType:"openrouter:fusion",schemaShape:a.y,defaultParameters:{analysis_models:void 0,model:void 0,max_tool_calls:void 0,max_completion_tokens:void 0,reasoning:void 0,temperature:void 0},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:f.I},advisor:{id:"advisor",apiType:"openrouter:advisor",schemaShape:g,defaultParameters:{advisors:void 0},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!0,sanitizeParameters:f.f},subagent:{id:"subagent",apiType:"openrouter:subagent",schemaShape:b,defaultParameters:{subagents:void 0},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!0,sanitizeParameters:f.R,migrateLegacyParameters:f.r},shell:{id:"shell",apiType:"openrouter:shell",schemaShape:y,defaultParameters:{engine:f.V},serializationBaseline:{engine:"auto"},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:f.t}},k=[z.datetime,z.webSearch,z.webFetch,z.imageGeneration,z.searchModels,z.fusion,z.advisor,z.subagent,z.shell],S={webSearch:A(z.webSearch),webFetch:A(z.webFetch),imageGeneration:A(z.imageGeneration),datetime:A(z.datetime),searchModels:A(z.searchModels),fusion:A(z.fusion),advisor:A(z.advisor),subagent:A(z.subagent),shell:A(z.shell)};function P(e,t){switch(t){case"webSearch":return T(z.webSearch,e.webSearch);case"webFetch":return T(z.webFetch,e.webFetch);case"imageGeneration":return T(z.imageGeneration,e.imageGeneration);case"datetime":return T(z.datetime,e.datetime);case"searchModels":return T(z.searchModels,e.searchModels);case"fusion":return T(z.fusion,e.fusion);case"advisor":return T(z.advisor,e.advisor);case"subagent":return T(z.subagent,e.subagent);case"shell":return T(z.shell,e.shell)}return S.datetime}function A(e){return{enabled:e.enabledByDefault,parameters:e.defaultParameters}}function T(e,t){let o=(0,f.g)(t),i=e.migrateLegacyParameters?e.migrateLegacyParameters(o):o;return{enabled:(0,f.l)(t,e.enabledByDefault),parameters:e.sanitizeParameters(i)}}e.s(["m",0,g,"_",0,S,"q",0,z,"r",0,k,"Y",0,b,"f",0,function({toolId:e,fieldKey:t,parameters:o,capabilityContext:i}){switch(e){case"imageGeneration":return(0,h.y)(t,o.model);case"webSearch":{let e=o.engine;return x(t,{engine:"string"==typeof e&&(0,f.U)(e)?e:void 0},i)}case"webFetch":case"datetime":case"searchModels":case"fusion":case"advisor":case"subagent":case"shell":return!0;default:return e}},"$",0,x,"F",0,P,"n",0,function(e){let t=(0,o.d)(e.tools)?e.tools:{};return{webSearch:P(t,"webSearch"),webFetch:P(t,"webFetch"),imageGeneration:P(t,"imageGeneration"),datetime:P(t,"datetime"),searchModels:P(t,"searchModels"),fusion:P(t,"fusion"),advisor:P(t,"advisor"),subagent:P(t,"subagent"),shell:P(t,"shell")}},"V",0,function(e){let t=(0,o.d)(e.tools)?e.tools:void 0;if(!t||!(0,o.d)(t.bash))return e;let i=t.bash,{bash:a,...n}=t;return{...e,tools:{...n,shell:{..."boolean"==typeof i.enabled&&{enabled:i.enabled},parameters:{}}}}}])},434273,e=>{"use strict";var t=e.i(355140);e.s(["f",0,function(e){return`${t.b}${t.l}${e}`}])}]); //# sourceMappingURL=21xdt8e-aoeis.js.map