Overview
This node provides a flexible interface to interact with the Vast AI platform's API. It allows users to perform various operations such as managing instances, templates, billing information, searching offers, and more by selecting an API group and operation. The node is useful for automating Vast AI account management, instance lifecycle actions, billing queries, and template creation within n8n workflows.
Practical examples include:
- Creating or destroying compute instances on Vast AI.
- Searching available machine offers based on custom criteria.
- Retrieving billing invoices or deposit information.
- Creating new templates for deployment configurations.
Properties
| Name | Meaning |
|---|---|
| API Group Name or ID | Select the specific Vast AI API endpoint to call. Options depend on the chosen operation. |
| Body | Key-value pairs representing the request body parameters. Multiple parameters can be added. |
| - Parameter Name or ID | The name or identifier of the parameter to send in the request body. |
| - Value | The value corresponding to the parameter name. |
The "API Group Name or ID" property dynamically loads options based on the selected operation, allowing users to pick from predefined API calls like "create_instance_put", "search_offers_put", etc.
The "Body" property is a fixed collection that supports multiple key-value pairs to customize the request payload. For GET requests, these parameters are sent as query strings.
Output
The node outputs an array of JSON objects, each containing the response from the Vast AI API for the corresponding input item. The structure of the JSON depends on the specific API endpoint called and the data returned by Vast AI.
If the API returns binary data (not evident in this code), it would typically be handled separately, but this node primarily deals with JSON responses.
Dependencies
- Requires an API authentication token credential for Vast AI (referred generically as an API key credential).
- Makes HTTP requests to the Vast AI API base URL:
https://console.vast.ai/api/v0. - Uses n8n's built-in HTTP request helper for making authenticated API calls.
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 combination may result in no available API endpoints or errors. Verify the correct operation and API group are selected.
- Authentication errors: If the API key credential is invalid or missing, requests will fail. Confirm the API key is correctly configured in n8n credentials.
- HTTP errors from Vast AI: The node passes through any HTTP errors from the API. Check the error message for details and verify the request parameters and Vast AI service status.
Links and References
- Vast AI API Documentation (for detailed API endpoint info)
- n8n Expressions Documentation (for using expressions in parameters)