Interface: OpenRouterCompletionsParams
@providerprotocol/ai / openrouter / OpenRouterCompletionsParams
Interface: OpenRouterCompletionsParams
Section titled “Interface: OpenRouterCompletionsParams”Defined in: src/providers/openrouter/types.ts:65
Parameters for OpenRouter’s Chat Completions API.
These parameters are passed through to the /api/v1/chat/completions endpoint.
Includes standard OpenAI-compatible parameters plus OpenRouter-specific features
like model routing and provider preferences.
OpenRouter Chat Completions API
Properties
Section titled “Properties”debug?
Section titled “debug?”
optionaldebug:object
Defined in: src/providers/openrouter/types.ts:165
Debug options (streaming only)
echo_upstream_body?
Section titled “echo_upstream_body?”
optionalecho_upstream_body:boolean
If true, returns the transformed request body sent to the provider
frequency_penalty?
Section titled “frequency_penalty?”
optionalfrequency_penalty:number
Defined in: src/providers/openrouter/types.ts:79
Frequency penalty (-2.0 - 2.0)
image_config?
Section titled “image_config?”
optionalimage_config:OpenRouterImageConfig
Defined in: src/providers/openrouter/types.ts:129
Image generation configuration for Gemini models.
Only applies when modalities includes ‘image’.
https://openrouter.ai/docs/guides/overview/multimodal/image-generation
include_reasoning?
Section titled “include_reasoning?”
optionalinclude_reasoning:boolean
Defined in: src/providers/openrouter/types.ts:188
Legacy reasoning toggle (use reasoning instead).
true: Equivalent toreasoning: {}false: Equivalent toreasoning: { exclude: true }
Deprecated
Section titled “Deprecated”Use reasoning parameter instead
logit_bias?
Section titled “logit_bias?”
optionallogit_bias:Record<number,number>
Defined in: src/providers/openrouter/types.ts:103
Logit bias map
logprobs?
Section titled “logprobs?”
optionallogprobs:boolean
Defined in: src/providers/openrouter/types.ts:97
Enable logprobs
max_tokens?
Section titled “max_tokens?”
optionalmax_tokens:number
Defined in: src/providers/openrouter/types.ts:67
Maximum number of tokens to generate
min_p?
Section titled “min_p?”
optionalmin_p:number
Defined in: src/providers/openrouter/types.ts:106
Minimum probability threshold (0.0 - 1.0)
modalities?
Section titled “modalities?”
optionalmodalities: ("text"|"image")[]
Defined in: src/providers/openrouter/types.ts:122
Output modalities for multimodal generation.
Set to ['text', 'image'] to enable image generation with compatible models.
https://openrouter.ai/docs/guides/overview/multimodal/image-generation
models?
Section titled “models?”
optionalmodels:string[]
Defined in: src/providers/openrouter/types.ts:141
Multiple models for routing See: https://openrouter.ai/docs/guides/features/model-routing
parallel_tool_calls?
Section titled “parallel_tool_calls?”
optionalparallel_tool_calls:boolean
Defined in: src/providers/openrouter/types.ts:112
Whether to enable parallel tool calls
prediction?
Section titled “prediction?”
optionalprediction:object
Defined in: src/providers/openrouter/types.ts:157
Predicted output for latency optimization
content
Section titled “content”content:
string
type:
"content"
presence_penalty?
Section titled “presence_penalty?”
optionalpresence_penalty:number
Defined in: src/providers/openrouter/types.ts:82
Presence penalty (-2.0 - 2.0)
provider?
Section titled “provider?”
optionalprovider:OpenRouterProviderPreferences
Defined in: src/providers/openrouter/types.ts:152
Provider routing preferences See: https://openrouter.ai/docs/guides/routing/provider-selection
reasoning?
Section titled “reasoning?”
optionalreasoning:OpenRouterReasoningConfig
Defined in: src/providers/openrouter/types.ts:178
Reasoning configuration for thinking models.
Controls how much reasoning effort the model uses and whether to include reasoning tokens in the response.
https://openrouter.ai/docs/guides/best-practices/reasoning-tokens
repetition_penalty?
Section titled “repetition_penalty?”
optionalrepetition_penalty:number
Defined in: src/providers/openrouter/types.ts:85
Repetition penalty (0.0 - 2.0)
response_format?
Section titled “response_format?”
optionalresponse_format:OpenRouterResponseFormat
Defined in: src/providers/openrouter/types.ts:115
Response format for structured output
route?
Section titled “route?”
optionalroute:"fallback"
Defined in: src/providers/openrouter/types.ts:146
Routing strategy (e.g., ‘fallback’)
optionalseed:number
Defined in: src/providers/openrouter/types.ts:91
Seed for deterministic sampling
optionalstop:string|string[]
Defined in: src/providers/openrouter/types.ts:88
Custom stop sequences
temperature?
Section titled “temperature?”
optionaltemperature:number
Defined in: src/providers/openrouter/types.ts:70
Temperature for randomness (0.0 - 2.0)
top_a?
Section titled “top_a?”
optionaltop_a:number
Defined in: src/providers/openrouter/types.ts:109
Top-a sampling threshold (0.0 - 1.0)
top_k?
Section titled “top_k?”
optionaltop_k:number
Defined in: src/providers/openrouter/types.ts:76
Top-k sampling (not available for OpenAI models)
top_logprobs?
Section titled “top_logprobs?”
optionaltop_logprobs:number
Defined in: src/providers/openrouter/types.ts:100
Number of top logprobs to return
top_p?
Section titled “top_p?”
optionaltop_p:number
Defined in: src/providers/openrouter/types.ts:73
Top-p (nucleus) sampling (0.0 - 1.0)
transforms?
Section titled “transforms?”
optionaltransforms:string[]
Defined in: src/providers/openrouter/types.ts:135
Prompt transforms to apply See: https://openrouter.ai/docs/guides/features/message-transforms
optionaluser:string
Defined in: src/providers/openrouter/types.ts:94
User identifier for abuse detection