Skip to content
CASTIA

API reference.

The comic localization endpoint requires an API key: POST /v1/comics/adapt adapts comic and webtoon dialogue. It uses the same structured review process as the product workspace — see how it works for the mechanism. The endpoint is functional and gated by real per-key quotas, but there's no published SDK and requests are synchronous only (more on that below).

Authentication

Pass your key as a bearer token: Authorization: Bearer castia_sk_.... Generate one from your dashboard settings — the raw key is shown exactly once at creation and never again, only its prefix is stored for you to recognize it by afterward. A missing or invalid key returns 401.

Rate limits

Each key has a daily request cap, checked and incremented atomically per request — 1,000 requests/day by default, though this is an environment-configurable setting on the server, so treat it as a starting point rather than a hard guarantee for every deployment. Exceeding it returns 429 with the actual configured limit stated in the error message. A cache hit — the identical text and language pair submitted before — still counts against the limit, but doesn't re-run the pipeline.

Errors

StatusMeaning
400Bad request - e.g. an unsupported language, or source and target set to the same language
401Missing or invalid API key
429Daily request limit exceeded for this key
500Something failed inside the pipeline itself - safe to retry

Every error body has the same shape: { "detail": "..." }, with a specific, human-readable message - never a bare status code with nothing else.

POST /v1/comics/adapt

Adapts a chapter's worth of comic/webtoon dialogue at once. panels is a flat list of speech-bubble entries, not literally one per panel — a panel with three bubbles sends three entries. Naming a speaker in voice drives per-character voice and honorific-register consistency across the chapter; an unattributed bubble still adapts, it just doesn't get that benefit. A Chapter DNA profile — cast, tone, and the chapter's dramatic context — is built automatically and returned alongside the per-bubble results, same as the product UI shows.

Request

curl https://api.usecastia.com/v1/comics/adapt \
  -H "Authorization: Bearer castia_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "source_language": "Japanese",
    "target_language": "English",
    "panels": [
      { "id": "p1-b1", "text": "遅いよ、また", "voice": "Aiko" },
      { "id": "p1-b2", "text": "渋滞だったんだ", "voice": "Kenji" }
    ]
  }'

Response (200)

{
  "chapter_dna": {
    "artistic_thesis": "...",
    "genre_feel": "slice-of-life romance",
    "tone": "wry, affectionate",
    "ongoing_plot_context": "...",
    "characters": [
      { "name": "Aiko", "voice_description": "...", "honorific_register": "casual (plain form)", "relationships": ["Kenji: childhood friend"] }
    ]
  },
  "panels": [
    {
      "id": "p1-b1",
      "literal": "You're late. Again.",
      "adapted_text": "You're late. Again.",
      "why": "No rewrite earned its keep over the literal reading here."
    },
    {
      "id": "p1-b2",
      "literal": "It was traffic congestion.",
      "adapted_text": "Traffic. I swear.",
      "why": "Shortened to match a spoken excuse's rhythm; \"I swear\" carries Kenji's established defensive tone."
    }
  ]
}

Known limitations

The endpoint is synchronous — the request blocks until the full chapter pipeline finishes, with no job/poll pattern yet for API callers (the browser-facing app has one internally; it isn't exposed on the API yet). Large chapters can take minutes, so set your HTTP client's timeout generously or keep individual requests small until an async job endpoint ships here too.

See the full pipeline mechanics on how it works, or general questions on the FAQ.