Retro Diffusion
API Reference v2

The Retro Diffusion API

Everything the site does, over HTTP: generate images, animations, tilesets, and low-poly 3D models, run edit tools, and manage custom styles — from scripts, game engines, pipelines, or AI agents. Written for humans and machines; agents should start with the machine-readable summary.

Sections
17
Styles
84
MCP tools
33
Edits from
$0.001
POST/v2/inferences
{
  "prompt": "A knight resting by a campfire in a forest clearing at night, fireflies",
  "prompt_style": "rd_lite__default",
  "width": 256,
  "height": 256,
  "seed": 77,
  "num_images": 1
}
  1. 202accepted · task_id returned
  2. pendingpoll every ~2 s
  3. runninggenerating on rd_lite
  4. succeededresult.base64_images[0]
A knight resting by a campfire, generated by RD Lite
That exact request produced this image.256 × 256$0.03
01 Base URL, keys, and the one header

Overview & Authentication

Base URLhttps://api.retrodiffusion.ai/v2
AuthenticationHeader X-RD-Token: YOUR_API_KEY on every request (keys start with rdpk-)
BillingSame prepaid USD balance as the website; charged per generation, refunded on failure. Plan usage also works here, at 2 jobs at once (see Plans on the API)
FormatsJSON in, JSON out; images travel as raw base64 strings (PNG, or GIF for animations)
V2 is the default for new integrations. It uses asynchronous generation admission and one stable error envelope. /v1 remains supported with no retirement plan. Existing callers can keep using it; see the v1 compatibility and migration guide.

Getting a key

  • Create keys on the Developer Tools page (up to 5 per account).
  • The full key is shown once at creation — store it safely. The page only shows the prefix afterwards. Revoke any time.
  • Treat keys like passwords: server-side env vars, never client-side code or public repos.
02 Copy one block, automate everything

For AI Agents & LLMs

Building with Claude, GPT, Cursor, or your own agent? The block below is a complete, verified summary of this API in plain text. Paste it into your agent's context, system prompt, or llms.txt — it contains everything needed to generate pixel art without reading the rest of this page.

llms.txt — machine-readable API summary
# Retro Diffusion API — context for AI agents (verified 2026-09)
Pixel art generation API: images, animations, tilesets and low-poly 3D models. Default base URL for new integrations: https://api.retrodiffusion.ai/v2
V1 remains supported with no retirement plan at https://api.retrodiffusion.ai/v1. V2 uses {"error":{"code":"...","message":"...","request_id":"..."}} for every JSON error, corrects authentication to 401 and insufficient balance to 402, and returns the same request ID in X-Request-ID. Never retry a failed paid request by falling back across versions.
Auth: send header "X-RD-Token: <key>" on every request. Keys start with "rdpk-".
Humans create keys at https://www.retrodiffusion.ai/app/devtools (max 5 per account).
Prefer MCP if available: https://mcp.retrodiffusion.ai/mcp (HTTP transport, header "Authorization: Bearer <key>").
MCP tools (33): create_inference, estimate_inference_cost (free), start_inference_job + get_inference_job (async jobs — recommended for animations and batches; success results carry hosted output_urls, not base64), list_inference_jobs, get_inference_result, list_available_styles, list_available_models, get_style_usage, list_edit_tools, run_edit_tool, estimate_edit_tool_cost (free), fix_pixel_art ($0.002 standard, $0.005 neural), create_user_style, update_user_style, delete_user_style, Low-Poly 3D: get_lowpoly_pricing, estimate_lowpoly_cost (free), start_lowpoly_generate, start_lowpoly_revise, start_lowpoly_animate (pass animation to change an existing one), start_lowpoly_split, start_lowpoly_rerig, get_lowpoly_job, get_lowpoly_model, list_lowpoly_models, export_lowpoly_model, recolor_lowpoly_model, delete_lowpoly_animation; authenticate, get_balance, get_service_status, logout. Tip: pass upload_outputs=true on create_inference to receive temporary signed URLs instead of base64 payloads.
MCP setup guides for every client (Claude Code + plugin, Cursor, VS Code, Windsurf, Claude Desktop) live at https://github.com/Retro-Diffusion/retro-diffusion-mcp.

## Generate images
POST /v2/inferences  (Content-Type: application/json)
Required fields: width (int), height (int), num_images (int; clamped to between 1 and the style's max_number_of_images, and you are charged for the clamped count). Send prompt_style to select a style. prompt defaults to an empty string and is required only when the selected style's prompt_requirement says so; image-driven styles may accept an empty prompt.
Optional fields: seed (int, reproducible), input_image (base64 PNG string, NO "data:image/png;base64," prefix, RGB without transparency) + strength (float 0-1, default 0.75 — how much to change the input), reference_images (array of base64, RD Core and RD Pro styles only, up to 9, guides style/content without redrawing), input_palette (base64, constrains output colors), remove_bg (bool, transparent output), tile_x / tile_y (bool, seamless tiling; not available on RD Core styles), frames_duration (int 4|6|8|10|12|16, animation styles), return_spritesheet (bool, animations: PNG spritesheet instead of GIF), upscale_output_factor (int, 1 = native pixel size), bypass_prompt_expansion (bool; leave it off (the default): it skips the prompt writer that turns your words into the captions each style was trained on, so results get clearly worse (off-style art, stray text in the image); only for prompts already written in that style's own caption format; never set it unless the user explicitly asks), include_downloadable_data (bool, extra structured assets e.g. item atlas JSON), check_cost (bool, FREE dry run: returns price immediately, generates nothing, charges nothing).
The "negative" field exists but is a placeholder — current models ignore it. Do not rely on it.
Size limits: the API validates 12x12 to 512x512, and each style enforces its own limits (RD Core styles reach 512x512; most others top out at 256 or 384) — use the per-style limits in the catalog below or from the selector.
Before a paid submission, persist a unique Idempotency-Key (1-256 visible ASCII characters). Reuse that key only with identical inputs when the admission response is uncertain. Once task_id is known, poll that task instead of submitting again. Do not send Idempotency-Key on check_cost requests or edit/pixel-fixer routes.

### Example: minimal request
POST /v2/inferences
Headers: X-RD-Token: <key>, Idempotency-Key: <persisted-generation-key>
{"prompt": "A knight resting by a campfire in a forest clearing at night", "prompt_style": "rd_core__default", "width": 128, "height": 128, "num_images": 1, "seed": 77}
### Example: accepted response
{"status":"accepted","task_id":"8d24e990-...","request_id":"8d24e990-...","message":"Inference accepted. Poll GET /v2/inferences/tasks/{task_id} for status."}
Poll the task until it succeeds, then read task.result. Its base64_images entries are raw base64 PNG (or GIF for animation styles). Every successful generation is retained privately for 24 hours. Add "upload_outputs": true to receive 15-minute signed URLs in "output_urls". Large results are returned as hosted output_urls with base64_images empty — always handle both fields. Refresh access during retention with GET /v2/inferences/requests/{request_id}; URL expiry never extends the 24-hour deadline.

### Example: image to image (RD Core; also how to convert an existing image into pixel art)
{"prompt": "The same scene in deep winter, snow covered", "prompt_style": "rd_core__default", "width": 128, "height": 128, "num_images": 1, "input_image": "<base64>"}
### Example: RD Core with reference images ($0.10/image, up to 512px, about 4x faster than RD Pro)
{"prompt": "The same goblin merchant, now sitting by a campfire counting gold coins", "prompt_style": "rd_core__default", "width": 256, "height": 256, "num_images": 1, "reference_images": ["<base64 of the original character>"]}
### Example: RD Pro with reference images (character/style consistency)
{"prompt": "The same goblin merchant, now sitting by a campfire counting gold coins", "prompt_style": "rd_pro__default", "width": 128, "height": 128, "num_images": 1, "reference_images": ["<base64 of the original character>"]}
### Example: advanced animation (animate an uploaded start frame; input_image REQUIRED; output is a GIF)
{"prompt": "Confident, steady steps", "prompt_style": "rd_advanced_animation__walking", "width": 64, "height": 64, "num_images": 1, "frames_duration": 8, "input_image": "<base64 start frame, match width/height>"}
### Example: 8 directional views of an uploaded sprite (input_image REQUIRED; prompt is an OPTIONAL subject hint; no frames_duration)
{"prompt": "", "prompt_style": "rd_advanced_animation__rotate", "width": 64, "height": 64, "num_images": 1, "input_image": "<base64 sprite, 32-256px, multiples of 8>", "remove_bg": true, "return_spritesheet": true}
### Example: advanced tileset (two textures)
{"prompt": "grey stones with gravel", "extra_prompt": "lush green grass", "prompt_style": "rd_tile__tileset_advanced", "width": 16, "height": 16, "num_images": 1}
### Example: free cost check (never charges)
{"prompt": "test", "prompt_style": "rd_core__default", "width": 256, "height": 256, "num_images": 2, "check_cost": true}
-> {"balance_cost": 0.2, "model": "check_cost", "base64_images": [], "remaining_balance": 100.75}

## Async jobs (the v2 generation contract)
POST /v2/inferences
-> {"status": "accepted", "task_id": "8d24e990-...", "request_id": "8d24e990-...", "message": "Inference accepted. Poll GET /v2/inferences/tasks/{task_id} for status."}
Poll GET /v2/inferences/tasks/{task_id} (same X-RD-Token) every ~2s:
-> {"status": "pending" | "running" | "succeeded" | "failed", "task_id": "...", "result": <generation response when succeeded>, "error": {"status_code": 502, "code": "inference_failed", "message": "...", "request_id": "..."} when failed}

## Retrieve a generation during the 24-hour output window
GET /v2/inferences/requests/{request_id} with X-RD-Token
-> status, safe request settings, billing result, public failure details, and freshly signed output URLs.
Any active personal key from the owning account may retrieve a request after key rotation. System-key requests require the same system key. Unknown, non-owned, and expired output objects never expose bucket names or object keys.

## Low-Poly 3D models (async; base /v2/lowpoly)
Real low-poly 3D models with pixel-art textures from a prompt (<=250 chars) and/or up to 4 reference_images (base64). size: 16|32|64|128|256|"auto" (auto reads the prompt; image-only defaults to 64). style: rd_lowpoly__detailed (default) | rd_lowpoly__blocky (boxes only) | rd_lowpoly__detailed_lite | rd_lowpoly__blocky_lite (Lite: a lighter model, simpler results, $0.10 per model at any size and $0.08 per revise/animate/split/re-rig of a Lite model; GET /lowpoly/pricing lists each style's prices).
Prices by size 16/32/64/128/256 - generate $0.25/$0.50/$0.85/$1.20/$3.00, revise $0.20/$0.35/$0.65/$0.90/$1.50, animate $0.15/$0.25/$0.35/$0.50/$1.00, split and re-rig $0.10/$0.10/$0.15/$0.20/$0.25 each; the first animation rigs the model free; estimates, reads and exports are free; failed jobs refund automatically.
POST /lowpoly/generate {prompt?, size?, style?, reference_images?, reference_models? (asset_ids of your own finished models, placed exactly or adapted; images+models <= 4), input_palette? (palette image: the model uses only its colors; revisions/animations keep them), custom_id?} -> 202 {task_id, asset_id, cost, size}. POST /lowpoly/assets/{asset_id}/revise {prompt, version?, reference_images?} saves a new version. POST /lowpoly/assets/{asset_id}/animate {prompt, version?, animation?} adds an animation to that version; with animation set to an existing animation's name it changes that animation instead (same price, keeps its name; unknown name -> 404 lowpoly_animation_not_found). Poll GET /lowpoly/tasks/{task_id} every 10-20 s (jobs take 1-5 min, up to ~15 at 256): succeeded -> result {asset_id, versions:[{number, render_url, turntable_url, animations, stats}]}, plus animation (the added or changed one).
POST /lowpoly/assets/{asset_id}/export {target, version?, animation?} -> {url, filename}: godot|unity|unreal|web|blender (.glb), blockbench (.bbmodel), obj (zip), minecraft (resource pack), atlas, turntable, axis_views (zip of 6 PNGs seen along +X/-X/+Y/-Y/+Z/-Z: orthographic, 1 px per texel, no antialiasing, texture colors), gif|sheet|mp4 (pass animation; gif/sheet without one = every animation in one zip; mp4 = 1024px H.264 video). glb and bbmodel include the rig and every animation. GET /lowpoly/pricing, POST /lowpoly/estimate, GET /lowpoly/assets, GET /lowpoly/assets/{asset_id}, DELETE /lowpoly/assets/{asset_id}.
POST /lowpoly/assets/{asset_id}/rerig {prompt?, version?} rebuilds a rigged version's skeleton in place (prompt optional: 'give the tail three bones'); animations whose bones the new rig still has are kept; an unrigged version -> 409 lowpoly_not_rigged (its first animation rigs it free).
POST /lowpoly/assets/{asset_id}/split {prompt?, version?} breaks the model into separate models, one per object (prompt optional: 'only the books', 'each drawer too'); each piece is a new model and history item facing the front, with its own atlas, rig and animations (free); the original is unchanged; the succeeded task lists them in pieces [model, ...]; a single object -> lowpoly_split_failed (refunded).
POST /lowpoly/assets/{asset_id}/recolor {tool: color_reducer|palette_converter|color_style_transfer, version?, color_count?, dither_mode?, dither_strength?, palette_image?, reference_image?} -> the model with a new version (the image canvas's color tools on the texture atlas; reducer and converter $0.001, style transfer $0.01; later revisions and animations keep the colors).
DELETE /lowpoly/assets/{asset_id}/versions/{number}/animations/{name} -> the model: deletes one animation from that version (free); the rig stays, so animating again needs no new rig.
Example: POST /v2/lowpoly/generate {"prompt":"a cute corgi wearing sunglasses","size":"auto"} (X-RD-Token + Idempotency-Key) -> poll task -> POST /v2/lowpoly/assets/{asset_id}/animate {"prompt":"rocks out to music"} -> poll (task.animation = its name) -> POST /v2/lowpoly/assets/{asset_id}/export {"target":"godot"} and {"target":"mp4","animation":"<name>"}.
Example (reference images, blocky): POST /v2/lowpoly/generate {"reference_images":["data:image/png;base64,..."],"style":"rd_lowpoly__blocky","size":64} -> export {"target":"blockbench"} / {"target":"minecraft"}.

## Choosing a style (follow this order)
For still images, default to RD Lite (rd_lite__*): the same styles as RD Core at half the price ($0.05) and about 3x faster (about 6 seconds), 12-512px, one reference image. Use RD Core (rd_core__*, same style names) when the request is a complex, busy scene, needs more than one reference image, or RD Lite's result was not good enough, and for inventory item grids. Pick the style the same way on both: rd_core__isometric / __topdown / __platformer for those perspectives, __fantasy / __horror / __scifi for those genres, __painterly or __simple for those looks, __inventory_items for item grids, __spritesheet for sheets of assets, __dungeon_map, __hexagonal_tiles, __fps_weapon, __typography and __ui_panel for those exact jobs, and rd_core__default for everything else.
Image to image (a new image from an existing one, including converting an image into pixel art) also uses RD Core: send the source as input_image on an rd_core__* style. It is more accurate and more capable than the other models' img2img.
To change an existing image (add, remove or alter something, fill a masked area, extend the canvas, repair a tiling seam), use the edit tools below (image_edit, inpainting, outpainting, seam_tiling; $0.12, run on RD Core), never a new generation or rd_pro__edit.
Use another model only when RD Lite and RD Core can't do the job: RD Pro (rd_pro__*) when the user explicitly asks for the highest quality and complexity; RD Pro, Plus or Fast for seamless tiling at generation time (tile_x/tile_y; RD Lite and RD Core have none); RD Fast (API only) for batches over 4 or its 1-bit and Minecraft styles; rd_tile__* for tilesets; animation styles for motion. Use RD Plus and rd_animation__* only when the user names them.

## Style catalog (public styles)
RD Lite (recommended for most stills; the RD Core styles on a lighter model: $0.05/image flat at any size; about 6 seconds per image; 12-512px in any aspect ratio, e.g. 480x270; reference_images up to 1; batch<=4; no tiling; remove_bg on most styles): rd_lite__default, rd_lite__painterly, rd_lite__simple, rd_lite__fantasy, rd_lite__horror, rd_lite__scifi, rd_lite__isometric, rd_lite__topdown, rd_lite__platformer, rd_lite__dungeon_map, rd_lite__spritesheet, rd_lite__hexagonal_tiles, rd_lite__fps_weapon, rd_lite__typography, rd_lite__ui_panel (same names and size limits as rd_core__*, up to 512px; no inventory_items yet).
RD Core (about 90% of RD Pro quality at $0.10/image flat at any size; better than RD Lite for complex scenes; about 15-20 seconds per image; any aspect ratio, e.g. 480x270; reference_images up to 9; batch<=4; no tiling; remove_bg on most styles): rd_core__default, rd_core__painterly, rd_core__simple, rd_core__fantasy, rd_core__horror, rd_core__scifi, rd_core__isometric, rd_core__topdown, rd_core__platformer — all (12-512px, strong perspective consistency in isometric/topdown/platformer); rd_core__dungeon_map, rd_core__spritesheet, rd_core__hexagonal_tiles, rd_core__inventory_items (128-512px); rd_core__fps_weapon, rd_core__typography (64-512px); rd_core__ui_panel (256x256 only).
RD Pro (highest quality, supports reference_images, $0.18/image): rd_pro__default, rd_pro__painterly, rd_pro__fantasy, rd_pro__horror, rd_pro__scifi, rd_pro__simple, rd_pro__isometric, rd_pro__topdown, rd_pro__platformer — all (12-256px, batch<=16, refs<=9); rd_pro__dungeon_map, rd_pro__spritesheet, rd_pro__fps_weapon, rd_pro__typography (64-256px, batch<=4, refs<=9); rd_pro__hexagonal_tiles, rd_pro__ui_panel, rd_pro__inventory_items (256x256 only, batch<=4, refs<=9); rd_pro__pixelate (16-256px, batch<=16, refs<=9, INPUT_IMAGE_REQUIRED); rd_pro__edit (64-256px, batch<=4, refs<=9, INPUT_IMAGE_REQUIRED).
RD Plus (API and MCP only — retired from the website, prices unchanged; RD Core is the successor for most uses): rd_plus__default, rd_plus__retro, rd_plus__watercolor, rd_plus__textured, rd_plus__cartoon, rd_plus__ui_element, rd_plus__item_sheet, rd_plus__character_turnaround, rd_plus__environment, rd_plus__isometric, rd_plus__isometric_asset, rd_plus__topdown_map, rd_plus__topdown_asset — all (64-384px, batch<=16); rd_plus__classic, rd_plus__skill_icon (32-192px); rd_plus__low_res, rd_plus__mc_item, rd_plus__mc_texture (16-128px); rd_plus__topdown_item (16-96px).
RD Fast (API and MCP only — replaced by RD Lite on the website, prices unchanged; RD Lite is sharper and follows prompts better): rd_fast__default (batch<=15), rd_fast__simple, rd_fast__detailed, rd_fast__retro, rd_fast__game_asset, rd_fast__portrait, rd_fast__texture, rd_fast__ui, rd_fast__item_sheet, rd_fast__character_turnaround, rd_fast__no_style, rd_fast__1_bit — all (64-384px, batch<=16); rd_fast__low_res, rd_fast__mc_item, rd_fast__mc_texture (16-128px). (The selector may return internal ids like "default:rd_flux" for these — both forms are accepted.)
RD Mini (aliases routing to Plus/Fast low-res; response "model" shows the routed model): rd_mini__classic, rd_mini__skill_icon (32-192px); rd_mini__low_res, rd_mini__mc_item, rd_mini__mc_texture, rd_mini__fast_low_res, rd_mini__fast_mc_item, rd_mini__fast_mc_texture (16-128px); rd_mini__topdown_item (16-96px) — all batch<=16.
Advanced animations (INPUT_IMAGE_REQUIRED, 32-256px matching your start frame, batch=1, frames_duration supported, GIF output): rd_advanced_animation__walking, __idle, __jump, __crouch, __attack, __destroy, __custom_action (describe any motion), __subtle_motion (ambient scene motion), __rotate (the other 7 directional views of the uploaded subject, not motion: prompt OPTIONAL subject hint, size a multiple of 8, remove_bg/input_palette supported, frames_duration ignored; GIF of 8 views by default, return_spritesheet=true gives a 3x3 PNG sheet with an empty center where every view faces the center: top=front, bottom=back, left/right=sides, corners=diagonals — same layout and frame order as rd_animation__8_dir_rotation; cost 0.10).
Animations (API and MCP only — retired from the website, prices unchanged; on the site use Advanced Animations; prompt-driven, GIF output, batch=1 unless noted): rd_animation__four_angle_walking (48x48), rd_animation__four_angle_walking_idle (48x48), rd_animation__small_sprites (32x32, batch<=16), rd_animation__vfx (24-96px square), rd_animation__any_animation (64x64, refs<=9), rd_animation__big_animation (128x128, refs<=9), rd_animation__8_dir_rotation (80x80, refs<=5), rd_animation__battle_sprites (64x64).
Tilesets: rd_tile__tileset (16-32px tile, batch=1), rd_tile__tileset_advanced (16-32px, batch=1, extra_prompt + extra_input_image), rd_tile__single_tile (16-64px), rd_tile__tile_variation (16-128px, INPUT_IMAGE_REQUIRED), rd_tile__tile_object (16-96px), rd_tile__scene_object (64-384px).
User styles: user__<name>_<id> (created via /v2/styles or the My Styles page).
Live discovery: GET /v2/styles/selector (optional ?model=rd_lite|rd_core|rd_pro|rd_fast|rd_plus|rd_mini, ?tab=tab:image|tab:animation|tab:advanced-animation|tab:tileset). Each item: {"prompt_style", "name", "description", "required_model", "required_tab", "min_width", "max_width", "min_height", "max_height", "max_number_of_images", "require_input_image", "prompt_requirement", "supports_frames_duration", "supports_reference_images", "example_prompt"}.

## Costs (USD per request; verify with check_cost — it is free)
Image styles are flat per image at any size: rd_fast (and rd_mini__fast_*): 0.03 * num_images; rd_plus and rd_mini: 0.06 * num_images; rd_tile__single_tile, __tile_variation, __tile_object, __scene_object: 0.06 * num_images; rd_lite: 0.05 * num_images (flat at any size); rd_core: 0.10 * num_images (flat at any size); rd_pro: 0.18 * num_images (fps_weapon: 0.25); rd_advanced_animation: 0.14 (custom_action and subtle_motion: 0.25; rotate: 0.10); rd_animation: 0.07 (any_animation, big_animation and 8_dir_rotation: 0.25); rd_tile__tileset(_advanced): 0.10.
GET /v2/inferences/credits -> {"credits": 0, "balance": 100.75}. Balance is prepaid USD; charged before generation, auto-refunded on failure. Invalid token on this endpoint -> 401 invalid_token.
Plans and the API: plan usage works on the API and MCP, but at a slower rate than balance. A plan runs 2 API/MCP jobs at once (the website gets 5). A 3rd job started while 2 plan jobs are running is paid from balance (warning plan_concurrency_balance); with no balance it waits for a slot instead (async task status waiting_for_plan_slot; a sync request waits up to 60 s, then 429 plan_slots_busy with Retry-After). Jobs paid from balance are not limited by plan slots, so for high-throughput pipelines keep balance topped up alongside a plan. Order: plan usage first, then balance (free daily usage is website-only and never used by the API). Paid responses include "billing": {"source": "plan"|"balance", "reason", "plan_jobs_running", "plan_job_limit", "plan_usage_left_pct", "balance_charged", "balance_left"}, optional "warnings", and headers X-RD-Billing-Source, X-RD-Billing-Reason, X-RD-Plan-Jobs ("running/limit"). GET /usage shows plan usage left and slots in use.

## Canvas edit tools (the way to change an existing image; image_edit, inpainting, outpainting and seam_tiling run on RD Core; canonical fields use snake_case)
GET /v2/edit/tools -> enabled tool list with balance_cost, credit_cost, is_free, requires_minimum_balance, max_input_size, and api_fields (authoritative; exposed tools may vary). The older "fields" property describes the web canvas UI — API clients should use api_fields.
POST /v2/edit/tools/{tool_id} -> run a tool (holds the connection until done). POST /v2/edit/tools/{tool_id}/estimate -> validate and estimate without running -> {"tool_id", "balance_cost", "credit_cost", "estimate_seconds"}.
ASYNC EDIT TASKS: POST /v2/edit/tools/{tool_id}/tasks (same body) -> 202 {"status": "accepted", "task_id", "request_id", "message"}; poll GET /v2/edit/tasks/{task_id} -> {status: pending|running|succeeded|failed, task_id, created_at, updated_at, result?, error?}. result matches the sync response, and the image is always in output_urls. Use tasks when your HTTP timeout is under ~60 s or for inpainting/outpainting/image_edit (5-30 s). A dropped sync request still runs and is charged. Input and balance errors return 4xx before queuing. On the task endpoint custom_id is an idempotency key: resubmitting the same custom_id returns the original task_id with no second charge.
Every request requires input_image (raw base64 or data:image/...;base64 data URI) and accepts an optional custom_id for correlating runs with your queue (not an idempotency key on the sync run endpoint). Tools: image_edit ($0.12; prompt required, seed?; input <=256px), inpainting ($0.12; mask_image + prompt required, seed?, soft_inpaint?), outpainting ($0.12; expand_left/expand_right/expand_top/expand_bottom with at least one positive, prompt?, seed?, soft_inpaint?), seam_tiling ($0.12; tile_x?, tile_y? — at least one true, seam_width?, repair_window_size?, seed?), background_remover ($0.01; transparency_threshold?, force_solid_pixels?), color_style_transfer ($0.01; extra_input_image required), color_reducer ($0.001; color_count?, dither_mode?, dither_strength?), palette_converter ($0.001; input_palette required, dither_mode?, dither_strength?), k_centroid_downscale ($0.001; width + height required), pixel_correction ($0.001; no extra fields), rotate ($0.001; rotation_degrees?). The $0.001 tools charge animated inputs per frame. Every tool charges before running and auto-refunds on failure; insufficient balance -> 402 not_enough_balance (v1: 400).
Inpainting: POST /v2/edit/tools/inpainting, not /v2/inferences. Use a static input up to 256x256 and a same-size mask. Recommended mask format is RGBA PNG: alpha 0 protects a pixel; alpha >12 selects it for replacement (the visible mask color does not matter). A grayscale mask is also accepted: black protects and values >12 select. Do not send an ordinary fully opaque RGB/RGBA image as the mask because its generated alpha channel selects the whole image. soft_inpaint=false strictly restores pixels outside the selected mask; soft_inpaint=true may accept a bounded transition ring immediately outside it. Output can be in base64_images or output_urls.
dither_mode: none | bayer_2x2 | bayer_4x4 | bayer_8x8; dither_strength 0-10 (0 disables, default 5; values above 10 are treated as the deprecated 0-100 scale and divided by 10). Animated GIF input is supported by color_reducer, palette_converter, color_style_transfer, and k_centroid_downscale only; other tools accept static images.
### Example
POST /v2/edit/tools/background_remover  {"input_image": "<base64>"}
-> {"tool_id": "background_remover", "inference_id": "...", "base64_images": ["<base64>"], "output_urls": [], "balance_cost": 0.01, "credit_cost": null, "charged": true, "remaining_balance": 100.74}
RESULT DELIVERY — DO NOT ASSUME INLINE BASE64: the result arrives in base64_images OR output_urls. image_edit, inpainting, and outpainting normally return base64_images EMPTY and deliver the image only as a hosted URL in output_urls — download it; the other tools return inline base64 (as in the example above). Code that only reads base64_images[0] silently loses those tools' results while still being charged. Always check base64_images first, then fall back to fetching output_urls[0]. Chain tools by feeding the first base64_images item, or a base64-encoded fetched output_urls item, into the next call as input_image. Deprecated camelCase response fields remain available for existing clients; new integrations should read the snake_case fields.
Errors use the canonical v2 envelope {"error":{"code":"...","message":"...","request_id":"..."}}. Preserve X-Request-ID and Retry-After, and branch on code rather than message.

## Pixel Fixer (native-grid reconstruction; $0.002 standard, $0.005 neural)
POST /v2/pixel-fixer/standard {"input_image":"<raw base64 PNG/JPEG/WebP or data URI>"} or {"image_url":"<public HTTPS PNG/JPEG/WebP>"}
POST /v2/pixel-fixer/neural (same image source plus "width"?:positive int,"height"?:positive int)
Provide exactly one of input_image or image_url. Both endpoints return exactly {"base64_images":["<raw base64 PNG>"]}. Standard costs $0.002 per call and Neural $0.005, charged before running and auto-refunded on failure; insufficient balance -> 402 not_enough_balance (v1: 400). Tokens belonging to accounts with a completed purchase receive 120 requests/minute; other tokens receive 10. The allowance is shared across Standard and Neural. Standard uses native Rust grid detection and accepts decoded sources from 16x16 through 16 megapixels. Neural uses neural reconstruction, accepts larger source dimensions, and proportionally bilinear-downscales sources above its 1-megapixel working budget; optional width/height set its target output size, capped at 16 megapixels. Serialized request JSON is limited to 900000 bytes; successful response JSON is limited to 950000 bytes. Public HTTPS URL downloads are limited to 20MB and bypass the ALB request-body limit, but not the response limit. Unknown fields are rejected. Pixel Fixer error codes: not_enough_balance (402; v1: 400), pixel_fixer_request_too_large (413), pixel_fixer_output_too_large (413), invalid_pixel_fixer_image (422), pixel_fixer_rate_limit_exceeded (429), pixel_fixer_failed (500).

## Custom styles (RD Pro reference-image template)
POST /v2/styles  {"name": "My Style" (required), "reference_images": ["<base64>"] (exactly 1, required), "description"?, "style_icon"? (e.g. "sparkles"), "reference_caption"?, "apply_prompt_fixer"? (default true), "llm_instructions"?, "user_prompt_template"? (must contain the token {prompt}), "force_palette"? (bool), "force_bg_removal"? (bool), "min_width"? + "min_height"? (both together, 64-256)}
-> 201 {"id": "...", "prompt_style": "user__my_style_1a2b3c4d", "name": "...", "type": "user"} — use prompt_style in /v2/inferences.
PATCH /v2/styles/{style_id} (same fields, all optional). DELETE /v2/styles/{style_id} -> {"deleted": true}. Non-template fields are rejected.

## Assistant sessions (beta — conversational generation with plan approval; base /v1/assistant)
Describe the goal in plain language; the assistant picks styles/sizes/settings, proposes a PRICED plan, and only generates after approval. It makes 2D pixel art by default and Low-Poly 3D models only when the message asks for 3D ("3D model", "low poly", "for Blender/Godot/Unity").
Pricing: $0.01 per message (auto-refunded if the turn fails); decisions free; approved plans bill each step at standard rates (3D steps at Low-Poly prices); failed steps auto-refund. 30 messages+decisions/min per key.
POST /sessions -> {id, expires_at} (5 minutes idle; POST /sessions/{id}/keepalive is a free ping). POST /sessions/{id}/messages {message, images?} -> 202 {turn_id}. Poll GET /sessions/{id}/turns/{turn_id} every ~2s; events: message, status, plan, plan_status, image {ref, url, format png|gif}, asset3d {ref, url (render), scene_url, asset_id, version, operation, animations, animation, size, style, cost}, note, error. POST /sessions/{id}/decision {decision: approve|deny, feedback?}.
Plan steps: kind generate|edit|lowpoly; lowpoly steps carry operation generate|revise|animate|split, and animate steps may name an existing animation to change; a split step's prompt is optional and every piece enters the bank as its own 3d ref. 3D models made in the session stay in its bank (format "3d") so later messages can revise, animate or split them.

## Status & errors
GET /v2/status (no auth) -> {"status": {"rd_fast": "ok", "rd_pro": "ok", "rd_plus": "ok", "animations": "ok", "background_removal": "ok"}, "updated_at": 1789681864}. updated_at is Unix seconds. Check before bulk runs.
V1 error shapes (handle all): {"detail": {"code": "inference_failed", "message": "Unable to run inference."}}, {"detail": [{"msg": "Not enough balance."}]}, and {"detail": "Not Found"}.
V2 error shape: {"error":{"code":"inference_failed","message":"Unable to run inference.","request_id":"..."}}. Validation may add safe details.issues. Preserve X-Request-ID and Retry-After. Branch on code, never message.
V1 status compatibility: 400 may mean invalid input or insufficient balance; auth and provider failures also have historical status differences.
V2 status semantics: 400 semantic input; 401 invalid credentials; 402 insufficient balance; 403 permission; 404 concealed/missing; 409 conflict; 413 size; 422 schema; 429 rate limit; 500 unexpected; 502 provider failure; 503 unavailable; 504 timeout.
V2 generation failure codes (on failed tasks too; always refunded): inference_failed (502, generation failed; retry once with identical parameters), provider_busy (503, animation provider overloaded, job rejected before it started; retry after a few minutes — rd_advanced_animation__rotate has no alternate provider so it sees this most), provider_timeout (504, animation took too long and was cancelled; retry), request_timeout (504, execution deadline exceeded; retry).

## Agent best practices
1) Pick a prompt_style by the order in "Choosing a style" — RD Core first for stills (GET /v2/styles/selector for live limits). 2) POST with "check_cost": true to verify price — free and immediate. 3) Persist an Idempotency-Key, submit once logically, and reuse that key only to recover an uncertain admission of identical inputs. 4) Poll the returned task until succeeded or failed. 5) Reuse the same seed to iterate on a composition; change only the prompt. 6) Base64 images are raw strings — never include a data: URI prefix. 7) Prompts describe the subject; the style handles pixel-art rendering. 8) For a consistent character across images, generate once with RD Core or RD Pro, then pass that output as reference_images in follow-up requests.
Agents with MCP support should connect to the MCP server instead — it exposes typed tools (create_inference, list_available_styles, estimate_inference_cost, …) with built-in guidance, so agents don't need to hand-build HTTP requests at all.
03 First image in five minutes

Quick Start

  1. Create an API key at Developer Tools.
  2. Make sure your account has balance (each response tells you what's left).
  3. Send a request:
import base64
import time
import uuid
import requests

url = "https://api.retrodiffusion.ai/v2/inferences"
idempotency_key = str(uuid.uuid4())  # persist before POST; reuse only with identical inputs
print("Save this admission key until task_id is received:", idempotency_key)
headers = {"X-RD-Token": "YOUR_API_KEY", "Idempotency-Key": idempotency_key}
payload = {
    "prompt": "A knight resting by a campfire in a forest clearing at night, fireflies",
    "prompt_style": "rd_lite__default",
    "width": 128,
    "height": 128,
    "num_images": 1,
}

start = requests.post(url, headers=headers, json=payload)
start.raise_for_status()
task_id = start.json()["task_id"]

while True:
    response = requests.get(f"{url}/tasks/{task_id}", headers=headers)
    response.raise_for_status()
    task = response.json()
    if task["status"] in ("pending", "running"):
        time.sleep(2)
        continue
    if task["status"] == "failed":
        error = task["error"]
        raise RuntimeError(f"{error['code']} (request {error['request_id']})")
    data = task["result"]
    break

for i, image in enumerate(data["base64_images"]):
    with open(f"output_{i}.png", "wb") as f:
        f.write(base64.b64decode(image))

print(f"Cost: ${data['balance_cost']}  Remaining: ${data['remaining_balance']}")

That exact request produced this image:

API quick start output
rd_lite__default, 128×128, $0.05
Making 3D? Low-poly 3D models with pixel-art textures, animations and engine exports have their own endpoints: .
04 Pixel art, now in 3D

Low-Poly 3D Models

Turn a prompt (up to 250 characters), up to 4 reference images, or both into a real low-poly 3D model with hand-painted pixel-art textures: every texture pixel is the same size on every face, so it reads as pixel art from any angle. Revise it, animate it (rigging is automatic and free), change its animations, and export it for Godot, Unity, Unreal, three.js, Blender, Blockbench or Minecraft. Base URL https://api.retrodiffusion.ai/v2/lowpoly, same X-RD-Token header. Jobs take a few minutes, so every paid call returns 202 with a task_id to poll.

Corgi in sunglasses · rock_out
Corgi in sunglasses · rock_out
Crow character · dance
Crow character · dance
Alien brute · fireball_throw
Alien brute · fireball_throw
Sports car · drive
Sports car · drive
Stone ruin · crystal_float
Stone ruin · crystal_float
Swamp hut · roof_lift
Swamp hut · roof_lift

Quick start

Build a model, animate it, and download it for an engine and as a video:

import time
import uuid
import requests

API = "https://api.retrodiffusion.ai/v2/lowpoly"
HEADERS = {"X-RD-Token": "YOUR_API_KEY"}

def paid(path, body):
    # A fresh key per call; persist it and reuse it only to retry that same call (never charges twice).
    headers = {**HEADERS, "Idempotency-Key": str(uuid.uuid4())}
    response = requests.post(f"{API}{path}", headers=headers, json=body)
    response.raise_for_status()
    return response.json()

def wait(task_id):
    while True:  # jobs usually take 1-5 minutes (up to ~15 at size 256)
        task = requests.get(f"{API}/tasks/{task_id}", headers=HEADERS).json()
        if task["status"] == "succeeded":
            return task
        if task["status"] == "failed":
            raise RuntimeError(task["error"])  # failed jobs are refunded
        time.sleep(15)

# 1) Build a model. "auto" picks the size from the prompt (a coin is small, a castle is large).
job = paid("/generate", {"prompt": "a cute corgi wearing sunglasses", "size": "auto"})
model = wait(job["task_id"])["result"]
asset_id = model["asset_id"]
print(model["versions"][-1]["render_url"])  # a preview render; turntable_url has 4 views

# 2) Animate it. The first animation rigs the model, for free.
anim = wait(paid(f"/assets/{asset_id}/animate", {"prompt": "rocks out to music"})["task_id"])["animation"]

# 3) Export (free). The .glb carries every animation; mp4 is a 1024px video of one.
for body in ({"target": "godot"}, {"target": "mp4", "animation": anim}):
    file = requests.post(f"{API}/assets/{asset_id}/export", headers=HEADERS, json=body).json()
    print(file["filename"], file["url"])

Endpoints

POST /generateNew model: prompt?, size? (16|32|64|128|256|"auto"), style? (rd_lowpoly__detailed, rd_lowpoly__blocky, or their Lite versions rd_lowpoly__detailed_lite / rd_lowpoly__blocky_lite: a lighter model, $0.10 per model at any size and $0.08 per edit or animation of it), reference_images?, reference_models? (asset ids of your own models, built in exactly or adapted), input_palette? (a palette image: the model uses only its colors)
POST /assets/{asset_id}/reviseChange the model from a prompt (and optional reference images); saves a new version
POST /assets/{asset_id}/animateAdd an animation to a version (the first one rigs the model for free). Send animation with an existing animation's name to change that animation instead; it keeps its name and costs the same.
POST /assets/{asset_id}/rerigRebuild a rigged version's skeleton in place (the prompt is optional); animations whose bones remain are kept
POST /assets/{asset_id}/splitBreak a model into separate models, one per object (the prompt is optional). Each piece is a new model facing the front, with its own textures, rig and animations; the task lists them in pieces.
GET /tasks/{task_id}Poll every 10–20 s: pending → running → succeeded (with the model in result) or failed (refunded)
POST /assets/{asset_id}/exportFree download URL: godot, unity, unreal, web, blender (.glb), blockbench, obj, minecraft, atlas, turntable, axis_views, gif/sheet/mp4 (need an animation; mp4 is a 1024px video). The .glb and .bbmodel files include every animation.
DELETE /assets/{asset_id}/versions/{number}/animations/{name}Delete one animation from a version (free); the rig stays
POST /assets/{asset_id}/recolorThe image color tools on the model's textures, saved as a new version: color_reducer (color_count, dithering), palette_converter (palette_image, dithering) and color_style_transfer (reference_image, $0.01)
GET /pricing, POST /estimate, GET /assetsFree: prices, styles and limits; cost estimates; your models

More requests

Reference images and the blocky style, revisions, changing an animation, and free price checks:

python
# From reference images (several views of one object work best), in the blocky style:
# boxes only, tilted where needed - it maps 1:1 onto Blockbench and Minecraft.
paid("/generate", {"reference_images": [front_b64, side_b64], "style": "rd_lowpoly__blocky", "size": 64})

# Revise: saves a new version (the old ones stay; "version" picks which one to change).
paid(f"/assets/{asset_id}/revise", {"prompt": "make the roof red and add a chimney"})

# Change an existing animation instead of adding one: send its name. Same price, keeps the name.
paid(f"/assets/{asset_id}/animate", {"prompt": "slower, with a bigger jump", "animation": "hop"})

# Blockbench project + Minecraft Java resource pack (free)
for target in ("blockbench", "minecraft"):
    requests.post(f"{API}/assets/{asset_id}/export", headers=HEADERS, json={"target": target})

# Free price check before anything paid
requests.post(f"{API}/estimate", headers=HEADERS, json={"operation": "generate", "prompt": "a castle", "size": "auto"})
# -> {"operation": "generate", "size": 128, "size_source": "auto", "cost": 1.2}

Sizes and prices

Size is the model's largest dimension in texels; auto picks it from the prompt. Estimates, reads and exports are free, and failed jobs are refunded.

SizeGenerateReviseAnimate
16$0.25$0.20$0.15
32$0.50$0.35$0.25
64$0.85$0.65$0.35
128$1.20$0.90$0.50
256$3.00$1.50$1.00

Exports

godot, unity, unreal, web, blender.glb (glTF 2.0) with a bone hierarchy and every animation
blockbench.bbmodel project with bone groups and every animation
minecraftJava resource pack (best with the blocky style)
obj, atlas, turntable, axis_viewsOBJ + MTL + texture zip, the texture atlas, an 8-view turntable sheet, a zip of 6 pixel-exact PNGs seen along each axis (1 px per texel, no antialiasing)
gif, sheet, mp4One animation (send animation) as a GIF, a sprite sheet, or a 1024px H.264 video; GIF and sheet without animation return every animation in one zip

Runnable clients: 13_lowpoly_model.py, 14_lowpoly_from_references.py and lowpoly_model.mjs. The full guide, with response shapes and error codes, is LOW_POLY.md.

05 The core endpoint

Generating Images

POST /v2/inferences — one endpoint for all models, styles, animations, and tilesets. Real generation requests return an accepted task immediately; poll it for the result. A free check_cost request returns immediately.

Request fields

FieldTypeNotes
promptstringDefaults to an empty string. Describe the subject when the selected style's prompt_requirement is required; image-driven styles may make it optional. Never write "pixel art"; the style handles that.
prompt_stylestringStyle id (rd_lite__default, rd_core__isometric, user__..., …). Discover ids with the selector endpoint below.
width, heightintRequired. The API validates 12–512 px, but each style enforces tighter limits — RD Core styles go up to 512 px in any aspect ratio, most others top out at 256 or 384 px, and several RD Core and RD Pro styles go down to 12 px. Check the selector or the explorer below.
num_imagesintRequired. Batch size: up to 16 for most styles (including the 12px-capable RD Pro styles), 4 for RD Core and other RD Pro styles, 1 for animations.
seedintOptional. Same seed + same settings ≈ same image. Omit for random.
input_image, strengthbase64, floatimg2img starting image + how much to change it (0–1, default 0.75). See Images In.
reference_imagesbase64[]RD Core and RD Pro styles only: up to 9 style/content references.
input_palettebase64Palette image; output colors are constrained to it. Add return_pre_palette: true to also get the un-quantized image.
remove_bgboolTransparent output. Add return_non_bg_removed: true to also get the original.
tile_x, tile_yboolSeamless tiling on either axis (textures, backgrounds).
frames_durationintAnimation styles: 4, 6, 8, 10, 12, or 16 frames. Ignored by rd_advanced_animation__rotate (always 8 views).
return_spritesheetboolAnimations: return a PNG spritesheet instead of a GIF.
upscale_output_factorint1 (default) = native pixel size; higher values return nearest-neighbor upscaled PNGs.
bypass_prompt_expansionboolLeave it off (the default). It skips the prompt writer that turns your words into the captions each style was trained on, so results get clearly worse: off-style art and stray text in the image. Only for prompts already written in the style's own caption format.
include_downloadable_databoolInclude structured extras when a style produces them (e.g. rd_pro__inventory_items returns an item-atlas JSON with sprite positions and names).
check_costboolFree dry run — returns the price, generates nothing, charges nothing.
asyncboolAccepted for v1 compatibility. V2 always queues real generation work. See Async Jobs.
A negative field is accepted for forward compatibility, but it is a placeholder — no current model uses it. Describe what you want in prompt instead.

Accepted response

json
{
  "status": "accepted",
  "task_id": "8d24e990-6a2f-4c5e-a804-b916c02d0db2",
  "request_id": "8d24e990-6a2f-4c5e-a804-b916c02d0db2",
  "message": "Inference accepted. Poll GET /v2/inferences/tasks/{task_id} for status."
}

Completed task result

json
{
  "created_at": 1783523045,
  "balance_cost": 0.05,
  "base64_images": ["iVBORw0KGgoAAA..."],
  "model": "rd_lite",
  "remaining_balance": 100.75,
  "request_id": "8d24e990-6a2f-4c5e-a804-b916c02d0db2",
  "outputs_retained_until": 1783609445
}
  • base64_images — PNGs (or GIFs for animations) as raw base64. Fields with null values are omitted from responses.
  • Set upload_outputs: true to also receive 15-minute signed output_urls. Inline base64 remains available for backward compatibility.
  • Every successful generation includes a request_id and retains its outputs privately for exactly 24 hours. URL expiry never extends that deadline.
  • Every other API call (edit tools, Pixel Fixer, Low-Poly 3D, assistant) is recorded in API Activity too, with an X-RD-Request-ID response header. List recent calls with GET /v2/inferences/requests to recover results after a client timeout.

Refresh output links during retention with GET /v2/inferences/requests/{request_id}. Any active personal key from the owning account can retrieve the request after key rotation.

python
# Refresh temporary output access during the 24-hour retention window.
request_id = result["request_id"]
activity = requests.get(
    f"https://api.retrodiffusion.ai/v2/inferences/requests/{request_id}",
    headers={"X-RD-Token": "YOUR_API_KEY"},
).json()

for output in activity["outputs"]:
    if output["available"]:
        image = requests.get(output["url"], timeout=30).content
        # output["url_expires_at"] is at most 15 minutes from now.
        # output["retained_until"] is the hard 24-hour access deadline.

An example of include_downloadable_data — the rd_pro__inventory_items style returns this image plus an item-atlas JSON with each sprite's position, size, and name:

Inventory items API output
rd_pro__inventory_items, 256×256 — comes with a machine-readable sprite atlas
06 Always check before you generate

Styles & Discovery

GET /v2/styles/selector returns every style available to your account with its exact capabilities — id, size limits, batch cap, whether it needs an input image, and whether it supports reference images. It accepts optional ?model= and ?tab= filters.

python
import requests

response = requests.get(
    "https://api.retrodiffusion.ai/v2/styles/selector",
    headers={"X-RD-Token": "YOUR_API_KEY"},
    params={"model": "rd_pro"},          # optional filters: model, tab
)

for style in response.json()["styles"]:
    print(
        style["prompt_style"],
        f"{style['min_width']}-{style['max_width']}px",
        f"batch<={style['max_number_of_images']}",
        "needs input image" if style["require_input_image"] else "",
    )

Style id families

FamilyExamplesNotes
rd_lite__*rd_lite__default, rd_lite__isometric, rd_lite__topdownRecommended for most stills: the RD Core styles at $0.05 per image in about 6 seconds, 12–512 px in any aspect ratio, one reference_images entry, batch ≤ 4, no tiling. Use RD Core for complex scenes or several references.
rd_core__*rd_core__default, rd_core__isometric, rd_core__spritesheetAbout 90% of RD Pro's quality at $0.10 per image, about 4x faster than RD Pro; better than RD Lite for complex scenes. 12–512 px in any aspect ratio (e.g. 480×270), up to 9 reference_images, batch ≤ 4, no tiling. rd_core__ui_panel is 256×256 only.
rd_plus__*rd_plus__default, rd_plus__isometric, rd_plus__topdown_mapQuality all-rounder with the largest style library. API and MCP only — no longer on the website; prices unchanged. See rd_core__* for new work.
rd_fast__*rd_fast__default, rd_fast__1_bit, rd_fast__mc_itemAPI and MCP only — replaced by RD Lite on the website; prices unchanged ($0.03). Most styles 64–384 px, low-res variants 16–128 px. See rd_lite__* for new work.
rd_pro__*rd_pro__default, rd_pro__edit, rd_pro__pixelateHighest quality; supports reference_images; batch ≤ 16 for the small-size styles (12px minimums, plus rd_pro__pixelate at 16px), otherwise ≤ 4; rd_pro__edit/pixelate require an input image.
rd_mini__*rd_mini__mc_item, rd_mini__low_resAliases that route to the equivalent Plus/Fast low-res styles (the response's model reflects the routed model).
rd_animation__*rd_animation__four_angle_walking, rd_animation__vfxSprite animations; GIF output; mostly fixed sizes; one per request. API and MCP only — no longer on the website; prices unchanged.
rd_advanced_animation__*...__walking, ...__custom_action, ...__subtle_motion, ...__rotateAnimate an uploaded start frame — input_image required, 32–256 px. ...__rotate instead generates the 8 directional views of the uploaded sprite.
rd_tile__*rd_tile__tileset, rd_tile__single_tileWang tilesets, single tiles, variations, and tile objects.
user__*user__my_style_1a2bYour custom styles — created in My Styles or via the styles API.

Style explorer

Every public style, with its exact size limits, batch cap, supported request fields, live cost calculation, and a ready-to-send payload. Built from the same registry the server enforces.

Default

rd_core__default

Clean modern pixel art style model that allows multiple reference images and extremely detailed prompting.

Limits
  • Width12–512 px
  • Height12–512 px
  • Batch (num_images)1–4
  • Cost equation0.10 * images
Cost calculator
$0.10
Supported request fields
  • ✓prompt, width, height, num_images, seed
  • —input_image
  • ✓reference_images — up to 9
  • ✓input_palette
  • —tile_x / tile_y
  • ✓remove_bg
  • —frames_duration
  • —extra_prompt
Ready-to-send payload
json
{
  "prompt": "A raven standing on a branch with appalachian forests and mountains in the background",
  "prompt_style": "rd_core__default",
  "width": 128,
  "height": 128,
  "num_images": 1
}
Shortcut: generate anything on the website, open the canvas info menu (⋮), and press Show API Code — it emits the exact payload (style id, size, seed) that recreates that generation.
07 img2img, references, and palettes

Images In: img2img & References

Rules for all image inputs

  • Raw base64 strings only — no data:image/png;base64, prefix.
  • RGB without transparency works best for inputs.
  • Keep palette images small (well under 1 MB).

img2img: input_image + strength

python
import base64
from pathlib import Path

payload = {
    "prompt": "A really cool corgi wearing sunglasses and a party hat",
    "prompt_style": "rd_plus__default",
    "width": 256,
    "height": 256,
    "num_images": 1,
    # Raw base64 — no "data:image/png;base64," prefix. RGB, no transparency.
    "input_image": base64.b64encode(Path("input.png").read_bytes()).decode(),
    "strength": 0.8,   # 0-1: low = subtle restyle, high = loose inspiration
}

References (RD Core and RD Pro): reference_images

References guide style and content without being redrawn — the way to keep a consistent character across many generations or match an existing art style. Up to 9 per request on RD Core and RD Pro styles. RD Core is $0.10 per image against $0.18 on RD Pro, with fewer reference artifacts.

python
payload = {
    "prompt": "The same character, now holding a torch, cave background",
    "prompt_style": "rd_core__default",   # $0.10/image, 12-512 px; rd_pro__default works the same
    "width": 256,
    "height": 256,
    "num_images": 1,
    # Up to 9 references: guide style/content without being redrawn
    "reference_images": [ref1_base64, ref2_base64],
}
Reference character
reference_images[0] — the goblin merchant
→
Same character in a new scene
"The same goblin merchant, now sitting by a campfire counting gold coins"
08 GIFs and spritesheets over HTTP

Animations

Sprite animations (rd_animation__*)

Prompt-driven animation formats with fixed layouts. These styles are no longer on the website — they stay available here and over MCP at the same prices (on the site, use Advanced Animations). Output is a transparent GIF in base64_images by default; add return_spritesheet: true for a PNG spritesheet. One animation per request.

  • rd_animation__four_angle_walking / walking_and_idle — 48×48 only.
  • rd_animation__small_sprites — 32×32 only.
  • rd_animation__vfx — 24–96 px, square only.
  • rd_animation__any_animation — 64×64; rd_animation__8_dir_rotation — 80×80.
python
payload = {
    "prompt": "corgi wearing a party hat",
    "prompt_style": "rd_animation__four_angle_walking",   # 48x48 only
    "width": 48,
    "height": 48,
    "num_images": 1,
    "seed": 123,
    # default output: transparent GIF (base64).
    # add "return_spritesheet": True for a PNG spritesheet instead.
}
VFX explosion animation
rd_animation__vfx — explosion
Battle sprites animation
rd_animation__battle_sprites
8 direction rotation animation
rd_animation__8_dir_rotation

Advanced animations (rd_advanced_animation__*) — the powerful one

Upload any pixel art image (32–256 px) as a start frame and animate it. Actions: walking, idle, jump, crouch, attack, destroy, plus custom_action (describe any motion) and subtle_motion (ambient life for scenes).

rotate is the odd one out: instead of motion it generates the other seven directional views of the uploaded sprite. The prompt is an optional subject hint, frames_duration is ignored, and sizes must be multiples of 8. The default output is an 8-frame GIF turning the subject a full circle; return_spritesheet: true returns a 3×3 PNG sheet instead (each cell the input size, empty center, every view facing the center: top = front, bottom = back, left/right = sides, corners = diagonals). Same layout and frame order as rd_animation__8_dir_rotation. Rotate runs on a single animation provider, so while that provider is overloaded a rotate task fails fast with provider_busy (refunded) instead of falling back; wait a few minutes and retry.

python
payload = {
    "prompt": "Confident, steady steps",
    "prompt_style": "rd_advanced_animation__walking",
    "width": 64,                       # match your starting frame, 32-256
    "height": 64,
    "num_images": 1,
    "frames_duration": 8,              # 4, 6, 8, 10, 12, or 16 frames
    "input_image": start_frame_base64, # REQUIRED for all advanced animation styles
}
# Styles: walking, idle, jump, crouch, attack, destroy,
#         custom_action (describe any motion), subtle_motion (ambient life)

# 8 directional views of a sprite you already have (prompt optional, no frames_duration)
payload = {
    "prompt": "",
    "prompt_style": "rd_advanced_animation__rotate",
    "width": 64,                       # 32-256, multiples of 8
    "height": 64,
    "num_images": 1,
    "input_image": sprite_base64,      # REQUIRED
    "remove_bg": True,
    "return_spritesheet": True,        # 3x3 direction sheet; omit for the 8-frame GIF
}
Start frame input
input_image (64×64)
→
Walking animation output
...__walking output GIF
Landscape start frame
input_image (64×64)
→
Subtle motion animation output
...__subtle_motion output GIF
For character actions, a neutral standing pose as the start frame gives the best results. Set width/height to match your start frame.
09 Terrain, programmatically

Tilesets

  • rd_tile__tileset — full wang tileset from one prompt (tile size 16–32); supports an inspiration input_image.
  • rd_tile__tileset_advanced — inside/outside textures via prompt/extra_prompt and input_image/extra_input_image.
  • rd_tile__single_tile (16–64), rd_tile__tile_variation (input image required), rd_tile__tile_object (16–96), rd_tile__scene_object (64–384).
python
payload = {
    "prompt": "grey stones with gravel and dirt",   # inside texture
    "extra_prompt": "lush green grass",             # outside texture (advanced only)
    "prompt_style": "rd_tile__tileset_advanced",
    "width": 32,      # tile size: 16-32 for full tilesets
    "height": 32,
    "num_images": 1,
    # optional: input_image (inside texture), extra_input_image (outside texture)
}
Tileset API output
rd_tile__tileset, 16px tiles — full wang combinations in one image
10 Queue now, collect later

Async Jobs

V2 validates and accepts every real generation request immediately. Poll the task endpoint for the result; no async flag is required. Free check_cost requests remain immediate.

Before a paid POST, persist a unique Idempotency-Key. If the admission response is lost, retry the identical request with the same key. Reusing it with different inputs returns 409 idempotency_conflict. Once you have a task id, poll that task instead of submitting again. Do not send the header on cost checks, edit tools, or Pixel Fixer requests.
python
import time
import requests

headers = {
    "X-RD-Token": "YOUR_API_KEY",
    "Idempotency-Key": "YOUR_PERSISTED_UNIQUE_KEY",
}
payload = {
    "prompt": "A really cool corgi",
    "prompt_style": "rd_pro__default",
    "width": 256, "height": 256, "num_images": 1,
}

start = requests.post("https://api.retrodiffusion.ai/v2/inferences", headers=headers, json=payload)
task_id = start.json()["task_id"]

while True:
    task = requests.get(
        f"https://api.retrodiffusion.ai/v2/inferences/tasks/{task_id}", headers=headers
    ).json()
    if task["status"] in ("pending", "running"):
        time.sleep(2)
        continue
    if task["status"] == "succeeded":
        result = task["result"]   # completed generation response
    else:
        print("failed:", task["error"])
    break
  • Statuses: pending → running → succeeded (with result) or failed (with error).
  • Tasks are private to the API key that created them.
  • request_id equals task_id. The task poll preserves the selected base64 or URL response mode, and retained outputs remain refreshable for 24 hours.
  • Idempotency-Key accepts 1–256 visible ASCII characters and is scoped to the API token.
11 Know the price before you pay it

Pricing & Budgeting

Cost depends on the style family and image count; image styles are flat per image at any size. These formulas are current at the time of writing — check_cost is always authoritative and free.

FamilyUSD per request
rd_fast__* (and rd_mini__fast_*)0.03 × num_images
rd_plus__* and rd_mini__*0.06 × num_images
rd_tile__single_tile, tile_variation, tile_object, scene_object0.06 × num_images
rd_lite__*0.05 × num_images (flat at any size)
rd_core__*0.10 × num_images (flat at any size)
rd_pro__*0.18 × num_images (fps_weapon: 0.25 × num_images)
rd_advanced_animation__*0.14 (custom_action and subtle_motion: 0.25; rotate: 0.10)
rd_animation__*0.07 (any_animation, big_animation and 8_dir_rotation: 0.25)
rd_tile__tileset / tileset_advanced0.10

Cost checks and balance

python
# check_cost: true = free dry run. Nothing is generated, nothing is charged.
payload = {
    "prompt": "A wizard's tower",
    "prompt_style": "rd_pro__default",
    "width": 256, "height": 256, "num_images": 2,
    "check_cost": True,
}
# -> { "balance_cost": 0.36, "model": "check_cost",
#      "base64_images": [], "remaining_balance": 100.75 }
  • GET /v2/inferences/credits → { "credits": 0, "balance": 100.75 } (invalid token → 401).
  • Balance is deducted before generation and automatically refunded if it fails.
  • Keep long-running workloads alive with auto-refill (Payment Methods page) — or, for teams and enterprise, ask about monthly invoicing based on spend via Discord or support@retrodiffusion.com.
  • Credits cannot be purchased through the API.

Plans on the API

Plan usage works on the API and MCP, but at a slower rate than balance: a plan runs 2 API and MCP jobs at once (the website gets 5). Jobs paid from balance aren't held to plan slots, so if you run a high-throughput pipeline, keep some balance alongside your plan.

  • Jobs use plan usage first, then balance. Free daily usage is website-only; the API never uses it.
  • A 3rd job started while 2 plan jobs are running is paid from your balance (warning plan_concurrency_balance). To stay on your plan, wait for a running job to finish first.
  • With no balance for it, the job waits for a slot instead: async tasks show status waiting_for_plan_slot and start when one finishes; a sync request waits up to 60 seconds, then returns 429 plan_slots_busy with Retry-After.
  • Every paid response says how it was paid for: "billing": { "source": "plan" | "balance", "reason", "plan_jobs_running", "plan_job_limit", "plan_usage_left_pct", "balance_charged", "balance_left" }, an optional warnings list, and the headers X-RD-Billing-Source, X-RD-Billing-Reason and X-RD-Plan-Jobs (running/limit, e.g. 2/2).
  • GET /usage shows your plan usage left and how many plan job slots are in use.
12 Your style, as an endpoint

Custom Styles API

Create, update, and delete custom styles built on the RD Pro reference-image template. Creation requires exactly one reference image. Fields outside the template are rejected.

POST /v2/stylesCreate (201) — requires exactly one reference_images entry and returns the new style, including its prompt_style
PATCH /v2/styles/{style_id}Update — same fields as create, all optional
DELETE /v2/styles/{style_id}Delete — style_id can be the internal id or the user__... id
python
payload = {
    "name": "My RD Pro Style",
    "description": "A polished pixel art look for item art",
    "style_icon": "sparkles",
    "reference_images": [reference_base64],    # exactly 1; required when creating
    "user_prompt_template": "Pixel art styled {prompt}, with 1px outlines.",
    "force_palette": False,
    "force_bg_removal": False,
    "min_width": 192,     # optional forced size: both together, 64-256
    "min_height": 192,
}
created = requests.post(
    "https://api.retrodiffusion.ai/v2/styles",
    headers={"X-RD-Token": "YOUR_API_KEY"},
    json=payload,
).json()
# created["prompt_style"] -> "user__my_rd_pro_style_1a2b3c4d"
# use it as prompt_style in /v2/inferences.
# PATCH /v2/styles/{style_id} to update; DELETE /v2/styles/{style_id} to remove.
  • reference_images accepts 1 image via the API; the My Styles web editor supports up to 4 per style.
  • user_prompt_template must contain {prompt} or user text is ignored.
  • Forced dimensions (min_width/min_height) must be set together, range 64–256.
13 Post-processing as endpoints

Edit Tools API

Every editing tool takes one image and returns one edited image. Request fields use snake_case, matching the rest of the /v2 API, and every tool requires input_image (raw base64 or a data:image/...;base64,... data URI).

Tool idKey inputsCost
image_editinput_image (≤256px), prompt, seed?$0.12
inpaintinginput_image, mask_image, prompt, seed?, soft_inpaint?$0.12
outpaintinginput_image, expand_left?, expand_right?, expand_top?, expand_bottom? (≥1 positive), prompt?, seed?, soft_inpaint?$0.12
seam_tilinginput_image, tile_x?, tile_y? (≥1 true), seam_width?, repair_window_size?, seed?$0.12
background_removerinput_image, transparency_threshold?, force_solid_pixels?$0.01
color_style_transferinput_image, extra_input_image$0.01
color_reducerinput_image, color_count?, dither_mode?, dither_strength?$0.001
palette_converterinput_image, input_palette, dither_mode?, dither_strength?$0.001
k_centroid_downscaleinput_image, width, height$0.001
pixel_correctioninput_image$0.001
rotateinput_image, rotation_degrees?$0.001

Every tool charges before running and refunds automatically on failure. $0.001 tools charge animated inputs per frame. An account that cannot cover a run gets 402 not_enough_balance.

Inpainting mask rules

Call POST /v2/edit/tools/inpainting with a static input_image no larger than 256×256 and a same-size mask_image. The recommended mask is an RGBA PNG: fully transparent pixels are protected, and pixels with alpha greater than 12 are replaced. The visible paint color does not matter. A grayscale mask also works: black is protected and values greater than 12 are replaced.

  • Do not use an ordinary fully opaque RGB/RGBA image as the mask. Its opaque alpha channel selects the entire image. Export a transparent mask or a black-and-white grayscale mask instead.
  • soft_inpaint: false restores every pixel outside the selected mask. Set it to true only when you want the service to accept a bounded transition ring immediately around the mask edge.
  • The prompt should describe the replacement content. The mask controls where the edit happens; the prompt controls what appears there.
python
import base64
import os
from io import BytesIO
from pathlib import Path

import requests
from PIL import Image

api_key = os.environ["RD_API_KEY"]
url = "https://api.retrodiffusion.ai/v2/edit/tools/inpainting"

source = Image.open("input.png").convert("RGBA")
mask = Image.open("mask.png")

if source.width > 256 or source.height > 256:
    raise ValueError("Inpainting input must be no larger than 256x256")
if mask.size != source.size:
    raise ValueError("mask.png must have the same dimensions as input.png")
if mask.mode == "L":
    selected_bounds = mask.point(lambda value: 255 if value > 12 else 0).getbbox()
elif "A" in mask.getbands():
    mask = mask.convert("RGBA")
    selected_bounds = mask.getchannel("A").point(lambda value: 255 if value > 12 else 0).getbbox()
else:
    raise ValueError("Use an RGBA mask with transparency or an L-mode grayscale mask")
if selected_bounds is None:
    raise ValueError("mask.png has no selected pixels")

def encode_png(image):
    buffer = BytesIO()
    image.save(buffer, format="PNG")
    return base64.b64encode(buffer.getvalue()).decode()

payload = {
    "input_image": encode_png(source),
    # Recommended RGBA mask: alpha=0 protects; alpha>12 replaces.
    "mask_image": encode_png(mask),
    "prompt": "replace the masked area with a small red crystal",
    "seed": 7,
    "soft_inpaint": False,
}
headers = {"X-RD-Token": api_key}

# Optional free validation and price check before the paid run.
estimate = requests.post(f"{url}/estimate", headers=headers, json=payload, timeout=60)
estimate.raise_for_status()
print("Estimated cost:", estimate.json()["balance_cost"])

response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
result = response.json()

if result["base64_images"]:
    output = base64.b64decode(result["base64_images"][0])
elif result["output_urls"]:
    download = requests.get(result["output_urls"][0], timeout=60)
    download.raise_for_status()
    output = download.content
else:
    raise RuntimeError("Inpainting returned no image")

Path("inpainted.png").write_bytes(output)
print("Saved", result["inference_id"], "to inpainted.png")

Other edit tools and chaining

python
import base64
import requests
from pathlib import Path

api_key = "YOUR_API_KEY"
base_url = "https://api.retrodiffusion.ai/v2"

def run_tool(tool_id, payload):
    response = requests.post(
        f"{base_url}/edit/tools/{tool_id}",
        headers={"X-RD-Token": api_key},
        json=payload,
        timeout=120,
    )
    response.raise_for_status()
    return response.json()

image = base64.b64encode(Path("input.png").read_bytes()).decode()

# Validate and price a request without running it
estimate = requests.post(
    f"{base_url}/edit/tools/image_edit/estimate",
    headers={"X-RD-Token": api_key},
    json={"input_image": image, "prompt": "add a tiny wizard hat"},
    timeout=60,
).json()
print(estimate["balance_cost"], estimate["estimate_seconds"])

def result_image_base64(result):
    if result["base64_images"]:
        return result["base64_images"][0]
    if result["output_urls"]:
        image_response = requests.get(result["output_urls"][0], timeout=30)
        image_response.raise_for_status()
        return base64.b64encode(image_response.content).decode()
    raise RuntimeError("Edit tool returned no image")

# Chain tools: each output feeds the next input
edited = run_tool("image_edit", {"input_image": image, "prompt": "add a tiny wizard hat"})
transparent = run_tool("background_remover", {"input_image": result_image_base64(edited)})
final = run_tool("color_reducer", {"input_image": result_image_base64(transparent), "color_count": 16})

Path("output.png").write_bytes(base64.b64decode(result_image_base64(final)))
  • GET /v2/edit/tools — the authoritative list of currently enabled tools, their costs, legacy UI fields, and canonical api_fields.
  • POST /v2/edit/tools/{tool_id}/estimate — validates the request and returns tool_id, balance_cost, credit_cost, and estimate_seconds without running the tool.
  • POST /v2/edit/tools/{tool_id}/tasks takes the same body, returns 202 with a task_id right away, and you poll GET /v2/edit/tasks/{task_id} until status is succeeded or failed. Use it when your client or proxy times out requests in under about 60 seconds, and for inpainting and outpainting (5-30 s). A dropped synchronous request still runs and is charged. Here custom_id is an idempotency key: resubmitting it returns the original task without a second charge. Task results arrive in output_urls.
  • Responses follow the regular inference conventions: inference_id, balance_cost, charged, remaining_balance, and the result in at least one of base64_images or output_urls.
  • Handle both result fields. image_edit, inpainting, and outpainting normally return an empty base64_images and deliver the image only as a hosted URL in output_urls — download it. Reading only base64_images silently drops those tools' results while the run is still charged.
  • Chain tools by passing a returned image as the next call's input_image. Deprecated camelCase response fields remain available for existing clients; new integrations should read the snake_case fields.
  • dither_mode accepts none, bayer_2x2, bayer_4x4, and bayer_8x8; dither_strength ranges 0–10 (0 disables, default 5; values above 10 are treated as the deprecated 0–100 scale and divided by 10).
  • Animated GIF input is supported by color_reducer, palette_converter, color_style_transfer, and k_centroid_downscale; other tools accept static images only. Every tool also accepts an optional custom_id for correlating runs with your own queue.
14 Recover the real pixel grid

Pixel Fixer API

Pixel Fixer reconstructs enlarged, softened, AI-rendered, or compression-damaged pixel art at its detected native resolution. It is authenticated with X-RD-Token. Standard costs $0.002 per call and Neural $0.005 per call, charged before running and refunded automatically if the call fails.

Standard engine

Send exactly one PNG, JPEG, or WebP source as raw base64, a data URI, or a public HTTPS image_url to POST /v2/pixel-fixer/standard. The native Rust detector is the recommended production engine and returns exactly one raw base64 PNG.

python
import base64
from pathlib import Path
import requests

response = requests.post(
    "https://api.retrodiffusion.ai/v2/pixel-fixer/standard",
    headers={"X-RD-Token": "YOUR_API_KEY"},
    # URL input avoids carrying a large source through the ALB request body.
    json={"image_url": "https://cdn.example.com/soft-sprite.png"},
    timeout=120,
)
response.raise_for_status()

# The response contains exactly one raw base64 PNG.
fixed = response.json()["base64_images"][0]
Path("fixed-sprite.png").write_bytes(base64.b64decode(fixed))

Neural contract

POST /v2/pixel-fixer/neural runs the CPU-backed neural reconstruction engine. Optional positive width and height fields set its target output size.

http
POST /v2/pixel-fixer/neural
{
  "input_image": "<raw base64 PNG/JPEG/WebP or data URI>",
  "width": 32,
  "height": 32
}

Response from either engine:
{
  "base64_images": ["iVBORw0KGgo..."]
}

Limits and errors

  • PNG, JPEG, and WebP images must be at least 16×16. Standard accepts up to 16 megapixels. Neural accepts larger source dimensions and proportionally bilinear-downscales sources above its 1-megapixel working budget before reconstruction; forced Neural output remains capped at 16 megapixels.
  • Public HTTPS image_url downloads are capped at 20 MB, follow at most three redirects, and cannot target private networks.
  • Standard and Neural share one allowance per API token: 120 requests per minute for accounts with a completed purchase, and 10 requests per minute otherwise.
  • Base64 request JSON is capped at 900,000 bytes. URL input bypasses that request-body constraint, while successful response JSON remains capped at 850,000 bytes for the AWS ALB Lambda target.
  • Unknown request fields are rejected. Stable Pixel Fixer error codes are not_enough_balance (402; 400 on v1), pixel_fixer_request_too_large and pixel_fixer_output_too_large (413), invalid_pixel_fixer_image (422), pixel_fixer_rate_limit_exceeded (429), and pixel_fixer_failed (500).
Prefer a visual workflow? The Pixel Art Fixer tool lets you switch between local WASM Standard processing and the hosted Neural engine, then apply palette finishing in your browser.
15 The Generation Assistant, as an API

Assistant Sessions

The same assistant as the site's chat bar, for programs. Send a message in plain language, get back a plan with an exact price, approve it, and the assistant runs every step and reports back. It makes 2D pixel art by default and Low-Poly 3D models when the message asks for 3D, and it can revise and animate the models it made in the session. Base URL: https://api.retrodiffusion.ai/v1/assistant.

POST /sessionsStart a session (expires after 5 minutes idle; any call refreshes it)
POST /sessions/{id}/messagesSay what you want (optionally with up to 4 images) → 202 with a turn_id. $0.01 per message, refunded if the turn fails.
GET /sessions/{id}/turns/{turn_id}Poll every ~2 s. Events: message, status, plan, plan_status, image, asset3d (a 3D model: render URL, asset_id, version, animations), note, error
POST /sessions/{id}/decisionApprove or deny the plan (free). Approved plans bill each step at standard prices; failed steps are refunded.
GET /sessions/{id}, POST …/keepalive, DELETE …Session state and image bank, a free keepalive ping, and ending the session
python
import time
import requests

API = "https://api.retrodiffusion.ai/v1/assistant"
HEADERS = {"X-RD-Token": "YOUR_API_KEY"}

session = requests.post(f"{API}/sessions", headers=HEADERS, json={}).json()
sid = session["id"]

def run_turn(turn_id):
    seen = 0
    while True:
        turn = requests.get(f"{API}/sessions/{sid}/turns/{turn_id}", headers=HEADERS).json()
        for event in turn["events"][seen:]:
            if event["type"] == "message":
                print("assistant:", event["text"])
            elif event["type"] in ("image", "asset3d"):
                print(event["type"], event["ref"], event["url"])
        seen = len(turn["events"])
        if turn["status"] in ("awaiting_approval", "completed", "failed"):
            return turn
        time.sleep(2)

# 2D by default; say "3D" to get a Low-Poly model
turn = requests.post(f"{API}/sessions/{sid}/messages", headers=HEADERS,
                     json={"message": "a low poly 3D model of a lantern, then make it swing"}).json()
turn = run_turn(turn["turn_id"])
if turn["status"] == "awaiting_approval":
    decision = requests.post(f"{API}/sessions/{sid}/decision", headers=HEADERS,
                             json={"decision": "approve"}).json()
    run_turn(decision["turn_id"])

The full guide (plan shapes, auto-approval budgets, errors) is ASSISTANT.md.

16 Plug Retro Diffusion into your AI assistant

MCP for AI Assistants

Retro Diffusion runs a hosted Model Context Protocol server at https://mcp.retrodiffusion.ai/mcp (HTTP transport, Authorization: Bearer YOUR_API_KEY). Once connected, your assistant can discover styles, estimate costs, generate pixel art and Low-Poly 3D models, and repair softened or enlarged art with typed tool calls — no HTTP code required — including the canvas edit tools and async jobs for animations and batches. Setup guides for every client — including Windsurf, Claude Desktop, and the Claude Code plugin — live in the retro-diffusion-mcp repo on GitHub.

Available tools

CategoryTools
Generatecreate_inference, estimate_inference_cost (free), start_inference_job + get_inference_job (async jobs for animations and batches; results come back as hosted URLs), list_inference_jobs, get_inference_result
Low-Poly 3Dstart_lowpoly_generate, start_lowpoly_revise, start_lowpoly_animate (pass animation to change an existing one), get_lowpoly_job, get_lowpoly_model, list_lowpoly_models, export_lowpoly_model, get_lowpoly_pricing, estimate_lowpoly_cost (free)
Discoverlist_available_styles, list_available_models, get_style_usage
Edit toolslist_edit_tools, run_edit_tool, estimate_edit_tool_cost (free)
Pixel repairfix_pixel_art ($0.002 standard native-grid detection, $0.005 neural reconstruction)
Custom stylescreate_user_style, update_user_style, delete_user_style
Account & healthauthenticate, get_balance, get_service_status, logout

Setup

# Claude Code (CLI)
claude mcp add --transport http retrodiffusion https://mcp.retrodiffusion.ai/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

# Or install the plugin (bundles the server plus a pixel-art workflow skill)
/plugin marketplace add Retro-Diffusion/retro-diffusion-mcp
/plugin install pixel-art@retro-diffusion
Agent workflow tip: call list_available_styles (or get_style_usage for one style) first to learn size limits and required inputs, then estimate_inference_cost, then create_inference — with upload_outputs=true to receive hosted URLs instead of base64. Use start_inference_job + get_inference_job for animations and batches, and fix_pixel_art when an existing image has a softened or enlarged pixel grid. Use estimate_edit_tool_cost before run_edit_tool when post-processing.
17 When things go wrong

Status & Errors

Model status

bash
# No API key required
curl https://api.retrodiffusion.ai/v2/status

# -> { "status": { "rd_fast": "ok", "rd_pro": "ok", "rd_plus": "ok",
#                  "animations": "ok", "background_removal": "ok" },
#      "updated_at": 1789681864 }

Check status before sending large batches — it needs no API key.

Error shapes

/v2 is the default for new integrations. Every JSON error is {"error":{"code":"...","message":"...","request_id":"..."}}. Branch on code, preserve X-Request-ID and Retry-After, and never resubmit a failed paid request by falling back across versions.

/v1 remains supported and may return string, list, or structured detail values. Its compatibility guide documents those frozen shapes. Never resubmit a failed paid request by falling back across versions.

StatusMeaning
400Semantically invalid input.
401Missing or invalid X-RD-Token.
402Insufficient balance.
403Valid token without permission for the operation.
404Task or style not found (or not owned by this key).
409The request conflicts with the current resource or billing state.
413The request or response payload is too large.
422Request body failed validation (wrong types, missing required fields).
429Rate limited — respect the Retry-After header.
500Unexpected internal failure. Use the error code and request ID when contacting support.
502 / 503 / 504Provider failure, temporary unavailability, or timeout. Respect code-specific retry guidance.

Generation failures

Failed async tasks carry the same codes in error on GET /v2/inferences/tasks/{task_id}. Failed generations are always refunded.

CodeStatusMeaningRetry?
inference_failed502The generation failed.Once, with identical parameters.
provider_busy503The animation provider is overloaded and the job was rejected before it started. rd_advanced_animation__rotate has no alternate provider, so it sees this most.Yes, after a few minutes.
provider_timeout504The animation took too long and was cancelled.Yes.
request_timeout504The generation exceeded its execution deadline.Yes.
There is no hard throughput cap on generation, but be a good citizen: poll at a sensible interval (~2s), respect Retry-After, and use the documented code-specific retry classification. Never replay a paid request across API versions.