!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0880a-e62a-7672-8b95-3059e0669e78")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,982679,e=>{"use strict";var t=e.i(82352),o=e.i(284175),n=e.i(204067),i=e.i(796805),r=e.i(54684);let a=i.z.object({type:i.z.literal("image_generation.partial_image").openapi({description:"The event type"}),partial_image_index:(0,n.zInt)().openapi({description:"0-based index indicating which partial image this is in the sequence"}),b64_json:i.z.string().openapi({description:"Base64-encoded partial image data"})}).openapi("ImageGenPartialImageEvent",{description:"Emitted when a partial image becomes available during streaming generation",example:{type:"image_generation.partial_image",partial_image_index:0,b64_json:""}}),l=i.z.object({type:i.z.literal("image_generation.completed").openapi({description:"The event type"}),b64_json:i.z.string().openapi({description:"Base64-encoded final image data"}),media_type:i.z.string().optional().openapi({description:"Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined.",example:"image/png"}),created:(0,n.zInt)().openapi({description:"Unix timestamp (seconds) when the image was generated"}),usage:r.ImageGenerationUsageSchema}).openapi("ImageGenCompletedEvent",{description:"Emitted when generation completes and the final image is available",example:{type:"image_generation.completed",b64_json:"",created:0x68360bb0,usage:{prompt_tokens:0,completion_tokens:4175,total_tokens:4175,cost:.04}}}),s=i.z.object({type:i.z.literal("image_generation.text_chunk").openapi({description:"The event type"}),text:i.z.string().openapi({description:"A text fragment of the image being generated (e.g. partial SVG markup)"}),phase:i.z.enum(["content","reasoning","draft"]).openapi({description:"The generation phase this chunk belongs to. `content` is the renderable output; `reasoning` and `draft` are intermediate provider phases."})}).openapi("ImageGenTextChunkEvent",{description:"Emitted when a text chunk becomes available during streaming generation of text-based formats (e.g. SVG)",example:{type:"image_generation.text_chunk",text:'',phase:"content"}}),c=i.z.object({type:i.z.literal("error").openapi({description:"The event type"}),error:i.z.object({code:i.z.string().nullish().openapi({description:"Provider error code, when supplied"}),message:i.z.string().openapi({description:"Provider error message"}),param:i.z.string().nullish().openapi({description:"Request parameter associated with the error, when supplied"}),type:i.z.string().nullish().openapi({description:"Provider error type, when supplied"})}).openapi({description:"Provider error details"})}).openapi("ImageGenStreamErrorEvent",{description:"Emitted when streaming generation fails after the SSE response starts",example:{type:"error",error:{code:"upstream_error",message:"The upstream provider returned an error",param:null,type:"provider_error"}}});var p=e.i(586404),_=e.i(707283),u=e.i(693697);let d=a.or(s).or(l).or(c),m=o.ImageGenerationRequestSchema.shape;function h(e,t){if(void 0===t)return;let o=(0,n.parseSchema)(e,t);return(0,u.isOk)(o)?o.data:void 0}function z(e){let o=h(m.resolution,e.resolution),n=h(m.aspect_ratio,e.aspectRatio),i=h(m.size,e.size);return(0,p.definedValues)({size:function({size:e,resolution:o,aspectRatio:n}){return void 0===e||void 0!==o?void 0:void 0===n?e:null!==(0,t.parseSizeString)(e)?void 0:e}({size:i,resolution:o,aspectRatio:n}),resolution:o,aspect_ratio:n,quality:h(m.quality,e.quality),background:h(m.background,e.background),output_format:h(m.output_format,e.outputFormat),output_compression:h(m.output_compression,e.outputCompression)})}e.s(["IMAGE_API_ENDPOINT",0,"/api/v1/images","buildImageConfigParams",0,z,"buildImageConfigParamsFromRecord",0,function(e){return(0,_.isRecord)(e)?z({size:e.image_size??e.size,resolution:e.resolution,aspectRatio:e.aspect_ratio,quality:e.quality,background:e.background,outputFormat:e.output_format,outputCompression:e.output_compression}):{}},"extractImageApiErrorMessage",0,function(e){let t="Image generation failed";if(!e)return t;let o=(0,u.wrap)(()=>JSON.parse(e));if((0,u.isErr)(o))return e;let n=o.data;if(!(0,_.isRecord)(n))return t;let i=((0,_.isRecord)(n.error)?n.error.message:void 0)??n.message;if("string"!=typeof i)return t;let r=(0,u.wrap)(()=>JSON.parse(i));if((0,u.isErr)(r))return i;let a=r.data;if((0,_.isRecord)(a)){let e=(0,_.isRecord)(a.error)?a.error.message:void 0;if("string"==typeof e)return e}return i},"parseImageApiStreamPayload",0,function(e){let t=e.trim();if(!t||"[DONE]"===t)return(0,u.ok)(null);let o=(0,u.wrap)(()=>JSON.parse(t));if((0,u.isErr)(o))return(0,u.err)("Invalid image generation stream event");let i=(0,n.parseSchema)(d,o.data);return(0,u.isErr)(i)?(0,u.err)("Invalid image generation stream event"):(0,u.ok)(i.data)}],982679)},82352,e=>{"use strict";e.i(719929),e.i(462904),e.s(["parseSizeString",0,function(e){let t=e.trim().match(/^(\d+)\s*[x×]\s*(\d+)$/i);if(!t?.[1]||!t[2])return null;let o=Number.parseInt(t[1],10),n=Number.parseInt(t[2],10);return o<=0||n<=0?null:{width:o,height:n}}])},180897,e=>{"use strict";var t=e.i(204067),o=e.i(796805),n=e.i(54684);let i=o.z.object({created:(0,t.zInt)().openapi({description:"Unix timestamp (seconds) when the image was generated",example:0x68360bb0}),data:o.z.array(o.z.object({b64_json:o.z.string().openapi({description:"Base64-encoded image bytes"}),media_type:o.z.string().optional().openapi({description:"Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined.",example:"image/png"})})).openapi({description:"Generated images"}),usage:n.ImageGenerationUsageSchema}).openapi("ImageGenerationResponse",{description:"Image generation response",example:{created:0x68360bb0,data:[{b64_json:""}],usage:{prompt_tokens:0,completion_tokens:4175,total_tokens:4175,cost:.04}}});e.s(["ImageGenerationResponseSchema",0,i])},54684,e=>{"use strict";let t=e.i(110116).CompletionResponseUsageSchema.optional().openapi("ImageGenerationUsage",{description:"Token and cost usage for the image generation request, when available",example:{prompt_tokens:0,completion_tokens:4175,total_tokens:4175,cost:.04}});e.s(["ImageGenerationUsageSchema",0,t])},110116,e=>{"use strict";var t=e.i(586404),o=e.i(204067),n=e.i(796805);let i={Fast:"fast",Standard:"standard"},r=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"}),a=n.z.enum(i).openapi("AnthropicSpeed",{example:i.Standard});var l=e.i(704985),s=e.i(81174),c=e.i(800479),p=e.i(317913);let _=n.z.enum(["image/jpeg","image/png","image/gif","image/webp"]).openapi("AnthropicImageMimeType",{example:"image/jpeg"}),u=n.z.object({type:n.z.literal("base64"),media_type:_,data:n.z.string()}).openapi("AnthropicBase64ImageSource",{example:{type:"base64",media_type:"image/jpeg",data:"/9j/4AAQ..."}}),d=n.z.object({type:n.z.literal("url"),url:n.z.string()}).openapi("AnthropicUrlImageSource",{example:{type:"url",url:"https://example.com/image.jpg"}}),m=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..."}}),h=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!"}}),z=n.z.object({type:n.z.literal("url"),url:n.z.string()}).openapi("AnthropicUrlPdfSource",{example:{type:"url",url:"https://example.com/document.pdf"}}),b=n.z.object({type:n.z.literal("file"),file_id:n.z.string()}).openapi("AnthropicFileDocumentSource",{example:{type:"file",file_id:"or_file_011CNha8iCJcU1wXNR6q4V8w"}}),x=n.z.object({enabled:n.z.boolean().optional()}),g=n.z.object({type:n.z.literal("char_location"),cited_text:n.z.string(),document_index:(0,o.zInt)(),document_title:n.z.string().nullable(),start_char_index:(0,o.zInt)(),end_char_index:(0,o.zInt)()}).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}}),y=n.z.object({type:n.z.literal("page_location"),cited_text:n.z.string(),document_index:(0,o.zInt)(),document_title:n.z.string().nullable(),start_page_number:(0,o.zInt)(),end_page_number:(0,o.zInt)()}).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}}),f=n.z.object({type:n.z.literal("content_block_location"),cited_text:n.z.string(),document_index:(0,o.zInt)(),document_title:n.z.string().nullable(),start_block_index:(0,o.zInt)(),end_block_index:(0,o.zInt)()}).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}}),k=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"}}),A=n.z.object({type:n.z.literal("search_result_location"),cited_text:n.z.string(),search_result_index:(0,o.zInt)(),source:n.z.string(),title:n.z.string().nullable(),start_block_index:(0,o.zInt)(),end_block_index:(0,o.zInt)()}).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}}),v=n.z.discriminatedUnion("type",[g,y,f,k,A]),C=n.z.object({type:n.z.literal("text"),text:n.z.string(),citations:n.z.array(v).nullish()}).extend(p.AnthropicCacheControlSchema.shape).openapi("AnthropicTextBlockParam",{example:{type:"text",text:"Hello, world!"}}),j=n.z.object({type:n.z.literal("image"),source:n.z.discriminatedUnion("type",[u,d])}).extend(p.AnthropicCacheControlSchema.shape).openapi("AnthropicImageBlockParam",{example:{type:"image",source:{type:"base64",media_type:"image/jpeg",data:"/9j/4AAQ..."}}}),w=n.z.discriminatedUnion("type",[C,j]),T=n.z.object({type:n.z.literal("content"),content:n.z.union([n.z.string(),n.z.array(w)])}),E=n.z.object({type:n.z.literal("document"),source:n.z.discriminatedUnion("type",[m,h,T,z,b]),citations:x.nullish(),context:n.z.string().nullish(),title:n.z.string().nullish()}).extend(p.AnthropicCacheControlSchema.shape).openapi("AnthropicDocumentBlockParam",{example:{type:"document",source:{type:"text",media_type:"text/plain",data:"Hello, world!"}}}),S=n.z.object({type:n.z.literal("tool_use"),id:n.z.string(),name:n.z.string(),input:n.z.unknown()}).extend(p.AnthropicCacheControlSchema.shape),R=n.z.object({type:n.z.literal("thinking"),thinking:n.z.string(),signature:n.z.string()}),I=n.z.object({type:n.z.literal("redacted_thinking"),data:n.z.string()}),B=n.z.object({type:n.z.literal("server_tool_use"),id:n.z.string(),name:r,input:n.z.unknown()}).extend(p.AnthropicCacheControlSchema.shape),U=n.z.object({type:n.z.literal("server_tool_use"),id:n.z.string(),name:n.z.string(),input:n.z.unknown()}).extend(p.AnthropicCacheControlSchema.shape),q=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"}}),P=n.z.object({type:n.z.literal("search_result"),source:n.z.string(),title:n.z.string(),content:n.z.array(C),citations:x.optional()}).extend(p.AnthropicCacheControlSchema.shape).openapi("AnthropicSearchResultBlockParam",{example:{type:"search_result",source:"example_source",title:"Example Result",content:[{type:"text",text:"Result content"}]}}),O=n.z.object({type:n.z.literal("web_search_tool_result"),tool_use_id:n.z.string(),content:n.z.union([n.z.array(q),n.z.object({type:n.z.literal("web_search_tool_result_error"),error_code:n.z.enum(["invalid_tool_input","unavailable","max_uses_exceeded","too_many_requests","query_too_long"])})])}).extend(p.AnthropicCacheControlSchema.shape),F=n.z.object({type:n.z.literal("tool_reference"),tool_name:n.z.string()}),D=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([C,j,F,P,E]))]).optional(),is_error:n.z.boolean().optional()}).extend(p.AnthropicCacheControlSchema.shape),M=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()})]),N=n.z.object({type:n.z.literal("tool_addition"),tool:M}).extend(p.AnthropicCacheControlSchema.shape).openapi("MessagesToolAdditionBlock",{description:'Loads a previously deferred tool (declared in `tools` with `defer_loading: true`) 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_addition",tool:{type:"tool_reference",name:"get_forecast"}}}),W=n.z.object({type:n.z.literal("tool_removal"),tool:M}).extend(p.AnthropicCacheControlSchema.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"}}}),L=n.z.object({type:n.z.literal("compaction"),content:n.z.string().nullable(),encrypted_content:n.z.string().nullish()}).extend(p.AnthropicCacheControlSchema.shape),G=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"}}}),H=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(l.ContainerFileCitationSchema).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}}]}}}),V=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(l.ContainerFileCitationSchema).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}}}),J=[C,j,E,S,D,R,I,B,O,P],K=n.z.discriminatedUnion("type",[...J]),Q=n.z.discriminatedUnion("type",[C,j,E,S,D,R,I,U,O,P,L,G,N,W,H,V]),Z=n.z.enum(["low","medium","high","xhigh","max"]).openapi("AnthropicOutputEffort",{example:"high"}),Y=n.z.enum(["next_user_message","never"]).openapi("AnthropicSystemClearAt",{example:"next_user_message"}),X=n.z.object({effort:Z.nullish()}).strict().openapi("AnthropicMessageOutputConfig",{example:{effort:"low"}}),$=n.z.object({role:n.z.enum(["user","assistant","system"]),content:n.z.union([n.z.string(),n.z.array(K)])}),ee=n.z.object({role:n.z.enum(["user","assistant","system"]),content:n.z.union([n.z.string(),n.z.array(Q)]),clear_at:Y.nullish(),output_config:X.nullish()}),et=n.z.object({type:n.z.literal("object"),properties:n.z.unknown().nullish(),required:n.z.array(n.z.string()).nullish()}).loose(),eo=n.z.object({name:n.z.string(),description:n.z.string().optional(),input_schema:et,type:n.z.literal("custom").nullish(),defer_loading:n.z.boolean().optional()}).extend(p.AnthropicCacheControlSchema.shape),en=n.z.object({type:n.z.literal("bash_20250124"),name:n.z.literal("bash")}).extend(p.AnthropicCacheControlSchema.shape),ei=n.z.object({type:n.z.literal("text_editor_20250124"),name:n.z.literal("str_replace_editor")}).extend(p.AnthropicCacheControlSchema.shape),er=n.z.object({...c.WebSearchUserLocationSchema.shape}).openapi("AnthropicWebSearchToolUserLocation",{example:{type:"approximate",city:"San Francisco",country:"US",region:"California",timezone:"America/Los_Angeles"}}),ea=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.zInt)().nullish(),user_location:er.nullish()}).extend(p.AnthropicCacheControlSchema.shape).transform(e=>{let o=Array.isArray(e.allowed_domains)&&e.allowed_domains.length>0,n=Array.isArray(e.blocked_domains)&&e.blocked_domains.length>0;return o&&n?((0,s.wLog)("AnthropicWebSearchTool20250305Schema contained both allowed_domains and blocked_domains"),(0,t.omit)(e,["blocked_domains"])):(0,t.definedValues)({...e,blocked_domains:n?e.blocked_domains:void 0,allowed_domains:o?e.allowed_domains:void 0})}),el=n.z.array(n.z.enum(["direct","code_execution_20250825","code_execution_20260120"])).openapi("AnthropicAllowedCallers",{example:["direct"]}),es=n.z.object({type:n.z.literal("web_search_20260209"),name:n.z.literal("web_search"),allowed_callers:el.optional(),allowed_domains:n.z.array(n.z.string()).nullish(),blocked_domains:n.z.array(n.z.string()).nullish(),max_uses:(0,o.zInt)().nullish(),user_location:er.nullish()}).extend(p.AnthropicCacheControlSchema.shape).transform(e=>{let o=Array.isArray(e.allowed_domains)&&e.allowed_domains.length>0,n=Array.isArray(e.blocked_domains)&&e.blocked_domains.length>0;return o&&n?((0,s.wLog)("AnthropicWebSearchTool20260209Schema contained both allowed_domains and blocked_domains"),(0,t.omit)(e,["blocked_domains"])):(0,t.definedValues)({...e,blocked_domains:n?e.blocked_domains:void 0,allowed_domains:o?e.allowed_domains:void 0})});n.z.object({type:n.z.literal("advisor_20260301"),name:n.z.literal("advisor"),model:n.z.string(),allowed_callers:el.optional(),caching:p.AnthropicCacheControlDirectiveSchema.nullish(),defer_loading:n.z.boolean().optional(),max_uses:(0,o.zInt)().optional()}).extend(p.AnthropicCacheControlSchema.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:el.optional(),defer_loading:n.z.boolean().optional(),strict:n.z.boolean().optional()}).extend(p.AnthropicCacheControlSchema.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:el.optional(),defer_loading:n.z.boolean().optional(),strict:n.z.boolean().optional()}).extend(p.AnthropicCacheControlSchema.shape).openapi("AnthropicToolSearchToolRegex");let ec=n.z.discriminatedUnion("type",[eo.extend({type:n.z.literal("custom").optional()}),en,ei,ea,es]),ep=n.z.object({type:n.z.literal("auto"),disable_parallel_tool_use:n.z.boolean().optional()}),e_=n.z.object({type:n.z.literal("any"),disable_parallel_tool_use:n.z.boolean().optional()}),eu=n.z.object({type:n.z.literal("none")}),ed=n.z.object({type:n.z.literal("tool"),name:n.z.string(),disable_parallel_tool_use:n.z.boolean().optional()}),em=n.z.discriminatedUnion("type",[ep,e_,eu,ed]),eh=n.z.enum(["summarized","omitted","updates"]).openapi("AnthropicThinkingDisplay",{example:"summarized"}),ez=n.z.enum(["error","drop_block"]),eb=n.z.object({prefix_mismatch_behavior:ez.nullish(),mismatch_behavior:ez.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"}}),ex=n.z.object({type:n.z.literal("enabled"),budget_tokens:(0,o.zInt)(),display:eh.nullish(),block_binding:eb.nullish()}),eg=n.z.object({type:n.z.literal("disabled")}),ey=n.z.object({type:n.z.literal("adaptive"),display:eh.nullish(),block_binding:eb.nullish()}),ef=n.z.discriminatedUnion("type",[ex,eg,ey]),ek=n.z.object({user_id:n.z.string().nullish()}),eA=n.z.object({type:n.z.literal("json_schema"),schema:n.z.record(n.z.string(),n.z.unknown())}),ev=n.z.object({effort:Z.nullish(),format:eA.nullish()}),eC=n.z.object({type:n.z.literal("input_tokens"),value:(0,o.zInt)()}).openapi("AnthropicInputTokensTrigger",{example:{type:"input_tokens",value:1e5}}),ej=eC.extend({value:(0,o.zInt)().min(5e4,{message:"trigger.value must be at least 50000"})}),ew=n.z.object({type:n.z.literal("tool_uses"),value:(0,o.zInt)()}).openapi("AnthropicToolUsesTrigger",{example:{type:"tool_uses",value:10}}),eT=n.z.object({type:n.z.literal("input_tokens"),value:(0,o.zInt)()}).openapi("AnthropicInputTokensClearAtLeast",{example:{type:"input_tokens",value:5e4}}),eE=n.z.object({type:n.z.literal("thinking_turns"),value:(0,o.zInt)()}).openapi("AnthropicThinkingTurns",{example:{type:"thinking_turns",value:3}}),eS=n.z.object({type:n.z.literal("all")}),eR=n.z.object({type:n.z.literal("tool_uses"),value:(0,o.zInt)()}).openapi("AnthropicToolUsesKeep",{example:{type:"tool_uses",value:5}}),eI=n.z.object({type:n.z.literal("clear_tool_uses_20250919"),clear_at_least:eT.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:eR.optional(),trigger:n.z.discriminatedUnion("type",[eC,ew]).optional()}),eB=n.z.object({type:n.z.literal("clear_thinking_20251015"),keep:n.z.union([eE,eS,n.z.literal("all")]).optional()}),eU=n.z.object({type:n.z.literal("compact_20260112"),instructions:n.z.string().nullish(),pause_after_compaction:n.z.boolean().optional(),trigger:ej.nullish()}),eq=n.z.discriminatedUnion("type",[eI,eB,eU]),eP=n.z.object({edits:n.z.array(eq).optional()}),eO={model:n.z.string(),max_tokens:(0,o.zInt)(),system:n.z.union([n.z.string(),n.z.array(C)]).optional(),metadata:ek.optional(),stop_sequences:n.z.array(n.z.string()).optional(),temperature:(0,o.zDouble)().optional(),top_p:(0,o.zDouble)().optional(),top_k:(0,o.zInt)().optional(),tools:n.z.array(ec).optional(),tool_choice:em.optional(),thinking:ef.optional(),service_tier:n.z.string().optional(),output_config:ev.optional(),cache_control:p.AnthropicCacheControlDirectiveSchema.optional()},eF=n.z.object(eO).extend({messages:n.z.array(ee)}).extend({stream:n.z.boolean().optional(),context_management:eP.nullish()}),eD=n.z.object({...eO,messages:n.z.array($)});eF.extend({stream:n.z.literal(!1).optional()}),eD.extend({stream:n.z.literal(!1).optional()}),eF.extend({stream:n.z.literal(!0)}),eD.extend({stream:n.z.literal(!0)});let eM=n.z.object({type:n.z.literal("char_location"),cited_text:n.z.string(),document_index:(0,o.zInt)(),document_title:n.z.string().nullable(),start_char_index:(0,o.zInt)(),end_char_index:(0,o.zInt)(),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}}),eN=n.z.object({type:n.z.literal("page_location"),cited_text:n.z.string(),document_index:(0,o.zInt)(),document_title:n.z.string().nullable(),start_page_number:(0,o.zInt)(),end_page_number:(0,o.zInt)(),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}}),eW=n.z.object({type:n.z.literal("content_block_location"),cited_text:n.z.string(),document_index:(0,o.zInt)(),document_title:n.z.string().nullable(),start_block_index:(0,o.zInt)(),end_block_index:(0,o.zInt)(),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}}),eL=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"}}),eG=n.z.object({type:n.z.literal("search_result_location"),cited_text:n.z.string(),search_result_index:(0,o.zInt)(),source:n.z.string(),title:n.z.string().nullable(),start_block_index:(0,o.zInt)(),end_block_index:(0,o.zInt)()}).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}}),eH=n.z.discriminatedUnion("type",[eM,eN,eW,eL,eG]).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"}}}),eV=n.z.object({type:n.z.literal("text"),text:n.z.string(),citations:n.z.array(eH).nullable()}).openapi("AnthropicTextBlock",{example:{type:"text",text:"Hello, world!",citations:null}}),eJ=n.z.object({type:n.z.literal("direct")}).openapi("AnthropicDirectCaller",{example:{type:"direct"}}),eK=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"}}),eQ=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"}}),eZ=n.z.discriminatedUnion("type",[eJ,eK,eQ]).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"}}}),eY=n.z.object({type:n.z.literal("tool_use"),id:n.z.string(),caller:eZ,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"}}}),eX=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"}}),e$=n.z.object({type:n.z.literal("redacted_thinking"),data:n.z.string()}).openapi("AnthropicRedactedThinkingBlock",{example:{type:"redacted_thinking",data:"cmVkYWN0ZWQ="}}),e0=n.z.object({type:n.z.literal("server_tool_use"),id:n.z.string(),caller:eZ,name:r,input:n.z.unknown()}).openapi("AnthropicServerToolUseBlock",{example:{type:"server_tool_use",id:"srvtoolu_01abc",caller:{type:"direct"},name:"web_search",input:{query:"latest news"}}}),e1=eZ.nullable().openapi("ORAnthropicNullableCaller"),e2=n.z.object({type:n.z.literal("server_tool_use"),id:n.z.string(),caller:e1.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:{}}}),e5=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"}}),e4=n.z.object({type:n.z.literal("web_search_tool_result_error"),error_code:n.z.enum(["invalid_tool_input","unavailable","max_uses_exceeded","too_many_requests","query_too_long","request_too_large"])}).openapi("AnthropicWebSearchToolResultError",{example:{type:"web_search_tool_result_error",error_code:"unavailable"}}),e6=n.z.object({type:n.z.literal("web_search_tool_result"),caller:eZ,tool_use_id:n.z.string(),content:n.z.union([n.z.array(e5),e4])}).openapi("AnthropicWebSearchToolResult",{example:{type:"web_search_tool_result",caller:{type:"direct"},tool_use_id:"srvtoolu_01abc",content:[]}}),e8=n.z.object({enabled:n.z.boolean()}).openapi("AnthropicCitationsConfig",{example:{enabled:!0}}),e9=n.z.object({citations:e8.nullable().default(null),source:n.z.union([m,h]),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"}}),e7=n.z.object({type:n.z.literal("web_fetch_tool_result_error"),error_code:n.z.enum(["invalid_tool_input","url_too_long","url_not_allowed","url_not_accessible","unsupported_content_type","too_many_requests","max_uses_exceeded","unavailable"])}).openapi("AnthropicWebFetchToolResultError",{example:{type:"web_fetch_tool_result_error",error_code:"unavailable"}}),e3=n.z.object({content:e9,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"}}),te=n.z.object({type:n.z.literal("web_fetch_tool_result"),caller:eZ,content:n.z.discriminatedUnion("type",[e7,e3]).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"}}),tt=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"}}),to=n.z.enum(["invalid_tool_input","unavailable","too_many_requests","execution_time_exceeded"]).openapi("AnthropicServerToolErrorCode",{example:"unavailable"}),tn=n.z.object({error_code:to,type:n.z.literal("code_execution_tool_result_error")}).openapi("AnthropicCodeExecutionToolResultError",{example:{error_code:"unavailable",type:"code_execution_tool_result_error"}}),ti=n.z.object({content:n.z.array(tt),return_code:(0,o.zInt)(),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"}}),tr=n.z.object({content:n.z.array(tt),encrypted_stdout:n.z.string(),return_code:(0,o.zInt)(),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"}}),ta=n.z.object({type:n.z.literal("code_execution_tool_result"),content:n.z.discriminatedUnion("type",[tn,ti,tr]).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"}}),tl=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"}}),ts=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"}}),tc=n.z.object({content:n.z.array(tl),return_code:(0,o.zInt)(),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"}}),tp=n.z.object({type:n.z.literal("bash_code_execution_tool_result"),content:n.z.discriminatedUnion("type",[ts,tc]).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"}}),t_=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"}}),tu=n.z.object({content:n.z.string(),file_type:n.z.enum(["text","image","pdf"]),num_lines:(0,o.zInt)().nullable(),start_line:(0,o.zInt)().nullable(),total_lines:(0,o.zInt)().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"}}),td=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"}}),tm=n.z.object({lines:n.z.array(n.z.string()).nullable(),new_lines:(0,o.zInt)().nullable(),new_start:(0,o.zInt)().nullable(),old_lines:(0,o.zInt)().nullable(),old_start:(0,o.zInt)().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"}}),th=n.z.object({type:n.z.literal("text_editor_code_execution_tool_result"),content:n.z.discriminatedUnion("type",[t_,tu,td,tm]).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"}}),tz=n.z.object({tool_name:n.z.string(),type:n.z.literal("tool_reference")}).openapi("AnthropicToolReference",{example:{tool_name:"my_tool",type:"tool_reference"}}),tb=n.z.object({error_code:to,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"}}),tx=n.z.object({tool_references:n.z.array(tz),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"}}),tg=n.z.object({type:n.z.literal("tool_search_tool_result"),content:n.z.discriminatedUnion("type",[tb,tx]).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"}}),ty=n.z.object({type:n.z.literal("container_upload"),file_id:n.z.string()}).openapi("AnthropicContainerUpload",{example:{type:"container_upload",file_id:"file_01abc"}}),tf=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"}}}),tk=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(l.ContainerFileCitationSchema).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}}]}}}),tA=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(l.ContainerFileCitationSchema).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}}}),tv=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."}}),tC=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"}}),tj=n.z.object({id:n.z.string(),expires_at:n.z.string(),skills:n.z.array(tC).nullable().default(null)}).openapi("AnthropicContainer",{example:{id:"ctr_01abc",expires_at:"2026-04-08T00:00:00Z",skills:null}});n.z.discriminatedUnion("type",[eV,eY,eX,e$,e0,e6,te,ta,tp,th,tg,ty]).openapi("AnthropicContentBlock",{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/AnthropicServerToolUseBlock",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"}}});let tw=n.z.discriminatedUnion("type",[eV,eY,eX,e$,e2,e6,te,ta,tp,th,tg,ty,tv,tf,tk,tA]).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"}}}),tT=n.z.object({ephemeral_5m_input_tokens:(0,o.zInt)(),ephemeral_1h_input_tokens:(0,o.zInt)()}).openapi("AnthropicCacheCreation",{example:{ephemeral_5m_input_tokens:100,ephemeral_1h_input_tokens:0}}),tE=n.z.object({web_search_requests:(0,o.zInt)(),web_fetch_requests:(0,o.zInt)()}).openapi("AnthropicServerToolUsage",{example:{web_search_requests:1,web_fetch_requests:0}}),tS=n.z.object({ephemeral_5m_input_tokens:(0,o.zInt)().default(0),ephemeral_1h_input_tokens:(0,o.zInt)().default(0)}).openapi("AnthropicIterationCacheCreation",{example:{ephemeral_5m_input_tokens:0,ephemeral_1h_input_tokens:0}}),tR=n.z.object({input_tokens:(0,o.zInt)().default(0),output_tokens:(0,o.zInt)().default(0),cache_creation_input_tokens:(0,o.zInt)().default(0),cache_read_input_tokens:(0,o.zInt)().default(0),cache_creation:tS.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}}),tI=tR.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}}),tB=tR.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}}),tU=tR.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}}),tq=tR.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}}),tP=n.z.union([tI,tB,tU,tq]).openapi("AnthropicUsageIteration",{example:{type:"message",input_tokens:100,output_tokens:50,cache_creation_input_tokens:0,cache_read_input_tokens:0,cache_creation:null}}),tO=n.z.object({thinking_tokens:(0,o.zInt)()}).openapi("AnthropicOutputTokensDetails",{example:{thinking_tokens:0}}),tF=n.z.object({input_tokens:(0,o.zInt)(),output_tokens:(0,o.zInt)(),output_tokens_details:tO.nullable(),cache_creation_input_tokens:(0,o.zInt)().nullable(),cache_read_input_tokens:(0,o.zInt)().nullable(),cache_creation:tT.nullable(),inference_geo:n.z.string().nullable(),server_tool_use:tE.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:a.nullish(),iterations:n.z.array(tP).optional()}),tD=n.z.object({upstream_inference_cost:(0,o.zDouble)().nullish(),upstream_inference_prompt_cost:(0,o.zDouble)(),upstream_inference_completions_cost:(0,o.zDouble)(),server_tool_cost:(0,o.zDouble)().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}}),tM=n.z.object({web_search_requests:(0,o.zInt)(),web_fetch_requests:(0,o.zInt)(),tool_calls_requested:(0,o.zInt)().optional(),tool_calls_executed:(0,o.zInt)().optional()}).openapi("ORAnthropicServerToolUsage",{example:{web_search_requests:0,web_fetch_requests:0,tool_calls_requested:1,tool_calls_executed:1}});tF.extend({server_tool_use:tM.nullable(),service_tier:n.z.string().nullable(),cost:(0,o.zDouble)().nullish(),is_byok:n.z.boolean().optional(),cost_details:tD.nullish()});let tN={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(tN).openapi("AnthropicStopReason",{example:"end_turn",enum:[...Object.values(tN),null]});let tW={...tN,Compaction:"compaction"},tL=n.z.enum(tW).openapi("ORAnthropicStopReason",{example:"end_turn"}),tG=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."}}),tH=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:tj.nullable(),content:n.z.array(tw),model:n.z.string(),stop_reason:tL.nullable(),stop_details:tG.nullable(),stop_sequence:n.z.string().nullable(),usage:tF,input_transformations:n.z.array(tH).nullish()});let tV=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:tV,message:n.z.string()}),request_id:n.z.string().nullable()});let tJ=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."),tK=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.")}),tQ=n.z.object({cost:(0,o.zDouble)().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:tD.nullish()}),tZ=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 tY=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:tJ.nullish(),completion_tokens_details:tK.nullish(),server_tool_use:tZ.nullish(),service_tier:n.z.string().nullish().describe("The service tier used by the upstream provider for this request"),speed:a.nullish(),iterations:n.z.array(tP).nullish(),cache_creation:tT.nullish()}).extend(tQ.partial().shape);e.s(["CompletionResponseUsageSchema",0,tY,"CostSchema",0,tQ,"ServerToolUseSchema",0,tZ],110116)}]); //# sourceMappingURL=0-_am7yxtb2md.js.map //# chunkId=01a0880a-e62a-7672-8b95-3059e0669e78