How an AI Assistant With Your Own API Key Works on a Mac
An AI assistant with your own API key runs on your OpenAI or Anthropic account and you pay the provider per use. How it works, risks, and setup.

An AI assistant with your own API key sends your requests to a model provider such as OpenAI or Anthropic using a key from your own account, so the provider bills you for what you use and the app adds no AI charge of its own. You choose the model and see the bill directly, in return for looking after the key and keeping an eye on usage.
Put simply: bring your own key (BYOK) means the assistant does its thinking on your provider account instead of on an AI subscription the app sells you.
This guide explains how that works in everyday terms, how a key differs from a ChatGPT or Claude plan, what such an assistant can and cannot do today, the risks to watch, and how to try one on a Mac. One Mac example used throughout is Ninja Bots, the team of AI bots that comes with Mac Ninja and runs on an OpenAI or Anthropic API key, your Claude or ChatGPT plan, or a model on your Mac.
What does 'bring your own API key' mean?
It means the app has no AI of its own to sell you; you connect it to a model provider with a key from your account. The provider does the thinking and bills you, and the app only handles the interface and the actions.
An API key is a long secret string a provider gives you in its developer console. Any app holding it can call the provider's models and charge the usage to your account, which is why it should be treated like a password.
There are four common ways an assistant gets its AI:
| How the assistant gets AI | Who you pay for the AI | How it is billed | Where your text goes |
|---|---|---|---|
| Built into the app's own subscription | The app maker | Included in the app's plan, with its limits | To the app maker, then to whichever model it uses |
| Your own API key | The model provider (OpenAI, Anthropic) | Pay as you go, per amount of text processed | To the provider, on your account |
| Your own chat plan (ChatGPT, Claude) | The provider | Your monthly plan, with its usage limits | To the provider, signed in as you |
| A model on your Mac | Nobody per request | Your Mac's power and disk | Stays on the Mac |
Ninja Bots accepts the last three. It has no AI subscription of its own, and Mac Ninja adds no fee per request; see bring your own AI.
How does an AI assistant with your own API key work?
You create a key with your provider, paste it into the assistant once, and from then on every request the assistant makes is sent to that provider under your key. The provider answers and records the usage on your account.
- Create a key. Sign in to your provider's developer console (OpenAI's platform dashboard or the Anthropic Console), add billing, and create a key.
- Add it to the assistant. Paste the key into the app's AI settings. A careful app stores it in the operating system's protected storage rather than in a plain file.
- Ask or assign a task. The app sends your words, plus any file text, screenshot or web page the task needs, to the provider.
- The model replies. The provider returns the answer and counts the text in and out, usually in units called tokens.
- Agents repeat the loop. An assistant that acts, not only chats, may call the model many times for one task: read a file, decide, take a step, check, and call again.
What it costs
API usage is priced per token and the rate depends on the model you pick. A short question uses little; an agent task that reads several files or web pages uses much more, because all that text goes to the model. Check your provider's billing settings for a budget or usage limit, and look at the usage page during your first week so there are no surprises.
Is an API key the same as a ChatGPT or Claude plan?
No. A ChatGPT or Claude plan is a monthly subscription for the provider's own apps with usage limits, while an API key is separate pay-as-you-go billing meant for developers and other apps. Having one does not give you the other.
Some desktop assistants accept both. Ninja Bots uses a Claude plan through Claude Code and a ChatGPT plan through Codex, signed in as you, and the plan's own limits and terms apply. Step-by-step guides: use your Claude plan in a desktop AI assistant and use your ChatGPT plan in a desktop AI assistant.
- Pick an API key if you want to choose exact models, pay only for what you use, or you don't have a chat plan.
- Pick your plan if you already pay for ChatGPT or Claude and prefer a predictable monthly cost within its limits.
- Pick a local model if you want the model's work to stay on your Mac; see self hosted AI personal assistant.
Keep your key and your account to yourself. Sharing a key or account, or trying to get around a provider's limits, breaks its terms.
What can an AI assistant with your own key do today?
The key decides which model thinks and who bills you; the app decides what the assistant can actually do. Two apps on the same key can be very different: one only chats, another works with your files and the web.
On a Mac, Ninja Bots shows what an assistant that acts can do with your key:
- A team, not one chat. Each bot is a ninja with its own instructions, AI model, schedule and conversations, so one bot can run on your Anthropic key, another on your OpenAI key and a third on a local model.
- Files and the web. Bots can work with files on the Mac and browse the web in a built-in browser of their own.
- Ask from any app. A keyboard shortcut brings up the ask bar; the reply appears under it and can be opened as a conversation in Ninja Bots. From Mac Ninja 2.0.13 you can paste a screenshot or files copied in Finder into the bar, and nothing leaves the Mac until you press Return.
- Help while you work. Ninja, the always-on bot in the menu bar, offers help in a small bubble. For email, his one offer today is drafting a reply in Apple's Mail or in Gmail in a browser (Gmail in English, macOS 13 or later). The draft is put into a reply only on your click and sent only when you click Send; Outlook and other mail sites aren't supported yet.
What it cannot do: run on Windows, iPhone or the web, think without a plan, key or local model, or send email by itself. And any model can be wrong, so check a bot's work before you rely on it. More examples: what an AI assistant that works on your Mac can do today.
What are the risks of using your own API key?
The main risks are a leaked key that someone else spends on, an app that sends more of your data than you expect, and an agent that acts with more access than it needs. All three are manageable if you check a few things before you paste a key.
- Key leaks. Anyone with the key can bill your account. Don't paste it into chats, documents or shared notes, and revoke it in the provider console if you think it escaped. Ninja, in Mac Ninja's menu bar, can warn you when a secret key is on the clipboard.
- Where the key is stored. Ninja Bots seals keys with macOS's protected storage, and there is no Ninja Bots account to sign in to.
- What is sent where. With Ninja Bots, a task goes only to the provider you set up, on your account; with a model on the Mac, the work stays on the Mac. Bots, conversations and settings stay on the Mac, and nothing about bots, tasks or emails goes to macninjaa.com. Your provider's own data terms apply to what it receives. Details: what is sent where.
- What the agent may do. A new Ninja Bots bot starts with Full access: it can run commands, read and change files and use the internet with your rights without asking each step, and use the screen once allowed under Accessibility and Screen Recording. It still asks before using a saved login, setting up a routine, adding a skill or talking to another bot. Lower access in a bot's settings (Permissions) for any bot that doesn't need it; see what a bot may do.
- Mistakes and cost. Models get things wrong and agent loops use tokens. Review results, and set a spending limit with your provider if it offers one.
How do you try an AI assistant with your own API key on a Mac?
Install an assistant that accepts keys, add your key once, create a bot with only the access it needs, and give it a small task you can check. With Ninja Bots this takes a few minutes.
What you need
- A Mac on macOS 12 Monterey or later, Apple silicon or Intel, with about 1 GB free (Ninja's email offers need macOS 13).
- Mac Ninja with a license or its free 7-day trial (no card needed). Ninja Bots is inside Mac Ninja from version 2.0, so there is nothing more to download.
- Your own OpenAI or Anthropic API key, Claude or ChatGPT plan, or a local model (Ollama, LM Studio or any OpenAI-compatible server).
Steps
- Download Mac Ninja from the free trial page and open it.
- Option-click the ninja in the menu bar to open the Ninja Bots window.
- Add your API key as the AI for your bots, following setting up your AI.
- Choose New Bot… in Mac Ninja's menu, write its instructions and pick its model.
- Open the bot's settings and lower Permissions if the bot only needs to answer or read.
- Use Give a Bot a Task or the ask bar shortcut and start with something you can verify, such as summarizing a file you know well.
- Check the result and your provider's usage page before giving it bigger jobs.
Mac Ninja costs $19.99 a month or $200 a year for up to 3 Macs, with a 14-day money-back guarantee; no AI subscription is included because the AI is your own. See plans and honest limits.
Who should pick something else: anyone on Windows, iPhone or the web only, anyone without an AI plan, key or local model, and anyone who wants a bot to send email for them.
What to do next
If you already have an OpenAI or Anthropic key and a Mac on macOS 12 or later, start the free 7-day trial, add your key and set up one bot with lowered access. If you are still comparing options, read what an AI personal assistant is and the best AI assistants compared by what they do.
Frequently asked questions
Is it cheaper to use an AI assistant with your own API key?
It depends on how you use it. With a key you pay the provider per token, so light use can cost little while long agent tasks that read many files or pages cost more. A chat plan gives a fixed monthly price within its limits. Watch your provider's usage page for a week, set a budget if offered, then decide which suits you.
Is it safe to paste my OpenAI or Anthropic API key into an app?
It can be, if the app stores the key in protected storage and sends tasks only to your provider. Ninja Bots seals keys with macOS's protected storage, has no account of its own and sends nothing about tasks to macninjaa.com. Keep the key out of chats and documents, and revoke it in your provider console if you think it leaked.
Can I use my ChatGPT Plus or Claude subscription instead of an API key?
With some assistants, yes. Ninja Bots can use a Claude plan through Claude Code or a ChatGPT plan through Codex, signed in as you, and the plan's own limits and terms apply. An API key is billed separately by the provider, so having a plan does not give you API credit, and the reverse is also true.
Does my data go to the assistant's maker when I use my own key?
That depends on the app, so read its privacy page. With Ninja Bots, a task goes only to the AI provider you set up, on your account, and bots, conversations and settings stay on your Mac. Nothing about bots, tasks or emails goes to macninjaa.com, which only serves the download and a daily check for a newer version.
Can an AI assistant with my own key send emails for me?
Some tools can, but Ninja Bots does not. Ninja offers to draft a reply when an email is open in Apple's Mail or in Gmail in a browser, shows the draft for you to edit, puts it into a reply only on your click, and sends it only when you click Send. Outlook and other mail sites are not supported yet.
Do I need a powerful Mac to use my own API key?
No. With an API key the model runs on the provider's servers, so any Mac on macOS 12 Monterey or later, Apple silicon or Intel, with about 1 GB free can run Ninja Bots. A strong Mac matters only if you choose a local model through Ollama, LM Studio or another OpenAI-compatible server instead of a key.
Published November 26, 2026, updated November 27, 2026. Spotted a mistake? Email support@macninjaa.com.


