Skip to main content

Anthropic AI 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 Anthropic AI location.
anthropic_api.png

Anthropic AI

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 Anthropic AI location.

Create an Anthropic AI Destination

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

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

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

    Anthropic AI destinations can also be configured manually, allowing you to send data to Anthropic AI 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 Anthropic AI endpoints. Each template is designed specifically for the corresponding Anthropic AI 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.

    Multiple conversational turns

    This endpoint sends messages to Claude for multi-turn conversations. Use this endpoint when you need to have extended conversations with Claude, maintain conversation context, or build interactive AI applications.

    • This endpoint sends data to Claude's message API for conversational interactions. The request body should contain the message content in JSON format following Anthropic's message API structure.
    • The endpoint supports multi-turn conversations by maintaining conversation history in the request payload.
    • Each record in your Nexset will be sent as a separate message to Claude, and the response will be returned for each message.

    The request body should follow Anthropic's message API format, including model selection, message content, and optional parameters like max_tokens. For complete information about the messages endpoint, see the Anthropic Messages API Documentation.

    Count message tokens

    This endpoint counts the number of tokens in a message before sending it to Claude. Use this endpoint when you need to estimate token usage, validate message length, or optimize API costs.

    • This endpoint sends message content to Anthropic's token counting API. The request body should contain the message content in JSON format.
    • The endpoint returns the token count for the provided message, allowing you to estimate API usage and costs before making actual API calls.
    • Each record in your Nexset will be processed to count tokens, and the token count will be returned for each message.

    Token counting helps estimate API costs and ensure messages fit within model context limits. For complete information about token counting, see the Anthropic Messages Count Tokens API Documentation.

    Create message batch

    This endpoint creates a batch of messages for asynchronous processing. Use this endpoint when you need to process large volumes of messages efficiently or when you want to queue messages for later processing.

    • This endpoint sends message batch data to Anthropic's batch API. The request body should contain the batch configuration and messages in JSON format following Anthropic's batch API structure.
    • The endpoint creates a batch job that will be processed asynchronously. You can check the batch status using the "Get message batch" source endpoint.
    • Each record in your Nexset will be included in the batch, and a batch ID will be returned for tracking the batch status.

    Message batches are useful for processing large volumes of messages efficiently. The batch API returns a batch ID that can be used to check processing status. For complete information about creating message batches, see the Anthropic Creating Message Batches API Documentation.

    Delete message batch

    This endpoint deletes a message batch from Anthropic's API. Use this endpoint when you need to cancel or remove a batch that is no longer needed.

    • Enter the message batch ID in the Message Batch ID field. This ID is returned when you create a message batch using the "Create message batch" endpoint.
    • The endpoint sends a DELETE request to remove the specified batch from Anthropic's system.
    • Once deleted, the batch cannot be recovered, and any pending processing will be cancelled.

    Message batch IDs are unique identifiers returned when creating batches. Ensure you have the correct batch ID before deleting. For complete information about deleting message batches, see the Anthropic Deleting Message Batches API Documentation.

Configure Manually

Anthropic AI destinations can be manually configured to send data to any valid Anthropic AI API endpoint.

Using manual configuration, you can also configure Nexla to automatically send the response received from the Anthropic AI 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 Anthropic AI API from the Method pulldown menu. The most common methods for Anthropic AI destinations are:

    • POST: For sending messages, creating batches, or triggering actions (most common)
    • DELETE: For removing resources like message batches

Data Format

  1. Select the format in which the Nexset data will be sent to the Anthropic AI API from the Content Format pulldown menu. Nexla will automatically convert the data to the selected format for each API call.

The Anthropic API accepts JSON in request bodies and returns JSON in response bodies. Ensure you select JSON as the content format for Anthropic API destinations. For complete information about Anthropic API request formats, see the Anthropic API Getting Started Documentation.

API Endpoint URL

  1. Enter the URL of the Anthropic AI API endpoint to which you want to send the Nexset data in the URL field. For update/delete operations, include the ID of the object to be updated or deleted at the end of the URL.

Anthropic API URLs typically follow the format: https://api.anthropic.com/v1/messages for sending messages, or https://api.anthropic.com/v1/messages/batches/{batch_id} for batch operations. Replace {batch_id} with the actual batch identifier. For complete information about Anthropic API endpoints, see the Anthropic API Getting Started Documentation.

Request Headers

Optional
  • If Nexla should include any additional request headers in API calls to this destination, enter the headers & corresponding values as comma-separated pairs in the Request Headers field (e.g., header1:value1,header2:value2).

    You do not need to include authentication headers (x-api-key and anthropic-version) as these are automatically included from your credentials. However, you may need to include additional headers for specific Anthropic API features. The Content-Type header should be set to application/json for Anthropic API requests.

Exclude Attributes from the Call

Optional
  • If any record attributes in the Nexset should be omitted when sending data to this Anthropic AI destination, select the attributes from the Exclude Attributes pulldown menu.

  • Any number of attributes can be selected for exclusion, and all excluded attributes will be shown in the field. To remove an attribute from the list, click the X icon next to the attribute name.