SheetMagic includes AI tokens on every paid plan. You write a formula, it calls the AI provider using SheetMagic's keys, and tokens come off your monthly balance. Simple.
But some users want more control. They want to use their own OpenAI, Gemini, or Claude API key. Pay the provider directly, skip the token pool, and set their own spending limits. This is BYOK: Bring Your Own Key.
This guide covers how BYOK works, how to set it up, and when it actually saves you money compared to using included credits.
How BYOK changes your billing
With platform keys (the default), SheetMagic handles everything:
- You get a monthly token pool (3M on Solo, 15M on Team, 35M on Business)
- Every formula call takes tokens from your pool
- When the pool runs out, formulas stop working until it resets
With BYOK, the billing splits in two:
- You pay SheetMagic for the subscription (the add-on, caching, queuing, scraping, all the infrastructure)
- You pay your AI provider directly for token usage at their published rates
- No margin added. You pay exactly what the provider charges
- No monthly token limit. Your limit is whatever you set in your provider's dashboard
BYOK is available on all paid subscriber plans (Solo, Team, Business) as an optional toggle.
Setting up BYOK
Enable BYOK in your dashboard
Go to dashboard.sheetmagic.ai, navigate to your account settings, and toggle Bring Your Own Key on. This tells SheetMagic to use your API keys instead of platform keys for AI calls.
Get an API key from your provider
Go to your AI provider's developer console and create an API key:
- OpenAI: platform.openai.com/api-keys
- Google Gemini: aistudio.google.com/apikey
- Anthropic Claude: console.anthropic.com/settings/keys
Most providers offer free trial credits. OpenAI gives $5 in free credits for new accounts.
Add your key in the SheetMagic sidebar
Open any Google Sheet, go to Extensions > SheetMagic, and click the key icon in the sidebar header. Paste your API key for the provider you want to use. SheetMagic encrypts and stores the key securely in your Google account's user properties. It never leaves your Google environment.
Select your provider and start using formulas
Choose your provider in the sidebar dropdown. Your formulas now route through your own API key. Everything else works exactly the same. Same formulas, same caching, same batch processing.
When BYOK saves you money
BYOK is not always cheaper. Here's the math.
The platform key cost model
Solo plan: $19/month for 3.25M tokens. Your effective cost per 1,000 tokens:
$19 / 3,000 units = ~$0.0063 per 1,000 tokens
The BYOK cost model
With BYOK, you pay the provider's published rates. For GPT-4o (the most popular model):
| Component | Rate per 1M tokens |
|---|---|
| Input tokens | $2.50 |
| Output tokens | $10.00 |
| Blended estimate (60/40 split) | ~$5.50 |
That's ~$0.0055 per 1,000 tokens. Comparable to platform keys on the Solo plan, but with no monthly cap.
The breakeven point
You still pay the SheetMagic subscription for the add-on infrastructure. So the real question is: at what usage level does BYOK plus your subscription cost less than moving up to a bigger plan?
| Monthly Usage | Platform Key Cost | BYOK Cost (Solo + API) | Winner |
|---|---|---|---|
| 500K tokens | $19 (included) | $19 + ~$2.75 | Platform |
| 2M tokens | $19 (included) | $19 + ~$11.00 | Platform |
| 3.25M tokens | $19 (at limit) | $19 + ~$16.50 | Platform |
| 5M tokens | $19 + credit pack | $19 + ~$27.50 | Depends on pack price |
| 10M+ tokens | $49 Team plan | $19 + ~$55.00 | Team plan |
The rule of thumb: If you consistently stay within your plan's token limit, platform keys are simpler and often cheaper. BYOK makes sense when:
- You have unpredictable bursts. Some months 1M tokens, others 8M.
- You want to use cheaper models (GPT-4o-mini at $0.15/$0.60 per 1M tokens is dramatically cheaper).
- You need specific models not available through platform keys.
The biggest BYOK savings come from model selection. GPT-4o-mini handles most text generation tasks at 1/20th the cost of GPT-4o. If your formulas don't need top-tier reasoning, switching to a cheaper model through BYOK can cut your AI costs by 90%+.
BYOK for high-volume translation
This is the use case where BYOK really shines. Translation workflows process massive amounts of text. Every word in the source language becomes tokens in, and every translated word becomes tokens out.
=AITRANSLATE("Translate to Spanish: "&A2)Each row sends the full cell content as input and receives a full translation as output. Token usage scales linearly with text length.
Say you have a product catalog with 1,000 items averaging 100 words each. That's roughly 2M tokens per language. On platform keys, that eats up most of your Solo plan's monthly tokens. With BYOK using GPT-4o-mini, the same job costs about $1.50 in API fees.
For more on translation workflows, see AI translation at scale in spreadsheets (coming soon).
What BYOK does not change
BYOK changes who pays for AI tokens. It doesn't change how SheetMagic works:
- Same formulas.
=AITEXT(),=AIIMAGE(),=GPTV(),=AILIST()all work the same way. - Same caching. Results are cached just like before. Formulas don't re-run unless you change the input.
- Same batch processing. The async processing system handles your requests the same way.
- Same integration credits. Web scraping functions (
=VISIT(),=SERP(), etc.) use integration credits from your plan, not AI tokens. BYOK doesn't affect these.
Who Can Use BYOK
Not every account type supports BYOK. Here's the breakdown.
| Account Type | BYOK Available | Can Toggle Off |
|---|---|---|
| Free tier | No | N/A |
| Paid subscriber (Solo, Team, Business) | Yes | Yes |
| Seat user | Inherits from account owner | N/A |
Free users: BYOK is not available. You use platform keys with your 5,000 monthly token allowance.
Paid subscribers: You can enable BYOK in your dashboard settings. When enabled, your own API keys are used instead of platform keys. You can switch back to platform keys at any time.
Seat users: You inherit BYOK settings from the account owner who assigned you the seat. If the owner uses BYOK, so do you (using the owner's keys for billing purposes).
Security Considerations
Where keys are stored: API keys are stored in Google's UserProperties service, scoped to your Google account. Other users of the same spreadsheet cannot see your keys.
Key rotation: To rotate a key (recommended periodically), go to Extensions > SheetMagic > Manage AI API Keys and update it. The new key takes effect immediately.
Shared spreadsheets: When you share a spreadsheet with a colleague, your API keys do not transfer. If the colleague has BYOK set up, their keys handle their requests. If they use platform keys, platform keys handle theirs. Each user's billing is independent.
Sheet ownership matters: For usage tracking and billing, SheetMagic distinguishes between the sheet owner and the current user. The owner's subscription determines usage quotas. The current user's BYOK setting determines which keys are used for their requests.
Troubleshooting
"Invalid API key" error: Check that you copied the full key without leading or trailing spaces. Verify the key is active in your provider's dashboard.
"Quota exceeded" from the provider: This is a limit on your API provider account, not SheetMagic. Check your provider's usage dashboard and billing settings. You may need to request a rate limit increase.
"BYOK not available" message: Your account type doesn't support BYOK. Free tier users need to upgrade to a paid plan. Seat users inherit from their owner.
Functions work for you but not your colleague: Each user's BYOK configuration is independent. Your colleague needs to set up their own API keys (or use platform keys through their own subscription).
For a complete overview of AI in Google Sheets, including all functions and provider options, see The Complete Guide to AI in Google Sheets.
Getting started
You need a paid SheetMagic plan to enable BYOK. The free tier uses platform keys only.
Not sure if BYOK is right for you? Start with platform keys on the free tier. You get 20,000 tokens to test every formula. No credit card needed. Move to Solo ($19/mo) when you're ready, use the included 3.25M tokens for a month, and then decide if BYOK makes sense based on your actual usage.
For the complete formula reference, see how to use AI formulas in Google Sheets. To understand how token budgeting works at scale, read how to process 1,000 rows without hitting limits.
Have questions about BYOK setup or pricing? visit the FAQ.


