{
  "openapi": "3.0.1",
  "info": {
    "title": "SEC AI Query Planner",
    "description": "Translate controlled SEC research intents into explicit, dependency-aware, cost-bounded client execution plans.",
    "version": "0.1",
    "x-build-id": "r5j25hueqmhp5xPzj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bb-tradetec~sec-ai-query-planner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bb-tradetec-sec-ai-query-planner",
        "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/bb-tradetec~sec-ai-query-planner/runs": {
      "post": {
        "operationId": "runs-sync-bb-tradetec-sec-ai-query-planner",
        "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/bb-tradetec~sec-ai-query-planner/run-sync": {
      "post": {
        "operationId": "run-sync-bb-tradetec-sec-ai-query-planner",
        "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": [
          "requests"
        ],
        "properties": {
          "requests": {
            "title": "Planning requests",
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "description": "One to twenty controlled Suite intents with exact subjects, period, and cost constraints.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "requestId",
                "intent",
                "subjects",
                "period",
                "constraints"
              ],
              "properties": {
                "requestId": {
                  "title": "Request ID",
                  "description": "Stable caller correlation ID; never include secrets or personal free text.",
                  "editor": "textfield",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9._:-]+$"
                },
                "intent": {
                  "title": "Controlled Suite intent",
                  "description": "Choose the deterministic planning outcome; natural-language prompts are not accepted.",
                  "editor": "select",
                  "type": "string",
                  "enum": [
                    "build_company_dossier",
                    "build_disclosure_risk_feed",
                    "analyze_ownership",
                    "trace_capital_formation_or_deal",
                    "analyze_governance",
                    "perform_fund_diligence",
                    "assess_regulatory_risk",
                    "assess_market_integrity"
                  ]
                },
                "subjects": {
                  "title": "Exact subjects",
                  "description": "Exact identifiers supported by the selected Suite capability.",
                  "editor": "json",
                  "type": "array",
                  "minItems": 1,
                  "maxItems": 100,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "identifierType",
                      "identifier"
                    ],
                    "properties": {
                      "identifierType": {
                        "title": "Identifier type",
                        "description": "Machine-readable identifier semantics; availability is checked against the target capability.",
                        "editor": "select",
                        "type": "string",
                        "enum": [
                          "all",
                          "cik",
                          "ticker",
                          "accession",
                          "seriesId",
                          "classId",
                          "entityId",
                          "fileNumber",
                          "dealId",
                          "offeringId",
                          "transactionId",
                          "registrationId",
                          "participantId",
                          "enforcementMatterId",
                          "policyMatterId",
                          "secSecurityId",
                          "cusip",
                          "poolId",
                          "publicationType",
                          "publishedDate",
                          "releaseNumber",
                          "partyName",
                          "datasetVersionId+table"
                        ]
                      },
                      "identifier": {
                        "title": "Exact identifier",
                        "description": "Exact public identifier; type-specific validation is applied before planning.",
                        "editor": "textfield",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9 .,&'()_:/+\\-]+$"
                      }
                    }
                  }
                },
                "period": {
                  "title": "Requested period",
                  "description": "Inclusive source period that applicable target inputs receive unchanged.",
                  "editor": "json",
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "from",
                    "to"
                  ],
                  "properties": {
                    "from": {
                      "title": "From date",
                      "description": "Inclusive lower bound in YYYY-MM-DD form.",
                      "editor": "datepicker",
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "to": {
                      "title": "To date",
                      "description": "Inclusive upper bound in YYYY-MM-DD form.",
                      "editor": "datepicker",
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    }
                  }
                },
                "constraints": {
                  "title": "Execution constraints",
                  "description": "Hard record, charge, availability, and completeness requirements for the returned plan.",
                  "editor": "json",
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "maximumTotalChargeUsd",
                    "maximumRecords",
                    "preferExistingPublicActors",
                    "requireCompleteCoverage"
                  ],
                  "properties": {
                    "maximumTotalChargeUsd": {
                      "title": "Maximum total charge",
                      "description": "Maximum planned user charge as a precision-safe USD decimal string.",
                      "editor": "textfield",
                      "type": "string",
                      "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$"
                    },
                    "maximumRecords": {
                      "title": "Maximum records",
                      "description": "Maximum requested records before target-specific hard-limit clamping.",
                      "editor": "number",
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 10000
                    },
                    "preferExistingPublicActors": {
                      "title": "Prefer public Actors",
                      "description": "Use a compatible public fallback instead of an unavailable planned capability.",
                      "editor": "checkbox",
                      "type": "boolean"
                    },
                    "requireCompleteCoverage": {
                      "title": "Require complete coverage",
                      "description": "Reject plans whose known capability coverage cannot satisfy the request.",
                      "editor": "checkbox",
                      "type": "boolean"
                    }
                  }
                },
                "requiredFields": {
                  "title": "Required domains",
                  "description": "Optional controlled domains that the client expects the plan to cover.",
                  "editor": "stringList",
                  "type": "array",
                  "maxItems": 20,
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "freshnessMaximumAge": {
                  "title": "Maximum source age",
                  "description": "Optional controlled freshness requirement.",
                  "editor": "select",
                  "type": "string",
                  "enum": [
                    "latest",
                    "oneDay",
                    "sevenDays",
                    "thirtyDays",
                    "historical"
                  ]
                },
                "outputGoal": {
                  "title": "Output goal",
                  "description": "Optional result-shape goal for the selected capability.",
                  "editor": "select",
                  "type": "string",
                  "enum": [
                    "records",
                    "timeline",
                    "dossier",
                    "signals"
                  ]
                }
              }
            }
          },
          "catalogVersion": {
            "title": "Capability catalog version",
            "enum": [
              "1.0"
            ],
            "type": "string",
            "description": "Version of the bundled, network-free Suite capability projection.",
            "default": "1.0"
          },
          "maxResults": {
            "title": "Maximum plans",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Hard number of plan records returned in one page.",
            "default": 20
          },
          "maxSourceRequests": {
            "title": "Maximum catalog reads",
            "minimum": 1,
            "maximum": 1,
            "type": "integer",
            "description": "Reserved local manifest-catalog budget; no network request is made.",
            "default": 1
          },
          "maxDownloadBytes": {
            "title": "Maximum catalog bytes",
            "minimum": 1048576,
            "maximum": 1048576,
            "type": "integer",
            "description": "Reserved local catalog budget; no remote bytes are downloaded.",
            "default": 1048576
          },
          "outputSchemaVersion": {
            "title": "Output schema version",
            "enum": [
              "1.0"
            ],
            "type": "string",
            "description": "Version of the deterministic plan-record contract.",
            "default": "1.0"
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "full",
              "compact"
            ],
            "type": "string",
            "description": "Full or compact plan metadata.",
            "default": "full"
          },
          "cursor": {
            "title": "Continuation cursor",
            "pattern": "^secaiplancur1_[A-Za-z0-9_-]+$",
            "maxLength": 4096,
            "type": "string",
            "description": "Opaque cursor from the preceding SUMMARY; omit for the first page."
          },
          "queries": {
            "title": "Reserved compatibility field",
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "description": "Reserved for the shared hard-limit contract. The runtime rejects this field; use requests.",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}