Overview

API Reference

Full spec: /openapi.yaml (OpenAPI 3.1). Production server: https://api.cachly.dev.

Authentication#

Scheme Use
BearerAuth API key or Keycloak JWT in an Authorization: Bearer <token> header
AdminAuth Static bearer token (ADMIN_SECRET_KEY)
VectorToken Per-instance UUID in the URL path: /v1/sem/{token}/...
OAuth2 client_credentials Headless machine-to-machine auth for CI runners, agents, and AI-to-AI pipelines. Set CACHLY_CLIENT_ID + CACHLY_CLIENT_SECRET; the MCP server exchanges them for an access token against Keycloak — no device flow, no human

Machine-to-machine (gRPC): beyond the REST surface, a gRPC BrainService (Search / Recall / Learn / Subscribe / Health) is available on port 50051 for low-latency AI-to-AI access — including a write path (Learn) so agents and CI runners can teach the Brain directly, and a streaming read-push path (Subscribe) that delivers lessons to agents the moment they're learned. Per-token rate limiting, optional TLS, and request-ID correlation apply to unary and streaming RPCs alike. Reflection is enabled for grpcurl and grpc-health-probe.

The MCP tool surface (137 tools) is also exportable to OpenAI / Anthropic / LangChain / OpenAPI dialects:

npx @cachly-dev/mcp-server@latest tool-specs --format=<dialect>

Quick start: npx @cachly-dev/mcp-server@latest autopilot — one command detects all editors, writes configs, and bootstraps your Brain. No credit card.

Endpoints by resource group#

Health#

Method Path Description
GET /health API health check

Instances (Keycloak JWT required)#

Method Path Description
POST /api/v1/instances Create cache instance
GET /api/v1/instances List instances
GET /api/v1/instances/{id} Get instance
DELETE /api/v1/instances/{id} Delete instance
POST /api/v1/instances/{id}/rotate-vector-token Rotate vector token
POST /api/v1/instances/{id}/warm Warm cache
PUT / DELETE /api/v1/instances/{id}/byok Set / remove BYOK key
PUT /api/v1/instances/{id}/cost-per-call Set cost per call for ROI estimates
PUT / DELETE /api/v1/instances/{id}/custom-domain Set / remove custom domain
POST /api/v1/instances/{id}/custom-domain/verify Verify custom domain
PUT / DELETE /api/v1/instances/{id}/webhook Set / remove webhook URL

Brain (memory core used by the MCP server and dashboard)#

Method Path Description
POST /api/v1/instances/{id}/learn Store a lesson in the Brain
POST /api/v1/instances/{id}/recall Recall and count top Brain lessons
GET /api/v1/instances/{id}/memory Brain memory snapshot
GET /api/v1/instances/{id}/predictions Failure predictions
GET /api/v1/instances/{id}/brain-stats Brain search/usage stats
POST /api/v1/instances/{id}/scan PR risk scan
POST /api/v1/instances/{id}/ci-outcome Report CI outcome (closed-loop calibration)

Orgs#

Method Path Description
GET /api/v1/orgs/{id}/savings Org-wide savings (ROI)
GET /api/v1/orgs/:id/lessons Team Knowledge Hub lessons feed
GET /api/v1/orgs/:id/retention Team Knowledge Hub retention feed

See Team Knowledge Hub for the full response shapes of the last two.

Semantic Cache (vector token required, no Keycloak JWT)#

Method Path Description
POST /v1/sem/{token}/search ANN search
POST /v1/sem/{token}/entries Index entry
GET /v1/sem/{token}/entries List entries
POST /v1/sem/{token}/entries/batch Batch index (cache warming)
DELETE /v1/sem/{token}/entries/{id} Delete entry
DELETE /v1/sem/{token}/flush Flush namespace
GET /v1/sem/{token}/size Get namespace size
POST / GET /v1/sem/{token}/threshold Set / get adaptive threshold
POST /v1/sem/{token}/feedback Record feedback for adaptive threshold
POST /v1/sem/{token}/search/stream Streaming ANN search (SSE)
POST /v1/sem/{token}/detect-namespace Auto-detect namespace
GET /v1/sem/{token}/stats Semantic cache analytics
GET /v1/sem/{token}/analytics Full analytics 2.0
GET /v1/sem/{token}/analytics/anomalies Anomalies only
GET /v1/sem/{token}/analytics/recommend Recommendations only

See Semantic Caching for usage examples and SDK snippets.

Billing#

Method Path Description
POST /api/v1/instances/{id}/portal-session Create Stripe billing portal session
GET /api/v1/billing/invoices List invoices
GET /api/v1/billing/subscription Get subscription summary
POST /api/v1/billing/portal-session Create tenant billing portal session

Account (DSGVO data portability)#

Method Path Description
GET /api/v1/account/export Export account data (DSGVO Art. 20)
DELETE /api/v1/account Delete account (DSGVO Art. 17 — right to erasure)

Admin (ADMIN_SECRET_KEY required)#

Method Path Description
GET /api/admin/stats KPI stats
GET /api/admin/instances List all instances
GET /api/admin/nodes List cluster nodes
POST /api/admin/nodes/provision Provision a new Hetzner node

Plans, telemetry, warmup, webhooks#

Method Path Description
POST / GET / PATCH / DELETE /api/v1/plans Save, list, get, update, delete a Brain plan
POST /api/v1/telemetry/mcp Record MCP Brain funnel event
POST /v1/cache/{token}/warm Warm KV cache (token-based)
POST /v1/sem/{token}/warmup/snapshot Semantic cache warmup snapshot
POST /webhooks/stripe Stripe webhook handler

For instance-creation payloads specific to each engine, see Cache Engines and Cluster Mode. To manage instances and keys declaratively instead of by hand, see the Terraform Provider.

← Back to all docs

Updated

Was this page helpful?