VOOZH about

URL: https://apify.com/apify/openrouter

โ‡ฑ OpenRouter ยท Apify


Pricing

Pay per event + usage

Go to Apify Store

You can use any AI LLM model without accounts in AI providers. Use this Actor as a proxy for all requests. Use pay-per-event pricing to pay only for the real credit used.

Pricing

Pay per event + usage

Rating

4.7

(8)

Developer

๐Ÿ‘ Apify

Apify

Maintained by Apify

Actor stats

33

Bookmarked

5.9K

Total users

203

Monthly active users

1.8 days

Issues response

18 days ago

Last modified

Categories

Share

OpenRouter Proxy

This Apify Actor proxies the OpenRouter API over an OpenAI-compatible interface, billed to your Apify account on a pay-per-event basis.

What this Actor does

  • Proxy access: Forwards API requests to OpenRouter's models
  • OpenRouter SDK compatible: Works with the official @openrouter/sdk (TypeScript) and any OpenAI-compatible HTTP client
  • Billing: Charges your Apify account at OpenRouter's rates (see Pricing)
  • Supports: chat completions, embeddings, streaming, and image generation via modalities
  • Multiple API formats: OpenAI (/chat/completions), Anthropic (/messages), and OpenAI Responses (/responses)
  • Standby mode: Runs in Standby mode with a static URL, like a standard web server

Supported endpoints

MethodEndpointDescription
POST/api/v1/chat/completionsChat completions (OpenAI format)
POST/api/v1/messagesMessages (Anthropic format)
POST/api/v1/responsesResponses (OpenAI Responses API)
POST/api/v1/embeddingsText embeddings
GET/api/v1/modelsList available models
GET/api/v1/models/countModel count
GET/api/v1/models/userUser model preferences
GET/api/v1/models/{author}/{slug}/endpointsModel endpoints
GET/api/v1/embeddings/modelsEmbedding models
GET/api/v1/providersAvailable providers
GET/api/v1/endpoints/zdrZero-data-retention endpoints
GET/api/v1/generationGeneration details

For full API documentation, see the OpenRouter API docs.

Pricing

This Actor uses a pay-per-event pricing model on the Apify platform. You pay for the tokens used by the OpenRouter API. Free tier users pay 10x more than paying users and are limited to 2,048 tokens per response.

Pricing structure

  • Event: openrouter-api-usage
  • Paying users: Pay the exact OpenRouter cost (rounded up to nearest $0.00001)

Pricing examples

OpenRouter costCalculationCharged eventsYou payMarkup factor
$0.000012120.00001212 / 0.000012$0.000021.65x
$0.00010.0001 / 0.0000110$0.00011x (exact)
$0.0010.001 / 0.00001100$0.0011x (exact)
$0.010.01 / 0.000011,000$0.011x (exact)

Quick start

The proxy only accepts calls from inside the Apify platform (caller type APIFY_ACTOR). The examples below use the official OpenRouter TypeScript SDK; any OpenAI-compatible HTTP client also works โ€” point it at the same base URL and pass your Apify token as the bearer.

1. Install @openrouter/sdk

$npminstall @openrouter/sdk

2. Basic usage

Point the SDK at the proxy with serverURL, and pass your Apify token as apiKey โ€” the SDK sends it as Authorization: Bearer <token>, which is what the proxy expects.

import{ OpenRouter }from'@openrouter/sdk';
const client =newOpenRouter({
serverURL:'https://openrouter.apify.actor/api/v1',
apiKey: process.env.APIFY_TOKEN,// Apify token is loaded automatically in runtime
});
const result =await client.chat.send({
chatRequest:{
model:'openrouter/auto',
messages:[
{
role:'user',
content:'What is the meaning of life?',
},
],
},
});
console.log(result.choices[0].message.content);

3. Streaming responses

Set stream: true inside chatRequest. The SDK returns an async iterable of SSE chunks; the final chunk carries the usage object the proxy uses for billing.

const stream =await client.chat.send({
chatRequest:{
model:'openrouter/auto',
messages:[
{
role:'user',
content:'Write a short story about a robot.',
},
],
stream:true,
},
});
forawait(const chunk of stream){
process.stdout.write(chunk.choices[0]?.delta?.content ??'');
}

4. Image generation

OpenRouter generates images through chat completions on image-capable models, using the modalities parameter:

const result =await client.chat.send({
chatRequest:{
model:'google/gemini-2.5-flash-image',// Image-capable model
messages:[
{
role:'user',
content:'Generate an image of a cute baby sea otter',
},
],
modalities:['text','image'],// Enable image generation
},
});
// Generated image data lives on the assistant message
console.log(result.choices[0].message);

Note: OpenRouter does not expose an OpenAI-style /images/generations endpoint. Image generation goes through compatible chat-completion models. Check available image-capable models on OpenRouter's models page.

Using a different client

The proxy is OpenAI-compatible, so any client that lets you set the base URL and the Authorization header works โ€” point it at https://openrouter.apify.actor/api/v1 and pass Authorization: Bearer <APIFY_TOKEN>. The OpenAI SDK can be wired up this way, but it currently rejects some of the SSE events OpenRouter emits on streamed responses; prefer @openrouter/sdk above.

Raw fetch works too:

const res =awaitfetch('https://openrouter.apify.actor/api/v1/chat/completions',{
method:'POST',
headers:{
'content-type':'application/json',
Authorization:`Bearer ${process.env.APIFY_TOKEN}`,
},
body:JSON.stringify({
model:'openrouter/auto',
messages:[{ role:'user', content:'Hello'}],
}),
});

Available models

Every model OpenRouter serves is reachable through this proxy. For the full list, see OpenRouter's models page or call GET /api/v1/models.

Authentication

The Actor uses your Apify token for authentication. In Actor environments on the Apify platform, APIFY_TOKEN is automatically available.

Support

For issues related to this Actor, please open an issue or contact the Actor developer on Apify Store.

You might also like

Website Content to Markdown for LLM Training

easyapi/website-content-to-markdown-for-llm-training

๐Ÿš€ Transform web content into clean, LLM-ready Markdown! ๐Ÿ“˜ Scrape multiple pages, extract main content, and convert to Markdown format. Perfect for AI researchers, data scientists, and LLM developers. Fast, efficient, and customizable. Supercharge your AI training data today! ๐ŸŒ๐Ÿ“๐Ÿง 

TrustMRR Startup scraper

advantageous_subcontra/trustmrr

Get all startups listed in any category on TrustMRR startup database. Get all information about each startup, like revenue, founding year, and location.

66

RAG Web Browser

apify/rag-web-browser

Web search and fetch tool for AI agents and RAG pipelines. It queries Google Search, scrapes the top N pages using a full web browser, and returns their content as clean Markdown for further processing by an LLM. Can also fetch individual URLs.

TrustMRR Startup Explorer

mikolabs/trustmrr-startup-explorer

Scrape verified startup revenue data from TrustMRR with filters for category, MRR, asking price, growth rate, and more. Perfect for deal sourcing, market research, competitor tracking, and startup acquisition pipelines.

Link Prospecting Tool

apify/link-prospecting-tool

Monitor your brand visibility across AI and organic search platforms (ChatGPT, Google AI Mode, Google AI Overviews, and Perplexity). Check if quoted sources include your brand, and find link outreach opportunities.

Phantombuster result downloader

advantageous_subcontra/phantombuster-result-downloader

Download the result of a phantom and store it in an Apify dataset. This is useful to combine Phantombuster and Apify. Run an Apify actor based on a Phantom result.

18

Meta Ads Library Scraper

scraperhive/meta-ads-library-scraper

Scrape ads from the Facebook Ads Library by keyword or Facebook Page URL. Extract ad copy, creatives, targeting,CTA, start/end dates & compliance data. Export to JSON, CSV or Excel. $0.005 per ad โ€” pay only for results.

20

5.0

Gemini 3.1 High AI Query API

dev00/gemini-ai-query-api

Send natural language questions to Google's Gemini 3.1 High model and receive clean, structured answers โ€” no API keys or setup required.

dev00

5

AI Web Scraper

apify/ai-web-scraper

AI-first web scraper that extracts structured data from any website using natural-language prompts. No programming knowledge required. No hard-coded logic that breaks when a website changes.

Related articles

How to use a proxy with Python Requests
Read more