OpenAI Analytics icon

OpenAI Analytics

Use OpenAI Analytics API

File → Get Files

AI-generated

Overview

The node "OpenAI Analytics" integrates with OpenAI's APIs to perform various operations related to assistants, embeddings, files, threads, text parsing, and report generation. Specifically for the File resource with the Get Files operation, this node retrieves a list of files associated with the user's OpenAI account.

This operation is useful when you want to programmatically access metadata about files you have uploaded or that are available in your OpenAI environment. For example, you might use it to:

  • List all files available for fine-tuning or assistant input.
  • Display file names, sizes, and purposes before deciding which file to download or attach to other operations.
  • Automate workflows that require managing or referencing OpenAI files.

Properties

Name Meaning
Authentication Choose between two types of API credentials:
- OpenAI Analytics API credentials
- OpenAI API credentials

Output

The output of the Get Files operation is an array of objects representing files retrieved from the OpenAI API. Each object includes:

  • name: A string combining the filename and its unique ID (e.g., "example.json (file-id)").
  • value: The unique file ID used to reference the file in other operations.
  • description: A brief description including the file's purpose and size in kilobytes (e.g., "Purpose: assistants, Size: 123 KB").

This output allows subsequent nodes or steps in a workflow to select files by name or ID and understand their context.

The node does not output binary data for this operation; it only provides metadata about files.

Dependencies

  • Requires an API key credential for authentication with OpenAI services. The user must provide either:

    • Dedicated OpenAI Analytics API credentials, or
    • Existing OpenAI API credentials.
  • The node uses the official OpenAI SDK client internally to communicate with the OpenAI API endpoints.

  • No additional external dependencies beyond the OpenAI API and proper credential configuration in n8n.

Troubleshooting

  • Common Issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Network connectivity issues may prevent the node from reaching the OpenAI API.
    • If no files exist under the account, the node returns an empty list with a message indicating no files found.
  • Error Messages:

    • "Error loading credentials": Indicates failure to load or validate the provided API credentials. Verify that the credentials are correctly set up in n8n.
    • "Error loading files": Indicates an issue fetching files from the OpenAI API. This could be due to API limits, network errors, or invalid parameters.
  • Resolution Tips:

    • Ensure API keys are valid and have appropriate permissions.
    • Check internet connectivity and firewall settings.
    • Confirm that the OpenAI account has files uploaded or accessible.
    • Review any rate limits or usage restrictions imposed by OpenAI.

Links and References


This summary focuses exclusively on the File resource with the Get Files operation as requested.

Discussion