Gold Penguin Logo with Text

Save Clay AI Enrichment Credits By Using OpenAI's API

Clay is an amazing lead enrichment tool but can be quite costly. If you need to use OpenAI for anything, here's how to do it without using any of your expensive enrichment credits
Updated March 20, 2024
a man building a house out of clay, looks like cartoon, 4k digital art
a man building a house out of clay, looks like cartoon, 4k digital art

When you use Clay.com to enrich your database you probably use AI to do things like clean your lists, identify the customer persona of a prospect, or personalize the cold emails you’re planning on sending, you probably use the OpenAI enrichment.

Well I hate to say it but you’re probably wasting credits.

We know Clay’s pricing is relatively expensive especially if you’re a one person show or simply want to squeeze the most out of your credits every month. Luckily, there's an easy workaround.

In this article we’ll compare pricing of using Open AI’s API vs Clay’s enrichment, how to see your Open AI API key, and how to connect Clay to the API step by step.  

Comparing OpenAI vs Clay.com Pricing

Let’s first figure out the cost of Clay.

So even if we want connect to APIs or make HTTP requests, we have to be on Clay’s “Explorer” plan. 

This means you have to be paying at the minimum $349 per month and that comes with 12,000 credits. This comes out to $0.0291 per credit/enrichment (same thing).

With OpenAI, their pricing is a bit different. They measured by tokens as opposed to credits. With Clay, every time you execute an enrichment, that is one credit.

With OpenAI, it’s more of how many words you use in your prompt which equals a specific amount of tokens. 

Let’s assume our prompt is something simple: "Please summarize this company’s description and summarize in three sentences max what they do." - There are 14 words in this sentence, which according to both the image above as well as this GPT token calculator, it would cost us $0.0018 to run this prompt every time. 

We know at a glance, this is significantly cheaper than the cost to use GPT-4 with Clay as an enrichment.

To be exact, Clay is almost 17x more expensive than using OpenAI’s API directly.

Also worth noting, the reason this is even in conversation right now is because API calls, or HTTP requests on Clay are all free! It does not use any credits at all. 

Now you see why it might be worth doing an HTTP request yourself...

And I promise you, if you’re not technical, this will be a step-by-step guide on how to set it all up. 

How To Find Your Open AI API key

First you’re going to head to OpenAI’s playground. It may ask you to sign in. 

In the top right corner, you’re going to see your name. Click “View API Keys”. 

For me this section already has a few different keys, but if you’re starting from scratch you’re going to click “Create new secret key”, and then you’re going to give it a name.

You can name it “Clay” if you’d like. And this will generate a new API for you. 

You now have an Open AI API key! Copy this & keep it somewhere safe.

Making Open AI API Calls on Clay

Let’s start with a brand new table in Clay. 

Let’s use Apple, the company, as an example. We want GPT4 to describe what the company does in under 3 sentences using an HTTP request based off their LinkedIn Profile. 

Let’s get started by cleaning up our table.

Add a “Enrich Company” for LinkedIn enrichment and your table should look like this. 

Run the enrichment and you should now have the description that is on the Apple company LinkedIn page.

Obviously this is a super long description so we want to use AI to summarize it for us. 

Go ahead and add an enrichment and look for “HTTP API”.

This is where you’re basically going to copy and paste what I tell you to do. 

Method: POST

Endpoint: https://api.openai.com/v1/chat/completions

Body: {"model": "gpt-4", "messages": [{"role": "user", "content": "Please summarize this company’s description and summarize in three sentences max what they do. Here is the description {insert column you want to reference}“}], "temperature": 0.7}

This is what it should look like so far:

Now you’re going to have two headers. 

First Header:

Key: Content-Type 

Value: application/json

Second Hedaer:

Key: Authorization

Value: Bearer sk- {paste your API key}

This is what it should look like so far:

Now go ahead and click “Save and Run First 10 Rows”. 

If you’ve done it successfully, you should see a 200 come up. This means a Status 200 meaning it was able to connect to the API. 

Now, we can go ahead and map the result to a new column. 

Click the cell and expand it. Then click “Choices”. 

Once you expand it, you’re going to click “Message”. 

Then you’re going to see the response that came back from Open AI and now you can create a new column for the responses. 

This is what the end result should look like.

Clay Is Incredible

Using Clay’s HTTP feature is super amazing because it allows you to connect to APIs like Open AI for extremely high cost savings. You don't have to spend a single Clay enrichment credit.

If you’re willing to do a tiny bit of technical work, it will save you so much money and allow you to use your Clay credits for enrichments that you really need like LinkedIn or finding email addresses. 

I encourage you to give this a try and let me know your thoughts! Clay is an amazing lead enrichment tool. If you want to learn more about how we use it, you could check out our full review 🙂

Want To Learn Even More?
If you enjoyed this article, subscribe to our free monthly newsletter
where we share tips & tricks on how to use tech & AI to grow and optimize your business, career, and life.
Written by Jonathan Garces
Jonathan is a digital marketing expert. After sending hundreds of thousands of emails, Jonathan cracked the code on what gets somebody to reply – authenticity & transparency. Jonathan writes about his emailing experiences and has quickly became the go-to guy for learning about how to connect with your target audience.
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
Join Our Newsletter!
If you enjoyed this article, subscribe to our newsletter where we share tips & tricks on how to make use of some incredible AI tools that you can use to grow and optimize a business
magnifiercross