Copy-paste OpenRouter formulas for Google Sheets
Copy a formula into row 2, then drag it down to test different OpenRouter models on every spreadsheet row.
Compare outputs across models
A: prompt/task · B: source text · C: model slug
=OPEN_ROUTER(C2, "your-api-key", A2 & ": " & B2)
Low-cost bulk rewrite
A: source text · B: audience · C: tone
=OPEN_ROUTER("meta-llama/llama-3.1-8b-instruct", "your-api-key", "Rewrite this for " & B2 & " in a " & C2 & " tone. Keep it clear, concise, and useful: " & A2)
Premium research summary
A: company · B: notes · C: goal
=OPEN_ROUTER("anthropic/claude-sonnet-4", "your-api-key", "Analyze " & A2 & " for this goal: " & C2 & ". Use these notes: " & B2 & ". Return opportunities, risks, positioning, and 3 next actions.")
What is OpenRouter for Google Sheets?
OpenRouter for Google Sheets lets you use many AI models from one spreadsheet formula. With GPT for Sheets, you can run OpenRouter models across rows of leads, product data, reviews, keywords, support tickets, or research notes without manually copying data into chat tools.
Best for: model comparison, cost-optimized bulk prompts, lead research, content generation, data cleanup, classification, translation, summarization, and spreadsheet workflows where you want GPT, Claude, Gemini, Llama, DeepSeek, and other models available through one API key.
Fastest setup: Install GPT for Sheets → open the sidebar in Google Sheets → choose OpenRouter as the provider → run =OPEN_ROUTER() formulas across entire columns.
How GPT for Sheets adds OpenRouter to your spreadsheet
GPT for Sheets acts as the Google Sheets add-on layer between your spreadsheet rows and OpenRouter. Instead of building Apps Script code or maintaining separate provider integrations, you keep your source data in Sheets and use formulas to generate output columns.
Typical OpenRouter workflow:
- Input columns: leads, product descriptions, support tickets, emails, reviews, keywords, or research notes.
- Model column: optional OpenRouter model slug such as
openai/gpt-4o,anthropic/claude-sonnet-4, ormeta-llama/llama-3.1-8b-instruct. - Prompt column: reusable task instructions your team can edit.
- OpenRouter output columns: summaries, classifications, rewrites, insights, translations, or action items.
- QA columns: checks for hallucinations, missing fields, tone, length, or formatting.
This is useful when your spreadsheet is the operating system for a workflow, but you want the flexibility of choosing the best model for each task.
Install GPT for Sheets to run OpenRouter formulas across rows for model comparison, lead enrichment, content workflows, review analysis, data cleanup, and personalized outreach.
In this guide
- Install OpenRouter in Google Sheets with GPT for Sheets
- Connect your OpenRouter API key
- Use
=OPEN_ROUTER()formulas with cells and model slugs - Process entire columns without copy/paste
- Compare GPT, Claude, Gemini, Llama, and DeepSeek outputs side by side
- Copy practical formulas for content, sales, reviews, translation, enrichment, and QA
Use GPT, Claude, Gemini, Llama, and DeepSeek in Google Sheets
Need AI formulas for hundreds or thousands of rows? Install GPT for Sheets to use OpenRouter directly inside Google Sheets for bulk prompts, model routing, data cleanup, content generation, and analysis.
Start here: Install GPT for Sheets and run your first OpenRouter formula in minutes.
Key Benefits:
- 100+ model access: use models from OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, and more.
- One API key: avoid managing separate API keys for every provider.
- Model comparison: test multiple models on the same spreadsheet row.
- Cost control: route simple work to cheaper models and important work to premium models.
- Bulk workflows: fill formulas down entire columns for repeatable spreadsheet automation.
Installation Guide
Step 1: Install the Add-on
- Open Google Sheets in your web browser
- Navigate to Extensions → Add-ons → Get add-ons
- Search for “GPT for Sheets” in the Google Workspace Marketplace
- Click Install on the GPT for Sheets Add-on
- Grant necessary permissions when prompted
- Complete installation - the add-on will appear in your Extensions menu
Step 2: Launch the Add-on
- Open any Google Sheets document
- Go to Extensions → GPT for Sheets → Open
- The sidebar will appear on the right side of your screen
- You’re ready to start
Step 3: Set Up Your OpenRouter API Key
- Create an OpenRouter account:
- Visit openrouter.ai
- Sign up or log in
- Open the API Keys section
- Generate a new API key
- Add credits if your selected models require paid usage
- Configure in GPT for Sheets:
- In the GPT for Sheets sidebar
- Select “OpenRouter” as your AI provider
- Enter your OpenRouter API key
- Click “Save” to store your settings
Quick Formula Reference
The basic OpenRouter formula syntax is:
=OPEN_ROUTER(model, apikey, prompt)
Common patterns:
- Simple prompt:
=OPEN_ROUTER("openai/gpt-4o", "your-api-key", "write a tagline for a coffee shop") - With cell reference:
=OPEN_ROUTER("anthropic/claude-sonnet-4", "your-api-key", "summarize this review: " & A2) - Model slug in a cell:
=OPEN_ROUTER(C2, "your-api-key", "Analyze: " & A2) - Prompt in a cell:
=OPEN_ROUTER(C2, "your-api-key", B2 & ": " & A2) - Side-by-side model test: use the same prompt in columns B, C, and D with different model slugs.
Popular model routing ideas:
openai/gpt-4ofor polished general-purpose outputsanthropic/claude-sonnet-4for long-form writing, research notes, and nuanced analysisgoogle/gemini-2.5-profor complex reasoning and long-context tasksmeta-llama/llama-3.1-8b-instructfor lower-cost bulk rewrites or classificationsdeepseek/deepseek-chatfor cost-conscious analysis and coding-style tasks
More practical OpenRouter formulas for spreadsheet workflows:
=OPEN_ROUTER("anthropic/claude-sonnet-4", "your-api-key", "Summarize this customer review in one sentence, then classify sentiment as Positive, Neutral, or Negative: " & A2)
=OPEN_ROUTER("openai/gpt-4o", "your-api-key", "Turn these product attributes into 5 ecommerce benefit bullets. Keep each bullet under 12 words: " & TEXTJOIN(" | ", TRUE, A2:D2))
=OPEN_ROUTER("meta-llama/llama-3.1-8b-instruct", "your-api-key", "Categorize this support ticket. Return only: Billing, Bug, Feature Request, Account, or Other. Ticket: " & A2)
=OPEN_ROUTER(C2, "your-api-key", "Rewrite this email to be clearer, shorter, and more helpful while preserving the original meaning: " & A2)
=OPEN_ROUTER("openai/gpt-4o", "your-api-key", "Check this AI output for unsupported claims. Return Pass or Needs review with one reason: " & E2)
Run OpenRouter Prompts Across Entire Columns
The fastest way to use OpenRouter in Google Sheets is with GPT for Sheets: install the add-on, choose OpenRouter as your provider, then apply formulas like =OPEN_ROUTER() across entire columns.
A practical spreadsheet structure:
- Column A: source text or data
- Column B: task or prompt
- Column C: OpenRouter model slug
- Column D: OpenRouter output formula
- Column E: QA or approval status
CTA: Install GPT for Sheets to run OpenRouter, Claude, Grok, GPT, and Gemini prompts in bulk inside Google Sheets.
5+ Practical Examples
Example 1: Compare AI models on the same row
Use case: choose the best model for a repeatable spreadsheet workflow.
Setup:
- Column A: source prompt or task
- Column B: GPT output
- Column C: Claude output
- Column D: Gemini output
- Column E: Llama output
OpenRouter formulas:
B2: =OPEN_ROUTER("openai/gpt-4o", "your-api-key", A2)
C2: =OPEN_ROUTER("anthropic/claude-sonnet-4", "your-api-key", A2)
D2: =OPEN_ROUTER("google/gemini-2.5-pro", "your-api-key", A2)
E2: =OPEN_ROUTER("meta-llama/llama-3.1-8b-instruct", "your-api-key", A2)
Result: side-by-side outputs that make model choice obvious before you scale the formula down a full column.
Example 2: Cost-optimized content generation
Use case: generate drafts while using cheaper models for simple work and premium models for important work.
Setup:
- Column A: content type
- Column B: requirements
- Column C: budget tier (
economy,standard,premium) - Column D: generated output
OpenRouter formula:
=OPEN_ROUTER(
IF(C2="economy", "meta-llama/llama-3.1-8b-instruct", IF(C2="standard", "deepseek/deepseek-chat", "openai/gpt-4o")),
"your-api-key",
"Create " & A2 & " with these requirements: " & B2
)
Result: a repeatable content column that balances quality and cost.
Example 3: Lead research and account summaries
Use case: summarize company notes into sales-ready research fields.
Setup:
- Column A: company name
- Column B: website or notes
- Column C: target customer
- Column D: summary
OpenRouter formula:
=OPEN_ROUTER("anthropic/claude-sonnet-4", "your-api-key", "Research-style summary for " & A2 & ". Notes: " & B2 & ". Target customer: " & C2 & ". Return: one-line description, likely pain points, buying trigger, and personalized opener.")
Result: sales-ready account research that can be reviewed before outreach.
Example 4: Review mining and classification
Use case: turn messy reviews into structured product insights.
Setup:
- Column A: review text
- Column B: rating
- Column C: product/category
- Column D: structured insight
OpenRouter formula:
=OPEN_ROUTER("openai/gpt-4o", "your-api-key", "Analyze this " & C2 & " review with rating " & B2 & ": " & A2 & ". Return sentiment, key theme, pain point, feature request, and urgency score from 1-5.")
Result: structured review data for product, support, and marketing decisions.
Example 5: Translation and localization
Use case: localize marketing copy for multiple languages and markets.
Setup:
- Column A: English copy
- Column B: target language
- Column C: market or audience
- Column D: localized copy
OpenRouter formula:
=OPEN_ROUTER("google/gemini-2.5-pro", "your-api-key", "Translate and localize this copy into " & B2 & " for " & C2 & ". Preserve intent, adapt cultural references, and keep it natural: " & A2)
Result: localized copy that is more useful than literal translation.
Example 6: AI output QA before publishing
Use case: review AI-generated copy, summaries, or outreach before using it.
Setup:
- Column A: original source
- Column B: AI output
- Column C: QA result
OpenRouter formula:
=OPEN_ROUTER("openai/gpt-4o", "your-api-key", "Compare the source and AI output. Flag unsupported claims, missing important details, tone problems, and formatting issues. Return Pass or Needs review plus one reason. Source: " & A2 & " Output: " & B2)
Result: a review column that helps catch risky outputs before publishing or sending.
Advanced Tips and Best Practices
Choosing the right model
- Start with a strong baseline: test a premium model first so you know what good output looks like.
- Route by task: use cheaper models for simple classification and premium models for nuanced writing or research.
- Keep model slugs in a column: this makes it easy to switch models without editing every formula.
- Compare before scaling: test 10-20 rows before filling formulas down thousands of rows.
Managing OpenRouter costs
- Use short prompts when possible: smaller prompts are cheaper and often more reliable.
- Use helper columns: store reusable prompt pieces and model slugs once.
- Cache good outputs: copy/paste values when a batch is complete to avoid accidental re-runs.
- Monitor OpenRouter usage: review credits and model pricing before large batches.
Error handling
- Check the API key: invalid keys or missing credits are the most common setup problems.
- Verify model slugs: copy exact model names from OpenRouter’s model page.
- Use fallbacks: combine
IFandISERRORwhen a workflow must keep running. - Batch large jobs: process smaller groups first, especially when testing a new model.
OpenRouter vs direct Claude, ChatGPT, or Gemini in Google Sheets
OpenRouter, Claude, ChatGPT, and Gemini can all help with spreadsheet work. The difference is whether you want one specific provider or a model gateway.
OpenRouter is usually best for:
- comparing models side by side;
- routing tasks by cost, speed, or quality;
- trying new models without new provider setup;
- workflows where different rows need different models;
- teams that want one API key for many model families.
Direct Claude is usually best for:
- long customer reviews, support threads, or research notes;
- nuanced classification where context matters;
- tone-preserving rewrites for sales or support emails.
Direct ChatGPT is usually best for:
- fast short-form copy and variations;
- simple extraction or categorization;
- structured JSON-like or table-like outputs.
Direct Gemini is usually best for:
- teams that prefer Google’s model family;
- lightweight spreadsheet transformations;
- quick drafting and general-purpose analysis.
A practical setup is to use OpenRouter when you are still choosing models or want cost-based routing, then keep direct provider formulas for workflows where one model family has already proven best.
Frequently Asked Questions
General Questions
Q: What is OpenRouter for Google Sheets? A: It is a way to call OpenRouter models from Google Sheets formulas using GPT for Sheets. You can run one formula across rows and choose models like GPT, Claude, Gemini, Llama, DeepSeek, and others.
Q: Is OpenRouter different from Claude or ChatGPT in Sheets? A: Yes. Claude and ChatGPT are specific model/provider families. OpenRouter is a gateway that gives access to many providers and models through one API key.
Q: Can I use OpenRouter for Google Sheets for free? A: You can install GPT for Sheets for free, but OpenRouter model usage may require OpenRouter credits depending on the model you choose.
Q: How many cells can I process at once? A: You can process many rows, but rate limits, model availability, and credits still matter. Start with 50-100 rows, verify the output, then scale.
Technical Questions
Q: What formula do I use for OpenRouter in Sheets?
A: Use =OPEN_ROUTER(model, apikey, prompt). Put the model slug, your OpenRouter API key, and the prompt or cell references into the formula.
Q: Where do I find OpenRouter model names? A: Use openrouter.ai/models and copy the exact model slug into your sheet.
Q: Can I use different models in the same spreadsheet? A: Yes. You can put different model slugs in different formulas or store model slugs in a helper column and reference that cell.
Q: What happens if a model is unavailable?
A: You can use a fallback formula with IF(ISERROR(...)) to try a second model if the first call fails.
Troubleshooting
Q: Why am I getting an API error? A: Check that your API key is correct, your OpenRouter account has credits, and the model slug is valid. Also verify that the selected model is currently available in OpenRouter.
Q: My costs are higher than expected. What should I do? A: Use lower-cost models for simple tasks, shorten prompts, test on a small sample first, and paste completed outputs as values so formulas do not re-run accidentally.
Q: Can I share sheets with OpenRouter formulas with my team? A: Yes, but each user may need access to the configured API key or their own OpenRouter key depending on how your add-on settings are managed.
Best Practices
Q: How do I choose between similar models? A: Create comparison columns for 10-20 representative rows. Score outputs for accuracy, formatting, tone, speed, and cost before choosing a default model.
Q: Should I use OpenRouter or a direct provider? A: Use OpenRouter when you want model choice and comparison. Use a direct provider when you already know the exact model family you want and prefer that provider’s direct billing/settings.
Q: How do I avoid messy outputs? A: Ask for a strict format, include examples, keep one task per formula, and add a QA column before using outputs in production workflows.
Ready to Use OpenRouter in Google Sheets?
Install GPT for Sheets to use OpenRouter formulas, model comparison, and bulk spreadsheet workflows without writing Apps Script. You can also switch between OpenRouter, Claude, Grok, ChatGPT, Gemini, and other providers from the same add-on.
Conclusion
OpenRouter is especially useful when you want model flexibility inside a spreadsheet: compare GPT, Claude, Gemini, Llama, DeepSeek, and other models; route simple tasks to cheaper models; and keep premium models for high-value writing, research, or QA.
Start with a small sample, compare models side by side, improve the prompt, and then fill the formula down your sheet. When the output matters — published copy, customer messages, or business research — add a review column before you use it.
Ready to run OpenRouter across your spreadsheet? Install GPT for Sheets and create your first OpenRouter formula in minutes.
Need more help? Check out our AI for Spreadsheets or contact our support team for personalized assistance.
