OpenRouter Multi-Model Chat - Help & Guide
Quick Start
- Add OpenRouter API Key: Go to Settings → Add API Key section (get your key from openrouter.ai)
- Browse Models: Go to Settings → Browse OpenRouter Models → Click "Load Models" to see all available models
- Add Models: Click any model from the browser to auto-populate the Add New Model form, or manually add model configuration
- Select Models: Click "Select Models" button, check the models you want to use. Use the number input to select multiple instances of the same model (1-10).
- Choose Mode & Iterations: In model picker, select Parallel/Serial/Rotating/Autonomous and set how many iterations (1-100)
- Chat: Type your message and click Send!
Model Browser
The Browse OpenRouter Models section fetches the live model catalog from OpenRouter:
- Load Models: Click to fetch all available models
- Search: Filter models by name, ID, or description
- Sort: Sort by date (newest first), name, or context length
- Select: Click any model to auto-fill the Add New Model form
Each model shows context length, pricing, and release date to help you choose.
Model Configuration
Each model is defined by a JSON configuration with NO outer braces. Example:
"endpoint": "https://openrouter.ai/api/v1/chat/completions",
"model_id": "anthropic/claude-3.5-sonnet",
"api_key_id": "123456",
"system_prompt": "",
"max_tokens": null,
"temperature": 1.0
Available OpenRouter Models
You can use any model from OpenRouter. Popular options include:
anthropic/claude-3.5-sonnet - Claude 3.5 Sonnet
openai/gpt-4-turbo - GPT-4 Turbo
google/gemini-pro - Google Gemini Pro
meta-llama/llama-3-70b-instruct - Llama 3 70B
- ...and many more at openrouter.ai/models
Per-Model System Prompts
Set "system_prompt": "Your prompt here" in each model's config to give it a unique personality.
Global System Prompt Override
Use the "Active System Prompt" dropdown in the model picker to temporarily override all models' prompts.
Multi-Model Modes
- Parallel: All selected models respond independently to your message. Each only sees your messages, not other models' responses.
- Vote: Models vote on who responds next. The model with the highest adjusted vote wins and generates the response. Enables dynamic, self-organizing conversations.
Iterations
You can set the number of iterations (1-100) to control how many times models reply:
- Parallel: All models respond N times in parallel (e.g., 2 iterations = 2 rounds of all models responding simultaneously)
- Vote: N total responses are generated via voting (each round, models vote and the winner responds)
Human Participation
In Vote mode, you can choose whether to participate:
- Human Participates (default): You send messages normally, then models vote on who responds. Your messages appear in the conversation.
- Human Does Not Participate: Models converse autonomously via voting. Click "Start Vote" to begin. Models will vote and respond without human input.
Vote Mode Details
Voting Process
- Voting Round: Each model privately votes (0.1-10.0) on how much they want to respond next
- Invalid Votes: If a model's vote is invalid, it gets one retry; if still invalid, it gets a default vote of 5.0
- Debiasing: Votes are adjusted using z-score normalization based on each model's voting history
- Winner: Highest adjusted vote wins
- Tiebreaker: If votes are tied, the model that responded longest ago wins
Force Model
In Vote mode, you can force a specific model to respond next, bypassing voting:
- From Model Picker: Click a model's name (not checkbox) to force it
- From Chat: Click "Force Next" button on any assistant message
The forced model responds once, then normal voting resumes.
Debiasing
Debiasing normalizes votes across models with different voting tendencies:
- Tracks each model's last N votes (configurable, default 10)
- Applies z-score normalization:
z = (vote - mean) / stddev
- A model voting higher than usual gets a positive z-score; lower than usual gets negative
- Models with insufficient history (less than 3 votes) use approximate z-scores
- Can be disabled in the model picker settings
Flattened Participant Structure
In multi-model Vote mode conversations, all participants are treated equally with no hierarchy:
- Equal Participants: Your messages are prefixed with your identifier (e.g., "User said: hello"), just like model messages (e.g., "Claude said: hi").
- No Special Treatment: Models receive no indication that you are different from other participants. Everyone is simply a named participant in the conversation.
- Customizable Identity: Set your identifier in Settings → User Identifier (default: "Human"). Use any name you prefer to shape your role in the conversation.
Mode-Specific Behavior:
- Parallel: Each model converses independently with you. Your messages are not prefixed since there's only one other participant.
- Vote: All participants (you and all models) are listed equally. Messages are prefixed with participant identifiers.
Multiple Instances: You can select multiple instances of the same model by using the number input next to each model in the picker. The model name is simply a chat identifier to distinguish between different instances - multiple instances of the same underlying model can participate with different names (e.g., "GPT-4 Debater 1" and "GPT-4 Debater 2").
About OpenRouter
OpenRouter provides unified access to 100+ AI models from multiple providers through a single API:
- Anthropic: Claude models (Sonnet, Opus, Haiku)
- OpenAI: GPT-4, GPT-3.5, and more
- Google: Gemini models
- Meta: Llama models
- Mistral, Cohere, and many others
Visit openrouter.ai to get your API key and browse available models.
Advanced Features
Edit AI Responses
Click "Edit" button below any AI response to manually modify it before continuing the conversation.
Regenerate Responses
Click "Regenerate" to have the same model create a different response.
Edit User Messages
Click "Edit" button on your own messages to revise and branch the conversation from that point.
File Attachments
Click the "Attach" button to attach files. Supported file types:
- Images: Sent as visual data to vision-capable models
- PDFs: Text content is automatically extracted and sent to the model
- Text files: Content is read and sent to the model (.txt, .md, .json, .csv, .xml, code files, etc.)
- Other files: File name is mentioned (content extraction not supported)
Files are kept in context and will be included when you "Edit & Resend" messages.
Image Generation
The application supports receiving images from image generation models:
- Use models with "image" in their output modalities (check model browser or openrouter.ai/models)
- Request image generation in your message (e.g., "draw a sunset")
- Generated images appear automatically in the response
- Multiple images per response are supported
- Images are displayed inline below the text content
OpenRouter Parameters (All Optional)
Customize your model behavior with these parameters (set to null to use defaults):
temperature (0.0-2.0): Randomness/creativity level
max_tokens: Maximum response length
top_p (0.0-1.0): Nucleus sampling threshold
top_k: Limit sampling to top K tokens
frequency_penalty (-2.0 to 2.0): Reduce word repetition
presence_penalty (-2.0 to 2.0): Encourage topic diversity
repetition_penalty (≥0): Alternative repetition control
min_p (0.0-1.0): Minimum probability threshold
top_a (0.0-1.0): Adaptive sampling threshold
seed: For deterministic outputs
logit_bias: Adjust token probabilities
response_format: e.g., {"type": "json_object"}
stop: Array of stop sequences
tools: Function calling definitions
tool_choice: Force or disable tool use
reasoning: Enable extended thinking/reasoning mode with {"effort": "high"|"medium"|"low"} or {"max_tokens": number}
provider: Force specific provider (e.g., "Anthropic")
models: Fallback model array
route: "fallback" to use model list
transforms: ["middle-out"] for content filtering
timeout: Request timeout in milliseconds (default: 120000 = 2 minutes). Increase for extended thinking or complex requests.
Data Storage
All data is stored locally in your browser using IndexedDB:
- Storage Capacity: 50 MB to several GB (varies by browser), much larger than typical localStorage limits
- Images Supported: Store conversations with multiple images without quota issues
- Mobile Friendly: Works reliably on mobile devices including iPhone/iPad
- Privacy: All data stays on your device, nothing sent to servers except OpenRouter API calls
Data Management
Export Data
Settings → Export Data creates a JSON file with all your models, API keys, prompts, and current conversation.
Import Data
Settings → Import Data loads a previously exported JSON file.
Clear History
History → Clear All History removes all saved conversations.
Tips & Best Practices
- API Keys: Create separate API key entries for different projects/purposes
- System Prompts: Save reusable prompts (e.g., "Coding Assistant", "Creative Writer")
- Model Names: Use descriptive names like "GPT-4 Creative" vs "GPT-4 Analytical"
- Temperature: Lower (0.0-0.7) for factual/coding, higher (0.8-1.5) for creative
- Modes: Use Parallel for comparing responses, Serial for debate/discussion
Troubleshooting
Messages not sending: Check browser console (F12) for errors, verify API key is correct
Images not working: Ensure you're using a vision-capable model (Claude 3+, GPT-4V, Gemini Pro Vision). Images are always sent with the most recent message.
Mode not updating: Hard refresh (Ctrl+Shift+R or Cmd+Shift+R)
Model deleted: Can't regenerate old messages from deleted models
Multiple images on mobile: IndexedDB storage allows unlimited images even on mobile devices like iPhone
Source Code & License
This application is open source and available on GitHub:
https://github.com/mbbrinkman/my_api_chat
License: CC0 (Public Domain)
You are free to use, modify, distribute, and do basically whatever you want with this code. No attribution required.