{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/omniyond-com/json-schema/omniyond-com-schedule-input-schema.json",
  "title": "ScheduleInput",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/omniyond-com-openapi.yml#/components/schemas/ScheduleInput",
  "type": "object",
  "required": [
    "url"
  ],
  "properties": {
    "url": {
      "type": "string",
      "format": "uri",
      "description": "URL to call. http/https only, public hosts only (SSRF-protected)."
    },
    "method": {
      "type": "string",
      "enum": [
        "GET",
        "POST",
        "PUT",
        "PATCH",
        "DELETE",
        "HEAD"
      ],
      "default": "POST"
    },
    "headers": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Optional request headers."
    },
    "body": {
      "type": "string",
      "maxLength": 100000,
      "description": "Optional request body."
    },
    "schedule": {
      "type": "string",
      "description": "Recurrence interval: 5m, 1h, 1d. Omit for a one-shot job. Minimum 5m, 90-day horizon."
    },
    "maxRuns": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000,
      "description": "For recurring jobs — how many runs to prepay (each costs $0.01)."
    },
    "runAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO timestamp for the first run. Defaults to now."
    },
    "delivery": {
      "type": "string",
      "enum": [
        "store",
        "callback",
        "both"
      ],
      "default": "store",
      "description": "Where results go — stored for retrieval, POSTed to callbackUrl, or both."
    },
    "callbackUrl": {
      "type": "string",
      "format": "uri",
      "description": "URL to POST each run result to. Required when delivery is callback or both."
    },
    "pay": {
      "type": "boolean",
      "default": false,
      "description": "When true, the scheduler pays the target endpoint via x402 (USDC on Base) on each run from Omniyond's operator wallet, up to maxPriceUsd. Lets an agent schedule a job that itself buys a paid API. Requires an API key with prepaid credits (rejected on x402 jobs)."
    },
    "maxPriceUsd": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "Max USD to pay the downstream API per run when pay=true. Defaults to $0.10, hard-capped at $1.00. Reserved per run from your credits; unspent reservation is refunded on cancel."
    }
  }
}