# Kutti Public API v1 — Agent Specification > Fast, no-fluff URL shortening, link management, and click analytics at https://kutti.link. > Human Docs: https://kutti.link/api/docs > OpenAPI 3.1 Spec: https://kutti.link/api/v1/openapi.json > Base URL: https://kutti.link/api/v1 ## Authentication & Secret Handling - Every request requires a Bearer API key in the `Authorization` header: `Authorization: Bearer $KUTTI_API_KEY` - Key format: `kutti_live_` (scoped to an account, stored server-side as SHA-256). - Paid API access applies to Kutti Plus, Kutti Pro, and Kutti Enterprise accounts (`403 PLAN_REQUIRED` on Kutti Free). - **Security rules for agents:** 1. Read `KUTTI_API_KEY` from environment variables only — never hardcode, log, print, or commit raw keys. 2. Never send `KUTTI_API_KEY` to any domain other than `https://kutti.link`. 3. Always ask the user for explicit confirmation before calling `DELETE /links/{id}` or running bulk mutations. ## Endpoints ### 1. Inspect Account & Remaining Quota `GET https://kutti.link/api/v1/me` - Returns current user tier, link count vs quota, active API keys count, and remaining daily API quota. ### 2. List Links (Paginated) `GET https://kutti.link/api/v1/links` - Query params: - `page` (integer >= 1, default 1) - `limit` (integer 1..100, default 20) - `search` (string, matches name, shortUrl, or destination URL) - `activeOnly` (boolean, filters to active links only) ### 3. Create Short Link `POST https://kutti.link/api/v1/links` - Optional header: `Idempotency-Key` (string, max 128 chars — always set on retries to prevent duplicate creation). - Content-Type: `application/json` (max payload size: 16 KB; larger returns `413 PAYLOAD_TOO_LARGE`). - JSON body fields: - `url` (string, required, http/https URI, max 2048 chars) - `name` (string, optional, max 200 chars) - `shortUrl` (string, optional custom slug matching `^[a-zA-Z][a-zA-Z0-9_]{0,31}$`) - `isActive` (boolean, optional, default `true`) - `expiresAt` (ISO-8601 date-time string or `null`, optional) - `fetchTitle` (boolean, optional, default `false`) - Returns `201 Created` with `{ data: { id, shortUrl, shortLink, url, name, ... } }`. ### 4. Read, Update, or Soft-Delete a Link `GET https://kutti.link/api/v1/links/{id}` `PATCH https://kutti.link/api/v1/links/{id}` — update `url`, `name`, `shortUrl`, `isActive`, or `expiresAt`. `DELETE https://kutti.link/api/v1/links/{id}` — soft-deletes the link and releases its short slug immediately. Confirm with the user first. ### 5. Link Analytics `GET https://kutti.link/api/v1/links/{id}/analytics?days=30` - Query param `days`: `7`, `30`, or `90` (default `30`). - Returns `totalVisits`, time-series counts, and browser, OS, device, country, and referrer breakdowns. ## Quotas, Rate Limits & Anti-DDoS Cooldowns Limits apply across the account across all keys: - **Kutti Plus:** 15 req / 10s burst · 30/min · 15 writes/min · 100 new links/hr · 3,000/day - **Kutti Pro:** 40 req / 10s burst · 150/min · 50 writes/min · 400 new links/hr · 15,000/day - **Kutti Enterprise:** 150 req / 10s burst · 600/min · 200 writes/min · 2000 new links/hr · 250,000/day Response headers on API responses: - `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`, `X-DailyQuota-Remaining` - On HTTP `429`: stop sending immediate retries and obey `Retry-After`. Sustained `429` floods (>= 250 blocks in 5 min) trigger an automatic 15–60 minute account cooldown (`ABUSE_COOLDOWN`). ## Standard Error Envelope All errors follow `{ "error": { "code": "", "message": "
" } }`: - `401 UNAUTHORIZED` — invalid or revoked API key - `403 PLAN_REQUIRED` — account is on Free tier - `409 SLUG_CONFLICT` — requested `shortUrl` already exists - `410 ENDPOINT_DEPRECATED` — legacy endpoint retired - `413 PAYLOAD_TOO_LARGE` — request body exceeds 16 KB - `429 RATE_LIMITED` / `429 ABUSE_COOLDOWN` — slow down and respect `Retry-After`