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

# Overview

Every endpoint lives under `https://api.blende.dev/api/v1`.

## Redact, ask, restore

1. `POST /api/v1/redact` with `{"text": …}` answers the text with typed tags such as `[PERSON_7K2QX9MB]`, the billed `tokens` and `expires_at`. The mapping stays sealed on [Blende](https://www.blende.dev)'s servers under your key.
2. Send the tagged text to your LLM. Only tags leave your client.
3. `POST /api/v1/restore` with the answer and the same key puts the originals back.

`store_entity_mapping: false` stores nothing and answers the mapping, so the SDK restores locally. `detailed: true` adds the spans, their parts and the model.

## Concepts

* **Tags** are `[KIND_ID]`: the kind in capitals and 8 characters of Crockford base32. Restore reads altered tags (case, brackets, separators) and reports invented ones as `unknown`.
* **One context per API key.** A value keeps its tag across all of the key's conversations until `POST /api/v1/context/reset`, after which old tags restore as `unknown`. Signed-in apps send a JWT and the user's `Blende-Context-Key`.
* **Policies** say what to hide: a built-in (`standard`, `strict`, `light`), a saved policy's `pol_…` id, or an inline policy whose `overrides` hide or leave by tag, pattern or range.
* **Offsets** are half-open `[start, end)` ranges in Unicode code points of the text as sent.
* **Tokens** of the text sent to redact are the billed unit; restore is not billed.
* **No PII in our logs**: logs, traces, metrics and errors hold metadata only.
* **Errors** are RFC 9457 problem details (`application/problem+json`) with a stable `code`; `detail` never echoes input.

## Authentication

Send `Authorization: Bearer <token>`: an API key (`bl_live_…`, `bl_test_…`) for developers, or a ZITADEL JWT with `Blende-Context-Key` for Blende's apps. Each endpoint names the scope it needs: `redact`, `restore`, `usage:read`, `policies:write` or `admin`.