Skip to content

Leaked Together AI API key? What to do now

Revoke it first, then check what it was used for, cap what your keys can spend and clean up where it leaked. Every Together AI step below comes from Together AI's own docs, checked 17 Nov 2026.

Free. No sign-up.

Whose key leaked?
Where did it leak?

What to do now, for Together AI

  1. Revoke the key now

    In the project's API keys settings, open the key's three-dot menu, choose Revoke key and type “I understand”. The key stops working within about five minutes and can't be restored. Then create a new one. Do this first: until it's revoked, anyone who copied it can keep spending. GitHub has no pattern for Together AI keys, and Together's docs don't say it scans for leaked keys, so don't expect a warning about one in a public repo.

    Together AI API keys

  2. Keep the new key on the server

    Put the new key only in a server-side secret: your host's environment settings, your builder's secrets, or Supabase function secrets. Never in a variable starting NEXT_PUBLIC_, VITE_ or EXPO_PUBLIC_, which are sent to every visitor.

    Lovable secretsBolt secretsSupabase function secrets

  3. Check usage for charges that weren't yours

    Cost analytics can group spend by API key (in beta). The Last used column on the API keys page shows when each key was last used. Note the time the key leaked and the time you revoked it.

    Together AI cost analytics

  4. Cap what any key can spend

    Together is prepaid: API access stops when the organisation's balance reaches $0, but usage metered late is still charged. Auto-recharge keeps buying credits, so it doesn't cap spend. There's no spend limit per key or project yet.

    Together AI billing

  5. Clean up the repo, after revoking

    Remove the key from the code and the git history, but only once it's revoked: anyone who cloned the repo, or a fork, still has it. Then turn on push protection, so GitHub blocks the next key you try to push.

    GitHub: removing sensitive dataGitHub: push protection

  6. If someone ran up charges, ask for them back

    File a ticket from Together AI's support portal, or email support@together.ai. Together's terms say fees paid are non-refundable, and there's no stated policy on usage from leaked keys. Say when the key leaked, when you revoked it and which usage wasn't yours.

    Together AI support

Checked in Together AI's own docs. Sources: API keys, cost analytics, spend controls, credits, support, terms of service. Dashboards move, so if a link is out of date, look for the same setting under account or organisation settings.

Then find every other copy, with your coding agent

Find every place an API key or other secret is exposed in this project, and fix it. Search the code, env files, config and local settings files (such as .claude/settings.local.json), the full git history (with gitleaks or a similar scanner) and the built browser bundle. Flag any secret in a variable with a public prefix such as NEXT_PUBLIC_, VITE_ or EXPO_PUBLIC_, and any AI provider called from browser code. Move every AI call into a server route or function that reads its key from a server-only variable, add .env and local settings files to .gitignore, and list each key that was exposed and where, so I can revoke it. Don't rewrite git history.

Questions

Does Together AI disable a leaked key for you?

GitHub has no pattern for Together AI keys, and Together's docs don't say it scans for leaked keys, so don't expect a warning about one in a public repo. Revoke it yourself either way.

Can I cap what a Together AI key spends?

Together is prepaid: API access stops when the organisation's balance reaches $0, but usage metered late is still charged. Auto-recharge keeps buying credits, so it doesn't cap spend. There's no spend limit per key or project yet.

How do I see what a leaked Together AI key was used for?

Cost analytics can group spend by API key (in beta). The Last used column on the API keys page shows when each key was last used.

Will Together AI refund charges from a leaked key?

File a ticket from Together AI's support portal, or email support@together.ai. Together's terms say fees paid are non-refundable, and there's no stated policy on usage from leaked keys.

How do I find where my Together AI key leaked?

Search your code, your git history and your live site's JavaScript for the first few characters of the old key. Common places are browser code, a committed .env or local settings file, and screenshots.

Other providers