{
  "openapi": "3.0.1",
  "info": {
    "title": "ChatGPT Search API: Answers, Sources & Citations in Bulk",
    "description": "ChatGPT answers with cited sources from OpenAI's API with its own web search (not chatgpt.com, so no blocks or logins). Inputs: questions, fileUrl (CSV or Google Sheet), datasetId, country, brands, competitors, monitor. Charged only per answer returned. Agent-ready: x402, MCP.",
    "version": "0.1",
    "x-build-id": "TVHDDeu2HOaaK3950"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nerolabs~chatgpt-search-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nerolabs-chatgpt-search-api",
        "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/nerolabs~chatgpt-search-api/runs": {
      "post": {
        "operationId": "runs-sync-nerolabs-chatgpt-search-api",
        "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/nerolabs~chatgpt-search-api/run-sync": {
      "post": {
        "operationId": "run-sync-nerolabs-chatgpt-search-api",
        "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": {
          "questions": {
            "title": "Questions",
            "type": "array",
            "description": "The questions or search queries to ask ChatGPT, one per line. Each one returns the full answer from OpenAI's API with web search, with its cited sources, and is charged once, only when an answer with text comes back. Or give a CSV, Google Sheet or dataset below instead.",
            "items": {
              "type": "string"
            }
          },
          "fileUrl": {
            "title": "File or Google Sheet URL",
            "type": "string",
            "description": "A public link to a CSV, TSV, Excel, JSON or JSON Lines file with one question per row. A normal Google Sheets link works (share it as 'Anyone with the link can view'). Every other column is kept on the output row. Used when 'Questions' is empty."
          },
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "An Apify dataset with one question per row, for example a keyword list from another Actor. Every original column is kept. Use the picker rather than typing an ID. Used when 'Questions' and 'File or Google Sheet URL' are empty."
          },
          "questionField": {
            "title": "Question column",
            "type": "string",
            "description": "For a file or dataset: the column that holds the question. Leave empty to detect it (looks for question, query, prompt, keyword)."
          },
          "questionTemplate": {
            "title": "Question template",
            "type": "string",
            "description": "Optional. Turns each row into a full question, for example 'Best CRM for {question}' with a row 'real estate agents'. {question} is replaced by the row's text. Useful when a sheet holds keywords, not questions."
          },
          "fileFormat": {
            "title": "File format",
            "enum": [
              "auto",
              "csv",
              "tsv",
              "json",
              "jsonl",
              "xlsx"
            ],
            "type": "string",
            "description": "Leave on auto unless the file is detected wrongly.",
            "default": "auto"
          },
          "sheetName": {
            "title": "Excel sheet name",
            "type": "string",
            "description": "For an Excel file: which sheet to read. Leave empty for the first sheet."
          },
          "model": {
            "title": "OpenAI model",
            "enum": [
              "gpt-6-luna",
              "gpt-6.1-terra"
            ],
            "type": "string",
            "description": "gpt-6-luna is fast and cheap (about $0.011 of model and search cost per answer with one web search, billed to your Apify account by Apify's OpenRouter proxy). gpt-6.1-terra is a stronger model (about $0.02 per answer). Both are charged the same Actor price per answer.",
            "default": "gpt-6-luna"
          },
          "searchDepth": {
            "title": "Web searches per question",
            "enum": [
              "one",
              "auto"
            ],
            "type": "string",
            "description": "'one' asks OpenAI to run exactly one web search per question (fastest, about $0.011 model cost). 'auto' lets the model search as often as it wants, like the ChatGPT app can (1 to 4 searches, about $0.02 to $0.04 model cost, more sources). OpenAI bills $0.01 per search.",
            "default": "one"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Optional two-letter country code (US, GB, DE) so OpenAI searches as a user in that country. A 'country' column in the file overrides it per row."
          },
          "language": {
            "title": "Answer language",
            "type": "string",
            "description": "Optional, for example 'Spanish' or 'German'. The answer is written in this language; the question can be in any language."
          },
          "systemPrompt": {
            "title": "Extra instructions",
            "type": "string",
            "description": "Optional style instruction added to every question, for example 'Answer in 3 bullet points' or 'Name at least 5 products'. To change what is asked, use 'Question template'."
          },
          "brands": {
            "title": "Your brand names",
            "type": "array",
            "description": "Optional. Your brand or product names, for example 'HubSpot'. Each answer reports brandMentioned and brandPosition (1 = named first among all your brands and competitors that appear).",
            "items": {
              "type": "string"
            }
          },
          "domains": {
            "title": "Your website domains",
            "type": "array",
            "description": "Optional. Your website domains, for example 'hubspot.com'. Each answer lists ownDomainsCited with the position of each cited page.",
            "items": {
              "type": "string"
            }
          },
          "competitors": {
            "title": "Competitors",
            "type": "array",
            "description": "Optional. Competitor names or domains, for example 'Salesforce'. Each answer lists competitorsMentioned in the order named, and the summary ranks them by share of answers.",
            "items": {
              "type": "string"
            }
          },
          "monitor": {
            "title": "Monitor mode",
            "type": "boolean",
            "description": "Remember each question's last answer (in a named key-value store on your account) and, on the next run, mark only what changed: new and dropped sources (isNew on each citation), newly cited or dropped sites, and brand or competitor mentions gained or lost. Schedule the run daily or weekly. Off by default.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Keeps separate monitors apart, for example one per client. Letters, numbers and dashes.",
            "default": "default"
          },
          "onlyChanged": {
            "title": "Only output changed questions",
            "type": "boolean",
            "description": "In monitor mode, write only rows that are new or changed since the last run. Every answered question is still charged once, because OpenAI was asked.",
            "default": false
          },
          "keepOriginalFields": {
            "title": "Keep original columns",
            "type": "boolean",
            "description": "Copy every other column of the input row onto the output row.",
            "default": true
          },
          "concurrency": {
            "title": "Questions at once",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many questions are asked at the same time.",
            "default": 5
          },
          "maxItems": {
            "title": "Max questions",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many rows from the source."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}