Skip to main content

Anthropic AI Data Source

The Anthropic AI connector enables you to ingest data from Anthropic's Claude API, allowing you to retrieve model information, message batches, and other API responses. This connector is particularly useful for applications that need to extract AI model metadata, track message batch status, or analyze API usage patterns.
anthropic_api.png

Anthropic AI

Follow the instructions below to create a new data flow that ingests data from an Anthropic AI source in Nexla.

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

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

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

    Anthropic AI sources can also be configured manually, allowing you to ingest data from Anthropic AI endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Anthropic AI endpoints. Each template is designed specifically for the corresponding Anthropic AI endpoint, making data source setup easy and efficient.

Endpoint Settings

  • Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

    List models

    This endpoint retrieves a list of all available Claude models in the Anthropic API. Use this endpoint when you need to discover available models, check model capabilities, or build dynamic workflows that operate on multiple models.

    • This endpoint automatically retrieves all available Claude models. No additional configuration is required beyond selecting this endpoint template.
    • Enter a schedule in the Schedule field to specify when this data source should run. The schedule uses cron expression format (e.g., 0 6 * * * for daily at 6 AM).
    • The endpoint returns model metadata including model names, IDs, and capabilities. The response includes models from the Claude family such as Claude Haiku, Sonnet, and Opus.

    This endpoint is useful for discovering available models before configuring more specific endpoints. The returned data includes model identifiers that can be used as input for other Anthropic API endpoints. For complete information about listing models, see the Anthropic Models API Documentation.

    Get model

    This endpoint retrieves detailed information about a specific Claude model. Use this endpoint when you need detailed model metadata, capabilities, or configuration information for a particular model.

    • Enter the model identifier in the Model field. This should be the exact model name (e.g., claude-3-5-sonnet-20241022). You can find available model names by using the "List models" endpoint first.
    • Enter a schedule in the Schedule field to specify when this data source should run. The schedule uses cron expression format.
    • The endpoint returns detailed model information including model ID, name, and specific capabilities.

    Model identifiers are specific to each Claude model version. Ensure you have the correct model identifier before configuring this endpoint. For complete information about model details, see the Anthropic Models API Documentation.

    Get message batch

    This endpoint retrieves the status and results of a message batch from Anthropic's API. Use this endpoint when you need to check the status of batch message processing or retrieve batch results.

    • Enter the message batch ID in the Message Batch ID field. This ID is returned when you create a message batch using the Anthropic API.
    • Enter a schedule in the Schedule field to specify when this data source should run. The schedule uses cron expression format.
    • The endpoint returns batch status information including processing status, completion time, and any errors that occurred during processing.

    Message batch IDs are unique identifiers returned when creating message batches. You can obtain batch IDs from the response when creating batches through the Anthropic API. For complete information about message batches, see the Anthropic Messages API Documentation.

Endpoint Testing

Once the selected endpoint template has been configured, Nexla can retrieve a sample of the data that will be fetched according to the current settings. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Configure Manually

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

With manual configuration, you can also create more complex Anthropic AI sources, such as sources that use chained API calls to fetch data from multiple endpoints or sources that require custom authentication headers or request parameters.

API Method

  1. To manually configure this source, 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 are:

    • GET: For retrieving data from the API (most common for Anthropic AI data sources)
    • POST: For sending data to the API or triggering actions

API Endpoint URL

  1. Enter the URL of the Anthropic AI API endpoint from which this source will fetch data in the Set API URL field. This should be the complete URL including the protocol (https://) and any required path parameters.

Anthropic API URLs typically follow the format: https://api.anthropic.com/v1/models for listing models, or https://api.anthropic.com/v1/models/{model_id} for specific model details. Replace {model_id} with the actual model identifier. Ensure the API endpoint URL is correct and accessible with your current credentials. You can test the endpoint using the Test button after configuring the URL. For complete information about Anthropic API endpoints, see the Anthropic API Getting Started Documentation.

Request Headers

  1. If Nexla should include any additional request headers in API calls to this source, 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 most Anthropic API requests.

Response Data Path

  1. Enter the JSON path expression that identifies the location of the data array in the API response in the Response Data Path field. This path tells Nexla where to find the array of records in the JSON response.

For Anthropic API responses, the data path varies by endpoint. For list models responses, use $.data[*] to extract individual model objects from the data array. For single model responses, use $ to extract the entire model object. JSON path expressions use dot notation and array indexing to navigate the response structure. For complete information about Anthropic API response formats, see the Anthropic API Documentation.

Schedule

  1. Enter a schedule in the Schedule field to specify when this data source should run. The schedule uses cron expression format to define the frequency and timing of data ingestion.

Common cron expressions include: 0 6 * * * for daily at 6 AM, 0 */6 * * * for every 6 hours, and 0 0 * * 0 for weekly on Sunday at midnight. For more information about cron expressions, see the Nexla documentation on scheduling.