# OpenRouter AI Models Directory Scraper (`klondikeking/openrouter-models-scraper`) Actor

Extract structured data for all AI models available on OpenRouter, including pricing, capabilities, context lengths, and supported parameters. Perfect for comparing LLM options and building model catalogs.

- **URL**: https://apify.com/klondikeking/openrouter-models-scraper.md
- **Developed by:** [Pierrick McD0nald](https://apify.com/klondikeking) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 108 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 model extracteds

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

## OpenRouter AI Models Directory Scraper — Extract LLM Pricing & Capabilities

The OpenRouter AI Models Directory Scraper extracts structured data for every AI model available on the OpenRouter platform. Whether you are building a model comparison tool, monitoring price changes across providers, or cataloging LLM capabilities for your organization, this Actor delivers clean, structured data with zero configuration.

OpenRouter aggregates hundreds of large language models and multimodal AI providers behind a single API. Keeping track of which models support vision, audio, or tool calling — and what each costs per token — is a manual, time-consuming process. This Actor automates that entirely.

### Use Cases

- **LLM Comparison Dashboards** — Build internal or public tools that let users filter models by context length, modality, or price.
- **Price Monitoring** — Track how per-token pricing evolves across providers and alert stakeholders when cheaper alternatives appear.
- **Model Catalogs** — Populate your product with up-to-date model metadata including supported parameters, tokenizers, and moderation flags.
- **Capacity Planning** — Understand max completion tokens and context windows to match the right model to your workload.

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `maxItems` | Number | No | Maximum models to return (default: 100, max: 500) |
| `includePricing` | Boolean | No | Include per-token pricing data (default: true) |
| `includeArchitecture` | Boolean | No | Include modality, tokenizer, and I/O types (default: true) |
| `proxyConfiguration` | Object | No | Proxy configuration for requests |

### Output

The Actor outputs a dataset with the following fields for each model:

```json
{
  "id": "anthropic/claude-3.5-sonnet",
  "name": "Anthropic: Claude 3.5 Sonnet",
  "description": "Claude 3.5 Sonnet raises the industry bar...",
  "context_length": 200000,
  "modality": "text+image->text",
  "input_modalities": ["text", "image"],
  "output_modalities": ["text"],
  "tokenizer": "Claude",
  "instruct_type": null,
  "prompt_price": "0.000003",
  "completion_price": "0.000015",
  "image_price": "0.000004",
  "audio_price": null,
  "web_search_price": null,
  "max_completion_tokens": 8192,
  "is_moderated": false,
  "supported_parameters": ["max_tokens", "temperature", "top_p", "tools"],
  "knowledge_cutoff": "2024-04",
  "expiration_date": null,
  "created": 1718304000,
  "hugging_face_id": null
}
```

### Pricing

Pay per event: **$0.001 per model extracted**. A typical run extracting 100 models costs $0.10.

### Limitations

- Data reflects the current state of the OpenRouter public API. Deprecated models may still appear until they are removed by OpenRouter.
- Pricing fields are returned as strings and represent per-token costs in USD.
- The Actor makes a single API call to OpenRouter. Rate limits are respected through built-in retry logic.

### FAQ

**Q: Do I need an OpenRouter API key?**
A: No. The models directory endpoint is public and requires no authentication.

**Q: How often is the data updated?**
A: The Actor fetches live data on every run. Run it on a schedule to keep your catalog current.

**Q: Can I filter models by provider?**
A: The Actor returns all models. Filter the resulting dataset by the `id` prefix (e.g., `anthropic/`, `openai/`) in your downstream pipeline.

### Changelog

- **v1.0.0** — Initial release. Extracts model metadata, pricing, and architecture from the OpenRouter public API.

# Actor input Schema

## `maxItems` (type: `integer`):

Limit the number of models returned (default: 100, max: 500)

## `includePricing` (type: `boolean`):

Include per-token pricing information for each model

## `includeArchitecture` (type: `boolean`):

Include modality, tokenizer, and input/output modalities for each model

## `proxyConfiguration` (type: `object`):

Configure proxy settings for the scraper

## Actor input object example

```json
{
  "maxItems": 50,
  "includePricing": true,
  "includeArchitecture": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing extracted OpenRouter model data

## `stats` (type: `string`):

Key-value store with extraction statistics

# 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 = {
    "maxItems": 50,
    "includePricing": true,
    "includeArchitecture": true,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("klondikeking/openrouter-models-scraper").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 = {
    "maxItems": 50,
    "includePricing": True,
    "includeArchitecture": True,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("klondikeking/openrouter-models-scraper").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 '{
  "maxItems": 50,
  "includePricing": true,
  "includeArchitecture": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call klondikeking/openrouter-models-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,klondikeking/openrouter-models-scraper"
        }
    }
}
```

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/TccgpJKjwGdGTeFdm/builds/xeJTiTu8zC72JVhKd/openapi.json
