Listing SSH Key Pairs
/v2.1/{project_id}/os-keypairsRetrieve all SSH (or X.509) key pairs that belong to the authenticated project. Each item in the result is wrapped in a keypair object.
Source: list-keypairs
Request
Parameters
project_idstringrequiredpathThe UUID of the project (tenant).
user_idstringqueryFor administrators: list key pairs that belong to the specified user ID. New in version 2.10
limitintegerqueryMaximum number of items to return. Use with marker for pagination. New in version 2.35
markerstringqueryID (name) of the last-seen item for pagination. New in version 2.35
Sample Request
Using curl
curl -ks \
-H 'Content-Type: application/json' \
-H 'X-Auth-Token: gAAAAA<...>' \
-H 'X-OpenStack-Nova-API-Version: 2.72' \
https://api.vietnix.cloud:8774/v2.1/os-keypairs
http request
GET https://api.vietnix.cloud:8774/v2.1/f5d834d636c642c7bfe8af86139c6f26/os-keypairs
Response
Response Body Fields
keypairsarrayrequiredArray of key pair wrapper objects. Each element contains a keypair object.
keypairobjectrequiredThe key pair wrapper object.
5 fields
namestringrequiredHuman-readable name of the key pair (unique per user).
public_keystringrequiredThe public key material.
fingerprintstringrequiredMD5 fingerprint of the public key (colon-delimited hex).
typestringrequiredThe key type. Allowed: ssh or x509. New in version 2.2
created_atstringrequiredTimestamp when the key pair was created (ISO 8601).
keypairs_linksarrayPagination or related links (present when pagination is used). New in version 2.35
Status Codes
Success
| Code | Reason |
|---|---|
| 200 - OK | Request succeeded. |
Error
| Code | Reason |
|---|---|
| 401 - Unauthorized | Authentication is required or failed. |
| 403 - Forbidden | Policy does not allow the current user to perform this action. |
Sample Response
Response body
{
"keypairs": [
{
"keypair": {
"name": "Docs Writter",
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDAbqUDd3jvW3fA49sJWv5+iTQR8uPDCx3lt7Y6qcFT9 rumiaxolotl@gmail.com",
"fingerprint": "07:8a:eb:63:6a:4b:b4:fd:be:c9:77:c2:58:da:84:fb",
"created_at": "2025-09-03T09:50:28.194592"
}
}
]
}