Skip to main content

List Models

Lists all available AI models from OpenRouter with optional category filtering and RSS feed support.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Connection Id - The connection identifier from Connect node (optional if API Key is provided directly).

Options

Authentication

  • API Key - OpenRouter API key credential (optional if using Connection Id).
  • Use Robomotion AI Credits - Use Robomotion AI credits instead of your own API key.

Filtering

  • Category Filter - Optional. Filter models by category (e.g., "programming", "image", "reasoning").

RSS Options

  • RSS Format - Return format:
    • JSON - Standard JSON response (default)
    • RSS XML - RSS feed format
  • RSS Chat Links - When using RSS format:
    • Model Pages - Links to model detail pages (default)
    • Chat URLs - Links to chat interface with model pre-selected

Output

  • Models - List of available models. Format depends on RSS Format option:
    • JSON: Object with object and data array containing model objects
    • RSS: Object with format: "rss" and content containing XML string

Model Object Structure (JSON)

Each model in the data array contains:

  • id - Model identifier (e.g., "google/gemini-2.5-flash")
  • object - Object type ("model")
  • created - Unix timestamp
  • owned_by - Provider name

How It Works

When executed, the node:

  1. Validates the connection or creates a temporary client
  2. Builds query parameters with optional category filter and RSS options
  3. Makes GET request to /models endpoint
  4. For JSON: Parses and returns model list
  5. For RSS: Returns raw XML feed in structured format

Requirements

  • Either a valid Connection Id from Connect node OR direct API Key credentials OR Robomotion AI Credits

Error Handling

The node will return specific errors in the following cases:

  • Invalid Connection Id (when not using direct credentials)
  • API authentication errors (401)
  • API service errors (500, 502, 503, 504)

Examples

Example 1: List All Models (JSON)

Input:

  • Connection Id: msg.connection

Output:

{
object: "list",
data: [
{
id: "google/gemini-2.5-flash",
object: "model",
created: 1704067200,
owned_by: "Google"
},
{
id: "anthropic/claude-opus-4.5",
object: "model",
created: 1704153600,
owned_by: "Anthropic"
},
// ... 480+ more models
]
}

Usage:

console.log(`Total models: ${msg.models.data.length}`);

// Find specific model
const gemini = msg.models.data.find(m => m.id === "google/gemini-2.5-flash");
console.log(`Gemini found: ${gemini.id}`);

Example 2: Filter by Category

Input:

  • Connection Id: msg.connection

Options:

  • Category Filter: "programming"

Output: Returns only models optimized for programming tasks (e.g., Claude, GPT-4, Gemini Pro).


Example 3: Get RSS Feed

Input:

  • Connection Id: msg.connection

Options:

  • RSS Format: RSS XML

Output:

{
format: "rss",
content: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rss version=\"2.0\">...</rss>"
}

Usage:

// Save RSS feed to file
fs.writeFileSync("models.rss", msg.models.content);

Example 4: Find Models by Provider

Input:

  • Connection Id: msg.connection

Output Processing:

// Group models by provider
const by_provider = {};
for (let model of msg.models.data) {
const provider = model.owned_by;
if (!by_provider[provider]) {
by_provider[provider] = [];
}
by_provider[provider].push(model.id);
}

console.log("Models by provider:");
for (let provider in by_provider) {
console.log(`${provider}: ${by_provider[provider].length} models`);
}

Example 5: Search for Specific Models

Input:

  • Connection Id: msg.connection

Output Processing:

// Find all Claude models
const claude_models = msg.models.data.filter(m =>
m.id.toLowerCase().includes('claude')
);

console.log("Claude models:");
claude_models.forEach(m => console.log(` - ${m.id}`));

Example 6: Model Selection Helper

Input:

  • Connection Id: msg.connection

Output Processing:

// Create model selection options for UI
const model_options = msg.models.data.map(m => ({
value: m.id,
label: `${m.id} (${m.owned_by})`,
provider: m.owned_by
}));

// Sort by provider
model_options.sort((a, b) => a.provider.localeCompare(b.provider));

console.log(`Created ${model_options.length} model options`);

Example 7: Latest Models Check

Input:

  • Connection Id: msg.connection

Output Processing:

// Find models created in last 30 days
const thirty_days_ago = Date.now() / 1000 - (30 * 24 * 60 * 60);

const new_models = msg.models.data.filter(m =>
m.created > thirty_days_ago
);

if (new_models.length > 0) {
console.log("New models in last 30 days:");
new_models.forEach(m => {
const date = new Date(m.created * 1000).toLocaleDateString();
console.log(` - ${m.id} (${date})`);
});
}

Example 8: Model Availability Monitoring

Input:

  • Connection Id: msg.connection

Output Processing:

// Store previous model list
const previous_models = msg.previous_models || [];
const current_model_ids = msg.models.data.map(m => m.id);

// Find new models
const new_additions = current_model_ids.filter(id =>
!previous_models.includes(id)
);

// Find removed models
const removed = previous_models.filter(id =>
!current_model_ids.includes(id)
);

if (new_additions.length > 0) {
console.log(`New models added: ${new_additions.join(", ")}`);
}

if (removed.length > 0) {
console.log(`Models removed: ${removed.join(", ")}`);
}

// Update for next check
msg.previous_models = current_model_ids;

Best Practices

  1. Model Discovery:

    • Regularly list models to discover new options
    • Cache model list to reduce API calls
    • Update cached list daily or weekly
  2. Model Selection:

    • Use category filtering to narrow choices
    • Compare models by provider and capabilities
    • Test multiple models for your use case
  3. Performance:

    • Cache the model list (it doesn't change frequently)
    • Use category filters to reduce response size
    • Store model metadata for quick lookups
  4. Integration:

    • Build dynamic model selectors in UIs
    • Allow users to choose from available models
    • Provide model recommendations based on task type
  5. Monitoring:

    • Track new model additions
    • Monitor deprecated models
    • Update workflows when models change

Use Cases

  1. Model Discovery: Find available models for specific tasks
  2. Dynamic Configuration: Build model selection dropdowns in UIs
  3. Multi-Model Routing: Route requests to appropriate models
  4. Cost Optimization: Compare models and their pricing
  5. New Model Detection: Monitor for new model releases
  6. Provider Analysis: See all models from specific providers
  7. Category-Based Selection: Filter models by capability
  8. RSS Feeds: Integrate model updates into feed readers

Model Categories

Common categories include:

  • programming - Models optimized for code generation
  • image - Image generation models
  • reasoning - Models with enhanced reasoning capabilities
  • chat - General chat models
  • multimodal - Models supporting multiple input types
  • Google: gemini-2.5-flash, gemini-2.5-pro, gemini-3-pro-preview
  • Anthropic: claude-sonnet-4, claude-sonnet-4.5, claude-opus-4, claude-opus-4.5
  • OpenAI: gpt-4.1, gpt-4.1-mini, gpt-5, gpt-5-mini, o3, o3-mini, o4-mini
  • xAI: grok-4, grok-4.1
  • DeepSeek: deepseek-chat-v3-0324
  • Meta: llama-3.3-70b-instruct
  • Black Forest Labs: flux.2-pro, flux.2-flex