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

# REST API

> Headless access to the same surface the MCP tools wrap

Everything the Komo app does is backed by a REST API at
`https://api.komo.ai/api`, and your API key works on all of it — the MCP
tools are a curated wrapper over this surface.

## Authentication

Create a key at
[app.komo.ai/settings/api-keys](https://app.komo.ai/settings/api-keys). Two
equivalent header forms:

```bash theme={null}
curl -H "x-api-key: pk_xxx:sk_xxx" https://api.komo.ai/api/usage/summary
curl -H "Authorization: Bearer pk_xxx:sk_xxx" https://api.komo.ai/api/usage/summary
```

Every response carries `X-API-Version: 1`.

## Discovering endpoints

* **Public OpenAPI subset**:
  [`https://api.komo.ai/api/public-openapi.json`](https://api.komo.ai/api/public-openapi.json)
  — the curated public surface (CRM, search, lists, campaigns, LinkedIn
  actions, inbox connection, usage).
* **llms.txt**: [`https://api.komo.ai/llms.txt`](https://api.komo.ai/llms.txt)
  — agent-oriented summary of the API + MCP server.

## Python SDK

```python theme={null}
import komo

client = komo.Komo(api_key="pk_xxx:sk_xxx")
```

The `komo` package (beta) currently wraps agents and threads; use the REST
endpoints directly for CRM/campaign/LinkedIn operations.

## Errors & limits

| Status | Meaning                                                                |
| ------ | ---------------------------------------------------------------------- |
| `401`  | Key missing, malformed, revoked, or expired                            |
| `402`  | Insufficient credits or plan gate (body includes the reason)           |
| `409`  | Conflict — e.g. LinkedIn seat not connected (`LINKEDIN_NOT_CONNECTED`) |
| `422`  | Validation error (body lists the offending fields)                     |
| `429`  | Rate limit or LinkedIn safety cap — honor `Retry-After`                |

Per-key rate limits: **120 requests/min** overall, **20/min** on expensive
search/enrichment routes. Credit-consuming endpoints reserve credits before
running and refund on failure.

## Staging

The same API and MCP server run on Trybase staging:
`https://api.trybase.ai/api` and `https://api.trybase.ai/mcp`.
