{
  "openapi": "3.0.1",
  "info": {
    "title": "Causal Claim Referee",
    "description": "Referees a causal claim against an observational table with deterministic statistics: crude and stratified effects, Mantel-Haenszel pooling, Simpson's-paradox detection, d-separation and backdoor/front-door checks with minimal adjustment sets, g-formula standardization with…",
    "version": "0.1",
    "x-build-id": "rzbaBjaaeb6Dt9fnx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/davidcondrey~wl-causal-referee/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-davidcondrey-wl-causal-referee",
        "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/davidcondrey~wl-causal-referee/runs": {
      "post": {
        "operationId": "runs-sync-davidcondrey-wl-causal-referee",
        "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/davidcondrey~wl-causal-referee/run-sync": {
      "post": {
        "operationId": "run-sync-davidcondrey-wl-causal-referee",
        "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": [
          "treatment",
          "outcome",
          "covariates",
          "claim"
        ],
        "properties": {
          "data": {
            "title": "Data",
            "type": "array",
            "description": "Observational table as an array of row objects (at most 20000 rows). Cells are string, number, boolean or null; rows missing a used variable are dropped. Provide this or csv."
          },
          "csv": {
            "title": "Csv",
            "type": "string",
            "description": "Alternative to data: CSV text with a header line (comma, semicolon or tab separated; quoted fields allowed; at most 20000 data rows). Numeric cells become numbers."
          },
          "countColumn": {
            "title": "Count Column",
            "type": "string",
            "description": "Name of a column holding how many times each row repeats, so a published contingency table can be sent as a few aggregate rows (counts must be non-negative integers; the expanded table is capped at the row limit)."
          },
          "treatment": {
            "title": "Treatment",
            "type": "string",
            "description": "Column with exactly two distinct values."
          },
          "outcome": {
            "title": "Outcome",
            "type": "string",
            "description": "Binary column (risk difference, risk ratio, odds ratio) or numeric column (mean difference)."
          },
          "covariates": {
            "title": "Covariates",
            "type": "array",
            "description": "Candidate adjustment variables (at most 12). Numeric ones with more than `bins` distinct values are cut at deterministic quantile edges; others must have at most 20 levels.",
            "items": {
              "type": "string"
            }
          },
          "claim": {
            "title": "Claim",
            "type": "string",
            "description": "The causal claim being refereed, in plain language."
          },
          "dag": {
            "title": "Dag",
            "type": "object",
            "description": "Your causal DAG (formal input: no LLM is called to build the graph or, by default, the report). Omit to have one proposed by two independent model samples, which is then an assumption."
          },
          "treatedValue": {
            "title": "Treated Value",
            "type": "string",
            "description": "Treatment value that counts as treated; required unless the values are numeric or boolean (then the larger is treated)."
          },
          "successValue": {
            "title": "Success Value",
            "type": "string",
            "description": "Outcome value that counts as success for a binary outcome; same default rule."
          },
          "outcomeType": {
            "title": "Outcome Type",
            "enum": [
              "binary",
              "continuous"
            ],
            "type": "string",
            "description": "Force the outcome type; inferred from the number of distinct values otherwise."
          },
          "claimDirection": {
            "title": "Claim Direction",
            "enum": [
              "positive",
              "negative",
              "nonzero"
            ],
            "type": "string",
            "description": "Direction of the claimed effect of treated vs control; default nonzero."
          },
          "bins": {
            "title": "Bins",
            "minimum": 2,
            "maximum": 10,
            "type": "integer",
            "description": "Quantile bins for numeric covariates, default 4."
          },
          "alpha": {
            "title": "Alpha",
            "type": "string",
            "description": "Significance level for the permutation test and the (1-alpha) bootstrap interval, default 0.05. (a number)"
          },
          "seed": {
            "title": "Seed",
            "minimum": 0,
            "maximum": 4294967295,
            "type": "integer",
            "description": "Seed for bootstrap and Monte Carlo; default derived from the input hash."
          },
          "bootstrapReps": {
            "title": "Bootstrap Reps",
            "minimum": 100,
            "maximum": 2000,
            "type": "integer",
            "description": "bootstrapReps"
          },
          "permutationSamples": {
            "title": "Permutation Samples",
            "minimum": 1000,
            "maximum": 200000,
            "type": "integer",
            "description": "Used only when the exact enumeration would exceed 1000000 label assignments."
          },
          "llmReport": {
            "title": "Llm Report",
            "type": "boolean",
            "description": "Ask a model to write the executive report in prose (numbers verified in code, template fallback). Default false: the report is a deterministic template over the computed results."
          },
          "descriptions": {
            "title": "Descriptions",
            "type": "object",
            "description": "Optional one-line description per variable, used only to propose the DAG."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}