# Content Localization API — astro-aware translation in 20 languages

Translate text content into **20 languages** through the AstroWay AI gateway with an **astrology glossary**: specialist terms (Dasha, Nakshatra, Ascendant, Major Arcana, Life Path Number) aren't mangled by literal translation — they keep the canonical form of the target language. Numeric fields are left untouched.

## How it works

1. You send the text + target language (optionally a domain and source language; source defaults to English)
2. The API pulls the domain glossary for the language pair and builds a system prompt
3. The text goes through the AI gateway (Gemini → Groq → OpenRouter → …) with automatic failover
4. The response is the translation only; public input is **not cached** — your text is never stored

## Endpoints

| Endpoint | Method | Credits | Purpose |
|---|---|---|---|
| `/v1/translate/astro` | POST | `15 + ⌈chars/40⌉` | Translate one text (up to 3000 chars) |
| `/v1/translate/batch` | POST | `15 + ⌈total/40⌉` | Up to 25 strings (≤2000 chars each, ≤20000 total) |
| `/v1/translate/languages` | GET | 0 | List the 21 supported languages |
| `/v1/translate/glossary/{lang}` | GET | 0 | Download the glossary for a language |

## Pricing

`credits = 15 + ⌈chars/40⌉` per call (batch counts the summed chars of all items). Ballpark: 60 chars ≈ 17 credits, 500 chars ≈ 28. Charged against your existing plan credits — there's no separate tier. Roughly ~4× cheaper than DeepL.

## Glossary (astro-moat)

The domain glossary (Vedic / Western / Tarot / Numerology / HD / marketing) substitutes the canonical target-language term instead of translating literally: `Dasha`, `Nakshatra`, `Ascendant`, `Major Arcana`, `Life Path Number`, etc.

<Aside type="note">
The glossary currently covers the pairs **uk / en → de**. The rest of the 20 languages translate without a glossary (plain LLM translation). Coverage is expanding.
</Aside>

## Example

```bash
curl -X POST https://api.astroway.info/v1/translate/astro \
  -H "X-Api-Key: aw_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "text": "Mercury is retrograde in Gemini.", "target_lang": "de", "domain": "western" }'
# { "translated": "Merkur ist rückläufig in den Zwillingen.", "source_lang": "en",
#   "target_lang": "de", "domain": "western", "chars": 32, "credits": 16 }
```

Supported languages: uk · en · de · pl · es · pt · hi · fr · ko · it · ja · id · tr · nl · cs · ro · vi · ar · el · hu.
