Skip to main content
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

Path Parameters

project_id
integer
required
Examples:

Body

application/json
name
string
required
Required string length: 1 - 255
Examples:
public_key
string
Examples:
shared_in_project
boolean
default:true
Examples:

Response

201 - application/json
created_at
string<date-time>
required
Examples:
fingerprint
string
required
Examples:
id
string<uuid4>
required
Examples:
name
string
required
Required string length: 1 - 255
Examples:
private_key
string | null
required
Examples:
project_id
integer
required
Examples:
public_key
string
required
Examples:
shared_in_project
boolean
required
Examples:
state
enum<string>
required
Available options:
ACTIVE,
DELETING