{
  "openapi": "3.0.1",
  "info": {
    "title": "LLM Price Tracker — OpenRouter Markup vs Provider List Prices",
    "description": "See OpenRouter's estimated markup vs each provider's direct list price — full comparison table every run. Optional scheduled alerts when prices, context windows, or markups move. Clean JSON, keyless sources, watchlist filters.",
    "version": "0.0",
    "x-build-id": "F7wlgZmBK1XmPoFHe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kaz_kakyo~llm-price-alerts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kaz_kakyo-llm-price-alerts",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/kaz_kakyo~llm-price-alerts/runs": {
      "post": {
        "operationId": "runs-sync-kaz_kakyo-llm-price-alerts",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/kaz_kakyo~llm-price-alerts/run-sync": {
      "post": {
        "operationId": "run-sync-kaz_kakyo-llm-price-alerts",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "watchlist": {
            "title": "Model watchlist (substrings or globs)",
            "type": "array",
            "description": "Only emit changes for models whose id matches one of these. Plain text is a case-insensitive substring (e.g. `gpt-5`, `claude-opus`, `glm`); `*`/`?` globs are supported (e.g. `anthropic/*`). **Leave empty to watch ALL models — that is the runtime default.** The `gpt-5`/`claude-opus`/`gemini` values shown prefilled in the Console are only a starter example, not a default; clear them to watch everything. Matching affects only which events are emitted — the price snapshot always covers every model, so changing this list never fabricates new/removed events.",
            "items": {
              "type": "string"
            }
          },
          "monitorId": {
            "title": "Monitor ID (snapshot scope)",
            "type": "string",
            "description": "Names the snapshot this schedule diffs against. Run **one schedule per monitorId**. The diff is consumed as it is reported: two schedules that share a monitorId (and the same sources) will starve each other — each run consumes the change the other would have reported. Give each independent schedule its own value (e.g. `hourly-all`, `daily-watchlist`). Leave empty to use the shared `default` scope.",
            "default": ""
          },
          "sources": {
            "title": "Pricing sources",
            "type": "array",
            "description": "Where to pull current model pricing. OpenRouter = ~350 models with per-token prompt/completion prices; LiteLLM = a broad multi-provider map (OpenAI, Anthropic, Google, Bedrock, Mistral, Meta…). Both are free, keyless JSON APIs.",
            "items": {
              "type": "string",
              "enum": [
                "openrouter",
                "litellm"
              ],
              "enumTitles": [
                "OpenRouter — openrouter.ai/api/v1/models",
                "LiteLLM — community multi-provider price map"
              ]
            },
            "default": [
              "openrouter",
              "litellm"
            ]
          },
          "changeThresholdPct": {
            "title": "Minimum price / context change (%)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Relative-percent gate for `price_change` and `context_change` events: emit only if the absolute % move is at least this large. 0 = report every change. Example: at `5`, a price moving 100→104 ($/1M, a 4% move) is suppressed; 100→106 (6%) passes. Does NOT gate new/removed models or markup (see `markupThresholdPts`). Transitions where a % can't be computed — free↔paid, and a price appearing or disappearing (number↔null) — always pass.",
            "default": 0
          },
          "markupThresholdPts": {
            "title": "Minimum markup change (percentage points)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Absolute percentage-POINT gate for `markup_change` events (OpenRouter's estimated markup over the LiteLLM list price). 0 = report every markup move. This is points, not relative percent: at `2`, a markup moving from +10 to +11 points (a 1-point move) is suppressed; +10 to +13 (3 points) passes. Kept separate from `changeThresholdPct` because a markup figure is already a percentage.",
            "default": 0
          },
          "includeNewModels": {
            "title": "Emit new-model events",
            "type": "boolean",
            "description": "Emit an event when a model appears that was not in the previous snapshot.",
            "default": true
          },
          "includeRemovedModels": {
            "title": "Emit removed-model events",
            "type": "boolean",
            "description": "Emit an event when a model that was in the previous snapshot has disappeared.",
            "default": true
          },
          "includeMarkupSnapshot": {
            "title": "Include current markup table",
            "type": "boolean",
            "description": "On every run (including the first), output one `markup_snapshot` row per OpenRouter model matched to a direct provider list price: OpenRouter price vs list price vs markup % per 1M tokens, worst markup first. This is the current-state comparison — change events only fire when something moves between runs. Needs both sources selected. Rows bill as `markup-snapshot-row`. Turn off for a pure change feed.",
            "default": true
          },
          "maxItems": {
            "title": "Max change-events per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum change-events delivered per run. Keeps cost predictable — you are charged once per delivered event. **Lossy cap:** when the number of changes exceeds this (or your run's Max total charge), the excess is dropped permanently — it is NOT queued for the next run, and the snapshot still advances to today's prices, so those dropped changes are never re-reported. Raise this if completeness matters more than a cost ceiling. A volatile pricing day can legitimately produce many events, so this defaults high.",
            "default": 1000
          },
          "maxSourceDropPct": {
            "title": "Source drop guard (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Outage safety valve. If a source's priced-model count falls more than this percent versus the previous snapshot, the run skips the diff WITHOUT charging or advancing the snapshot — an upstream outage that made half a source's models vanish would otherwise bill you for a flood of false `removed_model` events. The run still succeeds and emits an uncharged `source_degraded` item you can alert on. Default 40. Lower it to be stricter; set 100 to disable. If a large drop is genuine (a provider really delisted models), raise this to let it through.",
            "default": 40
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}