Enhanciar API ← back to app

API Reference

Programmatic access to your Enhanciar workspace. Use it to query your wiki from a script, automate ingests from CI, or wire Enhanciar into another tool.

Connect over MCP

Enhanciar ships a native Model Context Protocol server, so any MCP-compatible AI assistant can query your Company Brain and ground its answers in your team's real, cited knowledge — not hallucinations. Add this to your client's MCP config:

Add to ~/.cursor/mcp.json:
{
  "mcpServers": {
    "enhanciar": {
      "url": "https://enhanciar.in/enhanciar/mcp/",
      "headers": { "Authorization": "Bearer dh_..." }
    }
  }
}

Use an API key from Settings → API keys as the bearer token.

Supported clients. Anything that speaks MCP works — verified with:

  • Cursor
  • Claude (Desktop & Code)
  • ChatGPT
  • Antigravity
  • Windsurf
  • Zed
  • Cline
  • Continue
  • VS Code (Copilot agent mode)
  • Goose
  • …and any other MCP client

Tools exposed. Once connected, your agent gets: query, search_wiki, get_page, list_pages, list_repos, and get_graph.

Authentication

Every request needs an Authorization header with a Enhanciar API key:

Authorization: Bearer dh_a1b2c3d4e5f6...

Get a key from Settings → API keys. Keys are long-lived bearer tokens — keep them secret. Revoke immediately if leaked. The plaintext is shown once on creation; only a hash is stored on our side.

Base URL

https://enhanciar.in/enhanciar

Quickstart

# 1. Generate a key in Settings → API keys
KEY="dh_paste_yours_here"

# 2. Ask a question
curl -sX POST https://enhanciar.in/enhanciar/api/v1/query \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"What is dataset preparation in nanoGPT?"}'

# 3. List your wiki pages
curl -s https://enhanciar.in/enhanciar/api/v1/wiki/pages \
  -H "Authorization: Bearer $KEY"

# 4. Read one page
curl -s https://enhanciar.in/enhanciar/api/v1/wiki/page/text-tokenization \
  -H "Authorization: Bearer $KEY"

Endpoints

POST/api/v1/query

Ask Enhanciar a question grounded in your ingested wiki. Returns one JSON answer.

Body

FieldTypeRequiredDescription
querystringyesYour question, max ~4000 chars.
modelstringnoOverride model (e.g. gemini-3-flash-preview). Default = your saved preference.

Response

{
  "answer": "In nanoGPT, dataset preparation involves a pipeline of scripts that ...",
  "sources": [
    { "slug": "text-tokenization", "category": "concepts", "title": "Text Tokenization" },
    ...
  ],
  "model": "gemini-3-flash-preview"
}

Limits: same daily/monthly token cap as your plan. 429 if you exceed it.

GET/api/v1/wiki/pages

List every wiki page in your workspace.

{
  "username": "skBVSIic8rfswwme7AYfnSnq9ae2",
  "raw": "## Concepts\n- text-tokenization\n- dataset-preparation-pipeline\n## Entities\n- gpt-training-script\n..."
}

GET/api/v1/wiki/page/{name}

Fetch a single page's markdown content. name is the slug (e.g. text-tokenization).

{
  "name": "text-tokenization",
  "content": "## Text Tokenization\n\nTokenization converts raw text into ..."
}

Returns 404 if the page doesn't exist for this user.

POST/api/account/api-keys requires Firebase auth

Mint a new API key. Plaintext returned once — store immediately.

Cannot be called with another API key (you must be signed in via the SPA).

GET/api/account/api-keys requires Firebase auth

List your keys (no plaintext, just metadata).

DELETE/api/account/api-keys/{key_id} requires Firebase auth

Revoke a key. Anything using it stops working immediately.

Streaming alternative

The v1 endpoints return one JSON. If you want live streaming traces (Scout's plan, Worker progress, integrator citations), call the existing POST /api/query instead — same auth, response is NDJSON (one JSON event per line).

Errors

StatusMeaning
401Missing or invalid Authorization header.
404Page or resource not found.
429Token cap exceeded for your plan.
5xxServer-side issue. Includes a short message; check Sentry if you have access.

Rate limits

Per-route token bucket on top of your plan's daily/monthly token cap. If you expect high-volume use (CI runs every push, etc.) please email support@enhanciar.in and we'll bump the bucket for your account.

Versioning

The /api/v1/* shape is stable — breaking changes ship as /api/v2/* with a 6-month deprecation overlap. Internal endpoints under /api/* (without /v1/) can change without notice.