Use your own OpenAI key in Leefy
Last updated 2026-07-28
Why would I use my own OpenAI key?
Every AI action in Leefy — improve, grow, synthesize, prune, produce, coach — costs money at the model provider. By default Leefy pays that bill and takes Leefy credits off your balance. Connect your own OpenAI key instead and those actions run on your OpenAI account: no Leefy credits are spent on that provider at all, and you pay OpenAI directly at OpenAI's own rates with nothing added on top.
Worth doing if you already have an OpenAI account, if you'd rather have all your AI spend on one bill, or if you plan to use Leefy heavily. Entirely optional — Leefy credits work with no setup, and you can remove your key later without breaking anything.
About ten minutes. No developer, no terminal.
What do I need before I start?
- An email address you can check now, and a phone that can receive a text. OpenAI may ask you to verify a number before it will let you create a key.
- A payment card. This is the step people skip. It is also, on OpenAI specifically, the step that hides its own failure — see the warning below.
- A browser signed in as you. Locked-down company accounts sometimes can't create API keys at all.
Two things to be clear about before you spend anything:
A ChatGPT Plus subscription is not API billing. ChatGPT Plus pays for the ChatGPT app. The API — which is what Leefy uses — has a separate balance that your subscription never touches. Paying for one gives you nothing on the other.
And on OpenAI, Leefy's "Validated" badge does not prove your key can generate text. When you save a key, Leefy asks OpenAI whether the key is real. OpenAI will confirm a key is real even when the account has no credit and even when the key is read-only. Both of those save cleanly, show as validated, and then fail on your first actual AI action. So do the billing step and the permissions step properly — a green badge here isn't the whole story, and we would rather tell you that than let you find out later.
How do I create an OpenAI account?
If you already have an OpenAI platform account, skip to billing.
- Open the OpenAI platform: platform.openai.com. This is the developer side of OpenAI, a different place from chatgpt.com — if you end up in a chat window, you're in the wrong product.
- Sign up with your email address, or with Google, Microsoft or Apple. If you already use ChatGPT, the same login works.
- Confirm the email OpenAI sends you.
- Verify a phone number if asked. OpenAI asks once, and it has to happen before you can create a key.
- Name your organisation if prompted. If it's just you, your own name or your company name is fine — it only appears on invoices.
You're in the right place when you can see a developer dashboard with sections like Playground, Dashboard, Docs and API keys.
How do I add billing before the key will work?
Do this before you create the key. A new OpenAI account has no API credit, and a key without credit fails every real request — while still looking perfectly healthy in Leefy.
- Open platform.openai.com/settings/organization/billing/overview, or click Settings and then the billing section.
- Add a payment method.
- Add credit to your balance. OpenAI's API runs on prepaid credit you buy in advance and choose the size of. A small first purchase is plenty to prove Leefy works.
- Set a monthly budget or usage limit while you're there. Strongly recommended: it puts a hard ceiling on the worst case. Be aware that hitting that limit stops your key working until you raise it — so if things suddenly stop, this is the first place to look.
- Optionally turn on auto-recharge, so your balance tops itself up rather than running dry mid-session.
You're done when the billing page shows a credit balance above zero and a payment method on file.
How do I create the API key?
- Open platform.openai.com/api-keys, or find API keys in the dashboard menu.
- Create a new secret key.
- Name it
Leefy. The name is only for you — but it's what lets you see, on OpenAI's usage page, exactly what Leefy costs versus anything else you connect. - Leave the project on the default unless you've deliberately set up others. Keys belong to one project, and each project can have its own budget and limits — so a key in the wrong project can fail even when your main balance is healthy.
- Set the permissions to All. Read the next section before you click past this — it's the one setting that fails silently.
- Create the key, and copy it now. OpenAI shows the full key exactly once, on this screen. Close the dialog and it's gone permanently — there is no "show it again". That's deliberate, and it isn't a problem: if you lose a key you delete it and make another. Nothing else breaks.
- Store it somewhere safe for the next two minutes — a password manager is ideal. Don't email it to yourself, and don't paste it into a shared document.
An OpenAI key starts with sk- — usually sk-proj- for a project key — followed by a long string. If what you copied doesn't start with sk-, you've copied the wrong thing.
Which permissions should the key have?
OpenAI lets you create a key with restricted permissions. This is a good feature that causes a very specific, very confusing failure in Leefy, so it's worth thirty seconds of attention.
Choose All. If your organisation's policy won't allow that, a Restricted key works as long as it has write access to model capabilities — the permission that covers generating text. Read-only will not work.
Here's the trap: a read-only key is a real, valid key. When Leefy checks it, OpenAI confirms it's real, Leefy saves it, and Settings shows it as validated. Everything looks right. Then every AI action fails, because the key isn't allowed to generate anything. If that's where you are, jump to "My key saved fine, but AI actions still fail" — you don't need to debug it, you need a new key with the right permission.
How do I connect the key in Leefy?
- Open Settings in Leefy — in the More menu, and in the command palette under "Settings — AI provider & keys".
- Under AI provider, select OpenAI (GPT). This matters more than it looks. The provider picker decides which key gets used. An OpenAI key saved while Anthropic is selected sits there doing nothing while your Leefy credits carry on being spent.
- Paste the key into the OpenAI field.
- Save.
Leefy checks the key with OpenAI before storing anything. If OpenAI confirms it, Leefy encrypts the key and saves it. If OpenAI refuses it, nothing is stored at all.
How do I know it worked?
- The OpenAI row in Settings shows the last four characters of your key and a Validated state.
- Now run a real AI action on a node — Improve is the fastest. On OpenAI this is the step that actually proves things, not the badge.
- Your Leefy credit balance doesn't move. That's the real proof: with your own key connected, OpenAI actions don't debit credits at all.
- Within a few minutes, the usage page on the OpenAI platform shows activity against the key you named
Leefy.
If credits are still being spent, your key isn't being used — check step 2 above, because the provider picker is almost certainly set to the other provider.
Why was my key rejected?
If Leefy said OpenAI rejected the key, OpenAI actively refused it. That's a key problem, not a money problem.
| Symptom | Cause | Fix |
|---|---|---|
| The key was truncated when you copied it | Keys are long, and double-clicking often selects only part of one | Delete it on the platform, create a new one, and use the copy button rather than selecting by hand |
| You pasted something that isn't an API key | Organisation ids and project ids get pasted here by mistake | Check it starts with sk- |
| The key was deleted or replaced | Someone rotated it, or you replaced it after copying | Create a fresh key and paste that one |
| You pasted an Anthropic key into the OpenAI field | The two fields look identical | Anthropic keys start with sk-ant- and belong in the Anthropic field — see the Anthropic guide |
| The key's project or organisation is disabled | Account-level or project-level controls block the key | Check the project's status on the platform |
If none of those obviously apply, create a brand-new key and try that first. It takes thirty seconds and resolves most cases without any diagnosis.
Why could Leefy not verify my key?
If Leefy said it couldn't verify the key, OpenAI neither accepted nor refused it — the check didn't complete.
| Symptom | Cause | Fix |
|---|---|---|
| It fails no matter what you paste | OpenAI may be having an incident | Check status.openai.com, then try again in a few minutes |
| It failed once and worked on retry | A slow or dropped request | Nothing to fix — this happens occasionally |
| It fails consistently on a work network | A firewall or proxy is blocking the request | Try a different network, or ask whoever runs it to allow api.openai.com |
Note that on OpenAI a missing balance usually does not land here — it lands in the section below instead, because the key saves successfully and only fails later.
My key saved fine, but AI actions still fail
This is the most common OpenAI problem, and the one Leefy's validation can't warn you about. Your key is genuine; something else about the account is stopping it generating text.
Work down this list in order:
| Symptom | Cause | Fix |
|---|---|---|
| Every AI action fails, key is new, account is new | No API credit. OpenAI confirms the key is real but refuses to generate anything on an empty balance | Add credit — see billing |
| Every AI action fails and you chose a restricted key | The key is read-only, or lacks write access to model capabilities | Create a new key with permissions set to All, paste it in Leefy, then delete the old one |
| It worked and suddenly stopped | The prepaid balance ran out, or a monthly budget or project limit was reached | Check the balance, the usage limit, and the limits on the key's project |
| You pay for ChatGPT Plus and expected it to cover this | ChatGPT subscriptions and API credit are separate balances that never meet | Buy API credit on the platform — your subscription is unaffected |
| Only some actions fail, the quick ones work | You're hitting a rate limit on heavier requests | Wait a minute and retry; if it persists, your account is at a rate limit for its tier |
If none of it fits: remove the key in Leefy and try again on Leefy credits. If it works then, the problem is on the OpenAI side. If it fails either way, it's ours — open Help & support in Leefy and tell us what you saw.
Is my key safe in Leefy?
Exactly what happens to the key you paste, so you can judge for yourself rather than take our word for it:
- It travels to Leefy's server over HTTPS and is never stored in your browser.
- Before anything is saved, Leefy checks it with OpenAI. A key OpenAI refuses is never stored at all.
- It is then encrypted with AES-256-GCM on the server. Only the encrypted form reaches Leefy's database. The plain key is never written to the database, never written to logs, and never included in analytics or error reports.
- Leefy keeps the last four characters as a display hint, plus the time it was checked. Nothing else about the key is readable.
- It is decrypted only in the moment one of your own server-side AI actions needs it. It is never sent back to a browser, including yours: once saved, no screen in Leefy can show it to you again.
- Every AI call Leefy makes runs on the server. Your key never touches anyone's browser.
If that still isn't enough assurance for a key with a card behind it, the strongest controls aren't ours — they're OpenAI's. Put the key in its own project, give that project its own budget, and the worst possible case has a number on it.
How do I rotate or remove the key?
To remove it: open Settings in Leefy, find the OpenAI row, and delete the key. It's removed immediately. OpenAI actions go back to spending Leefy credits, and nothing else about your tree changes.
To rotate it: create a new key on the OpenAI platform, paste it into the same field in Leefy, and save — it replaces the old one. Then delete the old key on the platform. In that order, you're never left without a working key.
If you think a key has leaked: delete it on the OpenAI platform first — that's the step that actually stops the spending. Removing it from Leefy alone does not revoke it at OpenAI. Then remove it in Leefy, then create a replacement.
Rotating on a schedule is good practice but isn't required. Once or twice a year, and any time someone leaves your team, is a sensible rhythm.
Is this problem Leefy or OpenAI?
Leefy's error messages are written to tell you which side broke:
| What Leefy tells you | What it means | Where to look |
|---|---|---|
| No OpenAI key is connected | Leefy has no usable key for the provider you currently have selected | Settings — check the provider picker matches the key you saved |
| The AI provider did not answer | The call reached OpenAI and OpenAI failed it | Your balance, your key's permissions, your usage limits, and status.openai.com |
| No credits left, or your trial has ended | Leefy credits — which means your key wasn't used at all | Your key is missing, or it's saved against the other provider |
| That's a lot of AI in one minute | Rate limited | Wait a minute. If it's constant, your OpenAI account is at a rate limit for its tier |
The quickest self-test: remove your key and try the action again. If it now works, the key was the problem. If it fails either way, it isn't your key — open Help & support in Leefy and tell us what you saw.
What if the OpenAI console looks different from this guide?
It will, eventually — OpenAI reorganises the platform regularly and buttons move. This guide is written to survive that:
- Trust the addresses over the labels. The links above are the stable part. If a menu item has been renamed, going straight to the URL usually still lands you in the right place.
- Trust the goal over the wording. There are only four things you need, whatever the buttons are called: a payment method, credit on the balance, a key with permission to generate text, and a copy of that key.
- The order never changes. Billing before key. Permissions before you create. Key before Leefy.
Check the "last updated" date at the top of this page — if it's old and the screens look nothing like this, trust your eyes over the text. And please tell us: open Help & support in Leefy, say which step is wrong and what you actually saw. Runbooks are part of the product here, and a stale one is a bug.