REST API

API Documentation

Integrate manga translation into your app with a simple REST API.

Quick Start

1

Get an API key

Create a key from your dashboard settings. Keys start with mg_live_ or mg_test_.

2

Upload an image

Request a presigned URL, then PUT the image bytes to it.

3

Create a job

Submit the upload key to start translation. Poll the job until it completes.

Authentication

Include your API key as a Bearer token in the Authorization header.

Authorization: Bearer mg_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • Live mode keys (mg_live_) use your real credits.
  • Test mode keys (mg_test_) use mock GPU — no credits consumed.

Endpoint Reference

Base URL: https://api.mangagloss.com

POST/v1/uploads/presignGet presigned upload URL

Returns a presigned URL for uploading an image to R2 storage.

Request

{
  "count": 1
}

Response

{
  "uploads": [
    { "key": "abc123...", "url": "https://..." }
  ]
}
PUT/v1/uploads/direct/:keyUpload image

Upload raw image bytes to the presigned URL. Send the image content type in the header.

Request

Raw image bytes (Content-Type: image/png or image/jpeg)

Response

{ "ok": true }
POST/v1/jobsCreate translation job

Start a translation job for uploaded images. Requires credits (1 per page).

Request

{
  "pages": ["abc123..."],
  "source_lang": "JPN",
  "target_lang": "ENG",
  "engine": "premium"
}

Response

{ "job_id": "x7k9m2..." }
GET/v1/jobs/:idGet job status

Poll this endpoint until status is completed or failed. Results include translated image URLs and text regions.

Response

{
  "id": "x7k9m2...",
  "status": "completed",
  "pages": [
    {
      "id": "p1...",
      "status": "completed",
      "output_url": "https://...",
      "regions": [...]
    }
  ]
}

Code Examples

Full translate-one-page flow in your language of choice.

# 1. Get a presigned upload URL
PRESIGN=$(curl -s -X POST https://api.mangagloss.com/v1/uploads/presign \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"count": 1}')

KEY=$(echo $PRESIGN | jq -r '.uploads[0].key')
URL=$(echo $PRESIGN | jq -r '.uploads[0].url')

# 2. Upload the image
curl -s -X PUT "$URL" \
  -H "Content-Type: image/png" \
  --data-binary @page.png

# 3. Create a translation job
JOB=$(curl -s -X POST https://api.mangagloss.com/v1/jobs \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"pages\": [\"$KEY\"], \"source_lang\": \"JPN\", \"target_lang\": \"ENG\", \"engine\": \"premium\"}")

JOB_ID=$(echo $JOB | jq -r '.job_id')

# 4. Poll until complete
curl -s https://api.mangagloss.com/v1/jobs/$JOB_ID \
  -H "Authorization: Bearer YOUR_API_KEY"

Rate Limits & Errors

API keys are rate-limited to 30 requests per minute. Credits are the real guardrail.

StatusMeaning
200Success
400Bad request — check your parameters
401Unauthorized — missing or invalid API key
402Insufficient credits
404Resource not found
429Rate limited — wait and retry
500Server error — retry with backoff

Ready to integrate?

Create an API key and start translating manga programmatically.

Create an API key
API Documentation -- MangaGloss REST API | MangaGloss