Create a key
- Open Inference API in the Compute console.
- In API keys, select New key.
- Enter a unique label using lowercase letters, numbers, and hyphens.
- Select Create.
- Copy the full key and store it securely.
- Select Copy and close only after you have saved it.
- Status
- Label
- Masked key
- Last used time
- Created date
Use a key in a request
Send the key as a bearer token when calling an endpoint:curl quick-start snippets.
See Call your Inference API endpoint for complete examples.
Disable a key
Disable a key when you want to stop requests that use it without revoking the key permanently.- Open the key’s options menu.
- Select Disable.
- Confirm that you understand requests using the key will fail while it is disabled.
- Select Disable key.
Re-enable a key
To make a disabled key work again:- Open its options menu.
- Select Re-enable.
Revoke a key
Revoke a key when it should never work again, for example when you are rotating credentials or believe the key has been exposed.- Open the key’s options menu.
- Select Revoke.
- Review the confirmation checklist.
- Confirm that dependent applications have been updated or no longer need the key.
- Select Permanently revoke.
- Requests using that key fail permanently.
- The action cannot be undone.
- Running endpoints stay online and are billed at their effective rate after any organization discount.
- You need a new key for any application that still requires access.
Store and rotate keys safely
- Give each key a label that identifies its application, environment, or purpose.
- Keep key secrets out of source code and repositories.
- Store them in environment variables or a secrets manager.
- Use separate keys when you want to be able to disable or revoke one application without affecting another.
- Check Last used before removing credentials that may still be active.
Keys and organizations
Keys belong to the organization in which they were created. If you work with more than one Compute organization, confirm the active organization before creating a key or troubleshooting authentication. Use a key from the same organization as the endpoint you are calling.Troubleshoot authentication
If a request is rejected:- Confirm you copied the complete key when it was created.
- Check that its status is Active.
- Confirm the request sends
Authorization: Bearer .... - Confirm the key and endpoint belong to the same organization.
- Check that you are calling the endpoint URL shown by Inference API rather than the Compute public API.