Vast AI icon

Vast AI

Get all informations of an account.

Overview

This node provides a flexible interface to interact with the Vast AI platform's API. It allows users to perform various operations related to accounts, billing, instances, search, serverless functions, templates, and volumes by selecting an API group and specifying parameters for the request body.

Common scenarios where this node is beneficial include:

  • Managing cloud compute instances (creating, destroying, rebooting, managing bids).
  • Retrieving account information such as API keys or user details.
  • Searching offers or invoices on Vast AI.
  • Handling SSH keys attached to instances.
  • Accessing billing data like deposits, earnings, and invoices.
  • Creating and managing templates or serverless endpoints.

Practical examples:

  • Automatically create a new instance with specific parameters.
  • Search for available machine offers matching certain criteria.
  • Retrieve logs from a particular instance.
  • Attach or detach SSH keys to/from instances programmatically.
  • Query billing invoices for reporting purposes.

Properties

Name Meaning
API Group Name or ID Select the specific Vast AI API endpoint to call. Options depend on the selected operation and include actions like "Attach SSH Key", "Create Instance", "Show User", "Search Offers", etc.
Body The request body parameters sent with the API call. This is a collection of key-value pairs where each key corresponds to a parameter name or ID relevant to the chosen API group, and the value is the parameter's value. For GET requests, these are query parameters; for others, they form the JSON body.

Output

The node outputs an array of items, each containing a json field with the parsed JSON response from the Vast AI API corresponding to the requested operation.

If the API returns binary data (not evident in the provided code), it would be handled accordingly, but this node primarily deals with JSON responses representing Vast AI resources such as instances, billing info, or search results.

Dependencies

  • Requires an API key credential for Vast AI authentication, which must be configured in n8n credentials.
  • Makes HTTP requests to the Vast AI API base URL: https://console.vast.ai/api/v0.
  • Uses standard HTTP methods (GET, POST, PUT, DELETE) depending on the selected API group.

Troubleshooting

  • Missing required path parameters: Many API calls require specific path parameters (e.g., id, instance_id, key). If these are not provided, the node throws an error indicating which parameter is missing. Ensure all required parameters are set in the Body property.
  • Invalid API Group or Operation: Selecting an unsupported API group or operation will result in no available options or errors. Verify that the correct API group is selected.
  • Authentication errors: If the API key credential is missing or invalid, requests will fail with authorization errors. Confirm the API key is correctly configured.
  • Malformed request body: Parameters must match expected names and types for the selected API group. Incorrect keys or values may cause API errors.
  • Continue On Fail behavior: If enabled, the node will output error details alongside input data for failed items instead of stopping execution.

Links and References

Discussion