Show SSH Key Pair Details
GET /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.
Source
Request
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| project_id | path | string | The UUID of the project (tenant). |
| keypair_name | path | string | The name of the key pair to retrieve. |
| user_id (Optional) | query | string | For 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
| Name | Type | Description |
|---|---|---|
| keypair | object | Wrapper object containing the key pair data. |
| keypair.id | integer | Internal numeric identifier of the key pair. |
| keypair.name | string | The name of the key pair. |
| keypair.public_key | string | Public key material. May include a descriptive trailing comment (e.g. VSTOR-KEY-DESC:...). |
| keypair.fingerprint | string | MD5 fingerprint of the public key (colon-delimited hex). |
| keypair.user_id | string | User ID that owns the key pair. |
| keypair.created_at | string | Creation timestamp (ISO 8601). |
| keypair.updated_at | null | Always null (not currently used). |
| keypair.deleted | boolean | Always false (soft-delete not applied here). |
| keypair.deleted_at | null | Always null. |
| keypair.type | string | Key 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
{
"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.