{
 "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/session": {
   "get": {
    "tags": [
     "Authentication"
    ],
    "operationId": "getAuthSession",
    "summary": "Key in use: account, permissions, expiry",
    "x-summary-tr": "Kullanılan anahtar: hesap, izinler, bitiş",
    "x-cli": {
     "command": "auth status"
    },
    "description": "Any valid key (no scope needed).",
    "x-description-tr": "Geçerli her anahtar (kapsam gerekmez).",
    "responses": {
     "200": {
      "description": "Session",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "key": {
             "$ref": "#/components/schemas/AuthKey"
            },
            "account": {
             "$ref": "#/components/schemas/AuthAccount"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  }
 },
 "components": {
  "responses": {
   "Unauthorized": {
    "description": "Missing, invalid or revoked key",
    "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."
       }
      }
     }
    }
   },
   "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": []
  }
 ]
}