remagicaDocs home
API referenceSprites

Redraw a frame

POST
/sprites/frames/{frameId}/fix

Needs a key withsprites:write

Redraws one frame to match the master, with the frames either side as references and your prompt's change; with region, only that box is replaced (feathered into the frame). The old file is kept for revert. Holds credits for the worst case and settles at what ran; the take is scored again and an approved take goes back to review. Locked frames and takes still running are refused. Follow it on the live feed (GET /sprites/events, topic take, by take id), then read the take.

Requires scope sprites:write.

Authorization

apiKey
headerx-api-key<token>

An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.

Path Parameters

frameId*string
Length1 <= length <= 128

Header Parameters

Idempotency-Key?string

Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is 409 CONFLICT. A request that fails frees its key.

Length1 <= length <= 255

Request Body

application/json
  1. body
model?string

A base image model (google/nano-banana-pro, openai/gpt-image-2, google/nano-banana-2.1) or its sprite_frame_fix/… id. Left out: the game's.

Length1 <= length <= 200
prompt?string

What to change, in your words.

Lengthlength <= 2000
region?

Only this box is redrawn, in frame pixels from the top left; the rest of the frame stays as it is.

Response Body

Accepted: the redraw is held and started.

application/json
  1. response

A frame edit, held and started.

credits*integer

What the request sets aside: every frame at its worst.

model*string

The capability model it runs.

priceVersion*integer|null
requestId*string

The request: its credit hold's subject.

Length1 <= length <= 128
takeId*string

The take it changes: follow it on the live feed (GET /sprites/events, topic take).

Length1 <= length <= 128
Example Request
curl -X POST 'https://api.remagica.com/api/v1/sprites/frames/f68c2bb4-5b3d-4f60-8e2a-1d9c6b4f7e05/fix' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "credits": 12,  "model": "google/nano-banana-pro",  "priceVersion": 3,  "requestId": "2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05",  "takeId": "2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"}