POST
/
cloud
/
v1
/
ssh_keys
/
{project_id}
Python
from gcore import Gcore

client = Gcore(
    api_key="My API Key",
)
ssh_key_created = client.cloud.ssh_keys.create(
    project_id=1,
    name="my-ssh-key",
)
print(ssh_key_created.id)
{
  "created_at": "2025-06-16T17:05:50Z",
  "fingerprint": "86:75:ce:e7:e9:1e:f0:79:ec:6f:d8:92:9b:43:fc:4d",
  "id": "36a7a97a-0672-4911-8f2b-92cd4e5b0d91",
  "name": "my-ssh-key",
  "private_key": "<private_key>",
  "project_id": 1,
  "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIjxL6g1II8NsO8odvBwGKvq2Dx/h/xrvsV9b9LVIYKm my-username@my-hostname",
  "shared_in_project": true,
  "state": "ACTIVE"
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project ID

Examples:

1

Body

application/json
name
string
required

SSH key name

Required string length: 1 - 255
Examples:

"my-ssh-key"

public_key
string

The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information.

  • If you’re uploading your own key, provide the public part here (usually found in a file like id_ed25519.pub).
  • If you want the platform to generate an Ed25519 key pair for you, leave this field empty — the system will return the private key in the response once only.
Examples:

"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIjxL6g1II8NsO8odvBwGKvq2Dx/h/xrvsV9b9LVIYKm my-username@my-hostname"

shared_in_project
boolean
default:true

SSH key is shared with all users in the project

Examples:

true

false

Response

201 - application/json

Created

created_at
string<date-time>
required

SSH key creation time

Examples:

"2025-06-16T17:05:50Z"

fingerprint
string
required

Fingerprint

Examples:

"86:75:ce:e7:e9:1e:f0:79:ec:6f:d8:92:9b:43:fc:4d"

id
string<uuid4>
required

SSH key ID

Examples:

"36a7a97a-0672-4911-8f2b-92cd4e5b0d91"

name
string
required

SSH key name

Required string length: 1 - 255
Examples:

"my-ssh-key"

private_key
string | null
required

The private part of an SSH key is the confidential portion of the key pair. It should never be shared or exposed. This key is used to prove your identity when connecting to a server.

If you omit the public_key, the platform will generate a key for you. The private_key will be returned once in the API response. Be sure to save it securely, as it cannot be retrieved again later.

Best practice: Save the private key to a secure location on your machine (e.g., ~/.ssh/id_ed25519) and set the file permissions to be readable only by you.

Examples:

"<private_key>"

project_id
integer
required

Project ID

Examples:

1

public_key
string
required

The public part of an SSH key is the shareable portion of an SSH key pair. It can be safely sent to servers or services to grant access. It does not contain sensitive information.

Examples:

"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIjxL6g1II8NsO8odvBwGKvq2Dx/h/xrvsV9b9LVIYKm my-username@my-hostname"

shared_in_project
boolean
required

SSH key will be visible to all users in the project

Examples:

true

state
enum<string>
required

SSH key state

Available options:
ACTIVE,
DELETING