Skip to main content

Overview

Clay is a data enrichment and outreach platform used by sales and GTM teams. With Layer AI, you can use Clay’s HTTP API enrichment to call Layer gates for AI-powered workflows on your Clay table rows — lead scoring, company research, email personalization, data classification, and more. The integration works through Clay’s built-in HTTP API enrichment feature. Clay sends requests to Layer’s REST API (POST /v3/chat), and Layer handles model routing, fallbacks, spending limits, and cost tracking.

Use Cases

  • Lead scoring — Score and qualify leads based on company data, job titles, and signals
  • Company research — Summarize company information, extract key details, classify industries
  • Email personalization — Generate personalized outreach copy using enriched lead data
  • Data classification — Categorize and tag records based on unstructured text fields

Why Layer for Clay?

  • Model routing — Use the best model for each enrichment task, with automatic fallbacks
  • Structured output — Force JSON responses that map cleanly to Clay columns
  • Spending limits — Set per-gate cost caps to control bulk enrichment spend
  • Cost tracking — See per-request costs in the Layer dashboard
  • Observability — All Clay requests appear in your Layer logs

Quick Start

Step 1: Create a Layer Gate

Create a gate optimized for Clay enrichment:
  1. Go to Dashboard → Gates → Create New Gate
  2. Configure:
    • Task typechat
    • Modelgpt-4o-mini is a good default for cost-efficient enrichment (or gpt-4o for higher quality)
    • System prompt — Describe the enrichment task (e.g., “You are a lead scoring assistant. Score the following lead on a scale of 1-10…”)
    • Structured output — Enable json_schema mode and define your output schema so responses map cleanly to Clay columns
    • Spending limit — Set a daily or monthly cap to control costs during bulk runs
  3. Copy the gate ID (UUID) — you’ll need it in the next step
Structured JSON output works best with OpenAI models (gpt-4o, gpt-4o-mini) which support native json_schema mode. Other providers use prompt-injected schema enforcement.

Step 2: Configure Clay HTTP API Enrichment

In your Clay table, add an HTTP API enrichment column and configure: Method: POST URL:
https://api.uselayer.ai/v3/chat
Headers:
{
  "Authorization": "Bearer layer_your_api_key",
  "Content-Type": "application/json"
}
Body:
{
  "gateId": "your-gate-uuid",
  "data": {
    "messages": [
      {
        "role": "user",
        "content": "Score this lead: Company: /Company Name, Title: /Job Title, Industry: /Industry"
      }
    ]
  }
}
Replace /Company Name, /Job Title, and /Industry with Clay’s column reference syntax — Clay automatically substitutes these with the actual row values at runtime.

Step 3: Map Response Fields

Layer returns a response with the following structure:
{
  "content": "{ \"score\": 8, \"reasoning\": \"Senior decision-maker...\" }",
  "model": "gpt-4o-mini",
  "cost": 0.0003,
  "latency": 450,
  "usage": {
    "promptTokens": 120,
    "completionTokens": 45,
    "totalTokens": 165
  }
}
In Clay’s response mapping:
  • content — Contains your structured JSON output. Extract individual fields (e.g., score, reasoning) into separate Clay columns.
  • cost — Per-request cost in USD, useful for tracking enrichment spend.

Important Notes

  • Gate ID must be a UUID — Use the gate ID from the dashboard (e.g., 3a58b1a4-e482-4e59-8e12-671f0266bf35), not the gate name.
  • Set spending limits — Clay enrichment runs can process thousands of rows. Set a gate-level spending limit to prevent unexpected costs.
  • All requests appear in Logs — Monitor your Clay enrichment requests in Dashboard → Logs for cost, latency, and error tracking.
  • Test with a single row first — Run the enrichment on one row before applying to the full table to verify your prompt and schema work correctly.

Dashboard

Layer provides a Clay integration page in the dashboard at Dashboard → Integrations → Clay with:
  • Overview — Integration description, use cases, and quick action links
  • Quick Start — Step-by-step setup guide with copyable code snippets