Show SSH Key Pair Details
/v2.1/{project_id}/os-keypairs/{keypair_name}Retrieve the detailed information for a specific key pair identified by keypair_name within the authenticated project.
Request
Parameters
project_idstringrequiredpathThe UUID of the project (tenant).
keypair_namestringrequiredpathThe name of the key pair to retrieve.
user_idstringqueryFor administrators: retrieve a key pair owned by the specified user ID. New in version 2.10
Although some references show
user_idin the request body, standard usage is as a query parameter for GET requests.
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/{project_id}/os-keypairs/key1
http request
GET https://api.vietnix.cloud:8774/v2.1//os-keypairs/apikey1
Response
Response Body Fields
keypairobjectrequiredWrapper object containing the key pair data.
10 fields
idintegerrequiredInternal numeric identifier of the key pair.
namestringrequiredThe name of the key pair.
public_keystringrequiredPublic key material. May include a descriptive trailing comment (e.g. VSTOR-KEY-DESC:...).
fingerprintstringrequiredMD5 fingerprint of the public key (colon-delimited hex).
user_idstringrequiredUser ID that owns the key pair.
created_atstringrequiredCreation timestamp (ISO 8601).
updated_atnullrequiredAlways null (not currently used).
deletedbooleanrequiredAlways false (soft-delete not applied here).
deleted_atnullrequiredAlways null.
typestringrequiredKey type: ssh or x509. New in version 2.2
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. |
| 404 - Not Found | The specified key pair does not exist. |
Sample Response
Response body
{
"keypair": {
"name": "apikey1",
"public_key": "ssh-rsa AAAA<...> VSTOR-KEY-DESC:Key description",
"fingerprint": "67:c0:a2:8a:b4:c8:50:de:80:91:ed:79:14:17:37:90",
"created_at": "2025-10-08T08:49:39.071378",
"user_id": "64166c7effeb4a89b59c073588099640",
"deleted": false,
"deleted_at": null,
"id": 183,
"updated_at": null
}
}
Notes & Tips
- Use the fingerprint to verify integrity after importing or distributing a key.
- Descriptive suffixes (comments) after the base key material aid auditing but must not modify the key itself.
- Administrative retrieval with
user_idrequires appropriate policy permissions and a compatible microversion (≥ 2.10). - Key type
x509support (microversion ≥ 2.2) may require additional configuration; if unsupported, the API may reject such keys at creation time.