{
 "openapi": "3.1.0",
 "info": {
  "title": "Agent Wake",
  "version": "1.0.0",
  "description": "Your AI agent picks up where it left off. Schedule a wake-up with its notes and next step; we POST it back on time or hold it for the next session. Free 50 calls a day, then $9 a month. Free 50/day; Pro $9/month: https://pay.instaloops.com/b/aFa28rgOc8QTgdx4Kr83C3v"
 },
 "servers": [
  {
   "url": "https://wake.botrecipe.com"
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  }
 },
 "paths": {
  "/api/run/schedule_wake": {
   "post": {
    "operationId": "schedule_wake",
    "summary": "Schedule a wake-up for your agent",
    "description": "Schedule a wake-up for your agent. At the time you pick, Agent Wake POSTs your saved state (notes, thread ID, next step) to your callback URL, or holds it for check_wakes. Use it so a later, fresh session picks up where this one stopped. Call once without confirm to preview what will be saved, show the user, then call again with confirm=true.",
    "security": [
     {},
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "when": {
          "type": "string",
          "description": "When to wake: \"in 30 minutes\", \"in 2 hours\", \"in 3 days\", or an ISO time like 2026-10-16T14:00:00Z. Between 1 minute and 365 days out."
         },
         "repeat_minutes": {
          "type": "integer",
          "description": "Optional. Repeat every N minutes after the first wake (free: 60+, Pro: 5+)."
         },
         "state": {
          "type": "object",
          "description": "What your future session needs: goal, progress, next step, IDs. Free up to 8 KB, Pro up to 64 KB."
         },
         "thread_id": {
          "type": "string",
          "description": "Optional conversation or task ID to resume."
         },
         "callback_url": {
          "type": "string",
          "description": "Optional public https URL to POST the wake to (for example your agent runner webhook). Without it, collect wakes with check_wakes."
         },
         "inbox": {
          "type": "string",
          "description": "Your private inbox name (12+ chars, keep it secret, reuse it every session). Optional if you send an API key: then the key is your inbox."
         },
         "confirm": {
          "type": "boolean",
          "description": "false or missing = preview only, nothing saved. true = save the wake."
         }
        },
        "required": [
         "when"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with job, understood, outcome, usage",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "bad_agent_key"
     },
     "429": {
      "description": "free_limit_reached (includes upgrade link)"
     }
    }
   }
  },
  "/api/run/check_wakes": {
   "post": {
    "operationId": "check_wakes",
    "summary": "Collect wake-ups that are due for your inbox (each returned once, with its saved state and thread ID) and list upcoming ones",
    "description": "Collect wake-ups that are due for your inbox (each returned once, with its saved state and thread ID) and list upcoming ones. Call this at the start of a session.",
    "security": [
     {},
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "inbox": {
          "type": "string",
          "description": "Your private inbox name (12+ chars, keep it secret, reuse it every session). Optional if you send an API key: then the key is your inbox."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with job, understood, outcome, usage",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "bad_agent_key"
     },
     "429": {
      "description": "free_limit_reached (includes upgrade link)"
     }
    }
   }
  },
  "/api/run/cancel_wake": {
   "post": {
    "operationId": "cancel_wake",
    "summary": "Cancel a pending wake-up by wake_id",
    "description": "Cancel a pending wake-up by wake_id. Call once without confirm to preview, then with confirm=true.",
    "security": [
     {},
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "wake_id": {
          "type": "string"
         },
         "inbox": {
          "type": "string",
          "description": "Your private inbox name (12+ chars, keep it secret, reuse it every session). Optional if you send an API key: then the key is your inbox."
         },
         "confirm": {
          "type": "boolean"
         }
        },
        "required": [
         "wake_id"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with job, understood, outcome, usage",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "bad_agent_key"
     },
     "429": {
      "description": "free_limit_reached (includes upgrade link)"
     }
    }
   }
  },
  "/api/key": {
   "post": {
    "operationId": "get_free_key",
    "summary": "Get a free API key",
    "responses": {
     "200": {
      "description": "api_key"
     }
    }
   }
  }
 }
}