# Bulk LLM Runner - Your Own Key, $1/1K, Pay Only for Successes (`dariandanciu/bulk-llm-runner`) Actor

Run one prompt over every row of a dataset or list with your own OpenAI, Anthropic or OpenRouter key. Presets for summarising, translating, classifying and extracting. Failed rows are retried and never charged. $1 per 1,000 rows.

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

## Pricing

from $0.70 / 1,000 row processeds

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 prompt over every row of a dataset or list, with your own API key.** Summarise reviews, translate listings, classify leads or pull fields out of messy text, and get one row back for each input.

### Why use it

- **You only pay for rows that worked.** Rate limits and server errors are retried. A row that still fails costs nothing here.
- **$1 per 1,000 rows**, and less on paid plans. The model's own cost goes straight to your provider, on your key.
- **Your key stays yours.** It's stored encrypted, sent only to the provider you pick, and removed from every log and error message.
- **Ready-made tasks.** Summarise, translate, classify and extract, or write your own prompt with `{{field}}` placeholders.
- **Chains after any Actor.** Point it at a dataset ID and it reads the rows.

### Providers

| Provider | Models |
|---|---|
| OpenAI | Any chat model on your account |
| Anthropic | Any Claude model on your account |
| OpenRouter | Hundreds of models, including Gemini and Llama |
| Other | Any OpenAI-compatible endpoint: Groq, Together, Mistral and others |

### Input

| Field | Example |
|---|---|
| Provider, API key, Model | `openai`, your key, the model name as your provider writes it |
| Task | Summarise, Translate, Classify, Extract, or Custom |
| Prompt or instruction | `French` for Translate, `bug, feature, praise` for Classify, or a full prompt with `{{title}}` |
| Texts or Dataset | Your rows |

### Output

```json
{
  "index": 0,
  "input": { "title": "Great kettle", "body": "Boils fast." },
  "output": "positive",
  "provider": "openai",
  "model": "your-model",
  "finishReason": "stop",
  "inputTokens": 31,
  "outputTokens": 2
}
```

The Extract task also returns `outputJson`, and a row whose answer isn't valid JSON counts as failed.

### Good to know

- A run with no key returns one example row, billed like any row.
- A rejected key or unknown model stops the run straight away, so you don't burn through a long list.
- Lower **Requests at once** if your provider keeps answering with rate limits.
- Rows are sent to the provider you choose, under that provider's terms, and using this Actor doesn't change those terms. Don't send data you aren't allowed to share with them.
- This Actor is independent, and isn't affiliated with or endorsed by any model provider. Use your own key, not anyone else's.
- Each answer depends on the model. Check a small sample before running a big list.

### Related Actors

More developer utilities by the same developer, with the same pay-per-result pricing:

| Actor | What it gets |
|---|---|
| [Dataset Dedupe, Merge and Filter](https://apify.com/dariandanciu/dataset-dedupe-merge-filter) | Clean up the output of any Actor |
| [Bulk HTTP Requests](https://apify.com/dariandanciu/bulk-http-requests) | Any method, JSON parsed, at $0.50 per 1,000 |
| [Bulk File Downloader](https://apify.com/dariandanciu/bulk-file-downloader) | Save file links to storage, with hashes |
| [Video Frame Extractor](https://apify.com/dariandanciu/video-frame-grabber) | Frames from direct video links at $1 per 1,000 |
| [Audio & Video Transcriber](https://apify.com/dariandanciu/audio-video-transcriber) | Files and podcast feeds to text, with subtitles |
| [Bulk OCR](https://apify.com/dariandanciu/bulk-ocr-text-extractor) | Images and scanned PDFs to text, one row per page |
| [PDF Text Extractor](https://apify.com/dariandanciu/pdf-text-extractor-bulk) | PDF links to clean text for RAG and AI agents |
| [Bulk SEO Audit](https://apify.com/dariandanciu/bulk-seo-audit) | A score and ranked issue list for every page |
| [Article Extractor](https://apify.com/dariandanciu/article-extractor-markdown) | Clean text and Markdown from any article URL |

# Actor input Schema

## `provider` (type: `string`):

Who runs the model. OpenRouter also reaches Gemini, Llama and many others.

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

Your key for that provider. It is stored encrypted, used only for these requests and never written to logs or results. You pay the provider directly.

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

The model name exactly as your provider writes it.

## `preset` (type: `string`):

A ready-made instruction. Choose Custom to write your own prompt.

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

For Custom, the full prompt, with {{field}} for values from each row. For the presets: the target language, the list of categories, or the fields to extract.

## `texts` (type: `array`):

One text per line, if you have no dataset.

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

A dataset to read rows from, for example the output of another Actor.

## `textField` (type: `string`):

For presets: the row field that holds the text. Left empty, the whole row is sent.

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

Optional standing instructions for the model.

## `maxTokens` (type: `integer`):

Longest answer per row.

## `temperature` (type: `string`):

Optional, for example 0.2. Leave empty for the model default; some models refuse any other value.

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

Stop after this many rows.

## `concurrency` (type: `integer`):

Lower this if your provider answers with rate limits.

## `baseUrl` (type: `string`):

Only for "Other OpenAI-compatible endpoint", for example https://api.groq.com/openai/v1.

## Actor input object example

```json
{
  "provider": "openai",
  "model": "gpt-4o-mini",
  "preset": "summarize",
  "texts": [
    "Apify lets developers publish scrapers and get paid per result."
  ],
  "maxTokens": 1000,
  "maxRows": 1000,
  "concurrency": 5
}
```

# Actor output Schema

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

The output rows.

## `summary` (type: `string`):

Counts, and anything that failed.

# 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 = {
    "model": "gpt-4o-mini",
    "texts": [
        "Apify lets developers publish scrapers and get paid per result."
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dariandanciu/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 = {
    "model": "gpt-4o-mini",
    "texts": ["Apify lets developers publish scrapers and get paid per result."],
}

# Run the Actor and wait for it to finish
run = client.actor("dariandanciu/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 '{
  "model": "gpt-4o-mini",
  "texts": [
    "Apify lets developers publish scrapers and get paid per result."
  ]
}' |
apify call dariandanciu/bulk-llm-runner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dariandanciu/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/xfhR16V1B696RP5aP/builds/G5ZHvwQkXWZEMrIuh/openapi.json
