On this page

API keys

An API key identifies your organization. Each key has one or more scopes.

ScopeUse
inferenceSend requests to models and deployments.
deployMake and change models, deployments and secrets.
readRead deployments, usage, logs and metrics.

A live key uses real resources and costs money. A test key is for development.

A key belongs to the organization. It also records the member who made it. To give keys to the people of your company, read Give access to your team.

Make a key#

  1. In the dashboard, go to API keys.
  2. Select Create key.
  3. Type a name and select the scopes.
  4. Optional: select Only these models and select the models that the key can use.
  5. Optional: type a monthly budget in US dollars.
  6. Select Create.
  7. Copy the key and keep it in a safe place.

The dashboard shows the key only one time. Nuemetrix keeps only a hash of the key, so Nuemetrix cannot show it again.

A key with the scope deploy needs a recent second-factor check. If the check is older than 15 minutes, the dashboard asks you to confirm your identity again.

The budget field shows only to owners, because only owners can make keys and also set budgets. Billing members set budgets on the key's row.

Limit a key to some models#

A key can have a list of 1 to 50 models. Each item is a shared model ID, such as llama-3.1-8b, or a deployment ID, such as dep_abc123. A deployment ID also permits the adapters of that deployment.

With a list, the key gets these answers:

  • A request to a model in the list works as usual.
  • A request to another model gets 403 permission_denied with the message "the API key may not use this model".
  • GET /v1/models shows only the models in the list.
  • An unknown model still gets 404 not_found.

You cannot change the list of a key. To change it, make a new key and revoke the old key.

The create request of the dashboard has the list in the field models. Only a signed-in member can make keys; an API key cannot make keys.

json
{
  "name": "coding-team",
  "scopes": ["inference"],
  "kind": "live",
  "models": ["qwen3-coder", "dep_abc123"]
}

Set a budget for a key#

A key budget is a monthly limit in US dollars for the key's tokens and audio on shared models. At 100%, the key gets 402 budget_reached until you raise the budget or the next month starts.

  1. Go to API keys.
  2. On the key's row, in the Budget this month column, select Set.
  3. Type the amount and select Save budget.

To limit all the keys of one person, use a member budget. Read Cost control.

Revoke a key#

  1. Go to API keys.
  2. Find the key in the list.
  3. Select Revoke and confirm.

Requests with a revoked key fail immediately.

Nuemetrix also revokes keys in these cases:

  • The member who made the key leaves the organization. This includes removal by SCIM from your identity provider.
  • The member who made the key gets the role billing or viewer. These roles cannot make keys.
  • GitHub secret scanning reports the key in a public repository.

Before you remove a member, the dashboard lists the keys that the removal revokes. If applications use these keys, make replacement keys first.

Keep keys safe#

  • Do not put a key in source code or in a container image.
  • Use a different key for each application or person.
  • Give each key only the models that it needs.
  • Give each key an expiry date.
  • Revoke a key immediately if you think that another person knows it.