{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Answers API: ChatGPT, Claude & Gemini with Web Search",
    "description": "Ask ChatGPT, Claude and Gemini any prompt, one or a thousand at a time, through the official OpenAI, Anthropic and Gemini APIs with web search on. Each answer is one clean record with citations, sources, search queries and token usage. From $0.08 per answer; failed checks are free.",
    "version": "0.1",
    "x-build-id": "7ONj92rgdI3ug4iSS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/localwire~ai-answers/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-localwire-ai-answers",
        "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/localwire~ai-answers/runs": {
      "post": {
        "operationId": "runs-sync-localwire-ai-answers",
        "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/localwire~ai-answers/run-sync": {
      "post": {
        "operationId": "run-sync-localwire-ai-answers",
        "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": {
          "prompts": {
            "title": "Prompts",
            "type": "array",
            "description": "The questions or instructions to answer, one per line, at most 2,000 characters each. Every prompt is asked of every selected engine, and each answer is one paid check, so 5 prompts on 3 engines is 15 checks. Required unless you give a prompts file or dataset below.",
            "items": {
              "type": "string"
            }
          },
          "instructions": {
            "title": "Instructions for every prompt",
            "maxLength": 500,
            "type": "string",
            "description": "Optional text placed before every prompt in the same message, for example \"Answer in German in under 150 words\" or \"Answer as a bulleted list\". At most 500 characters. It does not change the price of a check, and the record's prompt field stays exactly as you wrote the prompt."
          },
          "promptsFileUrl": {
            "title": "Prompts file URL",
            "type": "string",
            "description": "Bulk mode: a link to a file of prompts, added to the Prompts above. Plain text (one prompt per line), CSV or TSV (a column named \"prompt\", or a single column), or JSON / JSON Lines (an array of strings, or of objects with a \"prompt\" field). Use a direct link to the raw file, for example a Google Sheets CSV export link or a raw GitHub or gist URL. Up to 2 MB and 1,000 prompts per run."
          },
          "promptsDatasetId": {
            "title": "Prompts dataset",
            "type": "string",
            "description": "Bulk mode: an Apify dataset whose items each hold one prompt, for example the output of another Actor. The prompt is read from the field named in \"Prompt field or column\". Its prompts are added to the Prompts above; up to 1,000 prompts per run."
          },
          "promptsField": {
            "title": "Prompt field or column",
            "type": "string",
            "description": "The CSV column or the JSON / dataset field that holds the prompt in a bulk source. Not case-sensitive.",
            "default": "prompt"
          },
          "engines": {
            "title": "Engines",
            "type": "array",
            "description": "Which AI answer engines to ask: openai (ChatGPT's models through the OpenAI API), anthropic (Claude) and gemini (Gemini). Every prompt is asked of every engine listed, and each answer is one paid check: $0.09 for ChatGPT, $0.10 for Claude, $0.08 for Gemini with the default models. If the field is left out, only openai is asked.",
            "items": {
              "type": "string",
              "enum": [
                "openai",
                "anthropic",
                "gemini"
              ],
              "enumTitles": [
                "ChatGPT (OpenAI API)",
                "Claude (Anthropic API)",
                "Gemini (Gemini API)"
              ]
            },
            "default": [
              "openai"
            ]
          },
          "openaiModel": {
            "title": "OpenAI model",
            "enum": [
              "gpt-6.1-terra",
              "gpt-6.1-sol",
              "gpt-6-luna"
            ],
            "type": "string",
            "description": "The model asked through the OpenAI Responses API with web search. Terra and Luna cost $0.09 per answer; Sol is a premium check at $0.15.",
            "default": "gpt-6.1-terra"
          },
          "anthropicModel": {
            "title": "Anthropic model",
            "enum": [
              "claude-sonnet-5-5",
              "claude-opus-5-5",
              "claude-haiku-5-5"
            ],
            "type": "string",
            "description": "The Claude model asked through the Anthropic Messages API with web search. Sonnet and Haiku cost $0.10 per answer; Opus is a premium check at $0.18.",
            "default": "claude-sonnet-5-5"
          },
          "geminiModel": {
            "title": "Gemini model",
            "enum": [
              "gemini-3.8-flash",
              "gemini-3.6-flash",
              "gemini-3.5-flash-lite",
              "gemini-3.1-pro-preview"
            ],
            "type": "string",
            "description": "The Gemini model asked with Grounding with Google Search. The Flash models cost $0.08 per answer; Pro is a premium check at $0.15.",
            "default": "gemini-3.8-flash"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code (GB, US, DE...) to localise web search results on ChatGPT and Claude. Gemini's search has no location setting. Leave empty for no localisation."
          },
          "alwaysSearch": {
            "title": "Always search the web",
            "type": "boolean",
            "description": "Start every prompt with one line asking the engine to search the web for current information and cite the pages it used. On by default, because with search merely available the engines answer many everyday questions from memory, with no citations. Turn it off to send your prompt exactly as written and let each engine decide whether to search, as the chat apps do. The price of a check is the same either way.",
            "default": true
          },
          "maxSearches": {
            "title": "Max web searches per answer",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "How many web searches Claude may run for one answer (ChatGPT and Gemini decide for themselves). 2 if left out, at most 3.",
            "default": 2
          },
          "maxChecks": {
            "title": "Max checks per run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop after this many checks (one check = one prompt asked of one engine). Prompts × engines above this number are not run and not charged. 50 if left out, at most 1,000. You can also cap spending with the run's maximum cost.",
            "default": 50
          },
          "includeSources": {
            "title": "Include every page read",
            "type": "boolean",
            "description": "Return the full list of pages each engine read while answering (the sources field), not only the pages it cited. Turn off for smaller records; citations, the cited domains and the domains read are always returned.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}