Purpose
context sets the content register. general is the default. adult asks for the adult register and is available on every plan.
When to use it
Send adult when the source is adult material. Omit context, or send general, for everything else.
Request
POSThttps://edge.harktranslate.com/api/v1/translator/text
Send Content-Type: application/json and authenticate with the x-hark-key header.
| Field | Type | Required | Default | Allowed | Description |
|---|---|---|---|---|---|
| from | string | yes | none | A supported language code. from also accepts auto. | Source language code. The value auto asks the service to detect the source. |
| to | string | yes | none | A supported language code. from also accepts auto. | Language code to translate into. |
| text | string | yes | none | 1 to 1,037,299 characters. | The string to translate, or the text whose language should be identified. |
| context | string | no | omitted | general or adult. Case-insensitive. Omitted means general. | Content register. adult is available on every plan. |
Payload
Full request
curl -X POST "https://edge.harktranslate.com/api/v1/translator/text" \
-H "x-hark-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"from": "en",
"to": "vi",
"text": "Hello",
"context": "adult"
}
JSONSuccess
HTTP 200. Strings written as ... are the response shape, not a captured translation. meta.quality is what you asked, meta.grade is what served, and meta.degraded_segments counts protected parts that could not be restored. The register is not copied onto meta. The same field is accepted on /text, /texts, /json, and /html.
200 body
{
"trans": "...",
"meta": {
"quality": "auto-latency",
"grade": "llm",
"degraded_segments": 0
}
}Common mistakes
A register other than general or adult
Any other context value is HTTP 400. The check is case-insensitive.
Treating adult as a higher plan
Adult context is available on every plan. It is not a paid-tier flag.