Skip to content
AI · Secret guide

Leaked Together AI API Key: what to do in the first hour

High severityChecked liveLast verified · 5 min read

A Together AI API key lets whoever holds it run inference and fine-tuning jobs against your Together account. Those jobs are billed to you, and they count against the limits of the project the key belongs to. A leaked key is mostly a cost and capacity problem: the attacker’s prompts and training runs are paid for by you, and your own service can be throttled while they run. Delete the key first, then review the usage and jobs that followed.

Check your GitHub account for leaked secrets — free

Provider
Together AI
Severity
High
Impact
SaaS account access and billing
Checked live by LeakWatch
Yes

What a Together AI API Key looks like

Together AI keys begin with tgp_v1_, followed by a fixed-length run of letters, digits, underscores and hyphens. The prefix identifies the type in a file:

tgp_v1_…XXXX   Together AI API key (masked)

The key is sent as a bearer token in an Authorization header, and it is commonly kept in an environment variable named for the vendor. The prefix is what matters for recognition. A value with a different prefix, such as one used by another AI provider, is not a Together key, even when it looks similar at a glance. If you find a tgp_v1_ value, treat it as a live credential until you have checked it in your project settings.

How Together AI API Keys get leaked

  • Environment files committed to repositories. A .env file with the key, pushed because the ignore rule did not cover it.
  • Front-end calls. A request to the inference API made from browser code, which exposes the key to every visitor.
  • Notebooks and scripts. A key pasted into a notebook or a test script, saved with the file and shared with a wider group.
  • Build and deploy logs. A pipeline step that prints the environment, or a debug line that writes the request headers.
  • Examples and tutorials. A snippet copied from documentation or an AI assistant where the placeholder was replaced with a real key and never removed.

What to do in the first hour

  1. Delete the key. Open the account settings for the project in Together AI, go to the API keys section, find the key and delete it. A deleted key stops working shortly after, so the services that use it will need the replacement.
  2. Create a replacement for each service that needs one. Keep the key in a secret manager or the environment of the process that uses it.
  3. Check usage. Review the requests and billing for the project for the period since the exposure. Look for models you do not use, for fine-tuning jobs you did not start, and for a spike in usage.
  4. Check fine-tuning and uploads. Look at any training jobs and uploaded files on the account. An attacker who can start jobs can also upload data, so review what is stored there.
  5. Set a limit. If the account offers spending limits or alerts, set them so that unexpected charges are noticed quickly.
  6. Check the rest of the file. A leaked configuration often holds other keys. Revoke any other provider keys or database passwords kept with it.
  7. Clean the repository. Remove the value from current files, add the environment file to .gitignore, and rewrite history if the repository was public. See I accidentally pushed an API key to GitHub for the full order.

Not sure what else leaked from the same repository? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Together AI

Together AI’s current documentation describes keys that belong to a project. You create and delete them from the API keys settings of that project, where each key shows when it was last used. Deleting a key stops it from working within a few minutes, and the action cannot be undone, so create the replacement first if a live service depends on it. Older documentation describes an account-level key with a regenerate option in the settings menu. A legacy key can also appear in the default project with a deprecated label. If the key that leaked is one of these, follow the path for its type, and check the current console because the layout may have changed. Use the last-used column to see whether anything still depends on the key before you delete it.

How LeakWatch detects it

The rule is called “Together AI API Key”. It looks for the prefix tgp_v1_ followed by exactly 43 letters, digits, underscores or hyphens, with a word boundary before the prefix and a quote, space, semicolon or line end after the value. The match is not case-sensitive. The severity is high, with the SaaS impact class, because the key runs inference and billing on your account. This type is checked live: LeakWatch can check whether a detected key is still active with a read-only request that lists the available models. That request runs no inference and has no cost. LeakWatch does not start jobs, read your data or change anything in your account.

LeakWatch can check whether a detected key is still active with a read-only request to Together AI. It never reads your data or spends your credits.

FAQ

If LeakWatch says the key is valid, what should I do first?

Delete it. A valid result means the key works now, so it can be used to spend your credits at any moment. Create a replacement, deploy it, and then delete the leaked key.

Does a leaked key expose my training data?

It can, if the key can read the files or jobs in the project. Review the uploaded data and the training jobs for the affected project, since the key’s scope is what decides the exposure.

Why does the key belong to a project?

So that usage and limits can be separated between projects. Use one key per project or service, which keeps the next revocation from affecting unrelated work.

Get alerted next time a secret leaks — create a free account

LeakWatch is not affiliated with Together AI.