OpenRouter::CompletionRequest
Inherits JSON::Serializable < Reference < Object
Constructors
Instance methods
Image generation configuration (aspect ratio, size)
Output modalities, e.g. ["text"], ["image"], or ["image", "text"] Required for image generation models
Output modalities, e.g. ["text"], ["image"], or ["image", "text"] Required for image generation models
The model to use.
Browse models at openrouter.ai/models,
or use the get_models method of the OpenRouter::Client
The model to use.
Browse models at openrouter.ai/models,
or use the get_models method of the OpenRouter::Client
for models and route, See "Model Routing" section at openrouter.ai/docs/model-routing
See "Provider Routing" section: openrouter.ai/docs/provider-routing
Reasoning configuration for models that support reasoning tokens
Tool calling Will be passed down as-is for providers implementing OpenAI's interface. For providers with custom interfaces, we transform and map the properties. Otherwise, we transform the tools into a YAML template. The model responds with an assistant message. See models supporting tool calling: openrouter.ai/models?supported_parameters=tools
Tool calling Will be passed down as-is for providers implementing OpenAI's interface. For providers with custom interfaces, we transform and map the properties. Otherwise, we transform the tools into a YAML template. The model responds with an assistant message. See models supporting tool calling: openrouter.ai/models?supported_parameters=tools
Reduce latency by providing the model with a predicted output https://platform.openai.com/docs/guides/latency-optimization#use-predicted-outputs prediction?: { type: 'content'; content: string; };
OpenRouter-only parameters
provider?: ProviderPreferences; // See "Prompt Transforms" section at openrouter.ai/docs/transforms
Reduce latency by providing the model with a predicted output https://platform.openai.com/docs/guides/latency-optimization#use-predicted-outputs prediction?: { type: 'content'; content: string; };
OpenRouter-only parameters
provider?: ProviderPreferences; // See "Prompt Transforms" section at openrouter.ai/docs/transforms