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 ё, ю, я.
https://api.ana-yurt.dev/v1/translitBearer key with the translit scope. Runs on the API server, not the GPU.
#Request body
JSON, Content-Type: application/json.
| Name | Type | Description |
|---|---|---|
textrequired | string | Text to convert, Cyrillic or Latin or mixed. 1 to 10,000 characters (Unicode code points, not bytes). Longer text gets |
directionoptional | string |
Default: |
#Response
| Field | Type | Description |
|---|---|---|
text | string | The converted text. |
direction_detected | string | The direction applied: cyr2lat or lat2cyr. With auto this is the detected one. |
api_version | string | Always v1. |
model | string | Always translit. |
model_version | string | Version 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:
{
"api_version": "v1",
"model": "translit",
"model_version": "rules@9c813a9c",
"text": "Селям, достлар!",
"direction_detected": "lat2cyr"
}#Response headers
Rate limit headers (see 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
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | Missing or empty text, unknown direction, or a body that is not valid JSON. |
| 400 | key_in_query | The key was sent in the query string. |
| 401 | invalid_api_key | Missing, unknown, revoked or expired key. |
| 403 | account_suspended | The account is suspended. |
| 403 | scope_not_allowed | The key has no translit scope. |
| 413 | payload_too_large | Text over 10,000 characters, or a body over 128 KiB. |
| 429 | rate_limited | The per-minute limit is reached. |
| 429 | concurrent_request | Too many requests in flight for the account. |
| 429 | quota_exceeded | Only if a daily quota was set on the account by hand, and it is used up. |
| 429 | global_capacity | Free plan: the shared daily capacity is used up. |
| 503 | service_unavailable | The API is shedding load. Retry after 1 s. |
{
"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.
curl https://api.ana-yurt.dev/v1/translit \
-H "Authorization: Bearer $AY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Къырым – меним Ватаным.", "direction": "cyr2lat"}'{
"api_version": "v1",
"model": "translit",
"model_version": "rules@9c813a9c",
"text": "Qırım – menim Vatanım.",
"direction_detected": "cyr2lat"
}