In this tutorial, you'll learn how to connect to Anthropic's API in Airtable with no code. You'll use Anthropic's generative AI, Claude, to generate social media captions for products in an Airtable base.
The Airtable Claude integration can be used for free, and there's no need for code.
To get started, we'll create and configure the products table.
1. Create a new table called "Products".
2. Add the product names under the "Name" field. You can use these fictional kitchen products if you want:
3. Rename the default "Notes" field to "Description".
4. Create a new Grid view called Needs description with the following filters:
We've set up the table this way so that the product captions we'll generate later using the Airtable Claude integration move records out of this view. Let's get started with Anthropic.
We'll need an Anthropic API key before we can connect to their API in Airtable. Follow these steps to generate your API key:
1. Sign up for an Anthropic developer account.
2. Get $5 free credit for using the API by verifying your phone number or adding billing details.
3. Click "Get API keys" to open the API Keys screen, then click "Create Key".
4. Name your API key, select a workspace, then click "Create Key".
5. Copy the key and paste it somewhere safe.
Next, we'll add Data Fetcher to our Airtable base and access the Anthropic API.
1. Add the Data Fetcher extension to your Airtable base.
2. Sign in to Data Fetcher or sign up if you don’t have an account.
3. Once you're logged in to Data Fetcher, click Create your first request.
Follow these steps to customize the request you'll make to Anthropic's API:
1. Select Anthropic under Application.
2. Rename the request to "Generate product captions".
3. Copy and paste your Anthropic API key under Authorization
4. Under Endpoint, select "Create a message" to use the Airtable Claude integration.
5. Click Save and Continue in the bottom right corner to proceed to the next section.
6. Select Claude 3.5 Sonnet under Model.
Next, we'll give Claude the instructions for generating social media captions.
1. Copy and paste the following text under Messages:
"Generate an Instagram caption for "
We'll complete the phrase above by referencing the products in the table.
2. Click the + button next to Messages
3. In the dialog that opens, select Name under Field and Needs description under Run for every record in view.
4. Click Confirm to save, and the dialog will close.
You should now see the "Name" field referenced in the message.
5. Copy and paste the following instructions under Messages to complete the message.
Use a playful and quirky brand voice. Caption should be engaging and include a call-to-action. Max length: 200 characters. Return just the caption, no extra text.
TIP: Adding extra details to your messages will enable Claude to generate more accurate content for your use case.
With the request set up, we'll import the response data from Claude API into our table.
6. Click Save and Run to proceed to the next section.
After the Airtable Claude integration runs, the Response Field Mapping screen will open. On this screen, you can configure and import fields from the response data into your table.
This response contains one field, "Message", which we'll map to the "Description" field in the table.
1. Click Existing field under Message, then select "Description".
2. Click Save and Run.
Go back to your default grid view and see the fun captions Claude generated.
If you frequently add products to your Airtable base, you'll want to use Data Fetcher's Triggers feature to run the request automatically and generate captions.
Triggers are a premium feature, so we'll show you how to upgrade your plan and set up a trigger with the following steps:
1. Open the request in Data Fetcher, scroll down to the Schedule / Trigger / Webhook URL tabs, then select Upgrade under Trigger.
2. Select a paid plan that suits you, then follow the instructions to make payment.
3. Click + Authorize to give Data Fetcher access to your Airtable base.
4. Click I understand, let's Authorize in the warning dialog that pops up.
A new window will pop up, asking which bases or workspaces you want Data Fetcher to access.
5. Click Add a base, then select All current and future bases in all current and future workspaces so you won’t have to authorize Data Fetcher anytime you want to use it in another Airtable base.
6. Click Grant Access.
We can now add the trigger:
1. Select Record created.
2. Select "Products" under Table and "Needs description" under View.
3. Click Save at the bottom of the screen.
Add new products to the table and watch Data Fetcher automatically run the request.
Here's a quick summary of how to connect to the Claude API in Airtable:
That wraps up this tutorial. Check out our blog to see other ways you can use AI in Airtable with Data Fetcher.
Dec 10, 2024
•Andy Cloke
•WebflowWhalesyncOct 7, 2024
•Zayyad Muhammad Sani
•Custom RequestsData FetcherSep 20, 2024
•Zayyad Muhammad Sani
•Custom Requests