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

  1. Create an account and turn on two-factor authentication.
  2. Create an API key on the API keys page and copy it — it is shown once.
  3. 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.
  • POST requests need Content-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"}}
StatusCodeMeaning
400invalid_jsonThe body is not valid JSON, has unknown fields or several objects.
401missing_api_keyNo API key in the request.
401invalid_api_keyThe key is wrong or has been revoked.
413body_too_largeThe body is larger than 1 MB.
415unsupported_media_typeA POST without Content-Type: application/json.
422validation_errorA field is missing or out of range; message says which.
429rate_limitedToo many requests for this key this minute; wait for Retry-After seconds.
503model_unavailableThe check is temporarily unavailable.
500internal_errorSomething 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*stringThe 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": []
    }
  }
}
  • flagged is true when any toxic label (profanity, insult, threat, violence_call, hate, sexual, self_harm) is above its threshold; toxicity is the highest of their scores.
  • contacts.flagged is separate from flagged: you decide whether sharing contacts is allowed on your platform.
  • Scores are probabilities from 0 to 1; flagged on 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*stringLatin letters only, as in official documents (transliterate other scripts).
middle_namestringMiddle name or patronymic, optional.
last_name*stringLatin letters, spaces, apostrophes, hyphens and dots.
birth_date*stringYYYY-MM-DD.
gender*stringM 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, unlikely or impossible (birth date in the future or age over 120).
  • score is the final realism from 0 to 1 after the model, the reference of well-known people and the rules; model_score is the model alone.
  • flags lists 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*stringRecipient gender, M or F.
age*integerRecipient age, 0–120.
event*stringOccasion key from GET /gift-events, e.g. birthday, wedding, diwali.
budget_usd*numberBudget in US dollars, 1–100000.
limitintegerHow 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
apigate · apigate.bitvora.net