Clay Plugin (API & CLI)
Install the Clay Agent Plugin, sign in from any environment, and see what the API and CLI can do on your plan.

Clay’s plugin lets you use Clay programmatically — from coding agents, terminals, and backend systems — without working in the UI. With the API and CLI, you can run searches over Clay's GTM dataset, call Clay enrichment functions, and build Workflows, all using Clay's existing integrations and data infrastructure.
Getting started
Install the plugin
Tell any coding agent to set the plugin up for you — Claude Code, Codex, Cursor, or anything else. Copy this prompt:
Set up the Clay plugin by following the steps in https://github.com/clay-run/agent-plugins
Your agent will install the plugin, set up the clay command, and sign you in.
Signing in without a browser
The clay login command signs you in by opening a browser on the machine you're working on. That isn't possible everywhere — on a remote server, inside a container, or in an automated pipeline, there's no browser for it to open.
In those cases, run clay login --device instead. It prints a link and a short code, and you approve the sign-in from a browser on any other device — your laptop or phone works fine.
- Run
clay login --device. The CLI prints a verification link with your code pre-filled, prints the code on its own, and then waits for approval. - Open the link in a browser on any device, and sign in to Clay if you aren't already.
- If you enter the verification URL without the code, Clay shows
Connect a device— type the code from your terminal into theCodefield and clickContinue.
- If you enter the verification URL without the code, Clay shows
- On
Connect Clay CLI, check that the code on screen matches the one in your terminal, choose a workspace underWhich workspace should Clay CLI connect to?, and clickAuthorize. To reject the request, clickDeny. - The browser confirms
Device connectedand the CLI finishes signing in on its own — there is nothing to paste back into your terminal.
For the full CLI quickstart, Public API setup, code examples, and guides for Searches, Routines, and Workflows, see developers.clay.com.
What you can do
The plugin has two primary features:
- CLI — Build GTM workflows in natural language from coding agents (including Claude Code, Codex, and Cursor).
- Public API — Access data from Clay or 200+ vendors in the data marketplace. Trigger functions, Claygents, or workflows.
Both paths consume the same credits and actions as equivalent in-product work. There is no additional cost to use the plugin.
The plugin also gives you access to:
- Audiences — Read and segment the workspace's own people, companies, and deals. See Audiences for agents and the CLI.
- Searches — Find companies and people using structured filters over Clay's GTM dataset. Learn more about Searches in this video walkthrough.
- Functions — Run managed functions and custom functions. Learn more about functions in this video walkthrough.
- Workflows — Enrichment, research, scoring, routing, and other repeatable GTM logic.
- Tables — Read structured data from known Clay tables.
- Sequencer — Build and edit campaign sequences, run variant tests, and read analytics from the CLI. Launching, pausing, and resuming a campaign stay in the Clay app.
Plan availability and limits
The developer platform is available across all Clay plans, including free and trial plans. Legacy plans also have access for a limited time.
Search result limits vary by plan:
FAQs
Does using the API or CLI cost extra credits?
No. API and CLI calls consume the same credits and actions as the equivalent work done in-product. There is no additional cost because work is triggered via the developer platform instead of the UI.
What's the difference between the plugin and the Public API?
The plugin gives agent environments (Claude Code, Codex, Cursor) Clay's skills and the Clay CLI — the fastest path for agent-first and interactive coding workflows. The Public API is better suited for background jobs and your own apps, where you want to call Clay directly instead of installing anything.
The Public API uses its own key rather than your CLI sign-in. Create one with the clay api-keys create command — the key is shown only once, so store it somewhere safe.
What's the difference between MCP for Reps and the CLI/API?
They're separate surfaces, not two halves of one product. The plugin installs Clay's skills and the Clay CLI into your coding agent, and the CLI is what you or your agent run in a shell for one-off runs, scripting, and inspecting data. It authenticates with the session created by clay login, so there's no separate key to configure.
MCP for Reps is a different connection, set up separately by an admin for sellers working in chat apps and coding agents. It comes with its own Functions and per-rep credit budgets. See MCP in Clay for how that access is configured.
Can I build or write to Clay tables via CLI or API?
No. The CLI builds logic via Workflows, not tables. Tables in the Public API is read-only — you can query and read rows, but not create tables, add fields, or write records.
Basic row reads work on any plan. Structured queries — joins, ranges, and paging past 100 rows — need API table sync, an Enterprise feature. There are no current plans to support table building from the API or CLI.
Can I build Workflows with the API or CLI?
Yes, Workflows are available from the CLI and plugin in Beta. For production use, Clay-managed functions and custom functions are the more stable option.
Are credit budgets available via the developer platform?
Credit budgets aren’t available on the developer platform yet. You can see run-level credit and action consumption from the Runs view in Workflows. Credit budget support is on the roadmap.
Who can approve a device sign-in?
Whoever opens the verification link. They need to be signed in to Clay in that browser and have editor access to at least one workspace, since the sign-in is tied to the workspace they pick, not to the machine running the command. If they don't have editor access anywhere, the page shows Editor access required instead of the authorization screen.
Explore other docs
Other popular resources
Join a cohort, learn Clay fast!
The faster way to master Clay. Sign in if you're enrolled in a cohort (current or past) or apply!
Hire GTME Talent
Find and connect with GTM talent who've demonstrated expertise in building advanced workflows



