{
  "openapi": "3.1.0",
  "info": {
    "title": "AgentCron \u2014 Persistent Cron Scheduler for AI Agents",
    "version": "1.0.0",
    "description": "x402-powered persistent cron scheduler. AI agents register scheduled tasks that survive session termination. Runs even when the agent is offline. Pay per registration in USDC on Base mainnet.",
    "contact": {
      "url": "https://cron.memoryapi.org"
    }
  },
  "servers": [
    {
      "url": "https://cron.memoryapi.org"
    }
  ],
  "paths": {
    "/x402/cron/register": {
      "post": {
        "summary": "Register a persistent cron schedule",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_id": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "method": {
                    "type": "string",
                    "default": "GET"
                  },
                  "headers": {
                    "type": "object"
                  },
                  "body": {
                    "type": "string"
                  },
                  "interval_minutes": {
                    "type": "integer",
                    "minimum": 15
                  },
                  "duration_days": {
                    "type": "integer",
                    "maximum": 30,
                    "default": 7
                  }
                },
                "required": [
                  "agent_id",
                  "url",
                  "interval_minutes"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Schedule registered"
          },
          "402": {
            "description": "x402 payment required"
          }
        },
        "x-price": "$0.001 USDC"
      }
    },
    "/x402/cron/status": {
      "get": {
        "summary": "Check schedule status",
        "parameters": [
          {
            "name": "schedule_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Schedule status"
          },
          "402": {
            "description": "x402 payment required"
          }
        },
        "x-price": "$0.001 USDC"
      }
    },
    "/x402/cron/cancel": {
      "post": {
        "summary": "Cancel a cron schedule",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "schedule_id": {
                    "type": "string"
                  },
                  "agent_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "schedule_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Schedule cancelled"
          },
          "402": {
            "description": "x402 payment required"
          }
        },
        "x-price": "$0.001 USDC"
      }
    },
    "/x402/cron/history": {
      "get": {
        "summary": "View execution history",
        "parameters": [
          {
            "name": "schedule_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Execution history"
          },
          "402": {
            "description": "x402 payment required"
          }
        },
        "x-price": "$0.001 USDC"
      }
    }
  }
}