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

# Public API quickstart

> Make your first Clay Public API request.

Use the Public API when you want Clay behind a backend service, queue, webhook, custom app, or batch job. If you are testing from a terminal or working with an AI coding agent, start with the [CLI quickstart](/cli/quickstart) instead.

<Card title="Prefer the CLI?" href="/cli/quickstart">
  The CLI is the quickest path for most first-time users and agent workflows.
</Card>

## URLs and paths

Use these path types consistently:

| Type                    | Example                             | Meaning                                 |
| ----------------------- | ----------------------------------- | --------------------------------------- |
| Runtime API URL         | `https://api.clay.com/public/v0/me` | The URL your code calls                 |
| Runtime endpoint path   | `POST /routines/{routine_id}/run`   | The API path relative to `/public/v0`   |
| Guide page              | `/searches`, `/routines`, `/tables` | Human and agent-readable concept docs   |
| Generated API reference | `/api-reference/searches/...`       | Mintlify docs for schemas and try-it UI |

Do not call `/api-reference/...` from code. It is a docs URL, not a Clay API endpoint.

## 1. Set your API key

Create an API key in [Account settings](https://app.clay.com/settings/accounts). Then store it in your environment.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export CLAY_API_KEY="your_api_key"
```

## 2. Call the API

Use `GET /me` to verify that your key works.

<CodeGroup>
  ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl https://api.clay.com/public/v0/me \
    -H "clay-api-key: $CLAY_API_KEY"
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await fetch('https://api.clay.com/public/v0/me', {
    headers: {
      'clay-api-key': process.env.CLAY_API_KEY,
    },
  });

  if (!response.ok) {
    throw new Error(`Clay API request failed: ${response.status}`);
  }

  const me = await response.json();
  console.log(me);
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import os
  import requests

  response = requests.get(
      "https://api.clay.com/public/v0/me",
      headers={"clay-api-key": os.environ["CLAY_API_KEY"]},
      timeout=30,
  )
  response.raise_for_status()

  print(response.json())
  ```
</CodeGroup>

## 3. Run useful Clay work

After your key is verified, choose what you want Clay to do:

* Use [Searches](/searches) to find companies, people, and jobs.
* Use [Routines](/routines) to run Clay-managed functions, custom functions, or Workflows.
* Use [Tables](/tables) to query existing table data. Tables are Enterprise only.

## 4. Use the API reference

Use the API reference for endpoint paths, request bodies, and response schemas.
