> ## Documentation Index
> Fetch the complete documentation index at: https://onecli.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Clay Enrichment and GTM Data via the Gateway

> Search Clay's people and company database, run enrichment functions and workflows, and query Clay tables. The gateway injects your API key.

## Overview

OneCLI connects AI agents to Clay with an API key. Agents can search Clay's GTM database for people and companies, run Clay-managed or custom functions to enrich records, and query Clay tables. The gateway injects the key into requests to `api.clay.com`, so your agent never sees it.

## Setup

**1. Create an API key in Clay**

In Clay, go to **Settings** > **Account** > **API keys** and create a key. Keys are tied to your Clay user and workspace. See [Find your Clay API key](https://university.clay.com/docs/guide-find-clay-api-key).

**2. Connect in OneCLI**

Open the OneCLI dashboard, go to **Connections** > **Clay**, and paste your key. The connection shows your Clay email and workspace.

![OneCLI connect dialog for Clay, showing the required API key field, a link on how to find your Clay API key, an Advanced section with an optional connection label, and the Connect Clay button.](https://mintcdn.com/chartdbinc/L4k9tYUENUtEpMY8/images/integrations/clay/onecli-connect-clay.png?fit=max\&auto=format\&n=L4k9tYUENUtEpMY8\&q=85\&s=e0de8ceaaa40ca3f5adb94d486c1191f)

The Clay connect dialog in OneCLI.

## What agents can do

| Area | Description |
| - | - |
| **Search** | Find people and companies with Clay's search query language |
| **Routines** | Run enrichment functions and workflows on 1 to 100 items, or in batches (uses Clay credits) |
| **Tables** | Query rows in Clay tables (Clay Enterprise) |
| **Runs** | Check routine progress and results, and search past workflow runs |
| **Credits** | Check the workspace's remaining credit balance |

## Quick example

No auth header is needed, the gateway adds it:

```bash theme={null}
# Who am I connected as?
curl -s "https://api.clay.com/public/v0/me"

# Check remaining credits before a large run
curl -s "https://api.clay.com/public/v0/credits/balance"
```

## Disconnecting

* In OneCLI, open **Connections** > **Clay** and remove the connection.
* In Clay, delete the API key under **Settings** > **Account** > **API keys**.

## Controlling access

Access is per agent: [grant](https://onecli.sh/docs/guides/agent-access.md) the connection to each agent that needs it, choosing per tool what runs freely, what needs human approval, and what stays blocked. Routine runs spend Clay credits, so consider requiring approval for them. Organization [rules](https://onecli.sh/docs/guides/rules.md) add guardrails on top, like rate limits. Everything is checked before credential injection, so a blocked request never reaches Clay.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.