import * as z from "zod/v4"; import { OpenEnum } from "../types/enums.js"; import { AnthropicCacheControlDirective, AnthropicCacheControlDirective$Outbound } from "./anthropiccachecontroldirective.js"; import { AutoBetaRouterPlugin, AutoBetaRouterPlugin$Outbound } from "./autobetarouterplugin.js"; import { AutoRouterPlugin, AutoRouterPlugin$Outbound } from "./autorouterplugin.js"; import { ChatDebugOptions, ChatDebugOptions$Outbound } from "./chatdebugoptions.js"; import { ChatFormatGrammarConfig, ChatFormatGrammarConfig$Outbound } from "./chatformatgrammarconfig.js"; import { ChatFormatJsonObjectConfig, ChatFormatJsonObjectConfig$Outbound } from "./chatformatjsonobjectconfig.js"; import { ChatFormatJsonSchemaConfig, ChatFormatJsonSchemaConfig$Outbound } from "./chatformatjsonschemaconfig.js"; import { ChatFormatPythonConfig, ChatFormatPythonConfig$Outbound } from "./chatformatpythonconfig.js"; import { ChatFormatTextConfig, ChatFormatTextConfig$Outbound } from "./chatformattextconfig.js"; import { ChatFunctionTool, ChatFunctionTool$Outbound } from "./chatfunctiontool.js"; import { ChatMessages, ChatMessages$Outbound } from "./chatmessages.js"; import { ChatReasoningSummaryVerbosityEnum } from "./chatreasoningsummaryverbosityenum.js"; import { ChatStreamOptions, ChatStreamOptions$Outbound } from "./chatstreamoptions.js"; import { ChatToolChoice, ChatToolChoice$Outbound } from "./chattoolchoice.js"; import { ContextCompressionPlugin, ContextCompressionPlugin$Outbound } from "./contextcompressionplugin.js"; import { FileParserPlugin, FileParserPlugin$Outbound } from "./fileparserplugin.js"; import { FusionPlugin, FusionPlugin$Outbound } from "./fusionplugin.js"; import { ImageConfig, ImageConfig$Outbound } from "./imageconfig.js"; import { ModerationPlugin, ModerationPlugin$Outbound } from "./moderationplugin.js"; import { ParetoRouterPlugin, ParetoRouterPlugin$Outbound } from "./paretorouterplugin.js"; import { Prediction, Prediction$Outbound } from "./prediction.js"; import { PromptCacheOptions, PromptCacheOptions$Outbound } from "./promptcacheoptions.js"; import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js"; import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js"; import { StopServerToolsWhenCondition, StopServerToolsWhenCondition$Outbound } from "./stopservertoolswhencondition.js"; import { SwitchyardRouterPlugin, SwitchyardRouterPlugin$Outbound } from "./switchyardrouterplugin.js"; import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js"; import { WebFetchPlugin, WebFetchPlugin$Outbound } from "./webfetchplugin.js"; import { WebSearchPlugin, WebSearchPlugin$Outbound } from "./websearchplugin.js"; export declare const Modality: { readonly Text: "text"; readonly Image: "image"; readonly Audio: "audio"; }; export type Modality = OpenEnum; export type ChatRequestPlugin = AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin; /** * Constrains effort on reasoning for reasoning models */ export declare const ChatRequestEffort: { readonly Max: "max"; readonly Xhigh: "xhigh"; readonly High: "high"; readonly Medium: "medium"; readonly Low: "low"; readonly Minimal: "minimal"; readonly None: "none"; }; /** * Constrains effort on reasoning for reasoning models */ export type ChatRequestEffort = OpenEnum; /** * Configuration options for reasoning models */ export type ChatRequestReasoning = { /** * Constrains effort on reasoning for reasoning models */ effort?: ChatRequestEffort | null | undefined; summary?: ChatReasoningSummaryVerbosityEnum | null | undefined; }; /** * Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. */ export declare const ChatRequestReasoningEffort: { readonly Max: "max"; readonly Xhigh: "xhigh"; readonly High: "high"; readonly Medium: "medium"; readonly Low: "low"; readonly Minimal: "minimal"; readonly None: "none"; }; /** * Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. */ export type ChatRequestReasoningEffort = OpenEnum; /** * Response format configuration */ export type ResponseFormat = ChatFormatGrammarConfig | ChatFormatJsonObjectConfig | ChatFormatJsonSchemaConfig | ChatFormatPythonConfig | ChatFormatTextConfig; /** * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`. */ export declare const ChatRequestServiceTier: { readonly Auto: "auto"; readonly Default: "default"; readonly Fast: "fast"; readonly Flex: "flex"; readonly Priority: "priority"; readonly Scale: "scale"; }; /** * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`. */ export type ChatRequestServiceTier = OpenEnum; /** * Stop sequences (up to 4) */ export type Stop = string | Array; /** * Chat completion request parameters */ export type ChatRequest = { /** * Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. */ cacheControl?: AnthropicCacheControlDirective | undefined; /** * Debug options for inspecting request transformations (streaming only) */ debug?: ChatDebugOptions | undefined; /** * Frequency penalty (-2.0 to 2.0) */ frequencyPenalty?: number | null | undefined; /** * 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. */ imageConfig?: { [k: string]: ImageConfig; } | undefined; /** * Token logit bias adjustments */ logitBias?: { [k: string]: number; } | null | undefined; /** * Return log probabilities */ logprobs?: boolean | null | undefined; /** * Maximum tokens in completion */ maxCompletionTokens?: number | null | undefined; /** * Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. */ maxTokens?: number | null | undefined; /** * List of messages for the conversation */ messages: Array; /** * Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) */ metadata?: { [k: string]: string; } | undefined; /** * Minimum probability threshold relative to the most likely token. Tokens with probability below min_p * (probability of top token) are filtered out. Not all providers support this parameter. */ minP?: number | null | undefined; /** * Output modalities for the response. Supported values are "text", "image", and "audio". */ modalities?: Array | undefined; /** * Model to use for completion */ model?: string | undefined; /** * Models to use for completion */ models?: Array | undefined; /** * Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. */ parallelToolCalls?: boolean | null | undefined; /** * Plugins you want to enable for this request, including their settings. */ plugins?: Array | undefined; /** * Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. */ prediction?: Prediction | null | undefined; /** * Presence penalty (-2.0 to 2.0) */ presencePenalty?: number | null | undefined; promptCacheKey?: string | null | undefined; /** * Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. */ promptCacheOptions?: PromptCacheOptions | null | undefined; /** * When multiple model providers are available, optionally indicate your routing preference. */ provider?: ProviderPreferences | null | undefined; /** * Configuration options for reasoning models */ reasoning?: ChatRequestReasoning | undefined; /** * Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. */ reasoningEffort?: ChatRequestReasoningEffort | null | undefined; /** * Penalizes tokens based on how much they have already appeared in the text. A value of 1.0 means no penalty. Values above 1.0 penalize repeated tokens more strongly. Not all providers support this parameter. */ repetitionPenalty?: number | null | undefined; /** * Response format configuration */ responseFormat?: ChatFormatGrammarConfig | ChatFormatJsonObjectConfig | ChatFormatJsonSchemaConfig | ChatFormatPythonConfig | ChatFormatTextConfig | undefined; /** * Random seed for deterministic outputs */ seed?: number | null | undefined; /** * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`. */ serviceTier?: ChatRequestServiceTier | null | undefined; /** * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. */ sessionId?: string | undefined; /** * Stop sequences (up to 4) */ stop?: string | Array | null | undefined; /** * Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. When a condition fires while the model is still emitting tool calls, the pending tool calls are executed and one final turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call. */ stopServerToolsWhen?: Array | undefined; /** * Enable streaming response */ stream?: boolean | undefined; /** * Streaming configuration options */ streamOptions?: ChatStreamOptions | null | undefined; /** * Sampling temperature (0-2) */ temperature?: number | null | undefined; /** * Tool choice configuration */ toolChoice?: ChatToolChoice | undefined; /** * Available tools for function calling */ tools?: Array | undefined; /** * Consider only tokens with "sufficiently high" probabilities based on the probability of the most likely token. Not all providers support this parameter. */ topA?: number | null | undefined; /** * Limits the model to choose from the top K most likely tokens at each step. A value of 1 means the model will always pick the most likely next token. Not all providers support this parameter. */ topK?: number | null | undefined; /** * Number of top log probabilities to return (0-20) */ topLogprobs?: number | null | undefined; /** * Nucleus sampling parameter (0-1) */ topP?: number | null | undefined; /** * 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. */ trace?: TraceConfig | undefined; /** * Per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. */ user?: string | undefined; }; /** @internal */ export declare const Modality$outboundSchema: z.ZodType; /** @internal */ export type ChatRequestPlugin$Outbound = AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound; /** @internal */ export declare const ChatRequestPlugin$outboundSchema: z.ZodType; export declare function chatRequestPluginToJSON(chatRequestPlugin: ChatRequestPlugin): string; /** @internal */ export declare const ChatRequestEffort$outboundSchema: z.ZodType; /** @internal */ export type ChatRequestReasoning$Outbound = { effort?: string | null | undefined; summary?: string | null | undefined; }; /** @internal */ export declare const ChatRequestReasoning$outboundSchema: z.ZodType; export declare function chatRequestReasoningToJSON(chatRequestReasoning: ChatRequestReasoning): string; /** @internal */ export declare const ChatRequestReasoningEffort$outboundSchema: z.ZodType; /** @internal */ export type ResponseFormat$Outbound = ChatFormatGrammarConfig$Outbound | ChatFormatJsonObjectConfig$Outbound | ChatFormatJsonSchemaConfig$Outbound | ChatFormatPythonConfig$Outbound | ChatFormatTextConfig$Outbound; /** @internal */ export declare const ResponseFormat$outboundSchema: z.ZodType; export declare function responseFormatToJSON(responseFormat: ResponseFormat): string; /** @internal */ export declare const ChatRequestServiceTier$outboundSchema: z.ZodType; /** @internal */ export type Stop$Outbound = string | Array; /** @internal */ export declare const Stop$outboundSchema: z.ZodType; export declare function stopToJSON(stop: Stop): string; /** @internal */ export type ChatRequest$Outbound = { cache_control?: AnthropicCacheControlDirective$Outbound | undefined; debug?: ChatDebugOptions$Outbound | undefined; frequency_penalty?: number | null | undefined; image_config?: { [k: string]: ImageConfig$Outbound; } | undefined; logit_bias?: { [k: string]: number; } | null | undefined; logprobs?: boolean | null | undefined; max_completion_tokens?: number | null | undefined; max_tokens?: number | null | undefined; messages: Array; metadata?: { [k: string]: string; } | undefined; min_p?: number | null | undefined; modalities?: Array | undefined; model?: string | undefined; models?: Array | undefined; parallel_tool_calls?: boolean | null | undefined; plugins?: Array | undefined; prediction?: Prediction$Outbound | null | undefined; presence_penalty?: number | null | undefined; prompt_cache_key?: string | null | undefined; prompt_cache_options?: PromptCacheOptions$Outbound | null | undefined; provider?: ProviderPreferences$Outbound | null | undefined; reasoning?: ChatRequestReasoning$Outbound | undefined; reasoning_effort?: string | null | undefined; repetition_penalty?: number | null | undefined; response_format?: ChatFormatGrammarConfig$Outbound | ChatFormatJsonObjectConfig$Outbound | ChatFormatJsonSchemaConfig$Outbound | ChatFormatPythonConfig$Outbound | ChatFormatTextConfig$Outbound | undefined; seed?: number | null | undefined; service_tier?: string | null | undefined; session_id?: string | undefined; stop?: string | Array | null | undefined; stop_server_tools_when?: Array | undefined; stream: boolean; stream_options?: ChatStreamOptions$Outbound | null | undefined; temperature?: number | null | undefined; tool_choice?: ChatToolChoice$Outbound | undefined; tools?: Array | undefined; top_a?: number | null | undefined; top_k?: number | null | undefined; top_logprobs?: number | null | undefined; top_p?: number | null | undefined; trace?: TraceConfig$Outbound | undefined; user?: string | undefined; }; /** @internal */ export declare const ChatRequest$outboundSchema: z.ZodType; export declare function chatRequestToJSON(chatRequest: ChatRequest): string; //# sourceMappingURL=chatrequest.d.ts.map