Build on CloakAPI
You can build your own app or product on CloakAPI instead of using CloakAPI’s own apps (Chat, the extension, the desktop app). This section is for builders: the developer or company shipping a product on CloakAPI. To use CloakAPI yourself, start with the Quickstart.
What you get
You embed one of the build surfaces (an SDK, the drop-in proxy or the self-hosted MCP server). You do not re-implement the tokenizer, the detection rules or the cryptography. In return you get three parts:
- On-device tokenization. The build surface replaces the values its detector matches with stand-ins before the request leaves the device.
- A metered relay. The gateway checks the request proof and the supported content-part types, then forwards the submitted inference body to the provider. It does not scan the body for personal data or verify detector results. Prompt bodies are not written to gateway logs; bounded response copies are described below.
- Receipts. When a receipt is issued, it can use an
ecdsa-p256-sha256OpenReceipt v3 envelope that you can check against the published JWKS. The release register (release-integrity.json) is an unsigned SHA-256 catalog, not a signed proof.
Claims you can make
Keep your product copy within what the platform does. A build that displays the conformance badge is held to the same limits.
- Proof check, not content check. The gateway checks a caller declaration, a tenant-bound MAC over the submitted bytes, and the declared engine identity. It does not scan the inference body to confirm that a detector ran or that personal data was replaced, and the body may contain undetected or caller-supplied raw text. Do not describe the proof check as a body-safety check, and do not say that all content reaching CloakAPI is tokenized.
- Logs and records. Application logs are scrubbed of known payload-shaped fields as a safeguard; it is not a complete control. Usage and audit records are written without prompt or answer fields. The request body is kept only as a SHA-256, for idempotency.
- Response buffering is off by default. If a caller sends
X-CloakAPI-Buffer: truewhile it is off, the request returns HTTP 400 before provider dispatch or billing. If an operator turns it on, the gateway stores the provider response encrypted for the configured retention period (24 hours by default), and a successful retrieval deletes it. - Attribution header. When attribution recording is on (it is off by default), the
gateway runs a post-response check on
X-Cloak-End-Userthat can replace certain structured values with a tenant pseudonym. It runs on a header, not the inference body, but it is server-side processing of personal data and does not fit the client-side model below. Do not rely on it; see Attribution headers.
Client-side tokenization only
CloakAPI supports one integration model: client-side embedding.
- Tokenization runs on the end user’s device before data leaves it, through the drop-in proxy, an SDK (or the WASM or FFI engine) or the self-hosted MCP server. Values the on-device detector finds are tokenized before they reach your server or CloakAPI. This is the only way builds integrate.
- There is no server-side tokenize mode for inference bodies. The gateway has no endpoint that accepts prompt text and tokenizes it. It relays the inference body after checking the client’s declaration, MAC and engine identity; it does not verify detector execution or recall. The attribution-header check described above is not an inference-body control.
Proof check and detection are different
Keep these two properties apart in your copy.
- Proof check. The inference route checks a client declaration, the MAC over the submitted body bytes, and the declared engine identity. This confirms that the submitted bytes and metadata match the proof; it does not prove that an allowlisted engine processed them or that raw personal data is absent. A valid proof can accompany body content that still includes identifiers. Your client must tokenize and review content before sending it.
- Detection. Whether the tokenizer caught every piece of personal data is a separate question. Natural-language detection is probabilistic: it can miss values, its recall stays below 100%, and no cryptography changes that. The engine replaces high-stakes secrets with opaque placeholders rather than refusing them, and each surface has its own rule for a missing name model; see Detection coverage. Do not claim “100% safe” or “100% detection”: that claim is itself a user-safety hazard.
Next steps
- Choose your integration: the drop-in proxy, the SDKs, the self-hosted MCP server or REST, with a minimal example for each.
- Self-attested with CloakAPI conformance: install the receipt-checking CLI from npm and read the rules for displaying the badge.
- Onboard and bill your users: provision your end users as
CloakAPI accounts under your own
app_id, and bill them through their metered wallet or your own subscription. - Builder pricing: the markup for building on CloakAPI.