API documentation
A JSON over HTTPS API. All checks run on our own models on our servers: your data is not sent to third parties and is not stored — we only count requests per key.
Base URL: https://apigate.bitvora.net/api/v1
Quick start
- Create an account and turn on two-factor authentication.
- Create an API key on the API keys page and copy it — it is shown once.
- Call an endpoint from your server:
curl -X POST https://apigate.bitvora.net/api/v1/emotion \
-H "Authorization: Bearer $APIGATE_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "You are an idiot. Text me: four four seven 3 one 2 four"}'Authentication
Every endpoint needs an API key. Send it in the Authorization header (or in X-API-Key):
Authorization: Bearer ag_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX- Keys start with
ag_. We store only a hash, so a lost key cannot be shown again — create a new one. - Keep keys on your server. Do not put them in a browser, a mobile app or a public repository.
- A leaked key? Revoke it in your account: it stops working immediately.
POSTrequests needContent-Type: application/json.
Rate limits
60 requests per minute per key. Every response carries the current state:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1796036460 (Unix time when the minute resets)Over the limit you get 429 with a Retry-After header in seconds.
Errors
Errors use HTTP status codes and one JSON shape. code is stable — branch on it, not on the message.
{"error": {"code": "validation_error", "message": "text must be 1..5000 characters"}}| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_json | The body is not valid JSON, has unknown fields or several objects. |
| 401 | missing_api_key | No API key in the request. |
| 401 | invalid_api_key | The key is wrong or has been revoked. |
| 413 | body_too_large | The body is larger than 1 MB. |
| 415 | unsupported_media_type | A POST without Content-Type: application/json. |
| 422 | validation_error | A field is missing or out of range; message says which. |
| 429 | rate_limited | Too many requests for this key this minute; wait for Retry-After seconds. |
| 503 | model_unavailable | The check is temporarily unavailable. |
| 500 | internal_error | Something broke on our side. Retry later. |
Message emotionality
POST /emotion
Scores a message for profanity, insults, threats, calls to violence, hate, sexual content, self-harm and overall tone, and detects contacts (links, domains, phone numbers, emails), including disguised ones like “four four seven”, “shop dot com” or “anna at gmail dot com”.
Request body
| text* | string | The message, 1–5000 characters. |
Request
curl -X POST https://apigate.bitvora.net/api/v1/emotion \
-H "Authorization: Bearer $APIGATE_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "You are an idiot. Text me: four four seven 3 one 2 four"}'Response 200
{
"model_version": 12,
"took_ms": 0.84,
"result": {
"flagged": true,
"toxicity": 0.9312,
"tone": "negative",
"labels": {
"profanity": { "score": 0.4120, "flagged": false },
"insult": { "score": 0.9312, "flagged": true },
"threat": { "score": 0.0213, "flagged": false },
"violence_call": { "score": 0.0051, "flagged": false },
"hate": { "score": 0.0102, "flagged": false },
"sexual": { "score": 0.0034, "flagged": false },
"self_harm": { "score": 0.0011, "flagged": false },
"negative": { "score": 0.9620, "flagged": true },
"positive": { "score": 0.0150, "flagged": false },
"link": { "score": 0.0207, "flagged": false },
"phone": { "score": 0.8800, "flagged": true },
"email": { "score": 0.0090, "flagged": false }
},
"contacts": {
"flagged": true,
"phones": ["4473124"],
"links": [],
"emails": []
}
}
}flaggedis true when any toxic label (profanity, insult, threat, violence_call, hate, sexual, self_harm) is above its threshold;toxicityis the highest of their scores.contacts.flaggedis separate fromflagged: you decide whether sharing contacts is allowed on your platform.- Scores are probabilities from 0 to 1;
flaggedon each label already applies the threshold we tuned for that label. - Today the model analyses English. Automatic translation from other languages (German, French, Russian, Ukrainian) is coming — see Translation below. Contact detection already works on any language.
Person realism (KYC)
POST /person
Tells whether a name, birth date and gender look like a real person: catches random letters, test data (“Test Test”, “John Doe”), fictional and joke names, a name that does not match the gender, impossible dates and well-known people with their real birth date.
Request body
| first_name* | string | Latin letters only, as in official documents (transliterate other scripts). |
| middle_name | string | Middle name or patronymic, optional. |
| last_name* | string | Latin letters, spaces, apostrophes, hyphens and dots. |
| birth_date* | string | YYYY-MM-DD. |
| gender* | string | M or F. |
Request
curl -X POST https://apigate.bitvora.net/api/v1/person \
-H "Authorization: Bearer $APIGATE_KEY" \
-H "Content-Type: application/json" \
-d '{"first_name": "Adolf", "last_name": "Hitler", "birth_date": "1889-04-20", "gender": "M"}'Response 200
{
"model_version": 7,
"took_ms": 0.31,
"result": {
"verdict": "unlikely",
"score": 0.05,
"model_score": 0.4127,
"age": 137,
"flags": { "famous_name": 0.9930 },
"famous": [
{ "name": "Adolf Hitler", "birth_date": "1889-04-20", "description": "Dictator of Nazi Germany", "same_birth_date": true }
],
"reasons": ["name of a well-known person", "name and birth date match a well-known person", "age 137 is over 120"]
}
}verdict:likely_real,doubtful,unlikelyorimpossible(birth date in the future or age over 120).scoreis the final realism from 0 to 1 after the model, the reference of well-known people and the rules;model_scoreis the model alone.flagslists only flags above their threshold:gender_mismatch,gibberish,placeholder,fictional,famous_name.- Names are analysed as they are, without translation. A namesake of a famous person with a different birth date only lowers the score a little.
Gift ideas
POST /gifts
Ranked gift suggestions for a recipient and an occasion within a budget. Gifts that break the customs of the occasion (alcohol for Ramadan, clocks for Lunar New Year, an even number of flowers…) or do not suit the age are left out and listed with the reason.
Request body
| gender* | string | Recipient gender, M or F. |
| age* | integer | Recipient age, 0–120. |
| event* | string | Occasion key from GET /gift-events, e.g. birthday, wedding, diwali. |
| budget_usd* | number | Budget in US dollars, 1–100000. |
| limit | integer | How many suggestions to return, 1–30, default 10. |
Request
curl -X POST https://apigate.bitvora.net/api/v1/gifts \
-H "Authorization: Bearer $APIGATE_KEY" \
-H "Content-Type: application/json" \
-d '{"gender": "F", "age": 34, "event": "housewarming", "budget_usd": 60, "limit": 3}'Response 200
{
"model_version": 4,
"took_ms": 2.7,
"result": {
"event": {
"key": "housewarming", "title": "Housewarming", "group": "life_event", "tradition": "universal",
"when": "after moving in",
"avoid_tags": ["sharp", "clock"], "prefer_tags": ["home", "plant", "decor", "candle", "kitchen", "food"],
"customs": ["Bread and salt (Slavic), bread, salt and sugar (Jewish), a plant, candles, home decor."],
"taboos": ["Knives bring quarrels to the house (Slavic superstition); clocks are unlucky in Chinese culture."]
},
"suggestions": [
{
"name": "Olive tree in a ceramic pot", "description": "A slow-growing indoor tree that lasts for years.",
"category": "plants", "tags": ["plant", "home"], "price_min_usd": 35, "price_max_usd": 70,
"score": 0.8731, "reasons": ["plant is customary for Housewarming", "fits the budget"]
}
],
"avoided": [{ "name": "Chef's knife set", "reason": "a knife or other sharp item is not given for Housewarming (universal)" }],
"considered": 142
}
}Occasions dictionary
GET /gift-events
All occasions accepted by /gifts: personal, life events, secular, Christian, Jewish, Muslim, Hindu, East Asian and others, with customs and taboos.
Request
curl https://apigate.bitvora.net/api/v1/gift-events \
-H "Authorization: Bearer $APIGATE_KEY"Response 200
{
"events": [
{
"key": "birthday", "title": "Birthday", "group": "personal", "tradition": "universal",
"when": "the person's birthday",
"avoid_tags": [], "prefer_tags": ["personalized", "hobby", "experience"],
"customs": ["Pick a gift around the person's hobbies; for children toys, books and games are classic."],
"taboos": ["In Russia and the CIS early birthday gifts are considered bad luck — give on the day or after."]
}
]
}Translation
Coming soon Translation between English, German, French, Russian and Ukrainian (any direction) on our own servers, plus automatic translation of messages sent to /emotion. Planned endpoints:
POST /translate {"text": "Привет, как дела?", "source": "auto", "target": "en"}
GET /translate/languages