Service Keys

View as Markdown

NGC Service Keys allow programmatic access to NVIDIA Cloud Functions with fine-grained scope control. Unlike Personal API Keys, which are tied to an individual user, Service Keys are tied to a Nvidia Cloud Account. This means permissions are not dependent on any individual user’s account status. Service Keys let you grant only the specific permissions a workload requires — for example, an inference service may only need the Invoke Function scope while a deployment pipeline may need Deploy Function and List Functions.

Service Keys can be created and managed at org.ngc.nvidia.com/service-keys. For general information on NGC API keys, see the NGC User Guide.

Available Scopes

Each Service Key is configured with one or more scopes that determine which Cloud Functions operations are permitted.

ScopeDescription
Invoke FunctionAllows access to invoke a cloud function.
List FunctionsAllows access to list cloud functions.
List Function DetailsAllows access to list details for a cloud function.
Queue DetailsAllows access to get details of the queues associated with functions.
Register FunctionAllows access to register a cloud function.
Deploy FunctionAllows access to deploy a cloud function.
Update FunctionAllows access to update a cloud function.
Delete FunctionAllows access to delete a cloud function.
Authorize ClientsAllows sharing or removing access to a cloud function.
Update Function SecretsAllows access to update a cloud function’s secrets.
Manage Registry CredentialsAllows access to manage cloud function registry credentials.
Manage TelemetriesAllows access to manage cloud function telemetries.
List ClustersAllows access to list clusters.
Read GPU Quota RuleAllows access to read GPU quota rules.
GPU CapacityAllows access to read GPU availability, capacity, and instance types.

Resource Types

Each Service Key is configured with a resource type that controls which entities the key can access. You select the resource type in the UI when creating the key.

Resource TypeDescription
All FunctionsGrants access to all functions in the account. Supported by most function-related scopes.
FunctionGrants access to a specific function and all its versions. Use this to restrict a key to a single function (e.g. a key used only to deploy or invoke one particular function).
Function VersionsGrants access to specific versions of a function.
All ClustersGrants access to all clusters in the account. Used with cluster management scopes.
All EntityGrants access to all resource types, scoped to your organization. This is the broadest resource type. Some scopes — such as registry credentials, telemetry, GPU quota, and GPU capacity — only support this resource type.

The following scopes only work with the All Entity resource type. Selecting any other resource type will result in a 403 error:

  • Manage Registry Credentials
  • Manage Telemetries
  • Read GPU Quota Rule
  • GPU Capacity

Scope Requirements

The table below shows which scopes are required for each Cloud Functions CLI action, and which entity types the key resource must be set to.

A Service Key must be configured with both the required scope and a compatible resource type. If an action supports multiple resource types (e.g. All Functions or Function), you can use either to grant broad or narrowed access respectively.

ActionRequired Scope(s)Supported Entity TypesNGC CLI Example
Create FunctionRegister FunctionAll Functions, All Entityngc cf function create --health-uri /health ...
Deploy FunctionDeploy Function, List FunctionsAll Functions, Function, All Entityngc cf function deploy create --deployment-specification ...
Invoke FunctionInvoke FunctionAll Functions, Function(invoked via API; no direct CLI equivalent)
Get / List FunctionsList Functions, List Function DetailsAll Functions, Function, All Entityngc cf function info <id>:<version>; ngc cf function list
Update FunctionUpdate FunctionAll Functions, Function, All Entityngc cf function update; ngc cf update-rate-limit
Delete FunctionDelete FunctionAll Functions, Function, All Entityngc cf function delete
Update Function SecretsUpdate Function SecretsAll Functions, Function, All Entityngc cf update-secret
Authorize Clients (share access)Authorize ClientsAll Functionsngc cf function authorization add
List ClustersList ClustersAll Clusters, All Entityngc cf cluster ls
Manage Registry CredentialsManage Registry CredentialsAll Entity onlyngc cf registry-credential create; ngc cf registry-credential list
Manage Telemetry EndpointsManage TelemetriesAll Entity onlyngc cf telemetry-endpoint create; ngc cf telemetry-endpoint list
GPU QuotaRead GPU Quota RuleAll Entity onlyngc cf gpu quota
GPU Instance Types / CapacityGPU CapacityAll Entity onlyngc cf gpu ls; ngc cf gpu capacity

Troubleshooting

Common 403 Errors

A 403 Forbidden response when using a Service Key typically means either a required scope is missing or the resource type is not compatible with the API being called. The following scenarios cover the most common causes.

Scope is missing for the action

Each API operation requires a specific scope. If your key was not configured with that scope, the request will be rejected with a 403. Verify the scope your key has against the Scope Requirements Matrix and regenerate the key with the correct scope if needed.

Example: Calling the deploy API with a key that only has the Register Function scope will fail. The key must also include Deploy Function.

Resource type is incompatible with the scope

Each scope only authorizes requests for compatible resource types. Even if the scope is correct, using the wrong resource type will cause a 403.

Example: A key with Manage Registry Credentials and resource type All Functions will be rejected — this scope requires the All Entity resource type. See the important note in the Resource Types section for the full list of scopes that require All Entity.

Key is scoped to a specific Function but the request targets a different function

When a key is configured with the Function resource type and a specific function ID, it can only be used for that function. Requests targeting any other function ID will return a 403.

Example: A deploy key scoped to function abc-123 cannot be used to deploy function xyz-789. Use the All Functions resource type for keys that need to operate across multiple functions.

Deploying a function requires both Deploy Function and List Functions scopes

The deploy API requires the Deploy Function scope to create or update a deployment, but it also calls the function listing API internally to validate the function. A key that has only Deploy Function without List Functions will return a 403.

Ensure keys used for deployment include both Deploy Function and List Functions scopes.

Authorize Clients used with a non-All Functions resource type

The Authorize Clients scope only supports the All Functions resource type. Using it with Function, Function Versions, or All Entity will result in a 403.

Recently updated key still returning 403

After modifying a Service Key’s scopes or resource type, it can take up to 15 minutes for the changes to propagate. Requests made before propagation completes will continue to be evaluated against the previous authorization policy and may return a 403.

If you have recently updated a key and are seeing unexpected 403 errors, wait 15 minutes and retry before further debugging.