Skip to main content

Listing SSH Key Pairs

GET /v2.1/{project_id}/os-keypairs

Retrieve all SSH (or X.509) key pairs that belong to the authenticated project. Each item in the result is wrapped in a keypair object.

info

Request​

Parameters​

NameInTypeDescription
project_idpathstringThe UUID of the project (tenant).
user_id (Optional)querystringFor administrators: list key pairs that belong to the specified user ID. New in version 2.10
limit (Optional)queryintegerMaximum number of items to return. Use with marker for pagination. New in version 2.35
marker (Optional)querystringID (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​

NameTypeDescription
keypairsarrayArray of key pair wrapper objects. Each element contains a keypair object.
keypairobjectThe key pair wrapper object.
keypair.namestringHuman-readable name of the key pair (unique per user).
keypair.public_keystringThe public key material.
keypair.fingerprintstringMD5 fingerprint of the public key (colon-delimited hex).
keypair.typestringThe key type. Allowed: ssh or x509. New in version 2.2
keypair.created_atstringTimestamp when the key pair was created (ISO 8601).
keypairs_links (Optional)arrayPagination or related links (present when pagination is used). New in version 2.35

Status Codes​

Success​

CodeReason
200 - OKRequest succeeded.

Error​

CodeReason
401 - UnauthorizedAuthentication is required or failed.
403 - ForbiddenPolicy does not allow the current user to perform this action.

Sample Response​

{
"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"
}
}
]
}