---
title: "SSH anahtarları — API başvurusu"
description: "Yeni sunuculara kurulabilen, hesap düzeyinde açık anahtarlar."
url: https://www.gyrohosting.com/developers/tr/api/ssh-keys.html
language: tr
openapi: https://www.gyrohosting.com/developers/openapi.json
api_version: 2.30.0
---

# SSH anahtarları

Yeni sunuculara kurulabilen, hesap düzeyinde açık anahtarlar.

Base URL: `https://www.gyrohosting.com/api/v1/client` · OpenAPI: https://www.gyrohosting.com/developers/openapi.json


## GET /cloud/ssh-keys

**SSH anahtarlarını listele** · operationId `listSshKeys` · scope `cloud_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/listSshKeys.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `page` | query | integer |  |
| `limit` | query | integer |  |

### Yanıtlar

- **200**: SSH keys
- **401**: Missing, invalid or revoked key

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro ssh-key list
```
```hcl
# kaynak gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
  name       = "laptop"
  public_key = file("~/.ssh/id_ed25519.pub")
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/ssh-keys

**SSH anahtarı ekle** · operationId `createSshKey` · scope `cloud_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/createSshKey.json

ssh-ed25519, ecdsa-sha2-nistp256/384/521, sk-ssh-ed25519 ve ssh-rsa (en az 2048 bit) kabul edilir. Hesap başına en fazla 50 anahtar; parmak izi hesapta benzersizdir.


### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `name` (zorunlu) | string |  |
| `public_key` (zorunlu) | string |  |

### Yanıtlar

- **201**: Created
- **401**: Missing, invalid or revoked key
- **403**: Key lacks the scope, IP not allowed, or feature disabled
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Örnekler

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "laptop", "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFaA... me@laptop"}'
```
```bash
gyro ssh-key create --help    # tüm seçenekler
```
```hcl
# kaynak gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
  name       = "laptop"
  public_key = file("~/.ssh/id_ed25519.pub")
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", headers=h, json={"name": "laptop", "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFaA... me@laptop"}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name": "laptop", "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFaA... me@laptop"}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/ssh-keys/{id}

**SSH anahtarını getir** · operationId `getSshKey` · scope `cloud_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/getSshKey.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |

### Yanıtlar

- **200**: SSH key
- **404**: Not found — also returned for objects owned by someone else

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro ssh-key get 12345
```
```hcl
# kaynak gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
  name       = "laptop"
  public_key = file("~/.ssh/id_ed25519.pub")
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/ssh-keys/{id}

**SSH anahtarını sil** · operationId `deleteSshKey` · scope `cloud_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/deleteSshKey.json

Anahtarı hesabınızdan siler. Anahtarın kurulu olduğu sunucularda anahtar kalır.


### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |

### Yanıtlar

- **200**: Deleted
- **404**: Not found — also returned for objects owned by someone else

### Örnekler

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro ssh-key delete 12345
```
```hcl
# kaynak gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
  name       = "laptop"
  public_key = file("~/.ssh/id_ed25519.pub")
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```
