Openrouter LLM icon

Openrouter LLM

Send prompts to OpenRouter chat completion models

Openrouter LLM

AI-generated

Summary

Send chat completion requests to an OpenRouter LLM model with customizable prompt formats and response validation.

Inputs

  • Prompt Mode (required) — Choose how to assemble messages sent to OpenRouter: as a single user prompt, a system and user prompt pair, or an array of chat messages from JSON.
  • User Prompt or Messages JSON (required) — Depending on Prompt Mode, provide either a single user prompt string, a system message plus user prompt, or a JSON array of chat messages with roles (system, user, assistant).
  • Model (required) — Specify the OpenRouter model ID to use, chosen from a searchable list or provided directly.
  • Model Options — Configure fallback models and optional model variants to enhance routing and quality.
  • Reasoning — Control reasoning generation mode, effort, token budgets, and whether to exclude reasoning tokens from the final response.
  • Output Mode (required) — Set how to validate and parse the assistant's response: plain text, non-array JSON object, or JSON validated against a user-supplied JSON Schema.
  • JSON Schema — If using JSON Schema output mode, provide the schema (draft-07) to validate the response.
  • Max Repair Attempts — Maximum number of automatic repair attempts to fix structured output validation failures before error.
  • Repair — Configure model and prompt template for automatic repair calls on structured output validation failures.
  • Provider Options & Routing — Configure provider routing preferences, including allowed or denied providers, sorting, and fallbacks.
  • Integrations — Specify custom request headers, Langfuse tracing, session IDs, response healing, and web search plugin options.
  • Generation Options — Control generation parameters including temperature, max tokens, penalties, stop sequences, and prompt caching.
  • Advanced Sampling Options — Further specify sampling parameters like top-k, top-p, repetition penalty, and message transforms.

Output shape

a single record containing the assistant response in text and/or structured JSON form

The output includes a JSON field "output" with either the raw text response or parsed structured content depending on Output Mode. Optionally, raw OpenRouter response details and structured output repair diagnostics can be included if enabled. Structured output is validated and may be auto-repaired up to the Max Repair Attempts before failing with detailed errors.

Links

Discussion