ShinrAI API docs

ShinrAI API

Base URL https://api.shinrai.innovius.io. Sandbox https://api-sbx.shinrai.innovius.io (test keys shr_test_…). JSON in, JSON out, UTF-8. Authentication: Authorization: Bearer <key>. The machine-readable contract is at /openapi.json.

Units and tiers

1 record = 1.000 characters (Unicode code points), rounded up per text, at least 1 per text. The tier sets the weight and the limits.

TierWeightLimits per requestWho
standard1,064 texts, 200.000 characters eachall plans and packs
realtime1,64 texts, 4.000 characters each, first in the queueTeam, Business, Platform, packs 25 M and 100 M
batch0,5200 texts, 200.000 characters each, processed when idleall plans and packs

Monthly plan records are used first, then pack records. Plan records reset every billing cycle; pack records stay valid for 12 months.

POST /v1/analyze

Finds personal data. Send text or texts[]. Optional: model (shinrai-latest, shinrai-v1.3; add -realtime or -batch as an alias for the tier), tier, threshold (0…1, default 0,7), merge_persons (default true).

curl https://api.shinrai.innovius.io/v1/analyze \
  -H "Authorization: Bearer shr_live_…" -H "Content-Type: application/json" \
  -d '{"text": "Max Mustermann, max@example.com, Bonn", "tier": "standard"}'
{
  "model": "shinrai-latest", "tier": "standard",
  "results": [{"entities": [
      {"text": "Max Mustermann", "type": "PERSON", "startIndex": 0, "endIndex": 14, "confidence": 0.98, "source": "bert"},
      {"text": "max@example.com", "type": "EMAIL", "startIndex": 16, "endIndex": 31, "confidence": 1.0, "source": "regex"},
      {"text": "Bonn", "type": "CITY", "startIndex": 33, "endIndex": 37, "confidence": 0.91, "source": "bert"}],
    "stats": {"chars": 37, "records": 1}}],
  "usage": {"records": 1, "weighted_records": 1.0, "tier": "standard", "balance_after": 49999}
}

Response headers: X-Request-Id, X-Records-Charged, X-Records-Remaining. Offsets are code-point indexes into the text you sent.

POST /v1/redact

Returns the text with personal data replaced. mode: replace (default, consistent realistic stand-ins; the response carries the mapping so you can restore later), mask (mask_char, default *) or label ([PERSON]). known_replacements lets you keep stand-ins stable across calls; reserved_replacements lists stand-ins the service must not use. We store neither the text nor the mapping.

curl https://api.shinrai.innovius.io/v1/redact \
  -H "Authorization: Bearer shr_live_…" -H "Content-Type: application/json" \
  -d '{"text": "Max Mustermann schreibt an max@example.com", "mode": "replace", "known_replacements": {"max@example.com": "k.schulz@example.org"}}'
{"mode": "replace", "tier": "standard",
 "text": "Jonas Berger schreibt an k.schulz@example.org",
 "entities": [...], "mapping": {"Max Mustermann": "Jonas Berger", "max@example.com": "k.schulz@example.org"},
 "usage": {"records": 1, "weighted_records": 1.0, "tier": "standard", "balance_after": 49998}}

GET /v1/models · GET /v1/usage

/v1/models lists models and which tiers your key may use. /v1/usage returns plan, entitlements, balances and the last 30 days.

Errors

Every error is {"error": {"code", "message", …}}. Nothing is charged for an error.

StatuscodeMeaning
401invalid_keyKey missing, malformed, revoked, or from the other environment
402insufficient_recordsNot enough records; purchase_url, records_required, records_available
403tier_not_allowed · no_active_planThe plan does not include this tier (Starter has no Real-Time); upgrade_url
413too_largeText or batch over the tier limit
422invalid_requestUnknown model, bad field
429rate_limitedPlan request limit per minute; see Retry-After
503backend_unavailable · queue_full · billing_unavailableTemporary; retry after Retry-After. Not charged.

Keys and security

Keys look like shr_live_… (70 characters). Up to 5 per account, created and revoked in the console. Only a hash is stored. Text is processed in memory on servers in Germany (STACKIT) and never written to disk or logs; the audit log holds request id, sizes and timing only. Rate limits per plan: Starter 60, Team 300, Business 600, Platform 1.200 requests per minute.