# Access Keys

Access Keys allow users to authenticate and interact programmatically with the NVIDIA Run:ai API. Each access key consists of a client ID and secret that can be used to obtain authentication tokens. Access keys can be managed by individual users for their own use, or by administrators for organization-wide access. For more information, see [Access control](https://run-ai-docs.nvidia.com/self-hosted/2.24/infrastructure-setup/authentication/overview/#role-based-access-control).

## Get a list of access keys.

> Retrieve a list of the user's access keys.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Access Keys","description":"Access Keys allow users to authenticate and interact programmatically with the NVIDIA Run:ai API.\nEach access key consists of a client ID and secret that can be used to obtain authentication tokens.\nAccess keys can be managed by individual users for their own use, or by administrators for organization-wide access.\nFor more information, see [Access control](https://run-ai-docs.nvidia.com/self-hosted/2.24/infrastructure-setup/authentication/overview/#role-based-access-control).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"AccessKeys":{"type":"object","required":["accessKeys"],"properties":{"accessKeys":{"type":"array","minItems":0,"maxItems":100,"items":{"$ref":"#/components/schemas/AccessKey1"}}}},"AccessKey1":{"type":"object","required":["name","id","clientId","createdAt","lastLogin"],"properties":{"name":{"type":"string","description":"The name of the access key."},"clientId":{"type":"string","description":"The client identifier associated with the access key. Used when requesting authentication tokens."},"id":{"type":"string","description":"The unique identifier of the access key."},"createdAt":{"type":"string","format":"date-time","nullable":true,"description":"The timestamp for when the access key was created."},"lastLogin":{"type":"string","format":"date-time","nullable":true,"description":"The timestamp of the last time the access key was used to authenticate."}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/access-keys":{"get":{"summary":"Get a list of access keys.","description":"Retrieve a list of the user's access keys.","operationId":"get_access_keys","tags":["Access Keys"],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessKeys"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Create an access key.

> Used to create an access key.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Access Keys","description":"Access Keys allow users to authenticate and interact programmatically with the NVIDIA Run:ai API.\nEach access key consists of a client ID and secret that can be used to obtain authentication tokens.\nAccess keys can be managed by individual users for their own use, or by administrators for organization-wide access.\nFor more information, see [Access control](https://run-ai-docs.nvidia.com/self-hosted/2.24/infrastructure-setup/authentication/overview/#role-based-access-control).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"AccessKeyCreationRequest1":{"type":"object","required":["name"],"properties":{"name":{"type":"string","pattern":"^[a-z][-_a-z0-9]*[a-z0-9]$","description":"The name of the access key. The name must be unique within the user's access keys list and can only contain lowercase alphanumeric characters and hyphens. It must start and end with a letter.","minLength":2,"maxLength":255}}},"AccessKeyPostResponse":{"type":"object","required":["id","name","clientSecret","clientId","createdAt"],"properties":{"id":{"type":"string","description":"The unique identifier of the access key."},"clientId":{"type":"string","description":"The client identifier associated with the access key. Used when requesting authentication tokens."},"name":{"type":"string","description":"The name of the access key."},"clientSecret":{"type":"string","description":"Secret credential paired with the client ID. Used to obtain authentication tokens. Displayed only once upon creation."},"createdAt":{"format":"date-time","nullable":true,"type":"string","description":"The timestamp for when the access key was created."}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409Conflict":{"description":"The specified resource already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/access-keys":{"post":{"summary":"Create an access key.","description":"Used to create an access key.","operationId":"create_access_key1","tags":["Access Keys"],"requestBody":{"description":"Access key object to create","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessKeyCreationRequest1"}}}},"responses":{"201":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessKeyPostResponse"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"409":{"$ref":"#/components/responses/409Conflict"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get access key by id.

> Retrieve the details of an access key by id.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Access Keys","description":"Access Keys allow users to authenticate and interact programmatically with the NVIDIA Run:ai API.\nEach access key consists of a client ID and secret that can be used to obtain authentication tokens.\nAccess keys can be managed by individual users for their own use, or by administrators for organization-wide access.\nFor more information, see [Access control](https://run-ai-docs.nvidia.com/self-hosted/2.24/infrastructure-setup/authentication/overview/#role-based-access-control).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"accessKeyId":{"name":"accessKeyId","in":"path","required":true,"description":"The access key ID","schema":{"type":"string"}}},"schemas":{"AccessKey1":{"type":"object","required":["name","id","clientId","createdAt","lastLogin"],"properties":{"name":{"type":"string","description":"The name of the access key."},"clientId":{"type":"string","description":"The client identifier associated with the access key. Used when requesting authentication tokens."},"id":{"type":"string","description":"The unique identifier of the access key."},"createdAt":{"type":"string","format":"date-time","nullable":true,"description":"The timestamp for when the access key was created."},"lastLogin":{"type":"string","format":"date-time","nullable":true,"description":"The timestamp of the last time the access key was used to authenticate."}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/access-keys/{accessKeyId}":{"get":{"summary":"Get access key by id.","description":"Retrieve the details of an access key by id.","operationId":"get_access_key_by_id1","tags":["Access Keys"],"parameters":[{"$ref":"#/components/parameters/accessKeyId"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessKey1"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Delete an access key by id.

> Use to delete an access key by id.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Access Keys","description":"Access Keys allow users to authenticate and interact programmatically with the NVIDIA Run:ai API.\nEach access key consists of a client ID and secret that can be used to obtain authentication tokens.\nAccess keys can be managed by individual users for their own use, or by administrators for organization-wide access.\nFor more information, see [Access control](https://run-ai-docs.nvidia.com/self-hosted/2.24/infrastructure-setup/authentication/overview/#role-based-access-control).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"accessKeyId":{"name":"accessKeyId","in":"path","required":true,"description":"The access key ID","schema":{"type":"string"}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/access-keys/{accessKeyId}":{"delete":{"summary":"Delete an access key by id.","description":"Use to delete an access key by id.","operationId":"delete_access_key_by_id","tags":["Access Keys"],"parameters":[{"$ref":"#/components/parameters/accessKeyId"}],"responses":{"204":{"description":"Executed successfully."},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Regenerate an access key secret.

> Use to regenerate the access key secret by id.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Access Keys","description":"Access Keys allow users to authenticate and interact programmatically with the NVIDIA Run:ai API.\nEach access key consists of a client ID and secret that can be used to obtain authentication tokens.\nAccess keys can be managed by individual users for their own use, or by administrators for organization-wide access.\nFor more information, see [Access control](https://run-ai-docs.nvidia.com/self-hosted/2.24/infrastructure-setup/authentication/overview/#role-based-access-control).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"accessKeyId":{"name":"accessKeyId","in":"path","required":true,"description":"The access key ID","schema":{"type":"string"}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/access-keys/{accessKeyId}/secret":{"post":{"summary":"Regenerate an access key secret.","description":"Use to regenerate the access key secret by id.","operationId":"regenerate_access_key_secret","tags":["Access Keys"],"parameters":[{"$ref":"#/components/parameters/accessKeyId"}],"responses":{"200":{"description":"Regenerated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"clientSecret":{"type":"string","description":"Secret credential paired with the client ID. Used to obtain authentication tokens."}}}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get a list of all access keys.

> Retrieve a list of all access keys.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Access Keys","description":"Access Keys allow users to authenticate and interact programmatically with the NVIDIA Run:ai API.\nEach access key consists of a client ID and secret that can be used to obtain authentication tokens.\nAccess keys can be managed by individual users for their own use, or by administrators for organization-wide access.\nFor more information, see [Access control](https://run-ai-docs.nvidia.com/self-hosted/2.24/infrastructure-setup/authentication/overview/#role-based-access-control).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"AccessKeysAdministration":{"type":"object","required":["accessKeys"],"properties":{"accessKeys":{"type":"array","minItems":0,"maxItems":100,"items":{"$ref":"#/components/schemas/AccessKeyAdministration"}}}},"AccessKeyAdministration":{"type":"object","required":["name","id","clientId","createdBy","createdAt","lastLogin"],"properties":{"name":{"type":"string"},"id":{"type":"string"},"clientId":{"type":"string"},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time","nullable":true},"lastLogin":{"type":"string","format":"date-time","nullable":true}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/administration/access-keys":{"get":{"summary":"Get a list of all access keys.","description":"Retrieve a list of all access keys.","operationId":"get_access_keys_administration","tags":["Access Keys"],"parameters":[{"description":"Filter results by clientId","in":"query","name":"clientId","required":false,"schema":{"type":"string"}},{"description":"Filter results by creatdBy","in":"query","name":"createdBy","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessKeysAdministration"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Delete an access key by id for administrations.

> Use to delete an access key by id for administrations.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Access Keys","description":"Access Keys allow users to authenticate and interact programmatically with the NVIDIA Run:ai API.\nEach access key consists of a client ID and secret that can be used to obtain authentication tokens.\nAccess keys can be managed by individual users for their own use, or by administrators for organization-wide access.\nFor more information, see [Access control](https://run-ai-docs.nvidia.com/self-hosted/2.24/infrastructure-setup/authentication/overview/#role-based-access-control).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"accessKeyId":{"name":"accessKeyId","in":"path","required":true,"description":"The access key ID","schema":{"type":"string"}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/administration/access-keys/{accessKeyId}":{"delete":{"summary":"Delete an access key by id for administrations.","description":"Use to delete an access key by id for administrations.","operationId":"delete_access_key_by_id_administration","tags":["Access Keys"],"parameters":[{"$ref":"#/components/parameters/accessKeyId"}],"responses":{"204":{"description":"Executed successfully."},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```
