Endpoints

Transliteration

Convert Crimean Tatar text between the Cyrillic and Latin alphabets. The rules handle the letters and digraphs of both scripts, such as къ ↔ q, гъ ↔ ğ, нъ ↔ ñ and ё, ю, я.

POSThttps://api.ana-yurt.dev/v1/translit

Bearer key with the translit scope. Runs on the API server, not the GPU.

#Request body

JSON, Content-Type: application/json.

Request body
NameTypeDescription
textrequiredstring

Text to convert, Cyrillic or Latin or mixed.

1 to 10,000 characters (Unicode code points, not bytes). Longer text gets 413 payload_too_large; an empty string gets 400 invalid_request.

directionoptionalstring

cyr2lat, lat2cyr or auto, lowercase. An empty string means auto. Any other value is a 400 invalid_request.

auto converts to Latin when the text contains any Cyrillic letter, and to Cyrillic otherwise.

Default: auto

#Response

Response fields
FieldTypeDescription
textstringThe converted text.
direction_detectedstringThe direction applied: cyr2lat or lat2cyr. With auto this is the detected one.
api_versionstringAlways v1.
modelstringAlways translit.
model_versionstringVersion of the rule set, such as rules@9c813a9c. It changes when the rules change.

#Auto-detection

A Latin input with direction left out, {"text": "Selâm, dostlar!"}, comes back in Cyrillic:

Response 200
{
  "api_version": "v1",
  "model": "translit",
  "model_version": "rules@9c813a9c",
  "text": "Селям, достлар!",
  "direction_detected": "lat2cyr"
}

#Response headers

Rate limit headers (see headers).

Headers
HTTP/2 200
content-type: application/json
ratelimit-limit: 20
ratelimit-remaining: 19
ratelimit-reset: 3
x-ratelimit-limit: 20
x-ratelimit-remaining: 19
x-ratelimit-reset: 1795411347
x-quota-remaining-requests: 1999
x-quota-remaining-chars: 199977
x-request-id: 8e30638992ec4e3bb280338633c92830
x-ay-model: translit
x-ay-model-version: rules@9c813a9c

#Limits and billing

Transliteration is unlimited on every plan: there is no daily request or character quota. The plan’s per-minute rate and requests in flight still apply. The request body may be at most 128 KiB.

#Errors

StatusCodeWhen
400invalid_requestMissing or empty text, unknown direction, or a body that is not valid JSON.
400key_in_queryThe key was sent in the query string.
401invalid_api_keyMissing, unknown, revoked or expired key.
403account_suspendedThe account is suspended.
403scope_not_allowedThe key has no translit scope.
413payload_too_largeText over 10,000 characters, or a body over 128 KiB.
429rate_limitedThe per-minute limit is reached.
429concurrent_requestToo many requests in flight for the account.
429quota_exceededOnly if a daily quota was set on the account by hand, and it is used up.
429global_capacityFree plan: the shared daily capacity is used up.
503service_unavailableThe API is shedding load. Retry after 1 s.
400 Bad Request
{
  "error": {
    "message": "direction must be cyr2lat, lat2cyr, or auto",
    "type": "invalid_request_error",
    "code": "invalid_request"
  }
}

Long documents

Split text over 10,000 characters at paragraph or sentence boundaries and send the parts one by one, or up to your plan’s requests-in-flight limit in parallel.

Request
curl https://api.ana-yurt.dev/v1/translit \
  -H "Authorization: Bearer $AY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Къырым – меним Ватаным.", "direction": "cyr2lat"}'
Response 200
{
  "api_version": "v1",
  "model": "translit",
  "model_version": "rules@9c813a9c",
  "text": "Qırım – menim Vatanım.",
  "direction_detected": "cyr2lat"
}