Make your first API request
Create a key, select an API contract, send a request, and understand the response.
Your first API call
Log in to Dashboard and complete your cart. Your first managed purchase creates an API key when no active key exists and emails it to your verified account address. Copy it from API keys and store it in a secret manager, outside source code.
Browser-created keys can be recovered for 24 hours. Email can be disabled when creating additional keys. If recovery expires, explicitly replace the key; the old key stops working. Offline-only purchases use installation activation and do not create a managed API key.
API keys authenticate applications. AI connections use MCP to let an assistant access tools with your chosen permissions; connecting an assistant does not automatically protect unrelated chat messages.
Production base URL: https://api.getshinrai.com
curl https://api.getshinrai.com/v2/detect \
-H "Authorization: Bearer $SHINRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Emma Weber, emma@example.com"}'curl 'https://azure.api.getshinrai.com/language/:analyze-text?api-version=2023-04-01' \
-H "Ocp-Apim-Subscription-Key: $SHINRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"PiiEntityRecognition","analysisInput":{"documents":[{"id":"1","language":"en","text":"Emma Weber, emma@example.com"}]},"parameters":{"modelVersion":"latest","stringIndexType":"Utf16CodeUnit"}}'Compatibility APIs limit what ShinrAI can return. For full quality, use the native PII API v2.
# Once: create SigV4 credentials with your ShinrAI key
# curl -X POST https://aws.api.getshinrai.com/providers/aws/credentials -H "Authorization: Bearer $SHINRAI_API_KEY"
import boto3, os
client = boto3.client(
"comprehend",
region_name="eu-central-1",
endpoint_url="https://aws.api.getshinrai.com",
aws_access_key_id=os.environ["SHINRAI_AWS_ACCESS_KEY_ID"],
aws_secret_access_key=os.environ["SHINRAI_AWS_SECRET_ACCESS_KEY"],
)
print(client.detect_pii_entities(Text="Emma Weber, emma@example.com", LanguageCode="en"))Compatibility APIs limit what ShinrAI can return. For full quality, use the native PII API v2.
curl 'https://google.api.getshinrai.com/v2/projects/my-project/locations/global/content:inspect' \
-H "x-goog-api-key: $SHINRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"item":{"value":"Emma Weber, emma@example.com"},"inspectConfig":{"includeQuote":true}}'Compatibility APIs limit what ShinrAI can return. For full quality, use the native PII API v2.
Example output (simulated)
Simulated JSON excerpt for the command above. Your detections, replacement values and balance may differ.
{
"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
}
}The response lists the entities of each input with type, span and confidence, the engine that ran, and the usage with the remaining balance. This short Standard request uses one record. Entity predictions depend on the model and input.
This example uses the native PII API v2. The offline edition serves the native API v1 until its image includes v2.
Use your preferred client
curl https://api.getshinrai.com/v2/detect \
-H "Authorization: Bearer $SHINRAI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"text":"Emma Weber, emma@example.com"}'import os, requests
response = requests.post(
"https://api.getshinrai.com/v2/detect",
headers={"Authorization": f"Bearer {os.environ['SHINRAI_API_KEY']}"},
json={"text": "Emma Weber, emma@example.com"},
)
response.raise_for_status()
for entity in response.json()["results"][0]["entities"]:
print(entity["type"], entity["span"], entity["confidence"])const response = await fetch("https://api.getshinrai.com/v2/detect", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.SHINRAI_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ text: "Emma Weber, emma@example.com" }),
});
if (!response.ok) throw new Error(`ShinrAI HTTP ${response.status}`);
const { results } = await response.json();
for (const entity of results[0].entities) console.log(entity.type, entity.span, entity.confidence);