Choose a credential
Use CLI sign-in or a scoped team API key for every workload. Use a personal API key only for short-lived testing on your own machine: it carries all of your permissions, and Baseten revokes it when you’re deprovisioned or after 30 days without use.
Key types
Personal API keys are tied to your user account and carry your account’s permissions. Baseten attributes actions performed with a personal key to you. Team API keys belong to a team, independent of any individual user. When your organization has teams enabled, team keys can be scoped to a specific team. Choose one permission for a team key:- Full access to all team models: Everything except managing the team and its API keys, including deploying, calling, and training.
- Invoke dedicated models: Call the dedicated models you select, plus Chains when the key covers every model and environment. It can’t call Model APIs, deploy, train, or export metrics.
- Invoke Model APIs: Call the Model APIs you select. It can’t call dedicated models, deploy, train, or export metrics.
- Export metrics for team models: Export metrics for the models you select. It can’t call models, deploy, or train.
Environment-scoped API keys
Environment-scoped API keys are team API keys restricted to specific environments. Use them for least-privilege access when sharing keys with external partners or production integrations. You can scope a key in two ways:- By environment: The key can only call models in the selected environments (for example,
productiononly, orproductionandstaging). - By environment and model: The key can only call specific models within the selected environments.
API key management keys
Use an API key management key to provision and rotate team keys without an individual’s credentials. A management key can:- List teams and models to find the IDs used to scope new keys.
- Create team API keys of any permission level.
- List team API keys and members’ personal API keys.
- Revoke team and personal API keys.
Key expiration
Set an expiration when you create a key. You can’t change it afterward; rotate the key to replace it with one that has a different expiration. An expired key stops authenticating requests.
The dashboard offers 7 days, 30 days, and 90 days, subject to your organization’s limits. Team and API key management keys also offer Never when no limit applies. The Baseten CLI and Management API accept a future timestamp within the applicable limit. Organization Admins can set expiration limits for new keys; changing a limit doesn’t change existing keys.
Keys created before expiration was introduced have no expiration. Expired keys stay on the API keys page, marked Expired in the Expires column, so you can recreate them. Revoked keys can’t be recreated.
Baseten emails the key’s creator a reminder a week before expiration and again the day before. Each reminder includes the key’s last-used timestamp. Team Admins also receive reminders for team keys; Organization Admins receive them for API key management keys.
Automatic revocation of unused personal keys
Baseten automatically revokes personal API keys that haven’t authenticated a request in 30 days, including personal keys with no expiration. Team and API key management keys aren’t revoked for inactivity. Their configured expiration still applies. Check personal keys’ last-used timestamps on the API keys page to find keys approaching revocation. Use a team key for workloads that run less often than every 30 days. Revocation is permanent; create a replacement and update the affected clients to restore access.Create an API key
Choose a credential before you create a key. Create a separate key for each application and environment, so you can revoke one without interrupting the others.- UI
- Baseten CLI
- Management API
To create an API key:
1
Open the API keys page
Sign in to your workspace at app.baseten.co and open API keys under Organization settings.
2
Name the key
Choose Create API key. For Name, enter a name using lowercase letters, numbers, and hyphens, such as
production-inference.3
Set access and expiration
Select the key type for your workload:
Personal
Personal
- Select Personal.
- For Expiration, choose an available duration within your organization’s limit, up to 90 days.
Team
Team
- Select Team.
- For Expiration, choose an available duration, or Never if your organization allows keys without an expiration.
- Choose Next.
- Under Team scope, select the team that owns the resources.
-
Under Permissions, select the access the key needs:
- Full access to all team models: Deploy, call, train, and manage the team’s models.
- Invoke dedicated models: Call the dedicated models you select.
- Invoke Model APIs: Call the Model APIs you select.
- Export metrics for team models: Export metrics without deployment or inference access.
-
Narrow the key’s access for the permission you chose:
- For Invoke dedicated models or Export metrics for team models, select models under Model access. Select the option for all models, such as All dedicated models, only when the key needs every model in the team, including models added later. For Invoke dedicated models, choose environments under Environment access.
- For Invoke Model APIs, select Model APIs under Model API access.
- For Full access to all team models, use Restricted environment access to choose which restricted environments the key can also manage.
API key management
API key management
Only Organization Admins can create these keys.
- Select API key management.
- For Expiration, choose an available duration, or Never if your organization allows it.
4
Create and save the key
Choose Create API key and copy the key immediately; Baseten shows it only once. Store it in a secret manager or your CI provider’s secret store, separate from source code, notebooks, and container images.
5
Check the key's access
Confirm that the new key’s Owner and Expires values match your selections. For a team key, open its details and check the permissions, allowed models, and environment restrictions.
Use API keys with CLIs
The Baseten CLI reads an API key from theBASETEN_API_KEY environment variable. To sign in through your browser or save an API key in a profile, run the following command:
Command
Sign-in prompt
baseten auth login.
For the Truss CLI, the first truss push asks how to authenticate, with the same choice of pasting an API key or logging in via browser (OAuth). You can also sign in before pushing with truss login or its alias, truss auth login. For more information about credential storage, OAuth, and multiple remotes, see truss auth.
To configure or update an API key manually, edit ~/.trussrc:
Use API keys with endpoints
Set your key as an environment variable, or store it in your secret manager:Authorization header using the Bearer scheme:
Bearer works with OpenAI-style clients and AI gateways such as LiteLLM and OpenRouter without extra configuration. Baseten also accepts the legacy Api-Key scheme on every endpoint, so existing scripts using Authorization: Api-Key <key> continue to work:
Frontier Gateway federated API keys are the exception: they only accept the
Api-Key scheme. Workspace API keys used to manage gateway groups still accept either scheme.Rotate a key
Create a replacement with the original key’s type, team, model access, and environment restrictions. Update and test the workload with the replacement before revoking the original. To change the expiration of an existing key, set the new expiration on its replacement. To recreate a key in the dashboard, you must own the personal key, be a Team or Organization Admin for a team key, or be an Organization Admin for a management key. Seeing a key in the list doesn’t grant permission to recreate it.1
Create a replacement
Use dashboard recreation for environment-restricted keys and keys that only call Model APIs. It copies the original key’s current permissions. For CLI and REST creation, preserve the type, team, and complete model list from your provisioning configuration.
- UI
- Baseten CLI
- Management API
To recreate the key with its existing access:
- On the API keys page, choose API key actions next to the original key, then Recreate API key.
- For Name, enter a new name, such as
production-inference-replacement. - For Expiration, choose how long the replacement should last.
- Choose Create API key and copy the new key immediately.
2
Check the replacement's access
Check the replacement’s type, team, and expiration on the API keys page, with
baseten org api-key list, or with List API keys. Confirm that it has a different prefix from the original.Check the complete model list in the dashboard or REST listing. Check environment restrictions and Model APIs access in the dashboard; neither listing includes these settings.3
Update and test the workload
Update the application’s secret or environment variable to use the replacement. Restart or redeploy the application if it loads credentials only at startup.Run an operation the workload normally performs with the replacement key, such as an inference request or a metrics export. Confirm that it returns the expected result without authentication or permission errors before revoking the original.
4
Revoke the original
Revoke the original key by its original prefix. Keep the replacement active and confirm that the workload continues to succeed afterward.
Revoke a key
Revocation is permanent, and requests using the key stop authenticating. If a workload still needs the access, rotate its key first. If a key is exposed, revoke it and check for unauthorized use.- UI
- Baseten CLI
- Management API
To revoke an API key:
- On the API keys page, choose API key actions next to the key, then Revoke API key.
- Choose Delete key to confirm.
Respond to an exposed key
A key is exposed once it appears where others can read it, such as a commit, a log, or a shared message. Treat the key as exposed even after you delete the commit or message.- Revoke the key. Requests that use it stop authenticating.
- Create a replacement and update the workloads that used the exposed key.
- Check the audit log for actions the key performed, and your usage for unfamiliar requests.
Rename a key
Rename keys in the dashboard:- On the API keys page, choose the key to open its details.
- Choose Edit name, enter a new name, and save it.
Administer API keys
The API keys page shows each visible key’s creation date, expiration, and last-used timestamp. Use expiration dates to plan rotation. Use last-used timestamps to find personal keys approaching automatic revocation, and to find keys that nothing uses so you can revoke them.View and revoke keys as an organization Admin
Organization Admins see every key in the workspace: all team API keys plus every member’s personal API keys. The Owner column shows who each key belongs to: the owning member for personal keys, or the team for team keys. Use the Member, Team, and Type filters to narrow the list. Organization Admins can revoke any key in the workspace, including other members’ personal keys. Admins can’t rename other members’ personal keys. To see who created a team API key, check the audit log. All other roles see their own personal keys and any team keys they created. Team Admins also see every key scoped to their teams. The list API keys endpoint follows the same visibility rules. Each personal key includes anowner object with the member’s user_id, email, and name. API key management keys can list and revoke team and personal keys across the organization, making them suitable for automated key rotation and cleanup.
Set expiration limits
As an Organization Admin, set separate expiration limits for personal keys and for team and API key management keys in the dashboard. Changes apply only to new keys; the CLI and Management API don’t expose these settings.- On the API keys page, under Expiration configuration, choose Set expiration limits.
- For Personal key expiration, select 7, 30, or 90 days. Default (90 days) keeps the 90-day maximum.
- For Team & Organization key expiration, select 7, 30, or 90 days, 1 year, or No limit. This limit applies to team and API key management keys.
- Choose Save.
Control who can create API keys
As an Organization Admin, you can stop new personal API keys, new team and API key management keys, or both. Existing keys keep working.These settings are in Private Preview with workload identity federation, and they apply only to organizations that have it turned on. To request access, Contact us.
Whether members can create new personal API keys. Set it to
true to allow new keys again. null isn’t accepted.Whether Team Admins can create team keys and Organization Admins can create API key management keys. Set it to
true to allow new keys again. null isn’t accepted. Despite its name, this field doesn’t control service accounts.BASETEN_API_KEY to a Baseten API key with Organization Admin permissions.
To stop new personal API keys:
Run the following command:
allow_personal_api_keys is false.
To stop new team and API key management keys:
Run the following command:
allow_service_account_api_keys is false.
API key format
Baseten API keys use the stableb10_ prefix so secret-scanning tools can identify exposed credentials. Configure your scanner to match the complete key format:
Keys created before 15:30 UTC on November 9, 2026, don’t contain the
b10_ prefix, so this regular expression detects only keys created on or after that time.Security recommendations
- Store API keys in environment variables or secret managers, not in code.
- Never commit API keys to version control.
- Use environment-scoped keys to limit access to specific environments and models.
- Set the shortest expiration that fits the workload. Rotate keys before they expire.
- Monitor key creation, deletion, and use through the audit log.