{
  "openapi": "3.1.0",
  "info": {
    "title": "AGY Resets API",
    "version": "1.0.0",
    "description": "Read-only access to Gemini quota resets in Google Antigravity, as announced on X by the Antigravity team and sorted by an AI classifier. The reset watch is a rule-based heuristic, not a forecast. Not affiliated with Google."
  },
  "servers": [
    {
      "url": "https://agyresets.com"
    }
  ],
  "paths": {
    "/api/v1/status": {
      "get": {
        "summary": "Latest reset, open promise, active watch and stats",
        "operationId": "getStatus",
        "responses": {
          "200": {
            "description": "Current status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/resets": {
      "get": {
        "summary": "Published resets, newest first",
        "operationId": "listResets",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "next_cursor from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Only resets announced at or after this ISO 8601 date or time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Only resets announced before this ISO 8601 date or time.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of resets",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResetsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Source": {
        "type": "object",
        "description": "A post linked to a reset. role: primary (the announcement), echo (another account repeating it), follow_up (adds rollout or scope details), promise (announced before it happened).",
        "properties": {
          "id": {
            "type": "string"
          },
          "author": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "posted_at": {
            "type": "string",
            "format": "date-time"
          },
          "role": {
            "type": "string",
            "enum": [
              "primary",
              "echo",
              "follow_up",
              "promise"
            ]
          }
        },
        "required": [
          "id",
          "author",
          "url",
          "posted_at",
          "role"
        ],
        "additionalProperties": false
      },
      "Reset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The X post id of the announcement."
          },
          "announced_at": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "weekly",
              "rate_limit",
              "unspecified"
            ]
          },
          "models": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Model quota pools, e.g. [\"gemini\"], [\"argon\", \"gemini\"], [\"all\"]."
          },
          "plans": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Plans covered, e.g. [\"all\"], [\"paid\"], [\"unspecified\"]."
          },
          "trigger": {
            "type": "string",
            "enum": [
              "model_launch",
              "load",
              "incident",
              "backlash",
              "product_release",
              "none"
            ]
          },
          "limit_change": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "text": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "x_post"
                ]
              },
              "author": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "type",
              "author",
              "url"
            ],
            "additionalProperties": false
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source"
            }
          }
        },
        "required": [
          "id",
          "announced_at",
          "kind",
          "models",
          "plans",
          "trigger",
          "limit_change",
          "note",
          "text",
          "source",
          "sources"
        ],
        "additionalProperties": false
      },
      "ScheduledReset": {
        "type": "object",
        "description": "A reset a tracked account promised that has not happened yet.",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled"
            ]
          },
          "announced_at": {
            "type": "string",
            "format": "date-time"
          },
          "text": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "x_post"
                ]
              },
              "author": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "type",
              "author",
              "url"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "status",
          "announced_at",
          "text",
          "source"
        ],
        "additionalProperties": false
      },
      "Watch": {
        "type": "object",
        "description": "A rule-based reset watch signal with its rule and track record. reset_chance_percent is always null: there is no probability model.",
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "elevated",
              "strong"
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "model_launch",
              "load",
              "incident",
              "promise"
            ]
          },
          "reset_chance_percent": {
            "type": "null"
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "rule": {
            "type": "string"
          },
          "track_record": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "x_post"
                ]
              },
              "author": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "type",
              "author",
              "url"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "level",
          "reason",
          "reset_chance_percent",
          "observed_at",
          "expires_at",
          "rule",
          "track_record",
          "text",
          "source"
        ],
        "additionalProperties": false
      },
      "Stats": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "last_reset_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "days_since_last": {
            "type": [
              "number",
              "null"
            ]
          },
          "avg_interval_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "median_interval_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "longest_gap_days": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "total",
          "last_reset_at",
          "days_since_last",
          "avg_interval_days",
          "median_interval_days",
          "longest_gap_days"
        ],
        "additionalProperties": false
      },
      "Meta": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "string",
            "enum": [
              "v1"
            ]
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "api_version",
          "generated_at"
        ],
        "additionalProperties": false
      },
      "StatusResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "latest_reset": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Reset"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "scheduled_reset": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ScheduledReset"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "active_watch": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Watch"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "stats": {
                "$ref": "#/components/schemas/Stats"
              }
            },
            "required": [
              "latest_reset",
              "scheduled_reset",
              "active_watch",
              "stats"
            ],
            "additionalProperties": false
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "additionalProperties": false
      },
      "ResetsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Reset"
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "has_more": {
                "type": "boolean"
              },
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "has_more",
              "next_cursor"
            ],
            "additionalProperties": false
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        },
        "required": [
          "data",
          "pagination",
          "meta"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}