{
 "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/token": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "operationId": "pollDeviceToken",
    "security": [],
    "summary": "Poll for the key (device code)",
    "x-summary-tr": "Anahtarı sorgula (cihaz kodu)",
    "x-cli": {
     "command": "auth login"
    },
    "description": "No API key. 400 errors while waiting: `authorization_pending` (keep polling every `interval` s), `slow_down` (details.interval is the new interval), `access_denied` (denied in the browser, or the account can no longer get a key), `expired_token`, `invalid_grant` (unknown or already used code). 200 once: the new key (`access_token`).",
    "x-description-tr": "API anahtarı gerekmez. Beklerken 400 hataları: `authorization_pending` (her `interval` saniyede sormaya devam), `slow_down` (details.interval yeni aralık), `access_denied` (tarayıcıda reddedildi ya da hesap artık anahtar alamıyor), `expired_token`, `invalid_grant` (bilinmeyen ya da kullanılmış kod). 200 bir kez: yeni anahtar (`access_token`).",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_code": {
          "type": "string"
         }
        },
        "required": [
         "device_code"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Approved: the key, once",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DeviceToken"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "authorization_pending | slow_down | access_denied | expired_token | invalid_grant",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "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."
       }
      }
     }
    }
   },
   "DeviceToken": {
    "type": "object",
    "properties": {
     "access_token": {
      "type": "string",
      "description": "The new client API key (wck_…), returned exactly once"
     },
     "token_type": {
      "type": "string",
      "const": "Bearer"
     },
     "key": {
      "$ref": "#/components/schemas/AuthKey"
     },
     "account": {
      "$ref": "#/components/schemas/AuthAccount"
     }
    }
   },
   "AuthAccount": {
    "type": "object",
    "description": "Masked account identity.",
    "properties": {
     "id": {
      "type": "integer"
     },
     "name": {
      "type": "string",
      "example": "G*** P***"
     },
     "email": {
      "type": "string",
      "example": "g***@example.com"
     }
    }
   },
   "AuthKey": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "name": {
      "type": "string",
      "example": "Gyro CLI · laptop · 2026-11-15"
     },
     "token_prefix": {
      "type": "string",
      "example": "wck_4J4TOQcLG"
     },
     "source": {
      "type": "string",
      "enum": [
       "panel",
       "api",
       "device"
      ],
      "description": "where the key was created; device = gyro auth login"
     },
     "expires_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "permissions": {
      "type": "integer",
      "description": "number of endpoint permissions"
     },
     "scopes": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Gyro API scopes among them (cloud_read, services_write, ...)"
     },
     "sub_account": {
      "type": "boolean"
     },
     "ips": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}