Most tutorials say install an add-on first. But if you’re running fewer than 1,000 API calls a month, you’re probably overpaying. And if you care about data privacy or want full control? Add-on’s the wrong choice entirely.
Two ways to connect ChatGPT to Google Sheets. Most guides pick one and sell it as the only option. This one doesn’t.
The Real Question: Add-on or Apps Script?
First decision: what do you actually control?
Add-ons (like GPT for Sheets, SheetGPT, GPT Workspace) give you pre-built formulas like =GPT() right out of the box. Zero code. They handle API calls, retries, errors. GPT for Sheets hit 7M+ installs as of April 2026.
Cost? Credits that expire within a year (per the GPT for Work billing docs). You’re handing over every prompt to a third party.
Apps Script is Google’s built-in scripting tool. You write (or copy-paste) a function that calls the OpenAI API directly. Roughly $0.002 per 1,000 tokens for GPT-3.5-turbo. Your data never touches a middleman. You own it.
The catch: you’re responsible for error handling, API key security, debugging when things break.
Think of it like renting a car vs. owning one. Add-on = rental with insurance and roadside assistance. Apps Script = you bought the car, you fix the flat tire.
When Apps Script Wins
Pick Apps Script when:
- You want the cheapest option and don’t mind 10 minutes of setup
- Processing fewer than 10,000 rows/month (add-ons shine at scale)
- You need custom logic – conversation history, temperature per row, specific system prompts
- Data privacy matters. Prompts stay between you and OpenAI.
How to Set It Up
Open your Google Sheet. Click Extensions → Apps Script. Delete the placeholder code. Paste this:
const API_KEY = 'your-openai-api-key-here';
function GPT(prompt) {
const url = 'https://api.openai.com/v1/chat/completions';
const payload = {
model: 'gpt-3.5-turbo',
messages: [{ role: 'user', content: prompt }],
max_tokens: 150
};
const options = {
method: 'post',
contentType: 'application/json',
headers: { Authorization: 'Bearer ' + API_KEY },
payload: JSON.stringify(payload),
muteHttpExceptions: true
};
const response = UrlFetchApp.fetch(url, options);
const json = JSON.parse(response.getContentText());
return json.choices[0].message.content;
}
Replace 'your-openai-api-key-here' with your actual key from platform.openai.com/api-keys. Save. Name it “ChatGPT Integration.”
Back in your sheet: =GPT("Explain quantum computing in one sentence") in any cell. Wait a few seconds. Response appears. Done.
ChatGPT inside Google Sheets, billed at OpenAI’s direct rates.
Pro tip: Store your API key in Script Properties instead of hardcoding. Go to Project Settings → Script Properties → Add property. Name it
OPENAI_KEY, paste your key. Then change line 1 toconst API_KEY = PropertiesService.getScriptProperties().getProperty('OPENAI_KEY');– your key isn’t visible in the script itself.
When Add-ons Win
Pick an add-on if:
- Processing 10,000+ rows regularly (bulk operations way faster)
- You need image generation, vision models, multi-step workflows
- Non-technical team will use it – add-ons have sidebars and buttons, not code
- You want someone else to handle retries, rate limits, updates when OpenAI changes their API
The GPT for Sheets add-on? 1,000 rows per minute. A custom function can’t.
How to Install an Add-on
Extensions → Add-ons → Get add-ons. Search “GPT for Sheets” or “SheetGPT.” Click Install.
After install: Extensions → GPT for Sheets and Docs → Open. Sidebar appears. Some let you start immediately with a free trial (SheetGPT gives 100,000 words of GPT-3.5 for free as of 2026). Others ask you to buy credits upfront.
Formulas you’ll use:
=GPT("Summarize the text in A2")
=GPT_FILL(A2:A10, "Write a caption for each product")
=GPT_LIST("Generate 5 blog title ideas about AI")
Add-on handles everything. You just write the prompt.
The 3 Gotchas Nobody Warns You About
3 ways this breaks:
1. Google Sheets Has a 60-Second Timeout
Custom functions: 60 seconds max. GPT-4 call takes longer (complex prompts, high load)? You get “Exceeded maximum execution time.” Cell shows an error.
Add-ons using bulk processing bypass this – they don’t run as cell formulas. They execute in the background. Apps Script users? Stuck with this limit unless they switch to a triggered batch process instead of a formula.
2. OpenAI Tier 0 Blocks GPT-4 (Even With a Valid Key)
You create an API key. Paste it into your script. Try model: 'gpt-4'. 429 error.
Turns out OpenAI requires you to spend at least $5 to reach Tier 1 before GPT-4 access unlocks (multiple add-on troubleshooting guides confirm this). Error message doesn’t tell you. Just says “model not available.”
Fix: Add $5 to your OpenAI account. Wait a few minutes. Try again.
3. Google Has Its Own Rate Limits (Separate From OpenAI)
You drag a =GPT() formula down 500 rows. Rows 1-300 work. Then: 429 errors.
Not OpenAI’s rate limit. Google’s. Per the official Sheets API docs, you’re capped at 300 write requests per minute per user. Every formula recalculation counts.
Workaround: batch your API calls inside a single function instead of one formula per row. Or use an add-on’s bulk tool – handles batching automatically.
Which One Should You Actually Use?
Not sure which? Decision tree:
| Your Situation | Recommendation |
|---|---|
| One-time project, <100 rows | Apps Script (free-ish) |
| Monthly batches of 1,000-10,000 rows | Apps Script if you code; add-on if you don’t |
| 10,000+ rows regularly | Add-on (bulk speed matters) |
| Team of non-coders needs access | Add-on (UI makes it usable) |
| Custom logic, sensitive data | Apps Script (you control everything) |
For most people starting out: try Apps Script first. Costs almost nothing. Hit the limits or hate debugging? Switch to an add-on later.
FAQ
Do I need a ChatGPT Plus subscription to use this?
No. Plus ($20/month) is for chat.openai.com. The API is billed separately. You just need an OpenAI account and a payment method on file.
Can I use this with GPT-4 or other models?
Yes, but you need OpenAI Tier 1 access (spend $5 first). Then change model: 'gpt-3.5-turbo' to model: 'gpt-4' in your script. GPT-4 costs about 15x more per token, responses are slower – you might hit that 60-second timeout. One debugging session with GPT-4 in Sheets? I burned through 300 tokens just asking it to clean up a product list. Some add-ons also support Claude, Gemini, other models if you bring your own API keys.
What happens if I hit OpenAI’s rate limit?
429 error from OpenAI: “Rate limit reached for requests.” Free-tier API users have strict limits (3 requests per minute for GPT-4, for example). Paid tier? Limits are higher. Fix: wait a minute, or upgrade your OpenAI billing plan to increase quotas. Add-ons often handle retries automatically. Apps Script users need to add retry logic manually – or just wait it out.
Stop reading guides that all say the same thing. Pick the method that fits your actual use case, not the one that’s easiest to sell. Test small, then scale.