{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Cost & Token Savings Verifier — Resolver Zero",
    "description": "Verify caller-measured AI/LLM/API routing savings in calls, tokens, and cost from before/after content-free metadata. Returns machine-readable proof scope and explicit authority. No prompts, outputs, URLs, IDs, credentials, or free text.",
    "version": "0.3",
    "x-build-id": "n1WchLvTU6neAhsnQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/resolverzero~resolver-zero/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-resolverzero-resolver-zero",
        "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/resolverzero~resolver-zero/runs": {
      "post": {
        "operationId": "runs-sync-resolverzero-resolver-zero",
        "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/resolverzero~resolver-zero/run-sync": {
      "post": {
        "operationId": "run-sync-resolverzero-resolver-zero",
        "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",
        "required": [
          "protocol",
          "operation"
        ],
        "properties": {
          "protocol": {
            "title": "Protocol",
            "enum": [
              "rz-apify-shell-input/v2"
            ],
            "type": "string",
            "description": "Fixed machine-readable Resolver Zero input protocol version.",
            "default": "rz-apify-shell-input/v2"
          },
          "operation": {
            "title": "Operation",
            "enum": [
              "STORE_HEALTHCHECK",
              "PROVE_ROUTING_SAVINGS"
            ],
            "type": "string",
            "description": "STORE_HEALTHCHECK is economically inert and exists for platform health testing. Choose PROVE_ROUTING_SAVINGS only when supplying real caller-measured metadata.",
            "default": "STORE_HEALTHCHECK"
          },
          "baseline": {
            "title": "Before measurement",
            "required": [
              "externalCalls",
              "inputTokens",
              "outputTokens",
              "totalTokens",
              "evidence"
            ],
            "type": "object",
            "description": "Real content-free baseline measurements supplied by the caller. Resolver verifies structure and arithmetic, not provider origin.",
            "properties": {
              "externalCalls": {
                "type": "integer",
                "minimum": 0,
                "title": "External Calls",
                "description": "Caller-measured baseline external provider calls. Required by PROVE_ROUTING_SAVINGS.",
                "editor": "number"
              },
              "inputTokens": {
                "type": "integer",
                "minimum": 0,
                "title": "Input Tokens",
                "description": "Caller-measured baseline provider input tokens. Required by PROVE_ROUTING_SAVINGS.",
                "editor": "number"
              },
              "outputTokens": {
                "type": "integer",
                "minimum": 0,
                "title": "Output Tokens",
                "description": "Caller-measured baseline provider output tokens. Required by PROVE_ROUTING_SAVINGS.",
                "editor": "number"
              },
              "totalTokens": {
                "type": "integer",
                "minimum": 0,
                "title": "Total Tokens",
                "description": "Caller-measured baseline provider total tokens. Required by PROVE_ROUTING_SAVINGS.",
                "editor": "number"
              },
              "evidence": {
                "type": "string",
                "enum": [
                  "CALLER_MEASURED"
                ],
                "title": "Evidence",
                "description": "Public measurement authority is caller-supplied only. Provider/issuer evidence cannot be selected by the caller.",
                "editor": "select"
              }
            },
            "additionalProperties": false
          },
          "actual": {
            "title": "After measurement",
            "required": [
              "externalCalls",
              "inputTokens",
              "outputTokens",
              "totalTokens",
              "evidence"
            ],
            "type": "object",
            "description": "Real content-free optimized measurements supplied by the caller. Resolver verifies structure and arithmetic, not provider origin.",
            "properties": {
              "externalCalls": {
                "type": "integer",
                "minimum": 0,
                "title": "External Calls",
                "description": "Caller-measured optimized external provider calls. Required by PROVE_ROUTING_SAVINGS.",
                "editor": "number"
              },
              "inputTokens": {
                "type": "integer",
                "minimum": 0,
                "title": "Input Tokens",
                "description": "Caller-measured optimized provider input tokens. Required by PROVE_ROUTING_SAVINGS.",
                "editor": "number"
              },
              "outputTokens": {
                "type": "integer",
                "minimum": 0,
                "title": "Output Tokens",
                "description": "Caller-measured optimized provider output tokens. Required by PROVE_ROUTING_SAVINGS.",
                "editor": "number"
              },
              "totalTokens": {
                "type": "integer",
                "minimum": 0,
                "title": "Total Tokens",
                "description": "Caller-measured optimized provider total tokens. Required by PROVE_ROUTING_SAVINGS.",
                "editor": "number"
              },
              "evidence": {
                "type": "string",
                "enum": [
                  "CALLER_MEASURED"
                ],
                "title": "Evidence",
                "description": "Public measurement authority is caller-supplied only. Provider/issuer evidence cannot be selected by the caller.",
                "editor": "select"
              }
            },
            "additionalProperties": false
          },
          "gates": {
            "title": "Quality and safety declarations",
            "required": [
              "quality",
              "safety"
            ],
            "type": "object",
            "description": "Explicit caller declarations required only for PROVE_ROUTING_SAVINGS. Their authority is exposed in the output.",
            "properties": {
              "quality": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "status",
                  "method"
                ],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "PASS"
                    ],
                    "title": "Status",
                    "description": "Caller-declared quality result for this proof.",
                    "editor": "select"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "CALLER_VERIFIED_EQUIVALENT_ANSWER"
                    ],
                    "title": "Method",
                    "description": "Caller verification method. This is not an independent Resolver quality judgment.",
                    "editor": "select"
                  }
                },
                "title": "Quality",
                "description": "Caller-supplied quality-equivalence declaration required for a savings proof.",
                "editor": "json"
              },
              "safety": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "status",
                  "check"
                ],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "PASS"
                    ],
                    "title": "Status",
                    "description": "Caller-declared safety result for this proof.",
                    "editor": "select"
                  },
                  "check": {
                    "type": "string",
                    "enum": [
                      "LIVE_REQUEST_RETAINS_REQUIRED_SEARCH"
                    ],
                    "title": "Check",
                    "description": "Caller-declared safety condition for this proof. This is not an independent Resolver safety judgment.",
                    "editor": "select"
                  }
                },
                "title": "Safety",
                "description": "Caller-supplied safety declaration required for a savings proof.",
                "editor": "json"
              }
            },
            "additionalProperties": false
          },
          "costBounds": {
            "title": "Caller-supplied conservative cost bounds",
            "required": [
              "baselineCostLowerBoundMicroUsd",
              "actualCostUpperBoundMicroUsd",
              "resolverLocalCostUpperBoundMicroUsd",
              "baselineEvidence",
              "actualEvidence",
              "resolverCostEvidence"
            ],
            "type": "object",
            "description": "Calculation-only economic bounds. The caller cannot set Resolver fee/capture policy and this input grants no production charge authority.",
            "properties": {
              "baselineCostLowerBoundMicroUsd": {
                "type": "integer",
                "minimum": 0,
                "title": "Baseline Cost Lower Bound Micro Usd",
                "description": "Caller-supplied conservative lower bound of baseline cost.",
                "editor": "number"
              },
              "actualCostUpperBoundMicroUsd": {
                "type": "integer",
                "minimum": 0,
                "title": "Actual Cost Upper Bound Micro Usd",
                "description": "Caller-supplied conservative upper bound of actual cost.",
                "editor": "number"
              },
              "resolverLocalCostUpperBoundMicroUsd": {
                "type": "integer",
                "minimum": 0,
                "title": "Resolver Local Cost Upper Bound Micro Usd",
                "description": "Caller-supplied conservative upper bound of Resolver local cost.",
                "editor": "number"
              },
              "baselineEvidence": {
                "type": "string",
                "enum": [
                  "CALLER_MEASURED",
                  "CONSERVATIVE_BOUND"
                ],
                "title": "Baseline Evidence",
                "description": "Caller-supplied evidence class. Provider/issuer authority cannot be selected here.",
                "editor": "select"
              },
              "actualEvidence": {
                "type": "string",
                "enum": [
                  "CALLER_MEASURED",
                  "CONSERVATIVE_BOUND"
                ],
                "title": "Actual Evidence",
                "description": "Caller-supplied evidence class. Provider/issuer authority cannot be selected here.",
                "editor": "select"
              },
              "resolverCostEvidence": {
                "type": "string",
                "enum": [
                  "CALLER_MEASURED",
                  "CONSERVATIVE_BOUND"
                ],
                "title": "Resolver Cost Evidence",
                "description": "Caller-supplied evidence class. Provider/issuer authority cannot be selected here.",
                "editor": "select"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}