# ShinrAI managed API quickstart

Prefer a guided browser workspace? [Run Hello ShinrAI locally](hello-shinrai.md) to inspect text, files, protected chat, Azure-shaped requests and provider-compatible API calls.

Use Get API key to configure a plan or managed pack, optional services and partner preference in one cart. Sign in with your work email and complete secure checkout. Your first managed purchase issues a key if no active key exists, even if the checkout tab closes. Copy it in My account → API keys; it is also submitted to your verified account email. Keep the key in a secret manager. Browser-created keys can be recovered for 24 hours; expiry does not revoke the key. Additional keys have an optional email checkbox. Explicit replacement invalidates the old key. Offline-only purchases use installation activation, not a cloud key. Production API base: https://api.getshinrai.de

```bash
curl https://api.getshinrai.de/v2/detect \
  -H "Authorization: Bearer $SHINRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Emma Weber, emma@example.com"}'
```

<details>
<summary>Example output (simulated)</summary>

Simulated JSON excerpt for the command above. Your detections, replacement values and balance may differ.

```json
{
  "offset_unit": "codepoint",
  "engine": {
    "model": "shinrai-v1.5",
    "layers_run": ["model", "pattern"],
    "degraded": false
  },
  "results": [
    {
      "input_id": "1",
      "status": "ok",
      "entities": [
        {"id": "e1", "type": "PERSON", "span": {"start": 0, "end": 10}, "confidence": 0.98, "source": "model"},
        {"id": "e2", "type": "EMAIL", "span": {"start": 12, "end": 28}, "confidence": 1.0, "source": "pattern"}
      ]
    }
  ],
  "usage": {"records": 1, "weighted_records": 1.0, "tier": "standard", "charged": true, "balance_after": 9999.0}
}
```

</details>

Protect a text and keep the mapping, so you can restore a reply later:

```bash
curl https://api.getshinrai.de/v2/protect \
  -H "Authorization: Bearer $SHINRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Emma Weber, emma@example.com","policy":{"preset":"pseudonymize"},"output":{"include":["entities","mapping"]}}'
```

The protected text is in `results[].output`; `mapping.delta` lists each original with its replacement. Entity spans are half-open, in Unicode code points by default. The above short Standard requests use one record each. Never paste real customer information into public examples.

These examples use the native PII API v2, stable from version 2.0.0. The offline edition serves the native API v1 until its image includes v2. The Azure, Google and AWS compatibility APIs are for migration: https://getshinrai.com/docs#apis

Full API documentation: https://getshinrai.com/docs
OpenAPI schema: https://getshinrai.com/openapi.json
Native PII API v2 guide: https://getshinrai.com/docs/guides/v2
API explorer (Swagger): https://getshinrai.com/docs/api
Azure migration guide: https://getshinrai.com/docs/providers/azure
Offline activation: https://getshinrai.com/docs/operations#offline
Secure AI Suite: https://getshinrai.com/integrations/secure-ai-suite
