> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.elacity.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.elacity.ai/_mcp/server.

# API Reference

The Elacity API lets you manage registries, agents, environments, deployments, and more from your own tooling, CI/CD pipelines, or custom integrations.

## Base URL

All API endpoints are available at:

```
https://elacity.ai/api
```

## Authentication

Include your API key on every authenticated request using one of these headers:

| Header          | Example                              |
| --------------- | ------------------------------------ |
| `X-API-Key`     | `X-API-Key: YOUR_API_KEY`            |
| `Authorization` | `Authorization: Bearer YOUR_API_KEY` |

```bash
curl -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  https://elacity.ai/api/environments/list \
  -d '{"orgSlug": "your-org"}'
```

SDKs that default to Bearer auth can pass the same key without a custom header:

```bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  https://elacity.ai/api/environments/list \
  -d '{"orgSlug": "your-org"}'
```

If both headers are sent, `X-API-Key` takes precedence. See [API Keys](/api-keys) for setup and security guidance.

API keys are scoped to your organization. To create one, see [API Keys](/api-keys).

Public prompt registries can be accessed without authentication. Private registries require a valid API key belonging to the same organization.

## Request Format

Most endpoints accept `POST` requests with a JSON body:

```bash
curl -X POST https://elacity.ai/api/agents/list \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"orgSlug": "your-org"}'
```

## Error Handling

The API returns standard HTTP status codes:

| Status | Meaning                                            |
| ------ | -------------------------------------------------- |
| `200`  | Success                                            |
| `400`  | Bad request — check your input parameters          |
| `401`  | Unauthorized — missing or invalid API key          |
| `403`  | Forbidden — valid key but insufficient permissions |
| `404`  | Not found — resource does not exist                |
| `429`  | Rate limited — slow down and retry                 |
| `500`  | Internal error — contact support if persistent     |

Error responses include a `message` field describing the issue.

## Available Resources

Publish, list, and retrieve versioned prompt artifacts from registries.

Create, configure, and deploy AI agents with provider settings and tool references.

Manage deployment environments, provider credentials, and secrets.

View deployment history, status, and heatmaps across your infrastructure.

Group and manage agent configurations across environments.

Configure connections to OpenAI, Anthropic, Google, OpenRouter, and custom providers.

## Getting Started

If you haven't set up API access yet:

1. [Create an account](/creating-an-account) on the Elacity platform
2. [Generate an API key](/api-keys) from your account settings
3. Explore the endpoints in the sidebar to start building