Nodes/ComfyUI-EACloudNodes/OpenRouter Chat
ComfyUI Node

OpenRouter Chat

Access OpenRouter's multi-provider API for various AI models. Supports free models, vision analysis, JSON output, and comprehensive error handling.

By EnragedAntelope·Created 2 years ago·Updated 3 months ago· 9
OpenRouter Chat
  • image_input
  • response
  • status
  • help
api_key
modelcohere/north-mini-code:free
manual_model
base_urlhttps://openrouter.ai/api/v1/chat/completions
system_promptYou are a helpful AI assistant. Please provide clear, accurate, and ethical responses.
user_prompt
send_systemyes
temperature0.70
top_p0.70
top_k50
max_tokens1000
frequency_penalty0.00
presence_penalty0.00
repetition_penalty1.10
response_formattext
seed_moderandom
seed_value0
max_retries3
debug_modeoff
additional_params
CategoryOpenRouter

Inputs (21)

NameTypeDefaultDescription
api_keySTRING⚠️ Your OpenRouter API key from https://openrouter.ai/keys (Note: key will be visible - take care when sharing workflows)
modelCOMBOcohere/north-mini-code:freeSelect a free OpenRouter model or choose 'Manual Input' for custom models. Models with 'vision' or 'vl' support image inputs. Use ComfyUI's Refresh to update this list from OpenRouter's API.
manual_modelSTRINGEnter a custom model identifier (only used when 'Manual Input' is selected). Format: provider/model-name[:free]. Leave empty if using dropdown.
base_urlSTRINGhttps://openrouter.ai/api/v1/chat/completionsOpenRouter API endpoint URL. Leave as default unless using a proxy or alternate endpoint.
system_promptSTRINGYou are a helpful AI assistant. Please provide clear, accurate, and ethical responses.Optional system prompt to set the AI's behavior and context. Defines the assistant's role, personality, and guidelines.
user_promptSTRINGMain prompt or question for the model. For vision models, describe what you want to know about the image. Required field.
send_systemCOMBOyesToggle system prompt sending. Set to 'no' if the model doesn't support system prompts or you want to skip it.
temperatureFLOAT0.700–2Controls response randomness and creativity. Lower values (0.0-0.3) = more focused and deterministic. Higher values (0.7-2.0) = more creative and varied.
top_pFLOAT0.700–1Nucleus sampling threshold. Controls diversity of word choices. Lower values (0.0-0.3) = more focused vocabulary. Higher values (0.7-1.0) = more diverse word selection.
top_kINT501–1000Limits vocabulary to top K most likely tokens. Lower values = more focused. Higher values = more diverse. 50 is a balanced default. Range: 1-1000.
max_tokensINT10001–32768Maximum number of tokens to generate in the response. Note: actual limit varies by model. Higher values allow longer responses. Range: 1-32,768.
frequency_penaltyFLOAT0.00-2–2Penalizes tokens based on their frequency in the output. Positive values reduce word repetition. Range: -2.0 to 2.0. 0.0 = no penalty.
presence_penaltyFLOAT0.00-2–2Penalizes tokens that have already appeared in the output. Positive values encourage topic diversity. Range: -2.0 to 2.0. 0.0 = no penalty.
repetition_penaltyFLOAT1.101–2OpenRouter-specific repetition penalty. Values > 1.0 reduce repetition. 1.0 = off. Higher values = stronger penalty. Range: 1.0-2.0.
response_formatCOMBOtextResponse format: 'text' for natural language, 'json_object' for structured JSON output. When using JSON, instruct the model in your prompt to output JSON.
seed_modeCOMBOrandomSeed behavior control: 'fixed' uses the seed_value below, 'random' generates new seed each time, 'increment' increases by 1, 'decrement' decreases by 1.
seed_valueINT00–9007199254740991Seed value for reproducibility when seed_mode is 'fixed'. Use same seed + parameters for similar outputs. Valid range: 0-9007199254740991 (JavaScript safe integer limit).
max_retriesINT30–5Maximum number of automatic retry attempts for recoverable errors (rate limits, temporary server issues). 0 disables retries. Range: 0-5.
debug_modeCOMBOoffEnable detailed error messages and request debugging information. Useful for troubleshooting API issues or parameter problems.
image_inputoptIMAGEOptional image input for vision-capable models. Supported: llama-4-maverick/scout, nemotron-nano-12b-v2-vl, qwen2.5-vl-32b. Maximum size: 2048x2048.
additional_paramsoptSTRINGAdditional OpenRouter API parameters in JSON format. Example: {"min_p": 0.1, "top_a": 0.5}. Use for advanced model-specific parameters not exposed in the UI.

Outputs (3)

NameTypeDescription
responseSTRING
statusSTRING
helpSTRING