Skip to content

Instantly share code, notes, and snippets.

@dubiao
Last active April 13, 2026 05:59
Show Gist options
  • Select an option

  • Save dubiao/7cfcf2bb4c47ba9bff3d4fee6768db53 to your computer and use it in GitHub Desktop.

Select an option

Save dubiao/7cfcf2bb4c47ba9bff3d4fee6768db53 to your computer and use it in GitHub Desktop.
List all free models on openrouter.ai
const https = require('https');
const options = {
hostname: 'openrouter.ai',
path: '/api/frontend/models/find?max_price=0&order=pricing-low-to-high&fmt=cards&output_modalities=text',
method: 'GET',
headers: {
'accept': '*/*',
'accept-language': 'zh-CN,zh-HK;q=0.9,zh-TW;q=0.8,zh;q=0.7,en;q=0.6',
'cache-control': 'no-cache',
'pragma': 'no-cache',
'referer': 'https://openrouter.ai/models?max_price=0&order=pricing-low-to-high&fmt=cards&output_modalities=text',
'sec-ch-ua': '"Chromium";v="148", "Microsoft Edge";v="148", "Not/A)Brand";v="99"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"macOS"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36 Edg/148.0.0.0'
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
try {
const response = JSON.parse(data);
const models = response.data.models || [];
if (process.argv.includes('--verbose')) {
console.log(JSON.stringify(response, null, 2));
}
const result = models
.map(model => ({
model_name: model.name,
model_slug: model.slug,
description: model.description,
free_slug: model.endpoint?.model_variant_slug,
context_length: model.context_length,
reasoning: model.supports_reasoning,
is_free: model.endpoint?.is_free,
_modalities: {
input: model.input_modalities,
output: model.output_modalities,
has_text_output: model.has_text_output
},
supported_parameters: model.endpoint?.supported_parameters,
}))
.filter(v => v.is_free && v._modalities.has_text_output);
if (process.argv.includes('--json')) {
console.log(JSON.stringify(result, null, 2));
} else {
const tableData = result.map(m => ({
name: m.model_name,
free_slug: m.free_slug,
context_length: m.context_length,
reasoning: m.reasoning
}));
console.table(tableData);
}
} catch (e) {
console.error('Error:', e.message);
}
});
});
req.on('error', (e) => {
console.error(`Request Error: ${e.message}`);
});
req.end();
@dubiao
Copy link
Copy Markdown
Author

dubiao commented Apr 13, 2026

node get_free_models_on_openrouter.js

This will print a table in your console for all free models' **names*s and slugs like following:

(index) name free_slug context_length reasoning
0 'Arcee AI: Trinity Large Preview (free)' 'arcee-ai/trinity-large-preview:free' 131000 false
1 'LiquidAI: LFM2.5-1.2B-Instruct (free)' 'liquid/lfm-2.5-1.2b-instruct:free' 32768 false
2 'Qwen: Qwen3 Next 80B A3B Instruct (free)' 'qwen/qwen3-next-80b-a3b-instruct:free' 262144 false
3 'Qwen: Qwen3 Coder 480B A35B (free)' 'qwen/qwen3-coder:free' 262000 false
4 'Venice: Uncensored (free)' 'cognitivecomputations/dolphin-mistral-24b-venice-edition:free' 32768 false
5 'Google: Gemma 3n 2B (free)' 'google/gemma-3n-e2b-it:free' 8192 false
6 'Google: Gemma 3n 4B (free)' 'google/gemma-3n-e4b-it:free' 8192 false
7 'Google: Gemma 3 4B (free)' 'google/gemma-3-4b-it:free' 32768 false
8 'Google: Gemma 3 12B (free)' 'google/gemma-3-12b-it:free' 32768 false
9 'Google: Gemma 3 27B (free)' 'google/gemma-3-27b-it:free' 131072 false
10 'Meta: Llama 3.3 70B Instruct (free)' 'meta-llama/llama-3.3-70b-instruct:free' 65536 false
11 'Meta: Llama 3.2 3B Instruct (free)' 'meta-llama/llama-3.2-3b-instruct:free' 131072 false
12 'Nous: Hermes 3 405B Instruct (free)' 'nousresearch/hermes-3-llama-3.1-405b:free' 131072 false

Run with --json to get the JSON for more detailed info than the above table, but fewer details than the original response

node get_free_models_on_openrouter.js --json

Run with --verbose to get the original response.

node get_free_models_on_openrouter.js --json

@dubiao
Copy link
Copy Markdown
Author

dubiao commented Apr 13, 2026

But you will know, free models are slow and have always reached their rate limits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment