# Enrich Layer for agents

> Everything an agent needs to call the Enrich Layer API: spec, MCP server, auth and error handling.

## Entry points

- **OpenAPI spec v2 (JSON):** `https://enrichlayer.com/docs/api/v2/openapi.json` OpenAPI 3.0. Every endpoint, parameter, response schema and credit cost.
- **OpenAPI spec v2 (YAML):** `https://enrichlayer.com/docs/api/v2/openapi.yaml` Same spec in YAML.
- **OpenAPI spec v3 (JSON):** `https://enrichlayer.com/docs/api/v3/openapi.json` Preview. Person profile and company logo only, served from https://api.enrichlayer.com/v3/. Same API key. Use v2 for everything else.
- **OpenAPI spec v3 (YAML):** `https://enrichlayer.com/docs/api/v3/openapi.yaml` Same v3 spec in YAML.
- **MCP server:** `https://mcp.enrichlayer.com/mcp` Hosted, streamable HTTP. Sign in with OAuth and paste your API key at the consent screen.
- **llms.txt:** `https://enrichlayer.com/llms.txt` Index of every docs page with one-line descriptions.
- **Base URL (v2):** `https://enrichlayer.com` All endpoints live under /api/v2/. Every call is a GET and returns JSON.
- **Auth header:** `Authorization: Bearer $ENRICHLAYER_API_KEY` Get a key at https://enrichlayer.com/dashboard. New accounts start with free credits.

## Brief to paste into your agent

```text
You can call the Enrich Layer API for people, company, job and contact data.

Spec: https://enrichlayer.com/docs/api/v2/openapi.json
Base URL: https://enrichlayer.com
v3 preview (person profile, company logo): https://enrichlayer.com/docs/api/v3/openapi.json, base URL https://api.enrichlayer.com
Auth: Authorization: Bearer $ENRICHLAYER_API_KEY

- Every endpoint is a GET and returns JSON: /api/v2/ on the v2 base URL, /v3/ on the v3 one.
- Each operation's x-credits field gives its credit cost. Read it before batch jobs.
- Some lookups charge on a 200 with a null result. The operation description says which.
- Check the balance first with GET /api/v2/credit-balance (free).
- 429 or 503: back off and retry.
- 403: out of credits. Stop and tell the user.
- 401: the key is wrong or missing.
```

## First call

```bash
# Resolve a domain to a company profile URL (2 credits)
curl -s "https://enrichlayer.com/api/v2/company/resolve?company_domain=stripe.com" \
  -H "Authorization: Bearer $ENRICHLAYER_API_KEY"

# Check remaining credits (free)
curl -s "https://enrichlayer.com/api/v2/credit-balance" \
  -H "Authorization: Bearer $ENRICHLAYER_API_KEY"
```

## Errors

| Code | Meaning | What to do |
| --- | --- | --- |
| 401 | Invalid API key | Check the Authorization header. |
| 403 | Out of credits | Stop. Ask the user to top up. |
| 404 | Record not found | Move on to the next input. |
| 429 | Rate limited | Back off and retry. |
| 503 | Enrichment failed | Retry the same request. |

## For humans

- [API reference (v2)](https://enrichlayer.com/docs/api/v2)
- [API reference (v3 preview)](https://enrichlayer.com/docs/api/v3)
- [Rate limits](https://enrichlayer.com/docs/guides/rate-limits)
- [MCP setup for Claude, Cursor and VS Code](https://enrichlayer.com/mcp)
- [Pricing](https://enrichlayer.com/pricing)
