Before you start
To create a key, your organization needs:- An active paid plan: Pro, Power, or Enterprise. The Free plan doesn’t include API access. A trial, or a plan with an overdue payment, doesn’t count.
- API billing enabled. Open the Billing tab and click Enable API billing. See Billing.
- No API invoice with a failed payment.
- No usage review in progress. While DeepMask reviews recent usage, you can’t create keys. See When requests are paused.
Creating a key
Open the Keys tab
Name the key
Set a key spending cap (optional)
Choose the key's models
Create the key

Name the key, set an optional cap, and pick the models it can use.
Choosing models
Model access offers two options:- Type in Search models to filter by model name, ID, or provider.
- Provider groups start collapsed. Click a provider to show or hide its models. When you search, every matching group opens.
- The count next to a provider, such as
2/12, shows how many of its models you selected. - Click Select all or Clear to change a whole provider at once. While you search, these buttons read Select matches and Clear matches.
- Click the ⓘ button next to a model to see its details, including its context window, image input and tool calling support, and pricing. See Model details while creating a key.
Setting a key spending cap
A key spending cap limits one key’s monthly model costs and can’t be more than the Gateway spending cap, which is the organization-wide cap shared by all keys. See Key spending caps for the rules and how both caps work together.Saving your key
After you click Create key, the dialog changes to Save your API key. It shows the key’s name, its number of models, and the full key under API key. Keys start withsk- followed by 64 hexadecimal characters.
Copy the key
Store it securely
DEEPMASK_API_KEY.Close the dialog
Testing your key
Before you click I’ve saved it, you can test the key from the same dialog.Set the environment variable
DEEPMASK_API_KEY in your terminal, for example with export DEEPMASK_API_KEY="sk-...".Copy the test command
Run the command
Reviewing your keys
The Keys tab lists your organization’s keys, newest first. The number on the tab counts every key that isn’t revoked.
The Keys tab lists each key with its models, status, and cap usage.
Viewing a key’s models
Click the model count on a key, such as 3 models, to expand its Model access list. Each model shows its name and, when it differs, its API model ID. Click a model to copy its ID for themodel field of your requests.
Your app can also call GET /v1/models with the key. It returns only the models that key can use. See Models.
Key statuses
Why a key is inactive
A key shows Inactive when something on your organization’s account blocks API requests. The notice at the top of the API page tells you the cause and how to fix it. See Account notices for every notice and what to do about it. Keys also show Inactive while API access for your organization is being set up. The notice then says “API access is being set up. New keys stay inactive until it’s ready.” A key can also show Inactive for a moment while a change to your account is applied. If a key stays Inactive and no notice explains why, open the Billing tab and check the API billing status. While a key is Inactive, your app’s requests with it are refused. Depending on the cause, your app gets one of these errors:403API_SUBSCRIPTION_INACTIVE: your paid plan or API billing isn’t active.403API_SUBSCRIPTION_INACTIVEor402API_PAYMENT_FAILED: an API invoice payment failed. Most failed payments make the subscription past due and return403. See If a payment fails.503API_ADMISSION_UNAVAILABLE: API access for your organization is still being set up, a change to your account is still being applied, or requests are paused while DeepMask reviews recent usage. Unclear outcomes, such as provider errors or broken streams, pause requests only when your organization has more than 20 within 24 hours. Usage that DeepMask can’t verify yet can also pause requests. See When requests are paused.503API_ACCOUNTING_REVIEW: requests are paused while DeepMask reviews recent usage, and the request was already being processed when the pause began.401API_CREDENTIAL_INVALID: your organization’s API account is closed.
Editing a key’s spending cap
To add, change, or remove a key’s cap, click ⋮ next to the key and choose Edit spending cap. See Add, change, or remove a key cap for the steps.Changing a key’s models
You can’t change which models an existing key can use. This also means All current models never picks up models added to the catalog later. To give an app a different set of models, replace its key:Create a new key
Update your app
Revoke the old key
Revoking a key
Revoke a key when an app no longer needs it, or right away if the key may have leaked.Open the key's actions
Confirm
Revoked keys
Revoked keys move to Revoked keys below your key list. The section starts collapsed and shows how many revoked keys you have, such as Revoked keys (1). Click it to see each key’s name, last characters, revocation date, and model count. It lists up to 150 revoked keys, most recently created first. Requests made with a revoked key keep its name in the Request log. See Usage and logs.Security best practices
- Use one key per app and environment. For example, create separate keys for “Production service” and “Staging”. You can then revoke one without affecting the others. The Request log also shows which key made each request. Your organization’s Requests per minute, Tokens per minute, and Concurrent requests limits apply to all keys together, so extra keys don’t raise them. See Fair use.
- Name keys clearly. Key names don’t have to be unique, so pick names that tell your keys apart.
- Grant only the models an app needs. Use Choose models instead of All current models when an app needs a few models.
- Set a key spending cap. A cap limits what a single key can spend if it’s misused.
- Keep keys out of your code. Store keys in a secret manager or an environment variable such as
DEEPMASK_API_KEY. Never commit a key to source control. - Call the API from your server. Never put a key in browser, mobile, or desktop app code, where anyone can extract it.
- Rotate keys regularly. Create a new key, update your app, confirm it works, then revoke the old key.
- Revoke leaked keys immediately. If a key may be exposed, revoke it first. Then create a replacement and review the Request log for requests you don’t recognize.
- Review your admins. Every organization admin can manage all API keys. Keep your list of admins current. See Team management.
Troubleshooting
“Revoke an existing key before creating another”
“Revoke an existing key before creating another”
“Key creation could not be completed”
“Key creation could not be completed”
“Too many API management changes. Retry shortly.”
“Too many API management changes. Retry shortly.”
Your app gets API_CREDENTIAL_INVALID
Your app gets API_CREDENTIAL_INVALID
Authorization: Bearer <key> header. Then check that the key’s last characters match a key in your list that doesn’t show Pending or Revoking and isn’t under Revoked keys. See Errors and retries.Your app gets API_MODEL_NOT_ALLOWED
Your app gets API_MODEL_NOT_ALLOWED
Your app gets API_KEY_SPENDING_CAP
Your app gets API_KEY_SPENDING_CAP