{
 "openapi": "3.1.0",
 "info": {
  "title": "Gyro Public API",
  "version": "2.30.0",
  "summary": "Manage Gyro cloud servers, SSH keys and billing programmatically.",
  "x-summary-tr": "Gyro bulut sunucularınızı, SSH anahtarlarınızı ve faturalarınızı programla yönetin.",
  "contact": {
   "name": "Gyro Hosting",
   "url": "https://www.gyrohosting.com"
  },
  "license": {
   "name": "Proprietary",
   "identifier": "LicenseRef-Gyro-API-Terms"
  }
 },
 "servers": [
  {
   "url": "https://www.gyrohosting.com/api/v1/client",
   "description": "Production"
  }
 ],
 "paths": {
  "/cloud/storage": {
   "post": {
    "tags": [
     "Object storage"
    ],
    "operationId": "createStorageServices",
    "summary": "Order Object Storage (S3)",
    "x-summary-tr": "Nesne depolama (S3) sipariş et",
    "x-scope": "cloud_order",
    "x-cli": {
     "command": "storage create",
     "money": true
    },
    "description": "Orders 1..N storage services of a plan in ONE order (`quantity`, default 1, max 25) and pays from the account balance (never a stored card). Billed per `cycle` (monthly | quarterly | semiannually | annually; fixed EUR prices charged in the account currency) and renewed from the balance like other services. `extra_traffic` (`1tb` | `5tb`) adds a one-time traffic pack for this month; `object_lock_buckets` (protected plans, 1-50) buys object lock rights (billed every cycle). `name` (with `{n}`), `tags` and `project_id` label the services. Send `\"dry_run\": true` for a quote; a real order needs `\"confirm\": true` and an `Idempotency-Key` header. The first bucket and the first access key are created automatically within about a minute (status `inprocess` -> `active`); then use `/cloud/storage/{id}/buckets`, `/cloud/storage/{id}/keys` and `/cloud/storage/{id}/connect`. Errors: 402 `insufficient_balance`, 409 `capacity_unavailable`, 422 `confirm_required` (with `quote`), `product_not_orderable`, `cycle_invalid`, `invalid_extra_traffic`, `invalid_object_lock`, `invalid_quantity`; 429 `daily_limit`.",
    "x-description-tr": "Bir paketten 1..N depolama hizmetini TEK siparişte açar (`quantity`, varsayılan 1, en çok 25) ve hesap bakiyesinden öder (kayıtlı kart asla). `cycle` dönemine göre ücretlendirilir (monthly | quarterly | semiannually | annually; sabit EUR fiyat hesap para biriminde) ve diğer hizmetler gibi bakiyeden yenilenir. `extra_traffic` (`1tb` | `5tb`) bu ay için tek seferlik trafik paketi ekler; `object_lock_buckets` (korumalı paketler, 1-50) nesne kilidi hakkı alır (her dönem ücretlenir). `name` (`{n}` ile), `tags` ve `project_id` hizmetleri adlandırır. Teklif için `\"dry_run\": true`; gerçek sipariş `\"confirm\": true` ve `Idempotency-Key` başlığı ister. İlk kova ve ilk erişim anahtarı yaklaşık bir dakikada kendiliğinden oluşur (durum `inprocess` -> `active`); sonra `/cloud/storage/{id}/buckets`, `/keys`, `/connect`.",
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "plan": {
          "type": "string",
          "example": "standard-1tb",
          "description": "plan from GET /cloud/storage/plans",
          "x-description-tr": "GET /cloud/storage/plans paketi"
         },
         "product_id": {
          "type": "integer",
          "description": "product id instead of plan",
          "x-description-tr": "plan yerine ürün kimliği"
         },
         "cycle": {
          "type": "string",
          "enum": [
           "monthly",
           "quarterly",
           "semiannually",
           "annually"
          ],
          "default": "monthly",
          "description": "billing cycle",
          "x-description-tr": "fatura dönemi"
         },
         "quantity": {
          "type": "integer",
          "minimum": 1,
          "default": 1,
          "description": "services to create in one order (--count), max 25",
          "x-description-tr": "tek siparişte açılacak hizmet (--count), en çok 25"
         },
         "extra_traffic": {
          "type": "string",
          "enum": [
           "1tb",
           "5tb"
          ],
          "description": "one-time traffic pack for this calendar month",
          "x-description-tr": "bu takvim ayı için tek seferlik trafik paketi"
         },
         "object_lock_buckets": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "description": "protected plans: object lock bucket rights (billed every cycle)",
          "x-description-tr": "korumalı paketler: nesne kilitli kova hakkı (her dönem)"
         },
         "name": {
          "type": "string",
          "maxLength": 60,
          "example": "gyro-yedek-{n}",
          "description": "name (nickname); {n} = number in a batch",
          "x-description-tr": "ad (takma ad); toplu siparişte {n} = sıra no"
         },
         "tags": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 10
         },
         "project_id": {
          "type": [
           "integer",
           "null"
          ],
          "description": "project (0 = default project)",
          "x-description-tr": "proje (0 = Genel)"
         },
         "end_customer_id": {
          "type": "integer",
          "description": "reseller main key: assign to this end-customer"
         },
         "confirm": {
          "type": "boolean"
         },
         "dry_run": {
          "type": "boolean"
         }
        }
       },
       "example": {
        "plan": "standard-1tb",
        "cycle": "monthly",
        "name": "gyro-proje-s3",
        "extra_traffic": "1tb",
        "confirm": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Dry-run quote"
     },
     "201": {
      "description": "Ordered and paid; services are being set up",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "storage": {
             "type": "object",
             "description": "first service"
            },
            "services": {
             "type": "array",
             "items": {
              "type": "object"
             }
            },
            "quantity": {
             "type": "integer"
            },
            "plan": {
             "type": "string"
            },
            "cycle": {
             "type": "string"
            },
            "order": {
             "type": "object"
            },
            "payment": {
             "type": [
              "object",
              "null"
             ]
            },
            "invoice": {
             "type": [
              "object",
              "null"
             ]
            }
           }
          }
         }
        }
       }
      }
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     },
     "422": {
      "$ref": "#/components/responses/Validation"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    }
   }
  }
 },
 "components": {
  "responses": {
   "RateLimited": {
    "description": "Too many requests (`rate_limited`); see the `Retry-After` and `X-RateLimit-*` headers",
    "headers": {
     "Retry-After": {
      "description": "Seconds to wait",
      "schema": {
       "type": "integer"
      }
     }
    },
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Validation": {
    "description": "Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Conflict": {
    "description": "State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Forbidden": {
    "description": "Key lacks the scope, IP not allowed, or feature disabled",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "PaymentRequired": {
    "description": "Account balance does not cover the order (`insufficient_balance`)",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "error"
    ],
    "properties": {
     "error": {
      "type": "object",
      "required": [
       "code",
       "message"
      ],
      "properties": {
       "code": {
        "type": "string",
        "example": "server_not_found"
       },
       "message": {
        "type": "string"
       },
       "details": {
        "type": "object",
        "additionalProperties": true,
        "description": "Extra data. Limit refusals add the LimitHint fields (`limit_exceeded: true`, `limit_key`, `limit`, `current`, `how_to_increase`, `support_ticket`, `hint`): account limits are raised with a support ticket. Validation errors (length, format) never carry the limit hint.",
        "x-description-tr": "Ek veri. Sınır retlerinde LimitHint alanları gelir: hesap sınırları destek talebiyle artırılır. Doğrulama hataları (uzunluk, biçim) sınır ipucu taşımaz."
       }
      }
     }
    }
   }
  },
  "parameters": {
   "IdempotencyKey": {
    "name": "Idempotency-Key",
    "in": "header",
    "required": true,
    "schema": {
     "type": "string",
     "minLength": 8,
     "maxLength": 191
    },
    "description": "Unique per logical request (e.g. a UUID). Replays within 24 hours return the stored answer."
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}