# Bulk LLM Runner: AI Prompt for Every Row, JSON Output, No Key (`rod_analytics/bulk-llm-runner`) Actor

Run one AI prompt over hundreds of rows from a list or a dataset. Classify, extract, summarize, translate or enrich every row with GPT-OSS and get strict JSON with your own fields, in input order. Try it with no key, or use your own free Groq key for $0.001 per row.

- **URL**: https://apify.com/rod_analytics/bulk-llm-runner.md
- **Developed by:** [Rod Services](https://apify.com/rod_analytics) (community)
- **Categories:** AI, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 1,000 row processed, gpt-oss 20bs

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

**Bulk LLM runner: run one AI prompt over hundreds of rows and get one clean JSON result per row.**
**No API key needed to try it.** Classify, extract, summarize, translate, tag or enrich a list, a CSV export or the dataset of any scraper run. You name the output fields, the model fills them for every row, in input order. From $0.001 per row with your own free Groq key.

### What does Bulk LLM Runner do?

You write the prompt for **one row** and use `{{field}}` to insert the row's data. The Actor runs it for every row with a hosted open-weight model (GPT-OSS 20B or 120B on Groq) and saves one result per row:

- **Strict JSON output.** List the fields you want, such as `sentiment` and `reason`, or give a full JSON schema. Every answer follows it.
- **Rows from anywhere.** Paste rows as JSON, as plain text lines, or pick the dataset of an earlier run, for example a scraper or a CRM export.
- **Same order as the input**, with the input row copied next to each result, so results join back easily.
- **Fast.** 10 rows run in parallel. A typical row takes 1 to 3 seconds.
- **No API key, no account at an AI provider.** Bring your own Groq, OpenAI or OpenRouter key if you want any other model.

Typical uses:

- **Sentiment and topic tagging** of reviews, tickets, survey answers or comments.
- **Data extraction** from messy text: company name, city, price, dates, into typed fields.
- **Lead enrichment and scoring** of scraped company or job rows.
- **Summaries and translations** of product descriptions or articles.
- **AI agents.** One predictable JSON schema per row, callable through the Apify API or MCP.

### How to use it

1. Open the **Input** tab.
2. Write the **Prompt for each row**, with `{{field}}` where the row's data goes. Plain text rows are `{{text}}`.
3. Paste **Rows**, or pick a **Dataset with rows**.
4. Add the **Output fields** you want, for example `sentiment`, `reason`.
5. Press **Start**. Open the **Output** tab when the run finishes. Download as JSON, CSV, Excel or HTML.

From code, one request returns the results:

```bash
curl -X POST "https://api.apify.com/v2/acts/rod_analytics~bulk-llm-runner/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"prompt": "Classify the sentiment of: {{text}}", "rows": ["Great product", "Never again"], "outputFields": ["sentiment"]}'
```

### Input example

```json
{
    "prompt": "Classify the sentiment of this customer review as positive, negative or neutral, and give a one-sentence reason.\n\nReview: {{text}}",
    "rows": [
        { "text": "Fast delivery and the product works great." },
        { "text": "The app crashes every time I open the settings." }
    ],
    "outputFields": ["sentiment", "reason"]
}
```

| Field             | Default       | Description                                                                          |
| ----------------- | ------------- | ------------------------------------------------------------------------------------ |
| `prompt`          | required      | Prompt for one row. `{{field}}`, `{{company.name}}` and `{{row}}` insert row data.   |
| `rows`            | empty         | Objects, plain strings, or a text block with one row per line.                       |
| `datasetId`       | empty         | Dataset of an earlier run. Each item is one row.                                     |
| `outputFields`    | empty         | Field names the JSON answer must have. Each is text.                                 |
| `jsonSchema`      | empty         | Full JSON schema for numbers, lists or nested objects. Overrides `outputFields`.     |
| `outputFormat`    | `json`        | `json` gives a parsed object in `output`, `text` gives a string.                     |
| `model`           | `gpt-oss-20b` | `openai/gpt-oss-20b` fast and cheap, `openai/gpt-oss-120b` smarter.                  |
| `systemPrompt`    | empty         | Rules for every row, such as language or tone.                                       |
| `reasoningEffort` | `low`         | How long the model thinks. Higher costs more tokens.                                 |
| `temperature`     | `0`           | 0 for consistent classification and extraction.                                      |
| `maxOutputTokens` | `1024`        | Upper limit per answer, thinking included.                                           |
| `maxRows`         | `10000`       | Most rows per run.                                                                   |
| `apiKey`          | empty         | Optional. Your own Groq, OpenAI or OpenRouter key. Lower price per row.              |
| `apiBaseUrl`      | Groq          | Your provider's OpenAI compatible endpoint, for example `https://api.openai.com/v1`. |
| `customModel`     | empty         | Any model of your provider. Only with your own key.                                  |

### Output example

```json
{
    "rowIndex": 0,
    "status": "ok",
    "output": {
        "sentiment": "positive",
        "reason": "The review praises the fast delivery and that the product works."
    },
    "input": { "text": "Fast delivery and the product works great." },
    "model": "openai/gpt-oss-20b",
    "inputTokens": 183,
    "outputTokens": 83,
    "reasoningTokens": 41,
    "totalTokens": 266,
    "finishReason": "stop",
    "latencyMs": 912,
    "warnings": [],
    "errorCode": null,
    "error": null,
    "retryable": null
}
```

| Field                             | Meaning                                                      |
| --------------------------------- | ------------------------------------------------------------ |
| `rowIndex`                        | Position of the row in the input, starting at 0              |
| `status`                          | `ok` or `error`                                              |
| `output`                          | The answer: an object for JSON, a string for text            |
| `input`                           | The input row, unless `includeInput` is off                  |
| `inputTokens`, `outputTokens`     | Token use. Output tokens include the model's thinking        |
| `errorCode`, `error`, `retryable` | Why a row failed and whether a later run may work            |
| `warnings`                        | For example a field of the prompt that was empty in this row |

### Use your own free Groq key for big lists

The built-in models share one free quota across all users, about 1,000 rows a day. That is fine for tests and small lists. For more:

1. Sign in at [console.groq.com/keys](https://console.groq.com/keys) and click **Create API key**. Groq has a free plan.
2. Paste the key into **Your own API key**. Leave **API base URL** empty.
3. Keep the model `openai/gpt-oss-20b`, or set **Custom model** to any Groq model.

Rows on your own key cost $0.001 each, with no token surcharge. OpenAI and OpenRouter keys work the same way with their base URL.

### Pricing

Pay per event. You pay only for **rows that return a result**. Rows that fail, return invalid JSON or are skipped are free.

| Event                                           | Price   |
| ----------------------------------------------- | ------- |
| Row with GPT-OSS 20B, up to 2,000 tokens        | $0.003  |
| Row with GPT-OSS 120B, up to 2,000 tokens       | $0.005  |
| Each further 1,000 tokens of a row, GPT-OSS 20B | $0.0005 |
| Each further 1,000 tokens of a row, 120B        | $0.001  |
| Row with your own API key, any length           | $0.001  |
| Run start, per GB of memory                     | $0.001  |

- A short row such as a review uses about 300 tokens, so 1,000 reviews cost about $3 with the default model.
- 2,000 tokens is about 1,500 words of prompt and answer together.
- With your own key you pay your provider for the tokens directly.
- Set **Maximum cost per run** in Run options to cap spend. The Actor stops before the limit.

### Tips

- Keep `temperature` at 0 and `reasoningEffort` at low for tagging and extraction. It is faster and cheaper.
- Use `outputFields` for simple text fields. Use `jsonSchema` when you need numbers, booleans, lists or nested objects.
- Test the prompt on 5 to 10 rows first, then run the full list.
- Put shared rules in **System prompt** instead of repeating them in every row.
- Long documents: keep each row under about 60,000 characters. Longer rows end as a free `PROMPT_TOO_LONG` error.

### FAQ

**Do I need an API key?** Not to try it. The built-in models run on a shared key with a daily limit for all users together. For lists over about 100 rows, paste your own key: a free Groq key takes one minute at [console.groq.com/keys](https://console.groq.com/keys), and rows then cost $0.001.

**Where does my data go?** Each row's prompt is sent to the model provider, Groq for the built-in models, or the provider of your own key. The Actor stores nothing outside your run's dataset. The log holds counts only, never prompts or answers.

**What if a row fails?** It gets `status: "error"`, an `errorCode`, and `retryable: true` when a rerun may work. It is not charged.

**The built-in model is busy.** The shared key has a per-minute and a daily limit. The Actor waits and retries on the per-minute limit. If the daily limit is used up, the run ends with one free row that says so, and the rows already done are kept. Retry tomorrow or add your own key.

**Can it browse the web?** No. It only works with the data in your rows. Combine it with a scraper: run the scraper, then pick its dataset here.

**Is the answer always correct?** No. Language models make mistakes. Check a sample before you rely on the results.

Use it only for lawful purposes and data you are allowed to process. Do not send sensitive personal data you have no right to process. Found a bug or need another model? Open an issue in the **Issues** tab.

### Related Actors

| Actor                                                                                                               | What it does                                                         |
| ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [Website Content Crawler to Markdown for RAG & LLMs](https://apify.com/rod_analytics/website-to-markdown)           | Crawl whole websites into clean Markdown, RAG chunks and llms.txt    |
| [PDF to Markdown & Text Extractor with OCR](https://apify.com/rod_analytics/doc-to-markdown)                        | PDF, Word, Excel and PowerPoint files to Markdown and text, with OCR |
| [Website Contact Scraper: Emails, Phones & Social Links](https://apify.com/rod_analytics/company-contact-extractor) | Find emails, phone numbers and social profiles on company websites   |
| [Speech to Text: Audio, Video & Podcast Transcriber](https://apify.com/rod_analytics/media-transcriber)             | Whisper transcripts, SRT and VTT subtitles from audio and video      |
| [PageSpeed Insights & Lighthouse Bulk Checker, No API Key](https://apify.com/rod_analytics/lighthouse-audit)        | Lighthouse scores and Core Web Vitals for many URLs or a sitemap     |

# Changelog

This Actor's version history is a separate document: https://apify.com/rod_analytics/bulk-llm-runner/changelog.md

# Actor input Schema

## `prompt` (type: `string`):

What the model should do with one row. Use {{field}} to insert a field of the row, for example {{text}} or {{company.name}}. {{row}} inserts the whole row as JSON. Plain text rows are available as {{text}}.

## `rows` (type: `array`):

The items to process: a list of objects like \[{"text": "..."}, {"name": "...", "website": "..."}], or a list of plain strings. Leave empty when you use a dataset.

## `datasetId` (type: `string`):

Optional. Process the items of a dataset, for example the output of a scraper run. Each item is one row. Added after the rows above.

## `outputFields` (type: `array`):

Field names the JSON answer must have, for example sentiment and reason. Every row gets exactly these fields as text. For numbers, lists or nested objects use "JSON schema" instead.

## `outputFormat` (type: `string`):

JSON returns one parsed object per row in "output". Text returns the answer as a string.

## `model` (type: `string`):

Open-weight models served by Groq through this Actor's own key. No API key needed. With your own key below, "Custom model" picks any model of your provider.

## `systemPrompt` (type: `string`):

Optional instructions for every row, for example tone, language or rules. The prompt above is still sent per row.

## `jsonSchema` (type: `object`):

Optional. A JSON schema of an object that every answer must follow, for example {"type": "object", "properties": {"score": {"type": "number"}, "tags": {"type": "array", "items": {"type": "string"}}}}. Overrides "Output fields". All properties become required.

## `maxRows` (type: `integer`):

Upper limit of rows per run, from the list and the dataset together. Set "Maximum cost per run" in Run options to cap spend.

## `reasoningEffort` (type: `string`):

How long GPT-OSS models think before answering. Thinking tokens count as output tokens.

## `temperature` (type: `number`):

0 gives the most consistent answers, which suits classification and extraction. Raise it for creative text.

## `maxOutputTokens` (type: `integer`):

Upper limit for the answer, thinking included. Answers cut at the limit are reported with finishReason "length".

## `includeInput` (type: `boolean`):

Copy each input row into "input" of its result, so results can be joined back without the row index.

## `maxConcurrency` (type: `integer`):

How many rows run at the same time. Results are still saved in input order.

## `apiKey` (type: `string`):

Optional. Leave empty to use the built-in models, which share a daily limit across all users. For big lists paste your own key: a free Groq key takes one minute at <a href='https://console.groq.com/keys'>console.groq.com/keys</a>. Stored encrypted.

## `apiBaseUrl` (type: `string`):

OpenAI compatible endpoint of your provider. Empty means Groq. Examples: https://api.openai.com/v1, https://openrouter.ai/api/v1. Only used with your own key.

## `customModel` (type: `string`):

Any model name of your provider, for example gpt-4o-mini or anthropic/claude-sonnet-4.5 on OpenRouter. Only used with your own key.

## Actor input object example

```json
{
  "prompt": "Classify the sentiment of this customer review as positive, negative or neutral, and give a one-sentence reason.\n\nReview: {{text}}",
  "rows": [
    {
      "text": "Fast delivery and the product works great."
    },
    {
      "text": "The app crashes every time I open the settings."
    },
    {
      "text": "It does what it says. Nothing special."
    }
  ],
  "outputFields": [
    "sentiment",
    "reason"
  ],
  "outputFormat": "json",
  "model": "openai/gpt-oss-20b",
  "maxRows": 10000,
  "reasoningEffort": "low",
  "temperature": 0,
  "maxOutputTokens": 1024,
  "includeInput": true,
  "maxConcurrency": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "prompt": `Classify the sentiment of this customer review as positive, negative or neutral, and give a one-sentence reason.

Review: {{text}}`,
    "rows": [
        {
            "text": "Fast delivery and the product works great."
        },
        {
            "text": "The app crashes every time I open the settings."
        },
        {
            "text": "It does what it says. Nothing special."
        }
    ],
    "outputFields": [
        "sentiment",
        "reason"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rod_analytics/bulk-llm-runner").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 = {
    "prompt": """Classify the sentiment of this customer review as positive, negative or neutral, and give a one-sentence reason.

Review: {{text}}""",
    "rows": [
        { "text": "Fast delivery and the product works great." },
        { "text": "The app crashes every time I open the settings." },
        { "text": "It does what it says. Nothing special." },
    ],
    "outputFields": [
        "sentiment",
        "reason",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("rod_analytics/bulk-llm-runner").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 '{
  "prompt": "Classify the sentiment of this customer review as positive, negative or neutral, and give a one-sentence reason.\\n\\nReview: {{text}}",
  "rows": [
    {
      "text": "Fast delivery and the product works great."
    },
    {
      "text": "The app crashes every time I open the settings."
    },
    {
      "text": "It does what it says. Nothing special."
    }
  ],
  "outputFields": [
    "sentiment",
    "reason"
  ]
}' |
apify call rod_analytics/bulk-llm-runner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rod_analytics/bulk-llm-runner"
        }
    }
}
```

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/3XnKpzfWwqbP5wxwZ/builds/cbph4ShFN6Xpy86h8/openapi.json
