# AI Answers API: ChatGPT, Claude & Gemini with Web Search (`localwire/ai-answers`) Actor

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.

- **URL**: https://apify.com/localwire/ai-answers.md
- **Developed by:** [Local Wire](https://apify.com/localwire) (community)
- **Categories:** AI, Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $90.00 / 1,000 chatgpt answers

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AI Answers API: ChatGPT, Claude & Gemini with Web Search

Ask **ChatGPT, Claude and Gemini** any prompt and get the answer back as structured data with its **citations, sources and search queries**. Each answer costs **$0.08 to $0.10** with the default models ($0.09 ChatGPT, $0.10 Claude, $0.08 Gemini), there is no start fee, and failed checks are free. Send one prompt or a thousand in a single run.

The answers come from the **official OpenAI, Anthropic and Gemini APIs with web search switched on**, not from scraping chat websites. There is no browser, no login, no proxy and no CAPTCHA to break, so runs are stable and every record has the same shape whichever engine wrote it.

Typical uses: generative engine optimisation (GEO) and answer engine optimisation (AEO) research, content research with sources, comparing how the three engines answer the same question, building evaluation sets, and giving an AI agent a cited second opinion.

### What you get

One record per prompt and engine, with:

- the **answer** as text (Markdown as the model wrote it);
- **citations**: the pages the answer cites, each with `url`, `title` and `domain`;
- **sources**: every page the engine read while answering, where the API exposes it, and the list of domains;
- **searchQueries**: what the engine typed into its search tool;
- the **model** that answered (the exact id the API reported), its price **tier**, the **status**, and **token usage** with the number of searches;
- a stable **id** and the prompt's position in your list, so you can join results back to your input.

#### Example record

From a real run (the answer and the lists are shortened here):

```json
{
  "id": "openai-8079ca68cd9a03ba",
  "prompt": "What are the best project management tools for small teams?",
  "promptIndex": 0,
  "engine": "openai",
  "engineLabel": "ChatGPT (OpenAI API)",
  "model": "gpt-6.1-terra",
  "tier": "standard",
  "country": null,
  "status": "ok",
  "error": null,
  "answer": "For most small teams, I’d start with **Trello** if simplicity matters most, or **Asana** if you need more structure across projects.\n\n| Tool | Best for | Main trade-off |\n|---|---|---|\n| **Trello** | Simple visual boards and getting started quickly | Less suited to complex timelines and reporting |\n...",
  "answerLength": 1655,
  "citations": [
    {
      "url": "https://smallbusinesssoftwareguide.com/guides/best-free-project-management-software-for-small-teams/?utm_source=openai",
      "domain": "smallbusinesssoftwareguide.com",
      "title": "Best Free Project Management Software for Small Teams | Small Business Software Guide"
    }
  ],
  "citedDomains": ["smallbusinesssoftwareguide.com"],
  "sources": [
    { "url": "https://clickup.com/learn/topic/project-management/tools/free/", "domain": "clickup.com", "title": null },
    { "url": "https://smallbusinesssoftwareguide.com/guides/best-free-project-management-software-for-small-teams/", "domain": "smallbusinesssoftwareguide.com", "title": null }
  ],
  "sourceDomains": ["stacknpilot.com", "smallbusinesssoftwareguide.com", "clickup.com", "asana.com", "reddit.com", "techradar.com"],
  "searchQueries": [
    "best project management software small teams 2026 pricing free asana trello clickup monday",
    "site:trello.com pricing free standard 2026"
  ],
  "usage": { "inputTokens": 12930, "outputTokens": 448, "searches": 1 },
  "checkedAt": "2026-11-10T09:59:28.936Z"
}
```

### Quick start

1. Type one or more **prompts**, one per line. The form is prefilled with a single example.
2. Pick the **engines**. ChatGPT is selected by default; add Claude and Gemini to ask all three.
3. Press **Start**. An answer usually takes between ten seconds and a minute, and three run at a time.

The results appear in the run's dataset, in two table views (**Answers** and **Citations and searches**) and as JSON, CSV or Excel. With the prefilled input the run asks one prompt of one engine and costs $0.09.

One **check** is one prompt asked of one engine. Three prompts on three engines is nine checks.

### Input reference

| Field | Meaning |
|---|---|
| `prompts` | The questions or instructions to answer, one per item, at most 2,000 characters each. Required unless you use a bulk source. |
| `instructions` | Optional text placed before every prompt, for example "Answer in German in under 150 words". At most 500 characters. |
| `promptsFileUrl` | Bulk mode: a link to a text, CSV or JSON file of prompts. |
| `promptsDatasetId` | Bulk mode: an Apify dataset whose items each hold a prompt. |
| `promptsField` | The CSV column or JSON / dataset field that holds the prompt. Default `prompt`. |
| `engines` | Any of `openai`, `anthropic`, `gemini`. Default: `openai` only. |
| `openaiModel` | `gpt-6.1-terra` (default), `gpt-6-luna`, or `gpt-6.1-sol` (premium). |
| `anthropicModel` | `claude-sonnet-5-5` (default), `claude-haiku-5-5`, or `claude-opus-5-5` (premium). |
| `geminiModel` | `gemini-3.8-flash` (default), `gemini-3.6-flash`, `gemini-3.5-flash-lite`, or `gemini-3.1-pro-preview` (premium). |
| `country` | Two-letter country code (`GB`, `US`, `DE`...) to localise web search on ChatGPT and Claude. Gemini's search has no location setting. |
| `alwaysSearch` | Start every prompt with one line asking the engine to search the web and cite its pages. Default on. See below. |
| `maxSearches` | How many web searches Claude may run for one answer: 1 to 3, default 2. ChatGPT and Gemini decide for themselves. |
| `maxChecks` | Stop after this many checks. Default 50, at most 1,000. |
| `includeSources` | Return the full list of pages each engine read (`sources`). Default on; turn off for smaller records. |

Only the models listed above can be chosen. A model id that is not on the list stops the run before anything is asked.

#### The search instruction (`alwaysSearch`)

Web search is always available to the engines, but an engine with search available still decides for itself whether to use it. For many everyday questions it answers from memory, and such an answer has no citations. In our own test, "What are the best project management tools for small teams?" was searched by ChatGPT but answered from memory by both Claude and Gemini.

So by default the Actor starts every prompt with this line:

> Search the web for current information before you answer, and cite the pages you used.

With that line, the same Gemini prompt came back with one search and eight cited pages. The line is a request, not a switch: an engine can still decide a question needs no search. `usage.searches` and `citations` on each record tell you what actually happened.

Turn `alwaysSearch` off to send your prompt exactly as you wrote it. That is the right setting when the thing you are measuring is the engine's own behaviour, for example whether it searches for a query at all. The price of a check is the same either way.

The text sent to the engine is, in order: the search line (if on), your `instructions` (if any), then the prompt. The record's `prompt` field always holds the prompt as you wrote it.

### Bulk mode

A run takes up to **1,000 prompts**. Besides typing them in, you can read them from a file or a dataset; all sources are merged in the order typed, file, dataset, and exact duplicates are dropped.

**From a file (`promptsFileUrl`).** Link to the raw file, up to 2 MB:

- **Plain text:** one prompt per line.
- **CSV or TSV:** a column named `prompt` (any position, any case), or a file with a single column. Quoted cells may contain commas and line breaks. Use `promptsField` if your column has another name.
- **JSON:** an array of strings, an array of objects with a `prompt` field, or `{ "prompts": [...] }`. JSON Lines works too.

Links that work well: a Google Sheets CSV export link, a raw file on GitHub or in a gist, a file in object storage, or a record in an Apify key-value store. A link that returns a web page (a sign-in page, a spreadsheet's normal view) stops the run with a clear message before anything is asked, so a wrong link never costs you a check.

```csv
id,prompt
1,"Best CRM for a small agency, and why?"
2,What is the cheapest way to send money from the UK to Poland?
```

**From an Apify dataset (`promptsDatasetId`).** Pick a dataset in the form, or pass its ID. Each item's `prompt` field (or the field named in `promptsField`) becomes one prompt. This is how you chain Actors: one produces the questions, this one answers them.

Every prompt is checked before the first one is asked. If any is longer than 2,000 characters, or there are more than 1,000, the run stops and tells you which, and nothing is charged.

`maxChecks` (default 50) is a safety cap, so raise it for a large list: 400 prompts on two engines needs `maxChecks: 800`. If the cap cuts a run short, the status message says how many checks were planned.

Large runs take time: three checks run at once, so 300 checks need roughly 30 to 60 minutes. Set the run's timeout accordingly. If the platform restarts a long run, it carries on where it stopped; finished checks are not asked or charged again.

### Output reference

| Field | Meaning |
|---|---|
| `id` | Stable id of the check: the same engine, model and prompt, with the same `instructions` and `alwaysSearch` setting, give the same id in every run. |
| `prompt`, `promptIndex` | The prompt as you wrote it, and its position in the run's merged prompt list (from 0). |
| `engine`, `engineLabel` | `openai`, `anthropic` or `gemini`, and a readable label. |
| `model`, `tier` | The model id the API reported (often a dated snapshot of the one you chose), and `standard` or `premium`. |
| `country` | The country used to localise search; always `null` for Gemini. |
| `status` | `ok`; `truncated` (the answer hit the output limit and is cut short); `refused` (the model declined); `no_answer` (no text came back); `error` (the provider call failed). |
| `error` | What went wrong, for `error`, `refused` and `no_answer`; otherwise `null`. |
| `answer`, `answerLength` | The answer text and its length in characters. `null` when no text came back. |
| `citations[]`, `citedDomains` | Pages cited in the answer (`url`, `title`, `domain`) and their distinct domains. |
| `sources[]`, `sourceDomains` | Every page the engine read (a superset of the citations where the API exposes it) and their domains. `sources` is `null` with `includeSources` off. |
| `searchQueries` | The searches the engine ran. |
| `usage` | `inputTokens`, `outputTokens` and `searches` as the provider reported them. `null` on `error`. |
| `checkedAt` | When the answer was produced (UTC). |

Only `ok` and `truncated` records are charged. `error`, `refused` and `no_answer` records are written so you can see what happened, and cost nothing.

The run's key-value store has an `OUTPUT` record with a summary: prompts, checks planned and completed, answers, failures per engine, why the run stopped, and how much of the daily allowance is used.

### Use cases

- **GEO and AEO research.** See what the AI answer engines say for the questions your market asks, which pages they cite and which queries they run. Turn `alwaysSearch` off to learn which questions an engine searches for unprompted. If you want brand mentions, ranks and competitor tracking computed for you, our AI Brand Visibility Monitor does that on top of the same engine calls.
- **Content research.** Get a sourced first draft of the facts on a topic from three engines, with the pages each one relied on, and see where they disagree.
- **Comparing engines.** Ask the same prompts of ChatGPT, Claude and Gemini in one run and compare answers, citations and search behaviour side by side in one schema.
- **Evaluation sets.** Run a file of test questions through several models, standard and premium, and keep the answers with token counts for scoring.
- **A cited second opinion for agents.** An AI agent that needs to check a claim can call this Actor through MCP or the API and get another model's web-grounded answer with its sources.
- **Scheduled monitoring.** Run the same prompts every day or week and watch how the answers and the cited pages move. Ids are stable across runs, so results line up.

### Pricing

Pay per answer. No start fee, no subscription.

| Engine | Standard models | Premium model |
|---|---|---|
| ChatGPT (OpenAI) | **$0.09**: GPT-6.1 Terra, GPT-6 Luna | **$0.15**: GPT-6.1 Sol |
| Claude (Anthropic) | **$0.10**: Claude Sonnet 5.5, Claude Haiku 5.5 | **$0.18**: Claude Opus 5.5 |
| Gemini (Google) | **$0.08**: Gemini 3.8 Flash, 3.6 Flash, 3.5 Flash-Lite | **$0.15**: Gemini 3.1 Pro Preview |

Worked examples:

- 1 prompt on ChatGPT (the prefilled input): **$0.09**.
- 10 prompts on all three engines, default models: 10 × ($0.09 + $0.10 + $0.08) = **$2.70**.
- 100 prompts on Gemini Flash: 100 × $0.08 = **$8.00**.
- 50 prompts on Claude Opus and GPT-6.1 Sol: 50 × ($0.18 + $0.15) = **$16.50**.
- 1,000 prompts on ChatGPT: 1,000 × $0.09 = **$90.00**.

What is free: a check that fails at the provider, an answer that comes back empty or refused, and every check that is never run because of `maxChecks`, the daily allowance or your cost limit.

**Capping the cost.** Set the run's maximum cost (in the console's run options, or `maxTotalChargeUsd` through the API). Before each provider call the Actor checks that the limit still covers that check; when it does not, the run stops there. You never pay more than the limit, and you never pay for an answer you did not get.

### Daily allowance

Every answer costs us real API usage at the provider, so each Apify account has a daily allowance:

- **15 checks a day** on a free Apify plan;
- **1,000 checks a day** on a paid plan.

The day is the UTC calendar day. When the allowance is used up, the run finishes what it can, stops with a status message that says so, and the rest can run the next day. Checks that fail at the provider do not count; an answer that comes back empty or refused does, although it is not charged. If you need more than 1,000 answers a day, open an issue on the Actor's Issues tab.

### Use it from the API

Any Apify client works. The Actor is addressed as `localwire/ai-answers`.

**curl** (run and wait for the results; best for a handful of prompts, since the request waits up to five minutes):

```bash
curl -X POST "https://api.apify.com/v2/acts/localwire~ai-answers/run-sync-get-dataset-items?token=$APIFY_TOKEN&maxTotalChargeUsd=1" \
  -H "content-type: application/json" \
  -d '{"prompts": ["What changed in the EU AI Act this year?"], "engines": ["openai", "gemini"]}'
```

**JavaScript:**

```js
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor("localwire/ai-answers").call(
  { prompts: ["What changed in the EU AI Act this year?"], engines: ["openai", "anthropic", "gemini"] },
  { maxTotalChargeUsd: 1 },
);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const item of items) console.log(item.engine, item.status, item.citedDomains);
```

**Python:**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("localwire/ai-answers").call(
    run_input={"promptsFileUrl": "https://example.com/prompts.csv", "engines": ["gemini"], "maxChecks": 200},
    max_total_charge_usd=20,
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["prompt"], item["status"], len(item["citations"]))
```

If you leave `engines` out, only ChatGPT is asked, so a call with nothing but prompts costs one check per prompt.

### Use it from an AI agent (MCP)

Apify's hosted MCP server at `https://mcp.apify.com` exposes this Actor as a tool to Claude, ChatGPT, Cursor, VS Code and any other MCP client. Add the server with the Actor preloaded:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com/?tools=localwire/ai-answers"
    }
  }
}
```

The agent sees the input fields with their descriptions and defaults: one engine (`openai`) unless it names others, at most 50 checks per run, and the search instruction on. A typical instruction to the agent is "ask ai-answers what Claude and Gemini say about X and compare their sources". Each call costs the same per answer as any other run, so give the agent a spending limit in your Apify account.

### How it works

- **ChatGPT:** the OpenAI Responses API with the hosted `web_search` tool, low reasoning effort. Citations are the answer's `url_citation` annotations; sources and queries come from the search calls.
- **Claude:** the Anthropic Messages API with the web search server tool, up to `maxSearches` searches, low effort. Citations come from the text blocks' search-result locations; sources from the search result blocks.
- **Gemini:** the Gemini API `generateContent` with Grounding with Google Search. Cited pages come from the grounding supports, pages read from the grounding chunks, and Google's redirect links are resolved to the real page URLs. Every Gemini request also carries a short system instruction to ground the answer in web sources.

One check is one request to the provider. It is repeated once only if the provider answers with a rate-limit or server error; a timeout is reported as a failed check, not retried.

### FAQ

#### Is there a ChatGPT search API with citations?

Yes. OpenAI's Responses API has a web search tool, and its answers carry `url_citation` annotations that point at the pages used. This Actor calls that API for you and returns the answer, the citations, the pages read and the search queries as one record, with no OpenAI account or key needed on your side. The same goes for Claude's web search tool and Gemini's Grounding with Google Search.

#### Can I query Perplexity?

No. This Actor asks OpenAI, Anthropic and Google models only. Perplexity is not included.

#### Does it return Google AI Overviews or AI Mode results?

No. Gemini here is the Gemini API with Grounding with Google Search. It is not the AI Overview shown on a Google results page, and not Google's AI Mode. Microsoft Copilot, Meta AI and Grok are not included either.

#### Why do answers differ from the ChatGPT app?

The consumer apps (ChatGPT, Claude, the Gemini app) wrap the model in their own system prompt, memory, personalisation, location and interface features, and they may route a question to a different model than the one you pick here. This Actor sends your prompt to the model through the API with web search available, low reasoning effort and no memory or history. The model family is the same; the surrounding product is not. Expect the same kind of answer and often the same sources, not the same wording. If you need exactly what a logged-in person sees in the app, an API cannot give you that.

#### Do the engines always search the web?

No. Search is available on every request, and by default the Actor asks the engine to use it (`alwaysSearch`), which makes cited answers the normal case. An engine can still answer from memory. Check `usage.searches` and `citations` per record. With `alwaysSearch` off, expect many everyday questions to come back without citations.

#### Will I get the same answer twice?

Not word for word. Language models are not deterministic, and search results change. Run the same prompt twice and the wording, and sometimes the cited pages, will differ. For tracking over time, ask several prompts and look at patterns across runs.

#### Can I use my own OpenAI, Anthropic or Gemini API key?

No. The Actor uses our provider accounts, and the price per answer covers the model and search usage. You need only an Apify account.

#### Which models can I choose?

The ones in the input reference above: three OpenAI models, three Claude models and four Gemini models. The lightest and the default model of each engine are charged at the standard price, the largest at the premium price. Other model ids are rejected.

#### How many prompts can I send in one run?

Up to 1,000 prompts and 1,000 checks per run, within your account's daily allowance. Split larger jobs over several runs or days.

#### What happens when a check fails?

The record is written with `status: "error"` and the provider's message in `error`, and it is not charged. After an authentication failure or three failures in a row, that engine is skipped for the rest of the run and the status message says so; the other engines carry on.

#### What happens to my prompts?

Each prompt is sent to the provider or providers you select, through their APIs, and the answer is stored in your run's dataset in your Apify account. The Actor keeps no other copy. Do not put personal or confidential information in prompts.

### Limitations

- **API answers, not app answers.** See the FAQ above. No Perplexity, no Google AI Overviews or AI Mode, no Copilot.
- **Search is requested, not guaranteed.** An answer can come back with `usage.searches: 0` and no citations.
- **Text only.** No images, files or conversation history; each prompt is answered on its own.
- **Bounded answers.** Answers are limited to roughly 3,000 to 4,000 output tokens depending on the engine. A longer one is cut and marked `truncated`.
- **Prompt length.** 2,000 characters per prompt and 500 for `instructions`. This is a question-answering tool, not a way to process long documents.
- **Country.** Applies to ChatGPT and Claude. Gemini's grounded search has no location setting.
- **What each API exposes differs.** Claude's and ChatGPT's records list the pages read as well as the pages cited; Gemini's page titles are often missing (the API gives the domain). ChatGPT's cited URLs can carry a `utm_source=openai` parameter, exactly as the API returns them.
- **Privacy scrub.** Email addresses and phone numbers that appear in answer text are replaced with `[email removed]` and `[phone removed]`, and full UK postcodes are shortened to their district. No user or account data is collected.
- **A run that costs too much is stopped.** If the prompts in a run make the engines search and write far beyond a normal answer, the run stops early with a message asking for narrower questions. You are charged only for the answers you received.
- **Models change.** The model ids are the providers' current ones. When a provider retires a model, the list here changes with it; the record always reports the model that actually answered.

# Actor input Schema

## `prompts` (type: `array`):

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.

## `instructions` (type: `string`):

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` (type: `string`):

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` (type: `string`):

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` (type: `string`):

The CSV column or the JSON / dataset field that holds the prompt in a bulk source. Not case-sensitive.

## `engines` (type: `array`):

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.

## `openaiModel` (type: `string`):

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.

## `anthropicModel` (type: `string`):

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.

## `geminiModel` (type: `string`):

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.

## `country` (type: `string`):

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` (type: `boolean`):

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.

## `maxSearches` (type: `integer`):

How many web searches Claude may run for one answer (ChatGPT and Gemini decide for themselves). 2 if left out, at most 3.

## `maxChecks` (type: `integer`):

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.

## `includeSources` (type: `boolean`):

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.

## Actor input object example

```json
{
  "prompts": [
    "What are the best project management tools for small teams?"
  ],
  "promptsField": "prompt",
  "engines": [
    "openai"
  ],
  "openaiModel": "gpt-6.1-terra",
  "anthropicModel": "claude-sonnet-5-5",
  "geminiModel": "gemini-3.8-flash",
  "alwaysSearch": true,
  "maxSearches": 2,
  "maxChecks": 10,
  "includeSources": true
}
```

# Actor output Schema

## `overview` (type: `string`):

One row per prompt and engine: the answer, its status and the domains it cites.

## `sources` (type: `string`):

Which pages each engine cited and read, and what it searched for.

## `allResults` (type: `string`):

Every record in the run's default dataset, all fields, including token usage and the full list of pages read.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "prompts": [
        "What are the best project management tools for small teams?"
    ],
    "engines": [
        "openai"
    ],
    "maxChecks": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("localwire/ai-answers").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "prompts": ["What are the best project management tools for small teams?"],
    "engines": ["openai"],
    "maxChecks": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("localwire/ai-answers").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "prompts": [
    "What are the best project management tools for small teams?"
  ],
  "engines": [
    "openai"
  ],
  "maxChecks": 10
}' |
apify call localwire/ai-answers --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,localwire/ai-answers"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/r3vVRzDFHYeNbapMj/builds/7ONj92rgdI3ug4iSS/openapi.json
