Skip to main content

Destination

Nexla's bi-directional connectors allow data to flow both to and from any location, making it simple to create a FlexFlow, DB-CDC, Spark ETL, or Replication data flow that sends data to an OpenAI location.
openai_api.png

Open AI

Create an OpenAI Destination

  1. Click the + icon on the Nexset that will be sent to the OpenAI destination, and select the Send to Destination option from the menu.

  2. Select the OpenAI connector from the list of available destination connectors. Then, select the credential that will be used to connect to your OpenAI account, and click Next; or, create a new OpenAI credential for use in this flow.

  3. In Nexla, OpenAI destinations can be created using pre-built endpoint templates, which expedite destination setup for common OpenAI endpoints. Each template is designed specifically for the corresponding OpenAI endpoint, making destination configuration easy and efficient.
    • To configure this destination using a template, follow the instructions in Configure Using a Template.

    OpenAI destinations can also be configured manually, allowing you to send data to OpenAI endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this destination manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure destinations to send data to common OpenAI endpoints. Each template is designed specifically for the corresponding OpenAI endpoint, making destination setup easy and efficient.

  • To configure this destination using a template, select the endpoint to which data will be sent from the Endpoint pulldown menu. Then, click on the template in the list below to expand it, and follow the instructions to configure additional endpoint settings.

    Upload file

    This endpoint template uploads a file to your OpenAI account that can be used across various endpoints. Use this template when you need to upload training data files, fine-tuning files, or other files for use with OpenAI services. The size of all files uploaded by one organization can be up to 100 GB.

    • This endpoint automatically uploads files from your data. No additional configuration is required beyond selecting this endpoint template. The request body should contain the file data in JSON format.

    This endpoint sends data as JSON in the request body to upload a file to your OpenAI account. The request body should contain the file data and file metadata. Uploaded files can be used with various OpenAI endpoints, including fine-tuning, embeddings, and other services.

    For detailed information about file uploads, request body formats, file size limits, and available file types, see the OpenAI API documentation.

    Create image

    This endpoint template generates a new image using OpenAI's image generation models. Use this template when you need to create images from text prompts or modify existing images using AI-powered image generation capabilities.

    • This endpoint automatically generates images from your data. No additional configuration is required beyond selecting this endpoint template. The request body should contain the image generation parameters in JSON format, including the prompt and any additional configuration options.

    This endpoint sends data as JSON in the request body to generate a new image using OpenAI's image generation models. The request body should contain the prompt (text description of the image to generate) and any additional configuration options such as image size, number of images, and image format.

    For detailed information about image generation, request body formats, available models, and image configuration options, see the OpenAI API documentation.

    Create Embedding

    This endpoint template creates an embedding vector representing the input text. Use this template when you need to generate vector embeddings for text data, which can be used for semantic search, similarity matching, or other machine learning applications.

    • This endpoint automatically creates embeddings from your data. No additional configuration is required beyond selecting this endpoint template. The request body should contain the text data and model configuration in JSON format.

    This endpoint sends data as JSON in the request body to create embedding vectors for input text. The request body should contain the input text and the embedding model name. The endpoint returns embedding vectors that represent the semantic meaning of the input text.

    For detailed information about embeddings, request body formats, available embedding models, and vector dimensions, see the OpenAI API documentation.

Configure Manually

OpenAI destinations can be manually configured to send data to any valid OpenAI API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

Using manual configuration, you can also configure Nexla to automatically send the response received from the OpenAI API after each call to a new Nexla webhook data source.

API Method

  1. To manually configure this destination, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the OpenAI API from the Method pulldown menu. OpenAI API typically uses POST method for creating resources and generating content.

Data Format

  1. Select the format in which the Nexset data will be sent to the OpenAI API from the Content Format pulldown menu. OpenAI API expects JSON format for all requests.

API Endpoint URL

  1. Enter the URL of the OpenAI API endpoint to which data will be sent in the URL field. This should be the complete URL to your OpenAI endpoint (e.g., https://api.openai.com/v1/files, https://api.openai.com/v1/images/generations, https://api.openai.com/v1/embeddings). Include any required query parameters in the URL.

Ensure the API endpoint URL is correct and accessible with your current credentials. The OpenAI API endpoint URL should point to the endpoint where you want to create resources or generate content. You can test the endpoint using the Test button after configuring the URL.

Request Body

  1. Configure the request body that will be sent to the OpenAI API. The request body should contain the resource data formatted as JSON, with field names matching the OpenAI API's expected structure. The request body format is typically {message.json} to send the entire Nexset data as JSON, or you can construct a custom JSON structure with specific field mappings.

The request body must be valid JSON and must match the OpenAI API's expected format for the specific endpoint you're using. OpenAI API uses specific structures for different endpoints (files, images, embeddings, etc.). For detailed information about request body formats, available endpoints, and resource structures, see the OpenAI API documentation.

Save the Destination

  1. Once all of the relevant steps in the above sections have been completed, click the Next button to proceed with the rest of the data flow configuration, or click Save to save the destination configuration for later use.