{
 "openapi": "3.1.0",
 "info": {
  "title": "Gyro Public API",
  "version": "2.31.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": {
  "/auth/device/code": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "operationId": "createDeviceCode",
    "security": [],
    "summary": "Start a browser sign-in (device code)",
    "x-summary-tr": "Tarayıcıyla girişi başlat (cihaz kodu)",
    "x-cli": {
     "command": "auth login"
    },
    "description": "No API key. Limits: 10 codes per IP per 10 minutes (429 `rate_limited`). The code is valid for `expires_in` seconds. `template` / `scopes` only preselect permissions on the approval page; the user decides.",
    "x-description-tr": "API anahtarı gerekmez. Sınır: IP başına 10 dakikada 10 kod (429 `rate_limited`). Kod `expires_in` saniye geçerlidir. `template` / `scopes` onay sayfasındaki izinleri yalnız önceden seçer; karar kullanıcınındır.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "client_name": {
          "type": "string",
          "example": "gyro-cli"
         },
         "client_version": {
          "type": "string",
          "example": "1.31.0"
         },
         "hostname": {
          "type": "string",
          "example": "laptop"
         },
         "os": {
          "type": "string",
          "example": "linux/amd64"
         },
         "template": {
          "type": "string",
          "enum": [
           "readonly",
           "dns",
           "cloud",
           "containers",
           "storage",
           "billing",
           "full",
           "custom"
          ]
         },
         "scopes": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "example": [
           "cloud_read",
           "services_read"
          ]
         },
         "lang": {
          "type": "string",
          "enum": [
           "tr",
           "en"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Code issued",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DeviceCode"
          }
         }
        }
       }
      }
     },
     "422": {
      "$ref": "#/components/responses/Validation"
     },
     "429": {
      "description": "rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "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."
       }
      }
     }
    }
   },
   "DeviceCode": {
    "type": "object",
    "properties": {
     "device_code": {
      "type": "string",
      "description": "Secret, single use; send only to /auth/device/token",
      "example": "gdc_…"
     },
     "user_code": {
      "type": "string",
      "example": "BCDF-GHJK",
      "description": "8 letters (no vowels), shown to the user"
     },
     "verification_uri": {
      "type": "string",
      "example": "https://www.gyrohosting.com/device"
     },
     "verification_uri_complete": {
      "type": "string",
      "example": "https://www.gyrohosting.com/device?code=BCDF-GHJK"
     },
     "expires_in": {
      "type": "integer",
      "example": 300
     },
     "interval": {
      "type": "integer",
      "example": 5
     }
    }
   }
  },
  "responses": {
   "Validation": {
    "description": "Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}