Who can mint
- Active subscribers (
isPremium). - Purchase-backed in-app credit packs.
- Anyone with API ink (
apiPackCredits). - Free weekly credits alone cannot mint a key.
Docs
Sign in here as a human. Agents send Bearer mangii_sk_ to the generate endpoint. Generate spends API credits first, then packCredits after the account has ever purchased (later ad/referral grants on that pack pool also spend). Weekly credits do not spend.
isPremium).apiPackCredits).Each standard image costs 1 credit, HD costs 2. API credits spend first, then packCredits after the account has ever purchased. Later ad/referral grants on that pack pool also spend. Weekly credits do not spend. Failed generations refund the same pools.
Live host: https://api.mangii.ai/v1/stories. Authorization Bearer, not X-API-Key.
curl -X POST https://api.mangii.ai/v1/stories \
-H "Authorization: Bearer mangii_sk_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"prompt":"a fox priestess under neon rain","style_id":"classic_shonen","quality":"standard","async":false}'Paste this into Claude Code, Codex, Cursor, or any coding agent. It covers the endpoints plus the four rules agents get wrong unprompted: the style lock, first-panel-only reference images, idempotent retries, and what each error code means.
You can generate manga art through the Mangii API.
BASE https://api.mangii.ai
AUTH Authorization: Bearer YOUR_KEY (keys look like mangii_sk_...)
SPEC https://api.mangii.ai/openapi.json (public, no key)
MCP https://mcp.mangii.ai/mcp Authorization: Bearer YOUR_KEY
ENDPOINTS
POST /v1/stories create a story + its first panel
POST /v1/stories/{id}/panels continue the story
POST /v1/stories/{id}/panels/{panelId}/regenerate redraw one panel
POST /v1/images one-off image, no story
GET /v1/styles style catalog (use these ids)
GET /v1/credits remaining balance
GET /v1/stories, /v1/stories/{id}, /v1/stories/{id}/panels, /v1/jobs/{id}
MCP TOOLS
manga.create_story / manga.continue_story / manga.regenerate_panel
manga.list_stories to resume after compaction (same as GET /v1/stories)
manga.list_panels, manga.list_styles, manga.get_credits, manga.get_job, manga.buy_credits
RULES THAT BITE
- Art style locks after the first panel. Continue and regenerate reject style_id.
- Refs default to Image 1 = first panel (identity) and Image 2 = last distinct panel (scene).
- Change Image 1 with identity_panel_id or identity_image / reference_image (https URL or data URI).
- Change Image 2 with continuity_panel_id or continuity_image (https URL or data URI).
- Do not send a panel id and an image for the same slot. GET /v1/stories/{id}/panels for ids (ref_role).
- On MCP use manga.list_panels, then the same named fields on manga.continue_story.
- Send an Idempotency-Key header on every POST. Retrying with the same key
returns the original result instead of paying twice.
- MCP generate tools take idempotency_key the same way. Reuse it on retry.
- HTTP generate is async by default: 202 + job_id, then poll GET /v1/jobs/{id}.
Send "async": false to wait for image_url.
- MCP generate defaults async=false and returns image_url in one call. Set async=true only if you will poll manga.get_job.
COST
standard 1 / hd 2 / ultra 5 from spendableCredits (apiPack + packCredits after a purchase; later ad/referral grants on that pack also spend). Weekly never spends. Failed generations are refunded.
ERRORS
401 bad key - 402 out of credits or key budget - 409 idempotency_in_progress (retry the same key) or idempotency_conflict (pick a new key) - 422 blocked content or bad
request - 429 rate limit or daily cap - 503 try again with Retry-After.
Ask me for a key before your first call if MANGII_API_KEY is not already set.Add to your agent's MCP config, then set MANGII_API_KEY in your environment. The server speaks JSON-RPC at https://api.mangii.ai/mcp and takes the same Bearer key.
{
"mcpServers": {
"mangii": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://api.mangii.ai/mcp",
"--header",
"Authorization: Bearer ${MANGII_API_KEY}"
],
"env": {
"MANGII_API_KEY": "mangii_sk_..."
}
}
}
}Native Streamable HTTP (Claude/Cursor custom connector):
{
"url": "https://mcp.mangii.ai/mcp",
"headers": {
"Authorization": "Bearer ${MANGII_API_KEY}"
}
}https://api.mangii.aihttps://api.mangii.ai/openapi.json — public, no API key. Health probe: https://api.mangii.ai/v1/health (not /healthz — Google Frontend intercepts that path on the custom domain).https://api.mangii.ai and https://mcp.mangii.ai/mcp. Fallback: https://us-central1-mangii-app.cloudfunctions.net/headlessApi.Product facts for crawlers live on /llms.txt.
Open llms.txt