OpenRouter

OpenRouter

by apify

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 t...

2,121 runs
136 users
Try This Actor

Opens on Apify.com

About OpenRouter

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.

What does this actor do?

OpenRouter is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.

Key Features

  • Cloud-based execution - no local setup required
  • Scalable infrastructure for large-scale operations
  • API access for integration with your applications
  • Built-in proxy rotation and anti-blocking measures
  • Scheduled runs and webhooks for automation

How to Use

  1. Click "Try This Actor" to open it on Apify
  2. Create a free Apify account if you don't have one
  3. Configure the input parameters as needed
  4. Run the actor and download your results

Documentation

OpenRouter Proxy This Apify Actor creates a proxy for the Open Router API, allowing you to access multiple AI models through a unified OpenAI-compatible interface. All requests are charged to your Apify account on a pay-per-event basis. ## What this Actor does - Proxy access: Routes your API requests to Open Router's extensive collection of AI models - OpenAI compatibility: Works seamlessly with the OpenAI SDK and any OpenAI-compatible client - Transparent billing: Charges are applied to your Apify account at the same rates as Open Router - Full feature support: Supports both streaming and non-streaming responses - No API key management: Uses your Apify token for authentication - no need to manage separate Open Router API keys - Standby mode: Actor runs in standby mode only and has a static URL address, like a standard web server. ## Pricing This Actor uses a pay-per-event pricing model through Apify. Each API request counts as one event, and no additional fees are applied beyond the standard Apify event pricing. ## Quick start ### 1. Install the OpenAI package bash npm install openai ### 2. Basic usage javascript import OpenAI from 'openai'; const openai = new OpenAI({ baseURL: 'https://openrouter.apify.actor/api/v1', apiKey: 'no-key-required-but-must-not-be-empty', // Any non-empty string works; do NOT use a real API key. defaultHeaders: { Authorization: `Bearer ${process.env.APIFY_TOKEN}`, // Apify token is loaded automatically in runtime }, }); async function main() { const completion = await openai.chat.completions.create({ model: 'openrouter/auto', messages: [ { role: 'user', content: 'What is the meaning of life?', }, ], }); console.log(completion.choices[0].message); } await main(); ### 3. Streaming responses javascript const stream = await openai.chat.completions.create({ model: 'openrouter/auto', messages: [ { role: 'user', content: 'Write a short story about a robot.', }, ], stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content || ''); } ### 4. Image generation with vision models OpenRouter supports image generation through models with vision and image generation capabilities. Use the chat completions API with the modalities parameter: javascript const response = await openai.chat.completions.create({ model: 'google/gemini-2.5-flash-image', // Vision-capable model messages: [ { role: 'user', content: 'Generate an image of a cute baby sea otter', }, ], modalities: ['text', 'image'], // Enable image generation }); // Access generated image from response console.log(response.choices[0].message); Note: OpenRouter doesn't support the traditional /images/generations endpoint. Image generation is done through compatible models using the chat completions API. Check available models with image capabilities on OpenRouter's models page. ## Available models This proxy supports all models available through Open Router from providers, including: - OpenAI - Anthropic - Google - Meta - Perplexity - And many more... For a complete list of available models, visit Open Router's models page. ## Authentication The Actor uses your Apify token for authentication. In Apify Actor environments, APIFY_TOKEN is automatically available. For local development, you can: 1. Set the environment variable: export APIFY_TOKEN=your_token_here 2. Or pass it directly in the Authorization header 3. Find your token in the Apify Console ## Support For issues related to this Actor, please contact the Actor developer.

Common Use Cases

Market Research

Gather competitive intelligence and market data

Lead Generation

Extract contact information for sales outreach

Price Monitoring

Track competitor pricing and product changes

Content Aggregation

Collect and organize content from multiple sources

Ready to Get Started?

Try OpenRouter now on Apify. Free tier available with no credit card required.

Start Free Trial

Actor Information

Developer
apify
Pricing
Paid
Total Runs
2,121
Active Users
136
Apify Platform

Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.

Learn more about Apify

Need Professional Help?

Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.

Find a Specialist

Trusted by millions | Money-back guarantee | 24/7 Support