BYOK: Using Your Own AI API Keys in Google Sheets
BackGuides

BYOK: Using Your Own AI API Keys in Google Sheets

Phil
Phil
6 min read

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, 80M 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. LTD (Lifetime Deal) users always use BYOK. It's the only mode available to them since LTD plans don't include platform AI tokens.


Setting up BYOK

1

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.

2

Get an API key from your provider

Go to your AI provider's developer console and create an API key:

Most providers offer free trial credits. OpenAI gives $5 in free credits for new accounts.

3

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.

4

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 3M 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):

ComponentRate 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 UsagePlatform Key CostBYOK Cost (Solo + API)Winner
500K tokens$19 (included)$19 + ~$2.75Platform
2M tokens$19 (included)$19 + ~$11.00Platform
3M tokens$19 (at limit)$19 + ~$16.50Platform
5M tokens$19 + credit pack$19 + ~$27.50Depends on pack price
10M+ tokens$49 Team plan$19 + ~$55.00Team 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.
  • You're an LTD user (BYOK is your only option for AI tokens).

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.

Formula
=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.

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 3,000 tokens to test every formula. No credit card needed. Move to Solo ($19/mo) when you're ready, use the included 3M 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.