Skip to main content

List Models

Lists available models from Google's Gemini API with detailed information and filtering capabilities.

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 ID obtained from the Connect node.

Options

  • Page Size - Number of models per page (1-100, default: 50).
  • Page Token - Token for pagination from a previous List Models operation.
  • Filter - Filter models (e.g., supportedGenerationMethods:generateContent).
  • Max Results - Maximum total models to return.
  • Include Details - Whether to include detailed model information. Default is true.

Output

  • Models - List of available models with detailed information.
  • Next Page Token - Token for retrieving the next page of results.

How It Works

The List Models node retrieves information about available models from Google's Gemini API with support for filtering and pagination. When executed, the node:

  1. Validates the provided connection ID
  2. Configures pagination parameters including page size and page token
  3. Applies any specified filters to narrow down the model list
  4. Sends a request to the Gemini API to list models
  5. Processes the results and categorizes models by type
  6. Returns detailed information about each model including:
    • Name and display name
    • Version information
    • Description
    • Token limits (input and output)
    • Supported generation methods
    • Additional metadata and capabilities
  7. Provides pagination support with next page token
  8. Includes statistics about the models such as counts by category and supported methods

Requirements

  • A valid Google Gemini API key
  • Connection ID from a successful Connect node execution

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Connection ID
  • Invalid page size value (must be between 1 and 100)
  • Invalid max results value (must be at least 1)
  • API errors from Google's Gemini service

Usage Notes

  • The default page size is 50 models per page
  • Models are categorized as Gemini Pro, Gemini Flash, Embedding, Imagen, or other
  • Filtering can be used to find models with specific capabilities
  • Detailed information includes token limits and supported generation methods
  • Common generation methods include:
    • generateContent: Text generation
    • streamGenerateContent: Streaming responses
    • embedContent: Embedding generation
    • batchEmbedContents: Batch embedding generation
    • countTokens: Token counting
    • generateAnswer: Answer generation
  • Model capabilities are automatically detected and included in metadata
  • The maximum page size is 100 models
  • Statistics include counts by model category and supported methods
  • The node provides both basic and detailed model information